wasm: expose Address.blindingPubkey()#159
Open
EvanWinget wants to merge 1 commit intoBlockstream:masterfrom
Open
wasm: expose Address.blindingPubkey()#159EvanWinget wants to merge 1 commit intoBlockstream:masterfrom
EvanWinget wants to merge 1 commit intoBlockstream:masterfrom
Conversation
Add an accessor for the blinding public key of a confidential Address. Returns Option<PublicKey>; None for unconfidential addresses. The underlying elements::Address exposes blinding_pubkey as a public field — this just bridges it to JS via the existing PublicKey newtype. Building a confidential PSET output to a known recipient requires their blinding pubkey; without this, JS callers either re-implement segwit/SLIP-77 decoding or work around it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PsetOutputBuilder.blindingPubkey()
takes a&PublicKey, but the WASMAddress` type has no producer for one.elements::Address::blinding_pubkeyexposes the field publicly on the Rust side.Callers using
Wollet::send_lbtc()and other high-level builders never see this: the wallet handles blinding-pubkey extraction internally, including for self-sends. Callers who construct PSET outputs manually (e.g. multi-party signing protocols where output composition is coordinated off-chain) currently have to either decode the CT address themselves in JS or skip blinding and silently degrade to unconfidential output.This is a small accessor that mirrors what
elements::Addressalready exposes. The returned key is the same public data already encoded in the CT address itself, so no new privacy surface AFAICT.