The sagest wallet for the Chia blockchain.
Sage is a fast, open source light wallet for Chia. It syncs by connecting directly to peers on the network (or to a full node you trust), so you get a responsive wallet without downloading the entire blockchain. It runs on Windows, macOS, Linux, Android, and iOS.
- XCH and CATs - Send, receive, and manage XCH and Chia Asset Tokens, or issue your own tokens.
- NFTs - Mint, view, organize, and transfer NFTs and collections.
- DIDs - Create and manage Decentralized Identifiers.
- Offers - Make, take, and manage Chia offer files for trustless peer-to-peer trading, plus token swaps.
- Options - Mint and exercise option contracts.
- WalletConnect - Connect to dApps and DeFi services.
- Apps - Run sandboxed apps inside the wallet, built with the Sage App SDK.
- RPC and CLI - Run Sage headless and automate it via its RPC server, with an OpenAPI spec.
- Multiple wallets - Manage several keys, including watch-only wallets, with custom themes and many languages.
Sage is built on the foundation of chia_rs, clvm_rs, and the Chia Wallet SDK, and is designed with maintainability and extensibility in mind from the beginning.
Note
Sage is under active development. Please use it with care, and keep a secure backup of your mnemonic.
Download the latest build for your platform from the releases page. For iOS, join the public TestFlight.
If you want to build from source, see the Development section for instructions.
This is an open source project, and we welcome pull requests to improve any part of the wallet.
The frontend is currently written in TypeScript with React and Shadcn UI, and can be found in the src directory.
The backend is written in Rust, powered by Tauri v2. The frontend and backend communicate via serialized commands and events over IPC. The src-tauri directory contains the backend wrapper code, and crates is the individual libraries that make up the wallet backend.
Finally, the wallet driver code is written on the backend using the Chia Wallet SDK.
These instructions should get you up and running with a source installation.
First, there are some prerequisites:
Install the frontend dependencies:
pnpm installThe build process on Windows requires CMake, Clang and NASM installed.
choco install cmake llvm nasmYou can run the app with:
# For development purposes:
pnpm tauri:dev
# If you need optimizations:
pnpm tauri:dev --releaseAnd build the application with:
pnpm tauri:buildYou can also run the app in the iOS or Android simulator, though it may take some prior setup:
pnpm tauri ios dev
pnpm tauri android devIf you are going to be working on the wallet database follow the steps below.
Sage uses sqlx for database integration, so first install the sqlx-cli
cargo install sqlx-cliNext create a .env file in the project root with these contents:
DATABASE_URL=sqlite://./test.sqliteIn order to sync your local environment to incoming query or schema changes or if you see rust compile errors like error: error returned from database you probably need to run this command:
sqlx db reset -yIf you add or change queries run this command to generate new sqlx SQL files:
cargo sqlx prepare --workspaceSchema changes, including new indices, go into the migrations folder as SQL DDL scripts.
Currently, only the wallet driver code has tests. These can be run with:
RUST_LOG=debug,sqlx=off cargo t -p sage-walletThe sqlx=off portion gets rid of noisy log spam from SQLx.
Most of the tests for the underlying coin spend implementations live in the Wallet SDK repo.
The following things have to be done before a new release is published:
- Bump the version of all crates
- Bump the versions in
src-tauri/gen/apple/sage-tauri_iOS/Info.plist - Run
pnpm prettierto format the code - Run
pnpm extractto extract new translations - Create a new tagged release
- Upload to TestFlight and the Google Play Store
- Generate the OpenAPI specification
cargo run --bin sage rpc generate_openapi -o dist/openapi.json - Upload to docusaurus