This week, AtomicalsXYZ has released its latest AVM virtual machine whitepaper. Many of you may remember last year’s $ATOM and the ARC-20 tokens like $quark that were popular during the New Year. The Atomicals protocol’s AVM whitepaper discusses its implications for the future of the Bitcoin ecosystem. Now let’s analyze the protocol and the content of the whitepaper.
Background:
With the development of the Bitcoin ecosystem, the introduction of technologies such as SegWit, Taproot, Schnorr, MAST, and Taproot Scripts has led to the emergence of new applications. This has also prompted the creation of many Bitcoin token issuance methods, promoting the continuous development of the Bitcoin ecosystem.
The birth of the Ordinals protocol is closely related to the concept of satoshis in the Bitcoin network. This protocol introduces the concepts of Ordinals and Inscriptions. Ordinals assign a unique number to each satoshi based on its mining order. Regardless of how satoshis are transferred between different wallets, their ordinal identifiers remain unchanged. Inscriptions, on the other hand, are achieved by engraving information on satoshis. Combining SegWit and Taproot, the Ordinals protocol allows for the engraving of a file, called an Inscription, on each satoshi on the Bitcoin blockchain, with a size limit of less than 4 MB. As the Bitcoin ecosystem evolves, the founder of Ordinals, Casey, suggests using Runes as an alternative to the BRC-20 protocol. Compared to BRC-20, Runes reduces the server consensus layer, making it simpler and not relying on off-chain data or requiring native tokens. It is well-suited for Bitcoin’s native UTXO model.
The birth of the Atomicals protocol was also serendipitous. Initially, the founder Arthur wanted to develop a DID project based on the Ordinals protocol. However, he encountered some limitations during the process. In May 2023, he tweeted about the protocol’s conceptual ideas and officially launched it in September last year. The concept of ARC-20 in Atomicals is not just a protocol for inscriptions as many people understand it. It is more like a colored coin, using the smallest unit of Bitcoin, sat, as the basic “atom.” Each token unit in Atomicals is supported by at least one satoshi unit, and it operates under the same rules as sending and receiving Bitcoin using the UTXO architecture.
When tracking the history of transactions and calculating the current ARC-20 asset balance, people only need to check the Bitcoin UTXOs related to ARC-20 tokens. There is no need to retrieve additional data from off-chain storage modules. This is a major difference between the ARC-20 and BRC-20 protocols, as BRC-20 protocols typically rely on off-chain indexers and storage layers. The ARC-20 protocol significantly reduces the cost of index servers, increases decentralization, and its transfer security relies on the BTC network, avoiding redundant transactions while maintaining the same atomicity as BTC. It is suitable for developing various native applications. The Atomicals protocol aims to provide more than just asset issuance but also richer use cases for assets, enhancing their liquidity and expanding their functionality.
What is AVM?
Bitcoin was initially designed as a peer-to-peer electronic cash system with a certain script data storage capability and basic OP Codes. So far, all overlay protocols on Bitcoin are based on fixed or predefined state machines. These state machines are essentially immutable and hardcoded in their respective overlay protocol indexers, preventing application developers from customizing the behavior of digital assets.
However, due to the limitations of the UTXO model and predefined state transition rules, this stateless model can only handle limited management of a single BTC asset. To add assets like BRC20, ARC20, and Runes on the Bitcoin network, a more complex dynamic “state machine” model is required to record the storage, transaction, and state changes of these assets. One approach is to use off-chain protocols and Layer 2 solutions, such as Nervos Network, RGB, and Lightning Network, to build the “state machine” model off-chain. Another approach is to directly extend the functionality of the script script, adding new OP Codes or storage space, such as Covenant and BIP proposals like OP_CAT. However, the first approach is difficult to achieve consensus in a short period, while the second approach has uncertainties.
The AVM virtual machine provides a solution that bridges the gap between the two. It directly builds a virtual machine execution environment on the Bitcoin mainnet, allowing for the creation and transfer of complex assets in a special processing manner, and allows application developers to fully customize and define the rules of their digital assets. The basic idea is to allow developers to place smart contract code in the data segment of a transaction so that all parties involved can execute it. By storing the code on the blockchain, different parties can easily synchronize states by executing the logic in the same way.
How does it work?
We all know that a smart contract programming language should have the following key attributes: predictable runtime, Turing completeness, and the ability to execute efficiently on resource-constrained systems. From these requirements, Bitcoin scripts are well-suited as an instruction set for defining the rules of creating and transferring digital assets. Smart contract program codes are stored in Bitcoin transactions, and overlay protocol indexers execute these codes for various method calls and state transitions. All parties involved execute the same logic and reach the same state transition, forming a spontaneous consensus.
The AVM creates and executes smart contracts for various overlay digital assets by simulating the Bitcoin virtual machine and its script interpreter. The Bitcoin blockchain serves as a timestamp and data provider, storing smart contract programs on the chain, while the execution of these programs is done by overlay protocol indexers in a sandbox runtime. Overlay protocol indexer nodes are operated by application developers, service providers, and users, forming an emerging consensus.
1. Bitcoin script simulation: Bitcoin instruction set, implemented through a dual-stack PDA, achieves Turing completeness.
2. Sandbox runtime environment: The entire simulator operates in a controlled and isolated environment, ensuring that execution within the sandbox does not interfere with execution outside.
3. State hash: Allows participants to verify whether their indexer’s state is correctly synchronized, preventing potential attacks from inconsistent states.
In simple terms, AVM utilizes the limited storage space and OP Codes processing framework of the current Bitcoin to introduce a special encoding and decoding method, namely the sandbox environment, in each BTC mainnet transaction. This sandbox is a streamlined version of the Bitcoin script interpreter with some notable differences. It directly accepts and executes locking scripts (scriptPubKey) and unlocking scripts (scriptSig), as well as various other data such as token states and protected memory snapshots. This environment can independently handle the storage, transaction records, and more of a complete set of assets, enabling complex smart contract processing, state synchronization, and verification.
Future Development:
So, what are the possible future developments for AVM? It provides an advanced execution environment for handling smart contracts and dApps. Equipped with a custom instruction set for enhanced performance, it can reduce gas fees, optimize state transition functions to increase parallel processing capabilities, and improve throughput and scalability. Additionally, AVM enables interoperability and cross-chain communication. In simple terms, AVM allows the Atomicals protocol to perform various tasks beyond simple token issuance mechanisms. Only after meeting the basic requirements of asset issuance and management can the Bitcoin ecosystem truly develop, leading to the implementation of larger-scale applications and system architectures.
Although AVM has its limitations, such as only being able to operate ARC20 assets and the availability of layer one smart contracts under the mainnet’s block speed and fee rates being unknown, and despite Bitcoin script language being designed for resource-constrained environments, complex smart contracts may still consume significant computational resources, raising efficiency concerns. However, its emergence is still exciting, and we look forward to further technological breakthroughs.