formated block https://webbtc.com/block/000000000000000001f942eb4bfa0aeccb6a14c268f4c72d5fff17270da771b9
transaction in block (coinbase transaction) https://webbtc.com/tx/9a223b09449cdd383206db29fe7f5ea31e0154d9fb30eabafe36eb8a9a33d22f
UTXO: 存在 memory 當中 類似 stack
Input:
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6
Index: 0
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501
Output:
Value: 5000000000
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d
OP_EQUALVERIFY OP_CHECKSIG
-
input 跟 output value 會相同
-
input 會指名來源的上一個 transaction id
-
scriptSig 存在 input 當中
-
scriptPubKey 存在 output 中
執行時 scriptSig scriptPubKey 會合併起來到 stack 中執行
至於如何執行,下面的 script 介紹有不同的例子
https://en.bitcoin.it/wiki/Script#Opcodes
- scriptPubKey: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG
- scriptSig:
=> OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG
- scriptPubKey: OP_CHECKSIG
- scriptSig:
=> OP_CHECKSIG

- Segregated Witness (Segwit)
- 取代 scriptSig 透過 witness
- SegWit replaces the 1MB block-size limit with a 4MB block-weight limit