Bitcoin Stack Change is a query and reply website for Bitcoin crypto-currency fanatics. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The most effective solutions are voted up and rise to the highest
Requested
Seen
117 instances
Because the title says I am attempting to extract bc1 addresses by utilizing opcodes I’ve discovered from studying about bitcoin on-line. Nonetheless, I can’t really discover the opcodes related to bc1. The segwit outputs right here are described as, from what I collect, not having OP codes. How can this be? Certainly I am misunderstanding one thing. Can anybody elaborate?
Native segwit scriptPubKeys are of the shape OP_n + <knowledge>
, so first a single quantity opcode adopted by a push of some knowledge (referred to as the witness program). Particularly:
- For P2WPKH (pay to witness pubkey hash, BIP141),
OP_0
adopted by a push of 20 bytes. These 20 bytes are the Hash160 of a public key. Their corresponding tackle format is outlined by BIP173. - For P2WSH (pay to witness script hash, BIP141),
OP_0
adopted by a push of 32 bytes. These 32 bytes are the SHA256 of a script. Their corresponding tackle format is outlined by BIP173 as nicely. - For P2TR (pay to taproot, BIP341),
OP_1
adopted by a push of 32 bytes. These 32 bytes are a tweaked x-only public key. Their corresponding tackle format is outlined by BIP350. - For future witness variations, any
OP_1
byOP_16
adopted by a push of one thing between 2 and 40 bytes (besidesOP_1
adopted by 32 bytes, which is P2TR). These too have addresses related to them in BIP350, however no semantics (but).
Basically, native segwit outputs don’t include any “energetic” opcodes like OP_CHECKSIG
or OP_HASH160
or something like that, they’re simply stubs that push some knowledge. The segwit (and taproot) consensus guidelines know the best way to interpret them.
7
I believe you could be misunderstanding how an tackle is constructed and the place scripting opcodes match into that. The bc1
signifies the usage of the bech32 tackle format for SegWit variations as outlined in BIP 173 and in addition damaged down right here. The hash of the witness script (SegWit model 0) or the tweaked inner key (SegWit model 1) is included inside that tackle. The opcodes used within the witness script or the tweak of the inner key are solely revealed on spending from the tackle. So to view and analyze the opcodes you should have a look at the transactions spending from a selected tackle somewhat than the transactions sending to a selected tackle.
2