<p>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).</p>

CC BY-SA 3.0
2011-09-04T18:39:19.763Z
2011-09-04T18:39:19.763Z
David Perry
<p>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.</p>

<p>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:</p>

<ul>
<li><a href="https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address" rel="nofollow noreferrer">Standard generation/transaction to Bitcoin address</a> - this is the typical situation everyone uses when sending/receiving bitcoins</li>
<li><a href="https://en.bitcoin.it/wiki/Script#Standard_Generation_.2F_transaction_to_IP_address" rel="nofollow noreferrer">Standard generation/transaction to IP address</a> - a method of <a href="https://en.bitcoin.it/wiki/IP_Transactions" rel="nofollow noreferrer">automatically getting the recipient to generate a Bitcoin address so long as their IP is known</a> (very dangerous due to man-in-the-middle attacks) </li>
<li><a href="https://en.bitcoin.it/wiki/Script#Transaction_with_a_message" rel="nofollow noreferrer">Transaction with a message</a> - Add arbitrary text to a transactions (typically limited to around 10,000 bytes) which allows for ASCII art and other graffiti, perhaps even a steganographic exploit</li>
<li><a href="https://en.bitcoin.it/wiki/Script#Hidden_recipient_address" rel="nofollow noreferrer">Hidden recipient address</a> - allows the address of the recipient to be encrypted so that only a shared secret between them allows the bitcoins to be spent</li>
</ul>

<p>The further linked <a href="https://en.bitcoin.it/wiki/Contracts" rel="nofollow noreferrer">Contracts</a> page on the wiki provides these additional use cases which are somewhat more complex:</p>

<ul>
<li><a href="https://en.bitcoin.it/wiki/Contracts#Example_1:_Providing_a_deposit" rel="nofollow noreferrer">Providing a refundable deposit</a> - 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</li>
<li><a href="https://en.bitcoin.it/wiki/Contracts#Example_2:_Escrow_and_dispute_mediation" rel="nofollow noreferrer">Escrow and dispute mediation</a> - 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)</li>
<li><a href="https://en.bitcoin.it/wiki/Contracts#Example_3:_Assurance_contracts" rel="nofollow noreferrer">Assurance contracts</a> - essentially to allow pledges to be given for the greater good by competing parties (example is to pay for a lighthouse)</li>
<li><a href="https://en.bitcoin.it/wiki/Contracts#Example_4:_Using_external_state" rel="nofollow noreferrer">Using external state</a> - 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)</li>
<li><a href="https://en.bitcoin.it/wiki/Contracts#Example_5:_Trading_across_chains" rel="nofollow noreferrer">Trading across chains</a> - Allows other Bitcoin based currencies to trade against each other (thus potentially <a href="https://bitcoin.stackexchange.com/questions/256/what-would-a-country-adapting-bitcoins-as-official-currency-have-to-reinvent/276#276">solving this problem</a> for countries wishing to use Bitcoin)</li>
</ul>

<p>Clearly there are many opportunities for exotic transaction types:</p>

<ul>
<li>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.</li>
<li>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)</li>
</ul>

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

CC BY-SA 4.0
2021-01-14T22:06:09.903Z
Sad that some of the scripts links died, gotta search history.
Ciro Santilli OurBigBook.com
CC BY-SA 3.0
2011-09-04T21:17:55.033Z
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
CC BY-SA 3.0
2011-09-04T20:47:32.993Z
2011-09-04T20:47:32.993Z
2017-04-13T12:47:33.583Z
Gary
<p>The Bitcoin wiki describes a transaction's <a href="https://en.bitcoin.it/wiki/Script">script</a> as something that describes "how the next person wanting to spend the Bitcoins being transferred can gain access to them".</p>

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

<blockquote>
  <ol>
  <li>a public key that, when hashed, yields destination address D embedded in the script, and</li>
  <li>a signature to show evidence of the private key corresponding to the public key just provided.</li>
  </ol>
</blockquote>

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

CC BY-SA 4.0
2021-01-14T17:59:09.823Z
Related: https://bitcoin.stackexchange.com/questions/5883/is-there-a-listing-of-strange-or-unusual-scripts-found-in-transactions
Ciro Santilli OurBigBook.com
<transactions><script>
Useful alternative Bitcoin transaction scripts
Ash Moran
# Useful alternative Bitcoin transaction scripts

(Asked by: username_0 on 2011-09-04)

The Bitcoin wiki describes a transaction's [script](https://en.bitcoin.it/wiki/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?

**Tags:** transactions, script

> **Comments:**
> **username_1**: Related: https://bitcoin.stackexchange.com/questions/5883/is-there-a-listing-of-strange-or-unusual-scripts-found-in-transactions  

---

## 2 answers

### Answer by username_3 on 2011-09-04. Score: 26 | Accepted answer

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:

* [Standard generation/transaction to Bitcoin address](https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address) - this is the typical situation everyone uses when sending/receiving bitcoins
* [Standard generation/transaction to IP address](https://en.bitcoin.it/wiki/Script#Standard_Generation_.2F_transaction_to_IP_address) - a method of [automatically getting the recipient to generate a Bitcoin address so long as their IP is known](https://en.bitcoin.it/wiki/IP_Transactions) (very dangerous due to man-in-the-middle attacks)
* [Transaction with a message](https://en.bitcoin.it/wiki/Script#Transaction_with_a_message) - Add arbitrary text to a transactions (typically limited to around 10,000 bytes) which allows for ASCII art and other graffiti, perhaps even a steganographic exploit
* [Hidden recipient address](https://en.bitcoin.it/wiki/Script#Hidden_recipient_address) - allows the address of the recipient to be encrypted so that only a shared secret between them allows the bitcoins to be spent

The further linked [Contracts](https://en.bitcoin.it/wiki/Contracts) page on the wiki provides these additional use cases which are somewhat more complex:

* [Providing a refundable deposit](https://en.bitcoin.it/wiki/Contracts#Example_1:_Providing_a_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](https://en.bitcoin.it/wiki/Contracts#Example_2:_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](https://en.bitcoin.it/wiki/Contracts#Example_3:_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](https://en.bitcoin.it/wiki/Contracts#Example_4:_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](https://en.bitcoin.it/wiki/Contracts#Example_5:_Trading_across_chains) - Allows other Bitcoin based currencies to trade against each other (thus potentially [solving this problem](https://bitcoin.stackexchange.com/questions/256/what-would-a-country-adapting-bitcoins-as-official-currency-have-to-reinvent/276#276) 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.

> **Comments:**
> **username_0**: 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.  
> **username_1**: Sad that some of the scripts links died, gotta search history.  

---

### Answer by username_2 on 2011-09-04. Score: 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).


---

