Bitcoin Forum
May 24, 2024, 07:19:26 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Output witness scripthash but input keyhash?  (Read 147 times)
Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
January 29, 2019, 10:03:26 AM
Merited by ABCbits (1)
 #1

Is
https://www.blockchain.com/btc/tx/49de9ea077feee38d4952023fbe9cbdbb9020675667c9637ea0f1a456cc40030

https://blockchair.com/bitcoin/transaction/49de9ea077feee38d4952023fbe9cbdbb9020675667c9637ea0f1a456cc40030

blockchair.com say that is witness_v0_keyhash. and witnessStack has height only two :

http://chainquery.com/bitcoin-api/getrawtransaction/49de9ea077feee38d4952023fbe9cbdbb9020675667c9637ea0f1a456cc40030/1

"txinwitness": [                  "30450221009c081fce7e263de3c8a0b0b12b18b6338cb2db4fc2f37ce3d22ec4ad618d611002205 21e0fbabb810593ef6878169e0d1020e69b167b9bbf54915b44e92c5b55ab7301",
                    "210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac"
                ],

But previous was scripthash and address is long (62, not 42) like scripthash
bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3   
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
January 29, 2019, 02:15:34 PM
Merited by ABCbits (3), bones261 (2), HeRetiK (1)
 #2

Previous outputs which this transaction is spending weren't "scripthash", they were Pay To Witness Pubkey Hash[1]. That is why the signature (or more precisely the scriptsig) is "transferred" elsewhere in a field called "witness" instead of it being in its usual place after the outpoint.

[1] https://bitcoin.stackexchange.com/questions/64733/what-is-p2pk-p2pkh-p2sh-p2wpkh-eli5

"txinwitness": [                  "30450221009c081fce7e263de3c8a0b0b12b18b6338cb2db4fc2f37ce3d22ec4ad618d611002205 21e0fbabb810593ef6878169e0d1020e69b167b9bbf54915b44e92c5b55ab7301",
                    "210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac"
                ],

This is your scriptsig.
30 <-Sequence tag of DER
45 <-DER length
02 <-Int tag of DER
21 <-DER Length
009c081fce7e263de3c8a0b0b12b18b6338cb2db4fc2f37ce3d22ec4ad618d6110 <-x coordinate of R
02 <-Int tag of DER
20 <-DER Length
521e0fbabb810593ef6878169e0d1020e69b167b9bbf54915b44e92c5b55ab73 <-s
01 <-SigHashType
21 <-OP_PushData
0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac <-compressed public key

(there are some CompactInt sizes among these numbers that the JSON serialization has omitted though)

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!