Someone recently suggested that scripts could get embedded inside the blockchain and executed independently by designated machines. What exactly can get stored inside the blockchain, and what are the limits? For instance, if someone uses Bitcoin to purchase electronics from an online site, could the review get embedded inside the transaction and be available for all to view (as opposed to controlled by the seller site)?
There's several ways to go about embedding data in the Blockchain:
- OP_RETURN method embeds data to a single output and the script following the OP_CODE is hex encoded ASCII text
- Use pubkeyScript fields to have ASCII (in hex) which can be concatenated across all the outputs (the addresses as hash160 are unspendable)
- Coinbase field can hold hex data, such as the Genesis Block
- BCI metadata notes which are not actually included in the Blockchain, but are visible on BCI
The first method is most common and accepted, allowing for 40 bytes of text.