Skip to main content

Crate zinc_core

Crate zinc_core 

Source
Expand description

Zinc Core - Bitcoin + Ordinals wallet engine.

zinc-core provides reusable wallet primitives for native Rust and WASM hosts: mnemonic handling, descriptor-backed account management, sync helpers, transaction signing, and Ordinal Shield PSBT analysis.

Quick start:

use zinc_core::{Network, WalletBuilder, ZincMnemonic};

let mnemonic = ZincMnemonic::parse(
    "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
)
.expect("valid mnemonic");
let mut wallet = WalletBuilder::from_mnemonic(Network::Regtest, &mnemonic)
    .build()
    .expect("wallet");
let _address = wallet.next_taproot_address().expect("address");

Additional examples are available in examples/: wallet_setup, sync_and_balance, and psbt_sign_audit.

Re-exports§

pub use builder::Account;
pub use builder::AddressScheme;
pub use builder::CreatePsbtRequest;
pub use builder::CreatePsbtTransportRequest;
pub use builder::DiscoveryAccountPlan;
pub use builder::DiscoveryContext;
pub use builder::Seed64;
pub use builder::SignOptions;
pub use builder::SyncRequestType;
pub use builder::SyncSleeper;
pub use builder::WalletBuilder;
pub use builder::ZincBalance;
pub use builder::ZincPersistence;
pub use builder::ZincSyncRequest;
pub use builder::ZincWallet;
pub use error::ZincError;
pub use error::ZincResult;
pub use history::TxItem;
pub use keys::taproot_descriptors;
pub use keys::DescriptorPair;
pub use keys::ZincMnemonic;
pub use offer::OfferEnvelopeV1;
pub use offer_accept::prepare_offer_acceptance;
pub use offer_accept::OfferAcceptancePlanV1;
pub use offer_create::CreateOfferRequest;
pub use offer_create::OfferCreateResultV1;
pub use offer_nostr::NostrOfferEvent;
pub use offer_nostr::OFFER_EVENT_KIND;
pub use offer_relay::NostrRelayClient;
pub use offer_relay::RelayPublishResult;
pub use offer_relay::RelayQueryOptions;
pub use ordinals::client::OrdClient;
pub use ordinals::types::Inscription;
pub use ordinals::types::Satpoint;

Modules§

builder
Core wallet construction and stateful operations.
crypto
Encryption module for wallet seed protection
error
Unified error types for Zinc wallet
history
Transaction history models and wallet history helpers.
keys
Keys module for mnemonic and descriptor handling
offer
Offer envelope models and deterministic offer hashing/signature helpers. Offer envelope primitives for decentralized offer publishing and discovery.
offer_accept
Offer acceptance safety checks and signing plan derivation. Offer acceptance validation helpers.
offer_create
Offer creation helpers for ord-compatible buyer offers. Offer creation helpers aligned with ord-style offer PSBT construction.
offer_nostr
Nostr event models and signing/verification helpers for decentralized offers. Nostr event primitives for decentralized offer publication and discovery.
offer_relay
Native Nostr relay publish/discovery transport for offer events. Nostr relay transport helpers for decentralized offer publication/discovery.
ordinals
Ordinals data models, HTTP client, and protection analysis. Ordinals integration primitives for zinc-core.

Structs§

DecryptResponse
WASM response payload for mnemonic decryption.
ZincWasmWallet
WASM-safe stateful wallet handle wrapping the core ZincWallet.

Enums§

Network
The cryptocurrency network to act on.

Functions§

decrypt_wallet
Decrypt an encrypted wallet blob.
derive_address
Derive a Taproot address from a mnemonic.
encrypt_wallet
Encrypt a mnemonic with a password.
generate_wallet
Generate a new wallet with a random mnemonic.
get_log_level
Get current runtime log level.
init
Initialize WASM module (call once on load).
set_log_level
Set runtime log level for zinc-core internals.
set_logging_enabled
Enable or disable zinc-core logging at runtime.
validate_mnemonic
Validate a mnemonic phrase.