Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: niser9370 on February 27, 2023, 11:34:36 AM



Title: help me in exploring non-standard transactions
Post by: niser9370 on February 27, 2023, 11:34:36 AM
does anyone have informations that can help me exploring unknown bitcoin transaction (transaction that are marked nonstandard because they use different scripts then the standard one like P2PKH, P2PK ...) 
anything can help, like a class of usage and examples, any machine learning model that i can use when studying them ( i have a file containing the hash of all non-standard transactions and the script associated)
also i see a lot of them recently as an output for coinbase TX, what is that about ?


Title: Re: help me in exploring non-standard transactions
Post by: ABCbits on February 27, 2023, 12:00:35 PM
anything can help, like a class of usage and examples

Here are few examples that i know,
1. SegWit address with uncompressed public key, https://bitcointalk.org/index.php?topic=5192454.0 (https://bitcointalk.org/index.php?topic=5192454.0).
2. Any transaction with multiple OP_RETURN or OP_RETURN with pushed data more than 80 bytes, https://bitcointalk.org/index.php?topic=5275615.0 (https://bitcointalk.org/index.php?topic=5275615.0).
3. Ordinal NFT with TX size 3915537 bytes which mined by Luxor, https://ordinals.com/inscription/0301e0480b374b32851a9462db29dc19fe830a7f7d7a88b81612b9d42099c0aei0 (https://ordinals.com/inscription/0301e0480b374b32851a9462db29dc19fe830a7f7d7a88b81612b9d42099c0aei0). Take note the TX size makes it non-standard.

any machine learning model that i can use when studying them ( i have a file containing the hash of all non-standard transactions and the script associated)

AI/ML is wrong approach in this case when you could just look for rules of standard transaction and create script to identify transaction which doesn't match the rule. For current rule, you could check Bitcoin Core source code at https://github.com/bitcoin/bitcoin/tree/v24.0.1/src/policy (https://github.com/bitcoin/bitcoin/tree/v24.0.1/src/policy).

also i see a lot of them recently as an output for coinbase TX, what is that about ?

Any example? I don't know which one you're talking about.


Title: Re: help me in exploring non-standard transactions
Post by: niser9370 on February 27, 2023, 07:14:15 PM
thank you for your help,
the last question was about transactions like this one : https://www.blockchain.com/explorer/transactions/btc/dffd8213c61c927e63c856fa579b7d147a0a3da492eb2e1361a2d4e4ff8a57a7
which are the first transactions in a block, the second output is marked unknown, mostly because they use op_return, do you know the reason why they use it in this cases (there are many blocks that use the second output an unknown transactions in their first transaction when the block is first created like the one in the link )


Title: Re: help me in exploring non-standard transactions
Post by: garlonicon on February 27, 2023, 08:50:23 PM
Because Segwit is activated, so one of the outputs of the coinbase transaction should contain Segwit commitment. See: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure

As you can see, there is 0xaa21a9ed magic number, and later you have Segwit hash.