RUNES STATE MACHINE

A Turing-complete state machine for the Runes Protocol, designed to enable complex decentralized applications (dApps) like DeFi by updating the internal states of tokens based on predefined states and

Overview

Runes State Machine (RSM) is a Turing-complete state machine designed to enable complex computing capabilities for the Runes Protocol. It aims to support decentralized applications (dApps) such as decentralized finance (DeFi) on Bitcoin Layer 1, enhancing the programmability of Runes tokens.

Introduction

RSM introduces a robust framework for the Runes Protocol, providing the computational power needed for decentralized applications. The protocol leverages the UTXO model and state machine model to extend Bitcoin's capabilities, ensuring decentralized and secure operations.

Design Principles

RSM is designed based on three core principles: security, extension, and consistency. All RSM contracts must adhere to these principles.

1. Security

  • No Custody of User Assets: Ensures that users retain full control over their assets.

  • Trustless: Operates without requiring trust in a central authority.

  • Censorship-resistant: Cannot be censored by any single entity.

  • Permissionless: Accessible to anyone without requiring permissions.

  • Open and Transparent: The computing logic is fully transparent.

  • Decentralized Governance: Supports decentralized decision-making processes.

2. Extension

RSM supports extensive extension capabilities through token nesting, enabling modular application development. This approach allows for the support of current and future decentralized application logics.

3. Consistency

RSM ensures consistency by aligning state transition functions with token UTXO operations, guaranteeing that all indexers compute the same state based on on-chain data.

Key Concepts

Runes State Machine (RSM)

RSM is a Turing-complete state machine that serves as the runtime environment for Runes Protocol contracts, enabling complex dApps like DeFi.

Contract

A collection of predefined states and state transition functions defining the computing capabilities of a token.

Token/Rune

Tokens (Runes) are instances created by etchings, implementing various contracts to gain different computing capabilities.

Application

A token that implements a contract, essentially becoming a token with computing capabilities and states.

State

The condition of a token based on previous inputs, defining reactions to subsequent inputs as specified in the contract.

State Transition Function

Computes the next state of the token given the current state and inputs, enabling the necessary computations for the token's functionality.

Token Nesting

Allows multiple tokens to be created under one token, enabling the implementation of multiple independent computing logics.

Governance

Decentralized governance of tokens, enabling updates to token attributes and the creation of child tokens through on-chain voting.

Oracle

Off-chain indexers act as oracle verifiers to authenticate off-protocol proof data submitted by users.

Detailed Concepts

Token and Contract

Tokens in RSM are instances created after a contract deployment, with computing capabilities defined by state transition functions. The process is decentralized and transparent, with no need for asset custody.

Token Nesting

Tokens can be nested, creating child tokens with independent computing logics under a parent token, allowing modular application development.

State and UTXO Conversion

RSM introduces new operations (burn2, burn3, mint2, mint3) to enable conversion between UTXO and state, ensuring decentralized and secure token operations.

Decentralized Governance

RSM’s governance contract (Contract-001) manages Runes tokens through decentralized voting, ensuring on-chain governance and automatic execution of decisions.

Privileges

RSM defines roles for owners and admins, with strictly limited privileges to ensure decentralized and trustless operations.

Contract Parameters

Contracts in RSM require definitions for parameters like openAsChild and onlyChild to specify deployment conditions for tokens.

Token Deployment

Tokens can be deployed either directly via Runes Protocol etching or through the governance contract, depending on the governance requirements.

Token Burn and Mint Operations

RSM introduces burn2, burn3, mint2, and mint3 operators for various token scenarios, enabling seamless state-UTXO conversions.

Trading Tax and Deflation

RSM supports trading tax mechanisms and deflation settings for tokens traded in decentralized exchanges based on AMM.

Anti-MEV Measures

RSM employs a block confirmation requirement for state-UTXO conversions to prevent MEV attacks.

Oracle Functionality

RSM’s oracle functionality relies on off-chain indexers as verifiers, enabling robust and flexible proof verification for various scenarios.

Contracts Overview

  • Contract-001: Decentralized On-Chain Governance

  • Contract-002: Automated Liquidity for Runes Assets

  • Contract-003: Relay among Bitcoin, Runes, BRC-100, and BRC-20

  • Contract-004: Liquid Staking/Restaking for Runes, BTC, BRC-20, and BRC-100

  • Contract-005: Decentralized Airdrop

  • Contract-006: Decentralized Collateral-backed Stablecoin

  • Contract-007: Decentralized Lending

  • Contract-008: Automated Liquidity for Stablecoin

  • Contract-009: Decentralized Exchange for Perpetual Futures

  • Contract-010: Relay among Runes and EVM Compatible Blockchains

  • Contract-011: Verification for Bitcoin Layer 2

  • Contract-012: Asset Issuance for Administrator

  • Contract-013: Launchpad for BRC-100 Assets

  • Contract-014: Aggregator for Decentralized Exchange

  • Contract-015: Aggregator for Lending

  • Contract-016: Asset Vesting

Glossary of Terms

Runes State Machine (RSM)

A Turing-complete state machine for the Runes Protocol, designed to enable complex decentralized applications (dApps) like DeFi by updating the internal states of tokens based on predefined states and state transition functions in the contract.

Contract and Token

In RSM, a contract is a standard that describes the states and state transition functions of a token. A token is an instance created after a contract is deployed to the Bitcoin network, with computing capabilities and states defined in the contract.

Token Nesting

Allows one token to create multiple child tokens under it, each with independent computing logics. For example, in an AMM DEX scenario, multiple LP child tokens can be created under an AMM DEX token.

State

Represents the condition of a token based on previous inputs and dictates reactions to subsequent inputs as defined in the contract. States can represent various conditions such as asset reserves in a liquidity pool or total staked amounts in a yield farming pool.

State Transition Function

Computes the next state of a token given the current state and UTXO inputs. Used with burn2/burn3/mint2/mint3 operators to convert between UTXO and state.

Decentralized Governance

RSM introduces a governance contract (Contract-001) to manage Runes tokens through decentralized voting. Governance includes updating token attributes and deploying child tokens.

Privileges

Defines roles for owners and admins, with limited privileges to ensure decentralized and trustless operations. Admins cannot manage other admins, and privileges are restricted to governing tokens that have not started a DAO.

Contract Parameters

Contracts in RSM need to define parameters like openAsChild and onlyChild to specify deployment conditions for tokens.

Deploy Token

Tokens can be deployed via Runes Protocol etching or through the governance contract, depending on whether governance is required.

Burn Token

Introduces burn2 and burn3 operators to convert assets to token states. Burn2 reduces the circulating supply by burning assets to a whitelist, while burn3 transfers assets to the token state for internal distribution.

Mint Token

Introduces mint2 and mint3 operators for different minting scenarios. Mint2 allows users to mint assets from a whitelist, while mint3 converts state balances to UTXO without increasing the circulating supply.

Trading Tax and Deflation

Supports trading tax mechanisms and deflation settings for tokens traded in AMM-based decentralized exchanges.

Anti-MEV Measures

Requires block confirmation for state-UTXO conversions to prevent MEV attacks like sandwich attacks.

Oracle

Off-chain indexers serve as oracle verifiers, authenticating off-protocol proof data submitted by users. This new paradigm of proof and verification enhances the oracle functionality in RSM.

Last updated