25

The Bitcoin wiki describes a transaction's script as something that describes "how the next person wanting to spend the Bitcoins being transferred can gain access to them".

The script for "a typical Bitcoin transfer to destination Bitcoin address D" is described as requiring of the future spender:

  1. a public key that, when hashed, yields destination address D embedded in the script, and
  2. a signature to show evidence of the private key corresponding to the public key just provided.

What useful alternative scripts could be made? What practical situations would they serve, and what client features would be required to support them?

1

2 Answers 2

26

If a full implementation of the scripting language were in place, then pretty much all of the following could be implemented. However, there are serious security concerns with some of these and they warrant further analysis before finding their way into the clients.

The referenced Scripts link in the original question contains several script examples covering the following use cases which are worth listing before getting to the more exotic cases:

The further linked Contracts page on the wiki provides these additional use cases which are somewhat more complex:

  • Providing a refundable deposit - handy for proving that you're willing to spend money to ensure that you're reputable, with the option to get it back after a given time
  • Escrow and dispute mediation - permits several parties that don't trust each other to trade using their common trust of a given set of trusted third parties (this is the classic M of N signatures to release the funds contract)
  • Assurance contracts - essentially to allow pledges to be given for the greater good by competing parties (example is to pay for a lighthouse)
  • Using external state - Scripts can consult addresses that may be attached to "oracle scripts" which can perform transaction signing based on complex internal logic (example is to guarantee payment of an inheritance upon death or coming of age whichever is the sooner)
  • Trading across chains - Allows other Bitcoin based currencies to trade against each other (thus potentially solving this problem for countries wishing to use Bitcoin)

Clearly there are many opportunities for exotic transaction types:

  • Proof of knowledge - to prove that knowledge was acquired at a certain time a transaction could be created that references an oracle script that could provide verification. The oracle may not exist at the time of presentation, but it would be trivial to run the script and verify the outcome.
  • Payment on successful prediction - another external state use case to allow an external oracle to sign a transaction based on pre-arranged transaction outcomes (examples include gambling, spread betting etc)

All in all, it shows that Bitcoin is a very effective financial trading instrument.

2
  • Thanks for the detailed reply. Apologies for not reading the wiki page more carefully, as I scrolled down I thought it was pure technical description and I zoned out! But your summary is terser and more accessible than the wiki content.
    – Ash Moran
    Sep 4, 2011 at 21:17
  • Sad that some of the scripts links died, gotta search history. Jan 14, 2021 at 22:06
2

I believe that such scripts are the mechanism by which Namecoin added its DNS-like capabilities. There are also numerous other types of transactions in the works including multi-signature (M of N) transactions that would allow for a built-in escrow functionality as well as adding additional "signers" on an account (i.e. "joint" Bitcoin accounts).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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