Skip to content

About

High-performance Rust SDK for developing Chia wallet applications.

Topics

Resources

Stars

27 stars

Watchers

7 watching

Forks

Repository files navigation

Chia Wallet SDK

crate documentation npm PyPI

A high-performance Rust SDK for building applications that interact with coins on the Chia blockchain, with bindings for Node.js, WebAssembly, and Python.

The Wallet SDK handles the low-level details of Chia's coin set model so you can focus on your application: constructing and parsing puzzles, building spend bundles, calculating required signatures, talking to full nodes, and testing everything against a simulator.

Note

This is a library, not a prebuilt wallet. If you're looking for a ready-to-use wallet, check out Sage, a light wallet built on top of the Wallet SDK that also exposes an RPC interface.

Features

  • Puzzle drivers for standard primitives, including CATs, NFTs, DIDs, singletons, vaults (MIPS), DataLayer stores, clawbacks, options, and streamed assets
  • Offers - create, inspect, and take Chia offer files
  • Action system for describing high-level operations (sends, issuance, minting, etc) and letting the SDK assemble the spends
  • Signing - compute the BLS and secp signatures required by a set of coin spends
  • Networking - connect to full node peers over the light wallet protocol, query the coinset.org API, or talk to a local Chia daemon via RPC
  • Testing - an in-memory blockchain simulator for exercising spends without a real network
  • Typed conditions and puzzle info shared across the whole stack

Packages

Language Package Install
Rust chia-wallet-sdk cargo add chia-wallet-sdk
Node.js chia-wallet-sdk npm install chia-wallet-sdk
WebAssembly chia-wallet-sdk-wasm npm install chia-wallet-sdk-wasm
Python chia-wallet-sdk pip install chia-wallet-sdk

The bindings are generated from a single definition (bindings.json and bindings/), so the API is consistent across languages.

The Rust crate re-exports a set of smaller crates, which can also be used individually:

Crate Description
chia-sdk-driver Puzzle drivers, spend construction, offers, and the action system
chia-sdk-types Conditions, puzzle arguments, and other shared types
chia-sdk-signer Calculates the signatures required for coin spends
chia-sdk-client Full node peer connections via the light wallet protocol
chia-sdk-coinset Client for the coinset.org and full node RPC APIs
chia-sdk-daemon Websocket client for the Chia daemon
chia-sdk-test Blockchain simulator and testing utilities
chia-sdk-utils Address encoding and other general utilities

Optional features

Feature Description
chip-0008 Splitter puzzle (CHIP-0008)
chip-0021 NFT fusion puzzle (CHIP-0021)
chip-0035 DataLayer store support (CHIP-0035)
chip-0037 EIP-712 vault members (CHIP-0037)
chip-0052 Partial offers (CHIP-0052)
action-layer Action layer puzzles and drivers
auction English auctions for NFTs, built on the action layer
pooling Plot NFTs (pooling puzzles)
offer-compression Compression and decompression of offer files
peer-simulator Simulated full node peer for networking tests
native-tls / rustls TLS backend for network connections

Getting Started

If you're new to developing on Chia, xch.dev is a great place to learn about the coin set model, Chialisp, and the standard puzzles.

From there:

You can run an example with:

cargo run --example cat_spends

Credits

Special thanks to:

License

Licensed under the Apache License, Version 2.0.

About

High-performance Rust SDK for developing Chia wallet applications.

Topics

Resources

Stars

27 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages