Skip to content

EcosystemNetwork/Liquid-Nation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

179 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Liquid Nation

A decentralized P2P cross-chain exchange protocol powered by Charms for seamless, trustless asset trading on Bitcoin.

Overview

Liquid Nation enables secure, peer-to-peer asset swaps across multiple blockchains using the Charms protocol. Our technology eliminates the need for liquidity pools, reducing gas fees and providing a safer, more efficient, and trustless experience for users.

Key Differentiators:

  • πŸ” No Liquidity Pools - Direct P2P atomic swaps via Bitcoin UTXOs
  • ⚑ Zero-Knowledge Proofs - Cryptographic verification, not trust
  • 🌐 True Cross-Chain - Native Bitcoin + Cardano support
  • πŸ’° Lower Fees - No bridge fees, proof batching reduces costs

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     LIQUID NATION ARCHITECTURE                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Frontend (React)  ◄───────►  Backend (Rust/Axum)               β”‚
β”‚       β”‚                              β”‚                           β”‚
β”‚       β–Ό                              β–Ό                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚                 CHARMS PROTOCOL LAYER                    β”‚    β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚    β”‚
β”‚  β”‚  β”‚ Swap App      β”‚  β”‚ Spells (Transaction Templates) β”‚  β”‚    β”‚
β”‚  β”‚  β”‚ (Rust)        β”‚  β”‚ β€’ create-order.yaml            β”‚  β”‚    β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚ β€’ fill-order.yaml              β”‚  β”‚    β”‚
β”‚  β”‚                      β”‚ β€’ cancel-order.yaml            β”‚  β”‚    β”‚
β”‚  β”‚                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                              β”‚                                   β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚              β–Ό               β–Ό               β–Ό                  β”‚
β”‚         Bitcoin         Cardano        Future Chains            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

Liquid-Nation/
β”œβ”€β”€ apps/                          # Charms Rust apps
β”‚   └── swap-app/
β”‚       β”œβ”€β”€ Cargo.toml
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ lib.rs            # Swap contract logic
β”‚       β”‚   └── main.rs           # Entry point
β”‚       └── spells/               # Transaction templates
β”‚           β”œβ”€β”€ create-order.yaml
β”‚           β”œβ”€β”€ fill-order.yaml
β”‚           β”œβ”€β”€ cancel-order.yaml
β”‚           └── partial-fill.yaml
β”œβ”€β”€ backend/                       # Rust API server
β”‚   β”œβ”€β”€ Cargo.toml
β”‚   └── src/
β”‚       β”œβ”€β”€ main.rs
β”‚       β”œβ”€β”€ routes/               # API endpoints
β”‚       β”‚   β”œβ”€β”€ orders.rs
β”‚       β”‚   β”œβ”€β”€ wallet.rs
β”‚       β”‚   └── spells.rs
β”‚       └── services/             # Business logic
β”‚           β”œβ”€β”€ bitcoin.rs
β”‚           └── charms.rs
β”œβ”€β”€ src/                          # React frontend
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── api.js               # Backend API client
β”‚   └── App.jsx
β”œβ”€β”€ Cargo.toml                    # Rust workspace
└── package.json                  # Node.js dependencies

Prerequisites

  • Node.js v18 or higher
  • Rust (latest stable)
  • Bitcoin Core v30.0.0+
  • Charms CLI v0.10.0

Quick Start

1. Install Dependencies

# Install Charms CLI
cargo install --locked charms

# Install Node.js dependencies
npm install

# Build Rust backend and apps
cargo build --release

2. Configure Bitcoin Core

Create ~/Library/Application Support/Bitcoin/bitcoin.conf:

testnet4=1
server=1
rpcuser=charms
rpcpassword=charms

Start Bitcoin Core:

bitcoind -daemon

3. Run the Application

# Terminal 1: Start the backend
cd backend
cargo run --release

# Terminal 2: Start the frontend
npm run dev

The application will be available at:

  • Frontend: http://localhost:5173/
  • Backend API: http://localhost:3001/api

API Endpoints

Orders

  • GET /api/orders - List all orders
  • POST /api/orders - Create new order
  • GET /api/orders/:id - Get order details
  • POST /api/orders/:id/fill - Fill an order
  • DELETE /api/orders/:id/cancel - Cancel an order
  • POST /api/orders/:id/partial-fill - Partially fill an order

Wallet

  • POST /api/wallet/connect - Connect wallet
  • GET /api/wallet/balance - Get balance
  • GET /api/wallet/utxos - Get UTXOs
  • GET /api/wallet/address - Get new address

Spells

  • POST /api/spells/prove - Prove a spell
  • POST /api/spells/broadcast - Broadcast transactions
  • GET /api/spells/status/:txid - Get transaction status

Building the Swap App

# Build the Charms app
cd apps/swap-app
cargo build --release

# Get the verification key
app_bin=$(charms app build)
charms app vk "$app_bin"

Technology Stack

Backend

  • Rust - Systems programming language
  • Axum - Web framework
  • Charms SDK - Bitcoin programmable assets
  • SQLite - Database

Frontend

  • React 19.2.0 - UI library
  • Vite 7.2.4 - Build tool
  • CSS3 - Styling

Blockchain

  • Bitcoin - Base layer
  • Charms Protocol - Programmable assets
  • Cardano - Cross-chain support (coming soon)

Development

Run Tests

# Rust tests
cargo test

# Frontend tests
npm test

Build for Production

# Build Rust
cargo build --release

# Build frontend
npm run build

Resources

License

Β© 2024 Liquid Nation. All rights reserved.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors