本文主要译自比特币 wiki

scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>

例如如下的raw scriptPubKey:
76A91489ABCDEFABBAABBAABBAABBAABBAABBAABBAABBA88AC
解析如下:

  76       A9             14
OP_DUP OP_HASH160    Bytes to push

89 AB CD EF AB BA AB BA AB BA AB BA AB BA AB BA AB BA AB BA   88         AC
                      Data to push                     OP_EQUALVERIFY OP_CHECKSIG

| Stack | Script | Description |
|----|-----|------|---|
| Stack | Script | Description |
| Empty. | <sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | scriptSig and scriptPubKey are combined. |
| <sig> <pubKey> | OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | Constants are added to the stack. |
| <sig> <pubKey> <pubKey> | OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | Top stack item is duplicated. |
| <sig> <pubKey> <pubHashA> | <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | Top stack item is hashed. |
| <sig> <pubKey> <pubHashA> <pubKeyHash> | OP_EQUALVERIFY OP_CHECKSIG | Constant added. |
| <sig> <pubKey> | OP_CHECKSIG | Equality is checked between the top two stack items. |
| true | Empty. | Signature is checked for top two stack items. |

相关文章:

  • 2021-11-20
  • 2021-04-10
  • 2021-06-28
  • 2021-05-04
  • 2021-05-17
  • 2021-12-22
  • 2021-09-06
  • 2022-01-15
猜你喜欢
  • 2021-12-28
  • 2021-12-14
  • 2021-06-09
  • 2021-12-14
  • 2022-01-16
  • 2022-01-15
  • 2021-09-23
相关资源
相似解决方案