Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ members = [
]

[workspace.dependencies]
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "eb889af13f667ed39c35e8e8a0830eeedf523476" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "3d0d5dcd4ad64e2199a726651bca7f8ffac123e6" }

# Optimize heavy crypto crates even in dev/test builds so that
# Halo 2 proof generation and verification run at near-release speed.
Expand Down
19 changes: 14 additions & 5 deletions packages/rs-platform-wallet-ffi/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,18 @@ pub struct PersistenceCallbacks {
),
>,
/// Called once per registration round with the wallet's
/// network tag + birth height. `network` uses the same
/// discriminant as `WalletRestoreEntryFFI.network` (0 = Mainnet,
/// 1 = Testnet, 2 = Devnet, 3 = Regtest). `birth_height` is the
/// best estimate of the block at which the wallet started; zero
/// means "scan from genesis / unknown".
/// network tag, network-independent group id + birth height.
/// `network` uses the same discriminant as
/// `WalletRestoreEntryFFI.network` (0 = Mainnet, 1 = Testnet,
/// 2 = Devnet, 3 = Regtest). `wallet_group_id` points to 32
/// readable bytes (same shape as `wallet_id`) — the
/// NETWORK-INDEPENDENT id shared by every network's wallet derived
/// from the same seed, so a consumer can group a seed's
/// sibling-network rows by it (the per-network `wallet_id` differs
/// per network for the same seed). For watch-only /
/// external-signable wallets it equals `wallet_id` (a group of
/// one). `birth_height` is the best estimate of the block at which
/// the wallet started; zero means "scan from genesis / unknown".
///
/// Returns 0 on success. A non-zero return flips the round's
/// `success` flag to `false` so [`Self::on_changeset_end_fn`]
Expand All @@ -191,6 +198,7 @@ pub struct PersistenceCallbacks {
context: *mut c_void,
wallet_id: *const u8,
network: FFINetwork,
wallet_group_id: *const u8,
birth_height: u32,
) -> i32,
>,
Expand Down Expand Up @@ -570,6 +578,7 @@ impl PlatformWalletPersistence for FFIPersister {
self.callbacks.context,
wallet_id.as_ptr(),
meta.network.into(),
meta.wallet_group_id.as_ptr(),
meta.birth_height,
)
};
Expand Down
16 changes: 14 additions & 2 deletions packages/rs-platform-wallet/src/changeset/changeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,9 @@ impl Merge for TokenBalanceChangeSet {

/// Per-wallet metadata captured at registration. Carries fields not
/// derivable from the xpub alone: which network the wallet is bound
/// to and the birth-height best estimate (the SPV tip at create time;
/// 0 means "scan from genesis / unknown").
/// to, the network-independent group id that ties a seed's per-network
/// wallets together, and the birth-height best estimate (the SPV tip
/// at create time; 0 means "scan from genesis / unknown").
///
/// The shape sits on [`PlatformWalletChangeSet`] as
/// `Option<WalletMetadataEntry>` because the round emits at most one
Expand All @@ -811,6 +812,17 @@ impl Merge for TokenBalanceChangeSet {
pub struct WalletMetadataEntry {
/// Network the wallet is bound to.
pub network: Network,
/// Network-INDEPENDENT 32-byte id shared by every network's wallet
/// derived from the same seed. Computed as
/// `Wallet::compute_wallet_id_from_root_extended_pub_key(root, None)`
/// — `SHA256(root_public_key || root_chain_code)` with no network
/// byte folded in. Distinct from the per-network [`Self::network`]-
/// scoped `wallet_id` the changeset is keyed on: that id differs per
/// network for the same seed, this one is the same across all of
/// them, so consumers can group a seed's sibling-network rows by it.
/// For watch-only / external-signable wallets (which carry no root
/// key) this falls back to the scoped `wallet_id` — a group of one.
pub wallet_group_id: [u8; 32],
/// Best estimate of the chain tip at creation time. `0` means
/// "scan from genesis / unknown".
pub birth_height: u32,
Expand Down
Loading
Loading