Arch Documentation
  • ♾️Introduction
  • 🌉History of Bitcoin Programmability
    • The Challenges Facing Bitcoin DeFi
  • Bitcoin-Native vs. Bitcoin L2s & Metaprotocols
    • Why L2s and Meta-protocols Aren’t Enough
  • 🔗Quick Links
  • FUNDAMENTALS
    • 🌟Introducing Arch
      • Arch’s Signature Scheme Model (FROST + ROAST)
      • How Arch Works
      • Bridgeless Execution
      • Decentralized Validation
      • State Transitions Anchored on Bitcoin
      • Minimized Trust Assumptions
    • Step-by-Step User Journey on Arch
      • How It Works
  • USE CASES
    • How Arch Unlocks the Core Pillars of DeFi
    • 💵Using multi-party programs to enable AMMs, LPs, and DEXs
      • 🤝Example: A Bitcoin DEX
      • 🪙StableCoin
  • DEVELOPERS
    • Overview
    • FAQ
  • The Future
    • 🗺️Roadmap
    • 🔎Audits
Powered by GitBook
On this page
  1. FUNDAMENTALS

Step-by-Step User Journey on Arch

PreviousMinimized Trust AssumptionsNextHow It Works

Last updated 8 months ago

  1. Users can invoke a program by preparing, signing, and sending a transaction to the Arch Network without having to use anything but their Bitcoin wallets (ie, no bridging). They send this message through an RPC call passing essential information for execution, including State UTXOs, the related programs to execute, and custom program inputs (Bitcoin PSBTs).

  2. A leader node, selected from the pool of validators, receives the RuntimeTransaction and initiates the process by proposing a new block. The transaction is then gossiped throughout the network whereby each validator will validate and process the transaction asynchronously.

  3. Execution results are shared back with the leader node and, once a signature threshold is reached, the leader will aggregate the signatures and sends a fully-signed Bitcoin transaction to the Bitcoin network, including state transitions and asset transfers from the execution (this guarantees that you can’t have the asset transfer happen without the state transition also occurring, or vice versa).

  4. The user, or dapp, can then poll the network to retrieve the result of the transaction.

Sample data structures

#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, BorshDeserialize, BorshSerialize)]
pub struct RuntimeTransaction {
    pub version: u32,
    pub signatures: Vec<Signature>,
    pub message: Message,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
pub struct Message {
    pub signers: Vec<Pubkey>,
    pub instructions: Vec<Instruction>,
}

#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
pub struct Instruction {
    pub program_id: Pubkey,
    pub accounts: Vec<AccountMeta>,
    pub data: Vec<u8>,
}