Bitcoin Forum
November 15, 2019, 05:18:54 AM *
News: 10th anniversary art contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Output witness scripthash but input keyhash?  (Read 83 times)
Frodek
Member
**
Offline Offline

Activity: 125
Merit: 15


View Profile
January 29, 2019, 10:03:26 AM
Merited by ETFbitcoin (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   
1573795134
Hero Member
*
Offline Offline

Posts: 1573795134

View Profile Personal Message (Offline)

Ignore
1573795134
Reply with quote  #2

1573795134
Report to moderator
The Bitcoin Forum is turning 10 years old! Join the community in sharing and exploring the notable posts made over the years.
1573795134
Hero Member
*
Offline Offline

Posts: 1573795134

View Profile Personal Message (Offline)

Ignore
1573795134
Reply with quote  #2

1573795134
Report to moderator
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 701
Merit: 1159


Novice C♯ Coder


View Profile WWW
January 29, 2019, 02:15:34 PM
Merited by ETFbitcoin (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
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!