A web-based Bitcoin wallet with Ark protocol integration for off-chain transactions.
Ark Web Wallet is a full-stack web application that allows users to:
- Create and manage Bitcoin wallets
- Send and receive on-chain Bitcoin transactions
- Send and receive off-chain transactions using the Ark protocol
- View transaction history
- Participate in settlement rounds
The application consists of a Rust backend API and a React frontend, providing a seamless user experience for managing Bitcoin with Ark protocol integration.
- Wallet Management: Create and access Bitcoin wallets
- On-chain Transactions: Send and receive regular Bitcoin transactions
- Off-chain Transactions: Use the Ark protocol for faster, cheaper transactions
- Transaction History: View all on-chain and off-chain transactions
- Round Participation: Participate in settlement rounds to batch transactions
- Balance Tracking: Monitor confirmed and pending balances
- Address Generation: Generate addresses for receiving funds
The backend is built with Rust and provides a RESTful for the frontend and used Grpc to connect with Ark server. It uses:
- Axum: Web framework for handling HTTP requests
- Ark Client: Integration with the Ark protocol
- Bitcoin Development Kit: For Bitcoin wallet functionality
- Tokio: Asynchronous runtime
The frontend is built with React and provides a user-friendly interface. It uses:
- React: JavaScript library for building user interfaces
- React Router: For navigation between pages
- Cloudscape Design System: For UI components
- Fetch API: For communication with the backend
- Rust
- Node.js
- Nigiri for server side To download nigiri run the following command:
curl https://getnigiri.vulpem.com | bash
by default Nigiri's Esplora client uses a port-5000:5000
change that to port-3002:5000
. If using default port numbers for Esplora client update the enviroment variable in backend directory to match your esplora server address.
- Clone the repo
git clone https://github.com/pingu-73/ark-web-app.git
cd ark-web-app
- Start Nigiri with Ark support
nigiri start --ark
- Build and run the backend
cd backend
cargo build
cargo run
The backend will be available at http://localhost:3030
- Install frontend dependencies and start the development server
cd frontend
npm install
npm start
The frontend will be available at http://localhost:3000.
The backend is structured as follows:
src/main.rs
: Entry point and server setupsrc/api/
: API routes and handlerssrc/services/
: Business logicsrc/models/
: Data models
The frontend is structured as follows:
src/App.js
: Main application componentsrc/pages/
: Page componentssrc/components/
: Reusable UI componentssrc/api/
: API client
6E8D
ul>
GET /api/wallet/info
: Get wallet informationGET /api/wallet/balance
: Get wallet balanceGET /api/wallet/address
: Get an Ark address for receiving off-chain paymentsGET /api/wallet/boarding-address
: Get a Bitcoin address for receiving on-chain paymentsPOST /api/wallet/send
: Send a payment (either Ark or on-chain)GET /api/transactions
: Get transaction historyPOST /api/round/participate
: Participate in a round- Commit Reveal protocol
- Add models for commit and reveal transactions
- Create API endpoints for the game flow
- Implement service functions for game logic
- Game State Management
- Track game states (waiting for commit, waiting for reveal, completed)
- Handle timeouts and disputes
- Manage game history
- Features
- proper random number generation
- verification of commitments and reveals
-
Crate with Core functionality for other developers to use
-
Features
- VTXO Tree Implementation
- Connector Mechanism (to ensure atomicity b/w forfeit txs and round txs)
- Timelock Handling (for boarding outputs and unilateral exits)
- Batch Expiry (track and handle batch expiry for liquidity recycling)
- Dummy to real impl
- make actual gRPC calls to the Ark server for balances, addresses, and tx history
- add signing and verification steps in Round participation
- Security Fatures (Improvement from current impl)
- tx Broadcasting (currently not broadcasting txs to network)
- bitcoin blockchain interaction for on-chain tx
- UTXO management
- Key Management
- Signature Verification
- Add cryptographic op for protocol's security
- Implement taproot script with collaborative and exit paths
The backend provides the following API endpoints: