P2PK - Pay to public key

這是最基本的交易方式,

前一個交易的 scriptPubKey 為: <PubKey> <OP_CHECKSIG>

此交易的 scriptSig 為: <Signature>

結合的 script 是: <Signature> <PubKey> <OP_CHECKSIG>

在 stack 上運算會對 <Signature> <PubKey> 進行驗證


缺點:

地址太長,導致 ScriptPubKey 很長,手續費會變高

而且這裡的 <PubKey> 是 P = k * G 的那個點,還沒經過 Hash160 加密

直接給 pubkey 容易被破解


P2PKH - pay to public key hash

工程師想出另一種腳本:

在鎖定腳本不直接給 P 點,而是給驗證的腳本,在解鎖腳本時才透露P

results matching ""

    No results matching ""