Inscription Standard
Check the Bitcoin Inscription Standard used by VIA Protocol.
Last updated
Check the Bitcoin Inscription Standard used by VIA Protocol.
Last updated
We view Bitcoin as a secure and decentralized "wall" for inscribing arbitrary data. At the interpretation level (encompassing the Sequencer and Verifiers) we retrieve and process this data according to predefined rules governing interactions between different parties. These rules are formalized in the VIA Inscription Standard.
VIA protocol needs Bitcoin blockchain to serve as the single source of truth. Unlike Ethereum, which has the Ethereum Virtual Machine (EVM) providing significant flexibility for designing various protocols, Bitcoin offers limited scripting capabilities. The available opcodes in Bitcoin’s scripting language are not directly related to our needs.
Given these constraints, we had to solve our problem indirectly using the available opcodes. One of the capabilities VIA Protocol leverages, is the ability to write arbitrary data onto the Bitcoin network. This concept of embedding arbitrary data onto the Bitcoin blockchain is referred to as within the ecosystem and it allowed us to establish a single point of truth for our protocol on the most secure and decentralized blockchain.
This section explains a different approaches for inscribing data on the Bitcoin blockchain.
OP_RETURN
This method involves spending a small amount of BTC and creating another UTXO with the OP_RETURN
opcode to write data. The data is revealed in the output section of the transaction.
Advantage: Requires only one transaction and implementation is simple.
Disadvantage: It is more expensive because the data is not written in the section.
Enabled by the Taproot fork on the Bitcoin network, this approach stores data in the witness storage instead of the UTXO chain-state database, making it significantly cheaper than using OP_RETURN
. The mechanism is straightforward. Inscription content is serialized using data pushes within unexecuted conditionals, called "Envelopes” OP_FALSE OP_IF … OP_ENDIF
:
First, OP_FALSE
is pushed onto the Bitcoin Stack-based validation machine. An if-statement with OP_IF
is then used. The default behavior of this opcode is to execute the code within the if-statement if the latest value in the stack is interpreted as "true". However, by pushing OP_FALSE
onto the stack, we ensure the code within the if-statement does not execute.
Nevertheless, the code in this section becomes part of the Bitcoin blockchain data. By writing arbitrary data here, we can use this approach for inscription at a lower cost.
Advantage: 4 times cheaper then OP_RETURN
option since the data is written in the witness section of the transaction.
Disadvantage: Requires 2 transactions (commit & reveal) and it is more complex to implement.
Witness data structures for different message types inscribed and used by the various components of the VIA Protocol can be seen .