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::DerivationMode;pub use builder::DiscoveryAccountPlan;pub use builder::DiscoveryContext;pub use builder::PaymentAddressType;pub use builder::ProfileMode;pub use builder::ScanPolicy;pub use builder::Seed64;pub use builder::SignOptions;pub use builder::SyncRequestType;pub use builder::SyncSleeper;pub use builder::WalletBuilder;pub use builder::WalletKind;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 listing::create_listing;pub use listing::create_listing_purchase;pub use listing::finalize_listing_purchase;pub use listing::finalize_listing_sale;pub use listing::passthrough_script_pubkey;pub use listing::passthrough_tapscript;pub use listing::prepare_listing_sale_signature;pub use listing::sign_listing_coordinator_psbt;pub use listing::sign_listing_sale_psbt;pub use listing::CreateListingPurchaseRequest;pub use listing::CreateListingPurchaseResultV1;pub use listing::CreateListingRequest;pub use listing::CreateListingResultV1;pub use listing::FinalizeListingPurchaseRequest;pub use listing::FinalizeListingPurchaseResultV1;pub use listing::FinalizedListingSaleResultV1;pub use listing::ListingBuyerFundingInput;pub use listing::ListingEnvelopeV1;pub use listing::ListingSaleSigningPlanV1;pub use listing::LISTING_SALE_SIGHASH_U8;pub use listing_nostr::NostrListingEvent;pub use listing_nostr::LISTING_EVENT_KIND;pub use listing_relay::ListingRelayPublishResult;pub use listing_relay::ListingRelayQueryOptions;pub use listing_relay::NostrListingRelayClient;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::RuneBalance;pub use ordinals::types::Satpoint;pub use sign_intent::build_pairing_transport_event;pub use sign_intent::build_signed_pairing_ack;pub use sign_intent::build_signed_pairing_ack_with_granted;pub use sign_intent::build_signed_pairing_complete_receipt;pub use sign_intent::build_signed_sign_intent_approved_receipt;pub use sign_intent::build_signed_sign_intent_rejection_receipt;pub use sign_intent::decode_pairing_ack_envelope_event;pub use sign_intent::decode_pairing_ack_envelope_event_with_secret;pub use sign_intent::decode_pairing_transport_event_content_with_secret;pub use sign_intent::decode_signed_pairing_complete_receipt_event;pub use sign_intent::decode_signed_pairing_complete_receipt_event_with_secret;pub use sign_intent::decode_signed_sign_intent_event;pub use sign_intent::decode_signed_sign_intent_event_with_secret;pub use sign_intent::decode_signed_sign_intent_receipt_event;pub use sign_intent::decode_signed_sign_intent_receipt_event_with_secret;pub use sign_intent::decrypt_pairing_transport_content;pub use sign_intent::encrypt_pairing_transport_content;pub use sign_intent::generate_secret_key_hex;pub use sign_intent::pairing_tag_hash_hex;pub use sign_intent::pubkey_hex_from_secret_key;pub use sign_intent::verify_pairing_approval;pub use sign_intent::verify_sign_seller_input_scope;pub use sign_intent::verify_sign_seller_input_scope_json;pub use sign_intent::BuildBuyerOfferIntentV1;pub use sign_intent::CapabilityPolicyV1;pub use sign_intent::NostrTransportEventV1;pub use sign_intent::PairingAckDecisionV1;pub use sign_intent::PairingAckEnvelopeV1;pub use sign_intent::PairingAckV1;pub use sign_intent::PairingCompleteReceiptStatusV1;pub use sign_intent::PairingCompleteReceiptV1;pub use sign_intent::PairingLinkApprovalV1;pub use sign_intent::PairingRequestV1;pub use sign_intent::SignIntentActionV1;pub use sign_intent::SignIntentPayloadV1;pub use sign_intent::SignIntentReceiptStatusV1;pub use sign_intent::SignIntentReceiptV1;pub use sign_intent::SignIntentV1;pub use sign_intent::SignSellerInputIntentV1;pub use sign_intent::SignSellerInputScopeV1;pub use sign_intent::SignedPairingAckV1;pub use sign_intent::SignedPairingCompleteReceiptV1;pub use sign_intent::SignedPairingRequestV1;pub use sign_intent::SignedSignIntentReceiptV1;pub use sign_intent::SignedSignIntentV1;pub use sign_intent::NOSTR_PAIRING_ACK_TYPE_TAG_VALUE;pub use sign_intent::NOSTR_PAIRING_COMPLETE_RECEIPT_TYPE_TAG_VALUE;pub use sign_intent::NOSTR_SIGN_INTENT_APP_TAG_VALUE;pub use sign_intent::NOSTR_SIGN_INTENT_RECEIPT_TYPE_TAG_VALUE;pub use sign_intent::NOSTR_SIGN_INTENT_TYPE_TAG_VALUE;pub use sign_intent::NOSTR_TAG_APP_KEY;pub use sign_intent::NOSTR_TAG_PAIRING_HASH_KEY;pub use sign_intent::NOSTR_TAG_RECIPIENT_PUBKEY_KEY;pub use sign_intent::NOSTR_TAG_TYPE_KEY;pub use sign_intent::PAIRING_TRANSPORT_EVENT_KIND;
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
- listing
- Fixed-price listing and sale PSBT validation helpers. Fixed-price listing primitives inspired by ord.net passthrough sale PSBTs.
- listing_
nostr - Nostr event models and signing/verification helpers for decentralized listings. Nostr event primitives for decentralized fixed-price listing publication and discovery.
- listing_
relay - Native Nostr relay publish/discovery transport for listing events. Nostr relay transport helpers for decentralized listing publication/discovery.
- 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. - sign_
intent - Signed pairing + sign-intent protocol primitives. Signed pairing and intent protocol primitives for decentralized agent approval flows.
Structs§
- Account
Discovery Report - Create
Listing Transport Request - Decrypt
Response - WASM response payload for mnemonic decryption.
- Inscription
Preview - Listing
Envelope Transport Request - Zinc
Wasm Wallet - WASM-safe stateful wallet handle wrapping the core
ZincWallet.
Enums§
- Network
- The cryptocurrency network to act on.
Functions§
- create_
listing_ js - decrypt_
secret - Decrypt encrypted secret material and return plaintext UTF-8.
- decrypt_
wallet - Decrypt an encrypted wallet blob.
- derive_
address - Derive a Taproot address from a mnemonic.
- encrypt_
secret - Encrypt arbitrary secret material with a password.
- encrypt_
wallet - Encrypt a mnemonic with a password.
- finalize_
listing_ sale_ js - 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).
- prepare_
listing_ sale_ signature_ js - set_
log_ level - Set runtime log level for zinc-core internals.
- set_
logging_ enabled - Enable or disable zinc-core logging at runtime.
- sign_
listing_ coordinator_ psbt_ js - sign_
listing_ sale_ psbt_ js - validate_
mnemonic - Validate a mnemonic phrase.
- validate_
nostr_ transport_ event_ json - Validate and verify a signed Nostr transport event payload.
- validate_
pairing_ ack_ envelope_ json - Validate and verify a pairing ack transport envelope payload.
- validate_
signed_ pairing_ ack_ json - Validate and verify a signed pairing ack payload.
- validate_
signed_ pairing_ complete_ receipt_ json - Validate and verify a signed pairing-complete receipt payload.
- validate_
signed_ pairing_ request_ json - Validate and verify a signed pairing request payload.
- validate_
signed_ sign_ intent_ json - Validate and verify a signed sign-intent payload.
- validate_
signed_ sign_ intent_ receipt_ json - Validate and verify a signed sign-intent receipt payload.
- verify_
pairing_ approval_ json - Verify a signed pairing request + signed pairing ack bundle at a given unix timestamp.