Skip to content

wasm: expose Address.blindingPubkey()#159

Open
EvanWinget wants to merge 1 commit intoBlockstream:masterfrom
EvanWinget:wasm/address-blinding-pubkey
Open

wasm: expose Address.blindingPubkey()#159
EvanWinget wants to merge 1 commit intoBlockstream:masterfrom
EvanWinget:wasm/address-blinding-pubkey

Conversation

@EvanWinget
Copy link
Copy Markdown

PsetOutputBuilder.blindingPubkey()takes a&PublicKey, but the WASM Address` type has no producer for one.

elements::Address::blinding_pubkey exposes 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::Address already exposes. The returned key is the same public data already encoded in the CT address itself, so no new privacy surface AFAICT.

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.
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