• 一个比特币脚本示例


    pay-to-pubkey-hash解析

    本文主要译自比特币 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.
  • 相关阅读:
    多项式求逆
    luoguP3380 【模板】二逼平衡树(树套树)
    NTT
    poj2728 Desert King
    eclipse使用
    Java之面向对象
    Python实现终端高亮显示
    requests
    Go基础
    0919CSP-S模拟测试赛后总结
  • 原文地址:https://www.cnblogs.com/baizx/p/9476189.html
Copyright © 2020-2023  润新知