Author

Topic: Where is witness part in SegWit transaction? (Read 1131 times)

newbie
Activity: 9
Merit: 2
That is the thing! Thank you!

I created address by standard way, then in console
Code:
addwitnessaddress ADDRESS
creates new witness address from it. And transaction from has "txinwitness" part and so on.
Another good tool with examples is https://blockchainprogramming.azurewebsites.net/checktx

Thank you again.

staff
Activity: 3458
Merit: 6793
Just writing some code
You need to spend from segwit outputs, which are not created by default. To do so, you need to create an address for segwit; there's an RPC command for it. Then spend from that address and you will see a segwit transaction.
You should also read the BIPs for segwit.
newbie
Activity: 9
Merit: 2
Hi,

I'm trying to understand how SegWit transaction looks like.

In article Segregated Witness, Part 1 on BitcoinMagazine.com is written

Quote
from the perspective of Bitcoin nodes that don't use Segregated Witness (lets call them “old nodes”), some newly created outputs might soon use a strange type of scriptPubKeys. Strange, because these scriptPubKeys can hardly be considered a lock at all. Commonly referred to as an “Anyone can spend,” these scriptPubKeys basically proclaim they don't require a signature. Additionally, they will include some meaningless text.
(embolden by me)

So I tried to send some segnet bitcoin from faucet to my address. The transaction outputs look like

Code:
  "outputs": [
    {
...
      "script_pub_key": {
        "asm": "OP_DUP OP_HASH160 b94d3e2318aa7265f5c75be6275c5af35a3751bf OP_EQUALVERIFY OP_CHECKSIG",
...
      },
...
    },
    {
...
      "script_pub_key": {
        "asm": "OP_DUP OP_HASH160 b5255516286472ed5b15833da1d9ea97c8d3f05c OP_EQUALVERIFY OP_CHECKSIG",
...
      },
...
    }
  ],

This looks like standard transaction to me. When I pick random transaction from current blockchain, let's say https://blockchain.info/tx/a569b7a41c9a2567b4a4bad4ed59f5e846cc30d652b448ff6430018fe0bf3128, I see:

Code:
OP_DUP OP_HASH160 ed1fd913ec4f7f1b5699fc77ca9dc9604a840600 OP_EQUALVERIFY OP_CHECKSIG

on output, so the same format.

Also when I get transaction from segwit in hexadecimal and try to decode it in current Bitcoin version, it is the same (except the addresses because address version).

Please, can someone enlighten me what is different on SegWit? Where I can see the witness part? I'm definitely missing something… Smiley

Thanks a lot Smiley

Jump to: