3

I noticed that there can be what seems to be more than 1 signature in a ScriptSig.

The transaction in question is: https://blockchain.info/tx/32e8677c968981549acc25f46641c74a3055d949c90bd22c15a5236bf92a622d

Below is a ScriptSig sample in question:

ScriptSig: 0[] PUSHDATA(71)[304402201c45383cc6e43202ed069e36184a97bf5dd489c6bea1372629540dea154c424902200a950b3557bba9ae9531237d46e6eb1afffd01eba989c3e53adaac443e5e2a2e01] PUSHDATA(71)[3044022032a681fb77589ce1a29a84494a6f9cb19630fcd65480ff646f30d8b826980390022006dc71baba1142abb275bbf3613b2a13b347bac4d09d41ccd9b69b02c270d8c201] PUSHDATA1[522103745aaaf364030720b2d14de50a3310eef521c91e36353dca20813713535c005a2102db8911b3989b43c43d8dd6e50459bd85c38faf3b2862eb78ef297002775a10bd210351e3f71b7cf9a5f5f86c1908fee02ebf5a1ed77b6748f7486505d155833645f253ae]

The above text is taken from blockchain.info webpage for the first ScriptSig in that particular transaction.

It seems like there is 2 pieces of PUSHDATA(71)304402...01 and from the sequence and formatting, it is a DER encoded signature.

My question would be how would there appear to be 2 pieces of PUSHDATA(71)304402...01 which is 2 pieces of digital signatures ?

Shouldn't a private key only generate a single digital signature and not two ?

Also, how do I interpret the final chunk regarding the PUSHDATA1[5221...53ae]

3

This is a 5 input one output multisig transaction. The decoding of the first sigscript

0047304402201C45383CC6E43202ED069E36184A97BF5DD489C6BEA1372629540DEA154C424902200A950B3557BBA9AE9531237D46E6EB1AFFFD01EBA989C3E53ADAAC443E5E2A2E01473044022032A681FB77589CE1A29A84494A6F9CB19630FCD65480FF646F30D8B826980390022006DC71BABA1142ABB275BBF3613B2A13B347BAC4D09D41CCD9B69B02C270D8C2014C69522103745AAAF364030720B2D14DE50A3310EEF521C91E36353DCA20813713535C005A2102DB8911B3989B43C43D8DD6E50459BD85C38FAF3B2862EB78EF297002775A10BD210351E3F71B7CF9A5F5F86C1908FEE02EBF5A1ED77B6748F7486505D155833645F253AE

can be decomposed into these sections:

       00
sig1   47304402201C45383CC6E43202ED069E36184A97BF5DD489C6BEA1372629540DEA154C424902200A950B3557BBA9AE9531237D46E6EB1AFFFD01EBA989C3E53ADAAC443E5E2A2E01
sig2   473044022032A681FB77589CE1A29A84494A6F9CB19630FCD65480FF646F30D8B826980390022006DC71BABA1142ABB275BBF3613B2A13B347BAC4D09D41CCD9B69B02C270D8C201
length 4C69
OP_2   52
pk1    21 03745AAAF364030720B2D14DE50A3310EEF521C91E36353DCA20813713535C005A
pk2    21 02DB8911B3989B43C43D8DD6E50459BD85C38FAF3B2862EB78EF297002775A10BD
pk3    21 0351E3F71B7CF9A5F5F86C1908FEE02EBF5A1ED77B6748F7486505D155833645F2
OP_3   53
check  AE

So this is a two of three multisig tx, which has provided two signatures, and three public keys. To explain each command, here are the details:

00: OP_0, OP_FALSE:      an empty array is pushed onto the stack.
47: OP_DATA_0x47:        push hex 47 (decimal 71) bytes on stack
30: OP_SEQUENCE_0x30:    type tag indicating SEQUENCE, begin sigscript
44: OP_LENGTH_0x44:      length of R + S
02: OP_INT_0x02:         type tag INTEGER indicating length
20: OP_LENGTH_0x20:      this is SIG R (32 Bytes)
    1C45383CC6E43202:ED069E36184A97BF:5DD489C6BEA13726:29540DEA154C4249
02: OP_INT_0x02:         type tag INTEGER indicating length
20: OP_LENGTH_0x20:      this is SIG S (32 Bytes)
    0A950B3557BBA9AE:9531237D46E6EB1A:FFFD01EBA989C3E5:3ADAAC443E5E2A2E
01: OP_SIGHASHALL:       this terminates the ECDSA signature (ASN1-DER structure)
#########################################################
47: OP_DATA_0x47:        push hex 47 (decimal 71) bytes on stack
30: OP_SEQUENCE_0x30:    type tag indicating SEQUENCE, begin sigscript
44: OP_LENGTH_0x44:      length of R + S
02: OP_INT_0x02:         type tag INTEGER indicating length
20: OP_LENGTH_0x20:      this is SIG R (32 Bytes)
    32A681FB77589CE1:A29A84494A6F9CB1
    9630FCD65480FF64:6F30D8B826980390
02: OP_INT_0x02:         type tag INTEGER indicating length
20: OP_LENGTH_0x20:      this is SIG S (32 Bytes)
    06DC71BABA1142AB:B275BBF3613B2A13
    B347BAC4D09D41CC:D9B69B02C270D8C2
01: OP_SIGHASHALL:       this terminates the ECDSA signature (ASN1-DER structure)
#########################################################
4C: OP_PUSHDATA1:        next byte is # of bytes that go onto stack
69: OP_Int(0x01-0xff):   105 bytes onto the stack
52: OP_2:                the number 2 is pushed onto stack
    ################### we go multisig ####################################
21: OP_DATA_0x21:        compressed pub key (33 Bytes)
    03745AAAF3640307:20B2D14DE50A3310:EEF521C91E36353D:CA20813713535C00:5A
    This is MultiSig's compressed Public Key (X9.63 form)
    corresponding bitcoin address is:    1GNXpcYzasmmXvM4rNgkvZ5SzXgL4L9Ch6
21: OP_DATA_0x21:        compressed pub key (33 Bytes)
    02DB8911B3989B43:C43D8DD6E50459BD:85C38FAF3B2862EB:78EF297002775A10:BD
    This is MultiSig's compressed Public Key (X9.63 form)
    corresponding bitcoin address is:    1KHCXt29T7cHfPA88SpPL128h9PyZMi2uR
21: OP_DATA_0x21:        compressed pub key (33 Bytes)
        21: OP_DATA_0x21:        compressed pub key (33 Bytes)
    0351E3F71B7CF9A5:F5F86C1908FEE02E:BF5A1ED77B6748F7:486505D155833645:F2
    This is MultiSig's compressed Public Key (X9.63 form)
    corresponding bitcoin address is:    1PjUtVWKkr2GxA5HrkAmvhpyHGUwNPyQzH
53: OP_3:                the number 3 is pushed onto stack
    ################### 2-of-3 Multisig ###################################
AE: OP_CHECKMULTISIG:    terminating multisig
    corresponding bitcoin address is:    33jhmQXe4Q9dP24Jm9EVa6XHxn85sZnQMR

Now if all this looks like being to much for the beginning, I recommend reading Andreas' book "Mastering Bitcoin", here especially chapter 7 "Advanced Transactions and Scripting".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.