Experimental TechnologyAll code and concepts presented in this documentation are for exploration and proof of concept purposes only. These examples should not be used in production environments. The Arkade Language ecosystem is under active development and subject to significant changes.
Smart Contracts in the UTXO Model
Bitcoin’s Unspent Transaction Output (UTXO) model differs fundamentally from the account-based model used in platforms like Ethereum. This difference creates both challenges and opportunities for smart contract development. Arkade builds upon Bitcoin’s UTXO model to enable powerful smart contracts while maintaining Bitcoin’s security properties.The UTXO Paradigm
In the UTXO model:- Each transaction consumes one or more UTXOs as inputs
- Each transaction creates one or more new UTXOs as outputs
- Each UTXO can only be spent once
- Each UTXO has an associated script that defines the conditions for spending it
Commit-Reveal Pattern
The classic approach to smart contracts in Bitcoin uses a commit-reveal pattern:- Commit Phase: Participants commit to certain values by locking funds in a transaction output with specific spending conditions
- Reveal Phase: Participants reveal the committed values when spending the output, satisfying the script conditions
- The commit phase locks funds that can be claimed by revealing a preimage to a hash
- The reveal phase occurs when the receiver spends the output by providing the preimage
State Transitions in UTXO
Traditional Bitcoin script has limited ability to enforce state transitions. When a UTXO is spent, its script can only verify the spending conditions, but cannot directly enforce conditions on the outputs being created. This limitation makes it difficult to implement contracts that need to maintain state across multiple transactions, such as:- Decentralized exchanges
- Payment channels
- Automated market makers
- Lending protocols
Advancing Beyond Commit-Reveal
Arkade Script introduces two key innovations that enable more powerful smart contracts in the UTXO model:1. Transaction Introspection
Transaction introspection allows a script to examine properties of the transaction that’s spending it, including the outputs being created. This enables:- Verification that outputs maintain certain properties
- Enforcement of state transitions
- Implementation of covenants (restrictions on how funds can be spent)
2. Taproot and Key Tweaking
Taproot enables more complex script conditions while maintaining privacy. Combined with key tweaking, it allows:- Verification that outputs commit to specific contract terms
- Complex spending conditions hidden in Taproot trees
- Efficient verification of contract continuation
State-Carrying Contract Primitives
With introspection and Taproot, Arkade enables true stateful contracts in the UTXO model through:Token Support
Tokens can represent state and ownership within contracts:- Fungible tokens for value representation
- Non-fungible tokens for unique assets
- Token transfers as state transitions
Recursive Covenants
Recursive covenants allow contracts to enforce conditions on their future spending:- Self-replicating contract logic
- Enforced state machine transitions
- Preservation of invariants across transactions
The VTXO Paradigm
Arkade introduces the Virtual Transaction Output (VTXO) paradigm, which combines the security of Bitcoin’s UTXO model with the flexibility needed for complex applications:- Immediate Execution Path: Cooperative execution with server co-signature for instant finality
- Timelock Unilateral Path: Fallback mechanism for onchain redemption with timelock constraints