zinc-core
zinc-core is a Rust wallet engine for Bitcoin + Ordinals use cases.
Key capabilities:
- Ledger Hardware Wallet Integration: Full signing and verification flow for external hardware devices.
- Watch-Only Identity: Track and monitor any Taproot address without requiring private keys.
- Parallel Account Probing: High-performance battery-efficient probing of multiple account paths via WASM.
- Deterministic Derivation: Robust account/key derivation built on top of BDK.
- Ordinal Shield Integration: Integrated PSBT analysis for burn and movement risk detection.
- Unified & Dual Schemes: Flexible support for both unified taproot and distinct SegWit payment branches.
Installation
[]
= "0.4.0"
What You Get
- BIP-39 mnemonic generation, validation, and encryption/decryption
- Hardware Integration: Support for Ledger and other hardware signatures via PSBT preparation and verification
- Watch-Only Support: Initialize wallets from public addresses for tracking-only functionality
- Discovery Engine: High-performance parallel probing for accounts across standard and legacy paths
- Taproot descriptor-based wallet construction with unified and dual-account address schemes
- Native sync with Esplora and Ordinals protection/analysis
- Typed surface for PSBT analysis and Ordinal Shield safeguards
- Extensible WASM exports for both stateless helpers and stateful wallet lifecycle
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 handles:
ZincWasmWallet(supports Mnemonic, Watch, and Hardware profiles) - Discovery:
probeHardwareAccountsfor ultra-fast parallel account scanning - Hardware Signing:
prepareExternalSignPsbtandverifyExternalSignedPsbt - Analytics:
analyzePsbtfor integrated Ordinal Shield protection - Logging:
set_log_level,set_logging_enabled,get_log_level
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.