Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use of blinding nonces in sign_psbt #170

Open
altafan opened this issue Jul 15, 2022 · 1 comment
Open

How to use of blinding nonces in sign_psbt #170

altafan opened this issue Jul 15, 2022 · 1 comment

Comments

@altafan
Copy link

altafan commented Jul 15, 2022

I'm trying to sign with sign_psbt a pset created with this version of libwally that contains inputs owned by a 2of2_no_recovery account.
As per documentation, I have to pass a list of blinding_nonces within the JSON object, but it's not clear to me how to calculate or retrieve these values.

@jgriffiths
Copy link
Contributor

Hi @altafan

The blinding nonces are constructed as sha256(ecdh(pub_key, priv_key)) where:

  • pub_key is the blinding pubkey of the output (retrievable from the receiving confidential address by e.g. wally_confidential_addr_to_ec_public_key from wally, present in a PSET as PSET_OUT_BLINDING_PUBKEY)
  • priv_key is an ephemeral randomly generated private key (32 bits of entropy).

The PR you've linked now has wally_ecdh_nonce_hash exposed to perform this computation for you.

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

No branches or pull requests

2 participants