Introduction to Alkanes

Alkanes is a metaprotocol built on top of Protorunes that brings smart contract functionality to Bitcoin. Unlike traditional Bitcoin scripts, Alkanes enables complex programmable logic while maintaining the security guarantees of the Bitcoin network.

What are Alkanes?

Alkanes are WebAssembly (WASM) smart contracts that run on Bitcoin through the Protorunes protocol. They enable:

  • DeFi on Bitcoin – AMMs, lending, derivatives
  • Token standards – Fungible and non-fungible tokens
  • Governance – On-chain voting and DAOs
  • Complex logic – Arbitrary computation anchored to Bitcoin

How it Works

  1. Write contracts in Rust – Use familiar tooling and the alkanes-std library
  2. Compile to WASM – Target wasm32-unknown-unknown
  3. Deploy to Bitcoin – Inscribe the WASM binary via Ordinals
  4. Interact via transactions – Call contract methods through Bitcoin transactions

Key Concepts

Protorunes

Protorunes extend the Runes protocol with programmable functionality. Each Alkane is a special type of Protorune that contains executable WASM code.

Metashrew Indexer

Metashrew is the indexing infrastructure that processes Bitcoin blocks and maintains Alkane state. It enables fast queries and real-time updates.

Architecture Overview

┌─────────────────────────────────────────────────────────┐
│                    Your Application                      │
├─────────────────────────────────────────────────────────┤
│                    Subfrost API                          │
│              (REST / JSON-RPC / GraphQL)                │
├─────────────────────────────────────────────────────────┤
│                   Metashrew Indexer                      │
│              (WASM-based block processing)              │
├─────────────────────────────────────────────────────────┤
│                    Bitcoin Network                       │
│              (Transactions & Block Data)                │
└─────────────────────────────────────────────────────────┘

Resources