zinc-core
zinc-core is a Rust wallet engine for Bitcoin + Ordinals use cases.
Key capabilities:
- deterministic account/key derivation on top of BDK,
- taproot-first public API naming,
- transaction creation/signing/broadcast helpers,
- Ordinal Shield PSBT analysis (burn/movement risk detection),
- optional WASM bindings for browser and extension hosts.
Installation
[]
= "0.1"
What You Get
- BIP-39 mnemonic generation, validation, and seed derivation
- Explicit-network wallet constructors (
from_mnemonic,from_seed) - Taproot descriptor-based wallet construction
- Unified and dual-account address schemes
- Native sync with Esplora backends
- Ordinals protection + metadata sync and PSBT analysis
- Typed core request/error surfaces (
CreatePsbtRequest,ZincError) - WASM exports for wallet lifecycle and runtime log controls
Quick Start (Native Rust)
use ;
Address Model
- Canonical public naming uses
taproot*fields and methods. - In
Unifiedmode, payment role resolves to the same taproot key/address family. - In
Dualmode, payment role uses a distinct SegWit payment branch.
Constructor Model
WalletBuilder::from_mnemonic(network, &mnemonic)WalletBuilder::from_seed(network, seed64)
Example Programs
Run from the workspace root (wallet/zinc-core):
ESPLORA_URL=https://mempool.space/api \
wallet_setup.rs: deterministic setup + account/address inspectionsync_and_balance.rs: online sync flow and balance retrievalpsbt_sign_audit.rs: Ordinal Shield analysis over a sample PSBT
WASM Integration Notes
WASM exports include:
- stateless helpers:
generate_wallet,validate_mnemonic,derive_address,encrypt_wallet,decrypt_wallet - stateful wallet wrapper:
ZincWasmWallet - runtime logging controls:
set_log_level,set_logging_enabled,get_log_level
WASM payloads are canonicalized to taproot* keys.
init() installs panic hooks only. Host applications should configure their own log subscriber/sink.
Logging Model
- Default runtime level is
warn - Runtime levels accepted by WASM API:
off|error|warn|info|debug|trace - Identifier-rich diagnostics (for example tx/output identifiers) are intended for
debug
Security and Stability
- This is security-sensitive software. Review release notes before upgrading.
- Avoid logging secret material and mnemonic data.
- Reporting process: see SECURITY.md.
- Discovery APIs are hardened to avoid exposing raw master private keys.
Development Checks
License
Licensed under MIT. See LICENSE.