klionask.blogg.se

Bitcoin transaction fee
Bitcoin transaction fee




bitcoin transaction fee

Then the redeem script is evaluated, with the two signatures being used as input data. When the transaction is broadcast to the network, each peer checks the signature script against the P2SH output Charlie previously paid, ensuring that the redeem script matches the redeem script hash previously provided. See the description in “OP_CHECKMULTISIG” for details.) Note that the signature script must provide signatures in the same order as the corresponding public keys appear in the redeem script. OP_0 is a workaround for an off-by-one error in the original implementation which must be preserved for compatibility. (Opcodes to push the signatures and redeem script onto the stack are not shown. Either one of them can complete it by adding his signature to create the following signature script: She gives a copy of the incomplete transaction to both Bob and Charlie. In the signature script Alice puts her signature and a copy of the unhashed serialized redeem script that Bob created. Alice asks for photo evidence from Charlie along with a copy of the redeem script Bob created and Charlie checked.Īfter looking at the evidence, Alice thinks a 40% refund is sufficient, so she creates and signs a transaction with two outputs, one that spends 60% of the satoshis to Bob’s public key and one that spends the remaining 40% to Charlie’s public key.

Bitcoin transaction fee full#

Charlie wants a full refund, but Bob thinks a 10% refund is sufficient.

bitcoin transaction fee

Unfortunately, the merchandise gets slightly damaged in transit. Bob sees the payment get added to the block chain and ships the merchandise. Then he hashes the redeem script to create a P2SH redeem script and pays the satoshis to it. This is a 2-of-3 multisig pubkey script, more generically called a m-of-n pubkey script (where m is the minimum matching signatures required and n in the number of public keys provided).īob gives the redeem script to Charlie, who checks to make sure his public key and Alice’s public key are included.

bitcoin transaction fee

OP_2 specifies that 2 signatures are required to sign OP_3 specifies that 3 public keys (unhashed) are being provided. OP_2 and OP_3 push the actual numbers 2 and 3 onto the stack. (Opcodes to push the public keys onto the stack are not shown.) Then Bob creates the following P2SH multisig redeem script: To create a multiple-signature ( multisig) output, they each give the others a public key. Now Charlie can pay Bob if everything is ok, Bob can refund Charlie’s money if there’s a problem, or Alice can arbitrate and decide who should get the satoshis if there’s a dispute. Charlie spends his satoshis to an output which can only be spent if two of the three people sign the input. This simple contract isn’t much help if there’s a dispute, so Bob and Charlie enlist the help of Alice-the-arbitrator to create an escrow contract. That means Bob won’t get paid unless Charlie gets his merchandise, but Charlie can’t get the merchandise and keep his payment. Charlie-the-customer wants to buy a product from Bob-the-businessman, but neither of them trusts the other person, so they use a contract to help ensure Charlie gets his merchandise and Bob gets his payment.Ī simple contract could say that Charlie will spend satoshis to an output which can only be spent if Charlie and Bob both sign the input spending it.






Bitcoin transaction fee