Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.
/ 0x21 Public archive

Modular programmable Bitcoin vault infrastructure

License

Notifications You must be signed in to change notification settings

0x21e8/0x21

Repository files navigation

0x21 Finance

Modular programmable Bitcoin vault infrastructure for DeFi integration across chains.

Overview

0x21 Finance provides application-specific personal Bitcoin vaults that can be unlocked under programmable conditions. Instead of wrapping BTC into fungible tokens (wBTC, cbBTC, etc.), users create vaults controlled by threshold keys on the Internet Computer, enabling native Bitcoin custody with cross-chain programmability.

Key use cases: Staking collateral, lending, stablecoins, perpetual DEXs - scenarios where collateral stays in user ownership under normal conditions but can change hands upon liquidation.

Live Deployments

Service URL Description
Main App app.0x21.finance Primary vault management interface
Staking Demo staking-demo.0x21.finance Stake BTC to earn Bitcoin Staking Token (BST) on Ethereum
Swap Demo swap-demo.0x21.finance Create and take BTC/ETH swap orders
Documentation docs.0x21.finance Technical documentation and integration guides
Monitoring monitoring.0x21.finance Grafana dashboards for system metrics
Bitcoin Explorer mempool.0x21.finance Mempool.space instance for Bitcoin regtest
EVM Explorer evm-explorer.0x21.finance Otterscan for Ethereum/Anvil transactions

Note: The live environment runs on hosted test networks (Bitcoin regtest, Anvil, IC replica) for demonstration purposes.

Architecture

Vault Types

  1. Timelocked Vaults - Unlockable programmatically during lifetime, reclaimable by user after expiry
  2. Perpetual Vaults - Only unlockable programmatically via unlock modules

Unlock Modules

Unlock modules define conditions under which vaults can be released:

  • Ethereum Unlock Module - Syncs vaults with a VaultRegistry contract on Ethereum. Authorized addresses can unlock vaults by calling unlockVault() on-chain.
  • Bitcoin Price Threshold - Unlocks based on BTC price conditions
  • Mock Unlock Module - For testing and development

Each module is an independent canister on the Internet Computer, enabling protocol integrations without IC development - only chain-specific contract work is required.

Repository Structure

src/
├── btc_vault_backend/     # Rust canister: vault logic, scheduler, state management
├── btc_vault_app/         # Main application frontend
└── btc_vault_landing/     # Landing page

examples/
├── apps/
│   ├── staking/           # Bitcoin staking demo application
│   └── swap/              # BTC/ETH swap demo application
└── unlock_modules/
    ├── ethereum_vault_unlock/
    ├── bitcoin_price_threshold/
    └── mock_unlock/

docs/                      # VitePress documentation site
scripts/                   # Deployment and testing scripts
monitoring/                # Prometheus, Grafana, Loki configuration
docker/                    # Docker infrastructure and entrypoints

Local Development

Prerequisites

  • Rust 1.70+ with wasm32-unknown-unknown target
  • DFX 0.15+ (Internet Computer SDK)
  • Node.js 20+ with pnpm
  • Docker (for full stack)

Quick Start

# Start full local stack (bitcoind, anvil, dfx replica) and deploy canisters
make setup

# Run tests
make test          # Full integration tests
make test-quick    # Faster iteration
make unit-tests    # Rust unit tests only

# Development
make build                # Build all canisters
make generate-bindings    # Regenerate TypeScript bindings
make frontend-dev         # Start frontend dev server
make status               # Check all services and canisters
make stop                 # Stop all services

Common Commands

make fmt && make clippy   # Format and lint Rust code
make logs                 # View canister logs
make endpoints            # Show all service URLs

Documentation

See docs.0x21.finance for:

  • Integration guides
  • Architecture deep-dive
  • Security model
  • API reference

Get In Touch

Interested in building with 0x21? Contact us to discuss integration opportunities.

License

MIT License - see LICENSE for details.

About

Modular programmable Bitcoin vault infrastructure

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors