Skip to content

SP Change Address - #136

Open
notTanveer wants to merge 3 commits into
CypherCommons:masterfrom
notTanveer:fix/sp-change
Open

SP Change Address#136
notTanveer wants to merge 3 commits into
CypherCommons:masterfrom
notTanveer:fix/sp-change

Conversation

@notTanveer

Copy link
Copy Markdown
Contributor

Implements BIP-352 label-0 for change addresses. Instead of sending change back to the regular wallet address, change is now sent to a labeled silent payment address (label = 0), making it indistinguishable from normal silent payment outputs on-chain.

Changes

  • Added labeled spend key derivation (SP_CHANGE_LABEL = 0) with helpers for deriving both private and public keys.
  • Updated the Rust scanner to scan against multiple spend pubkeys, return the matching key, and expose it as matchedSpendPubkey.
  • Updated transaction processing to scan for both the primary and change spend pubkeys, and assign the correct silentPaymentAddress to matched UTXOs.
  • Updated createSPTransaction to use the appropriate spend key (main or labeled change) when tweaking keys, generating SP outputs, and signing.
  • Fixed broadcastTx so the post-broadcast scan correctly recognizes change outputs sent to the labeled change address and includes them in balance calculations.
  • Updated SendDetails to automatically use the labeled silent payment change address whenever the recipient is an sp1 address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant