HomePhabricator

[SECP256K1] Extract the secret key from a keypair

Description

[SECP256K1] Extract the secret key from a keypair

Summary:

With schnorrsig if you need to tweak the secret key (for BIP32) you must
use the keypair API to get compatible secret/public keys which you do by
calling secp256k1_keypair_xonly_tweak_add(), but after that there's no
currently a way to extract the secret key back for storage.
so I added a secp256k1_keypair_seckey function to extract the key

Backport of secp256k1#845

Test Plan:

ninja check-secp256k1

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D9381

Details

Provenance
Elichai Turkel <elichai.turkel@gmail.com>Authored on Nov 5 2020, 14:48
FabienCommitted on Apr 8 2021, 13:19
FabienPushed on Apr 8 2021, 13:21
Reviewer
Restricted Project
Differential Revision
D9381: [SECP256K1] Extract the secret key from a keypair
Parents
rABC2da0553a815d: [SECP256K1] fixed trivial typo
Branches
Unknown
Tags
Unknown