mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
3db3dc946f
At the moment only lightingd needs it, and this avoids missing any places where we do bip32 derivation. This uses a hsm capability to mean we're backwards compatible with older hsmds. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: Protocol: we now always double-check bitcoin addresses are correct (no memory errors!) before issuing them.
32 lines
1.0 KiB
C
32 lines
1.0 KiB
C
#ifndef LIGHTNING_COMMON_KEY_DERIVE_H
|
|
#define LIGHTNING_COMMON_KEY_DERIVE_H
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
#include <stdbool.h>
|
|
|
|
struct pubkey;
|
|
struct privkey;
|
|
struct secret;
|
|
|
|
/* For `localkey`, `remotekey`, `local-delayedkey` and `remote-delayedkey` */
|
|
bool derive_simple_key(const struct pubkey *basepoint,
|
|
const struct pubkey *per_commitment_point,
|
|
struct pubkey *key);
|
|
|
|
bool derive_simple_privkey(const struct secret *base_secret,
|
|
const struct pubkey *basepoint,
|
|
const struct pubkey *per_commitment_point,
|
|
struct privkey *key);
|
|
|
|
/* For `revocationkey` */
|
|
bool derive_revocation_key(const struct pubkey *basepoint,
|
|
const struct pubkey *per_commitment_point,
|
|
struct pubkey *key);
|
|
|
|
bool derive_revocation_privkey(const struct secret *base_secret,
|
|
const struct secret *per_commitment_secret,
|
|
const struct pubkey *basepoint,
|
|
const struct pubkey *per_commitment_point,
|
|
struct privkey *key);
|
|
#endif /* LIGHTNING_COMMON_KEY_DERIVE_H */
|