Documentation
¶
Index ¶
- Constants
- Variables
- func DeriveKeyPair(hsmSecret [32]byte, desc *keychain.KeyDescriptor) (*btcec.PublicKey, *btcec.PrivateKey, error)
- func HkdfSha256(key, salt, info []byte) ([32]byte, error)
- func HkdfSha256WithSkip(key, salt, info []byte, skip int) ([32]byte, error)
- func NodeKey(hsmSecret [32]byte) (*btcec.PublicKey, *btcec.PrivateKey, error)
- type Signer
- func (s *Signer) AddPartialSignature(packet *psbt.Packet, keyDesc keychain.KeyDescriptor, utxo *wire.TxOut, ...) error
- func (s *Signer) AddPartialSignatureWithDesc(packet *psbt.Packet, signDesc *input.SignDescriptor) error
- func (s *Signer) ComputeInputScript(_ *wire.MsgTx, _ *input.SignDescriptor) (*input.Script, error)
- func (s *Signer) FetchPrivateKey(descriptor *keychain.KeyDescriptor) (*btcec.PrivateKey, error)
- func (s *Signer) FindMultisigKey(targetPubkey, peerPubKey *btcec.PublicKey, maxNumKeys uint32) (*keychain.KeyDescriptor, error)
- func (s *Signer) SignOutputRaw(tx *wire.MsgTx, signDesc *input.SignDescriptor) (input.Signature, error)
Constants ¶
View Source
const ( KeyOffsetFunding = 0 KeyOffsetRevocation = 1 KeyOffsetHtlc = 2 KeyOffsetPayment = 3 KeyOffsetDelayed = 4 )
Variables ¶
View Source
var ( InfoNodeID = []byte("nodeid") InfoPeerSeed = []byte("peer seed") InfoPerPeer = []byte("per-peer seed") InfoCLightning = []byte("c-lightning") )
Functions ¶
func DeriveKeyPair ¶
func DeriveKeyPair(hsmSecret [32]byte, desc *keychain.KeyDescriptor) (*btcec.PublicKey, *btcec.PrivateKey, error)
DeriveKeyPair derives a channel key pair from the given HSM secret, and the key descriptor. The public key in the key descriptor is used as the peer's public key, the family is converted to the CLN key type, and the index is used as the channel's database index.
func HkdfSha256 ¶
HkdfSha256 derives a 32-byte key from the given input key material, salt, and info using the HKDF-SHA256 key derivation function.
func HkdfSha256WithSkip ¶
HkdfSha256WithSkip derives a 32-byte key from the given input key material, salt, and info using the HKDF-SHA256 key derivation function and skips the first `skip` bytes of the output.
Types ¶
type Signer ¶
type Signer struct { *input.MusigSessionManager HsmSecret [32]byte // SwapDescKeyAfterDerive is a boolean that indicates that after // deriving the private key from the key descriptor (which interprets // the public key as the peer's public key), we should swap the public // key in the key descriptor to the actual derived public key. This is // required for P2WKH signatures that need to have the public key in the // witness stack. SwapDescKeyAfterDerive bool }
func (*Signer) AddPartialSignature ¶
func (*Signer) AddPartialSignatureWithDesc ¶ added in v0.14.1
func (*Signer) ComputeInputScript ¶
func (*Signer) FetchPrivateKey ¶
func (s *Signer) FetchPrivateKey( descriptor *keychain.KeyDescriptor) (*btcec.PrivateKey, error)
func (*Signer) FindMultisigKey ¶
func (s *Signer) FindMultisigKey(targetPubkey, peerPubKey *btcec.PublicKey, maxNumKeys uint32) (*keychain.KeyDescriptor, error)
func (*Signer) SignOutputRaw ¶
Click to show internal directories.
Click to hide internal directories.