Skip to content

pset: add blind_last_with_modes - #311

Open
KyrylR wants to merge 1 commit into
ElementsProject:masterfrom
KyrylR:feature/pset-blinding-modes
Open

KyrylR wants to merge 1 commit into
ElementsProject:masterfrom
KyrylR:feature/pset-blinding-modes

Conversation

@KyrylR

@KyrylR KyrylR commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Closes #301

Adds PartiallySignedTransaction::blind_last_with_modes, which works as blind_last but takes a BlindingMode per output index, with the API agreed in #301 (comment)

Things to note:

  • At least one output must have its value blinded, since its value blinding factor balances the transaction. Otherwise NoValueBlindedOutput is returned
  • A mode given for an output that this blinder does not blind returns UnusedBlindingMode
  • The blinding_key of an output that is not fully blinded is removed, because neither Elements Core nor our decoder accepts a partially blinded output that still has a blinding key
  • The outputs are cloned and written back at the end, so the pset is unchanged on error
  • The return value is keyed by output index and holds the TxOutSecrets of each blinded output, plus the ephemeral secret key if its value was blinded

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.

Add ability to blind only value in the PSET output

1 participant