I'm having a bit of trouble understanding example 3, the bit coin assurance contract on the bitcoin wiki(https://en.bitcoin.it/wiki/Contract) where senders choose to donate money only if 1000BTC total is raised. Here is the description of the assurance contract example:

  1. An entrepreneur creates a new address and announces that the good will be created if at least 1000 BTC is raised. Anyone can contribute.
  2. Each party wishing to pledge creates a new transaction spending some of their coins to the announced address, but they do not broadcast it. The transaction is similar to a regular transaction except for three differences: Firstly, there cannot be any change. If you don’t have any outputs of the right size, you must create one first by spending to one of your own addresses. Secondly, the input script signature is signed with SIGHASH_ALL | SIGHASH_ANYONECANPAY. Finally, the output value is set to 1000 BTC. Note that this is not a valid transaction because the output value is larger than the input value.
  3. The transaction is uploaded to the entrepreneur's server, which saves it to disk and updates its count of how many coins have been pledged.
  4. Once the server has enough coins, it merges the separate transactions together into a new transaction. The new transaction has a single output that simply spends to the announced address - it is the same as the outputs on each contributed transaction. The inputs to the transaction are collected from the contributed pledges.
  5. The finished transaction is broadcast, sending the pledged coins to the announced address.

where each transaction is of the following form from bitcoin wiki(https://en.bitcoin.it/wiki/Transaction):

Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6
Index: 0
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10

Value: 1000
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d

I'm having trouble understanding step 4. If the entraprenuer only ends up raising 500BTC and never meets their goal of raising 1000BTC why can't the entraprenuer change the output value to 500BTC, then broadcast the transaction and cash out anyway without each of the the sender's consent?


SIGHASH_ALL | SIGHASH_ANYONECANPAY signs the outputs. So the entrepreneur cannot change the output, as it would invalidate the signatures on all the inputs he received.

There is another way he can bypass this though - if he has 500 BTC himself (or can borrow that amount very briefly) - he can contribute that himself, getting away with raising only 500 BTC but still taking the coins. The only way around that is having some form of escrow that verifies the payments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.