lightningdevkit
Version:
Lightning Development Kit
54 lines (53 loc) • 2.37 kB
text/typescript
import { DelayedPaymentBasepoint } from '../structs/DelayedPaymentBasepoint.mjs';
import { Result_DelayedPaymentKeyDecodeErrorZ } from '../structs/Result_DelayedPaymentKeyDecodeErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
*
* The delayed payment key is used to pay the commitment state broadcaster their
* non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
* punish and claim all the channel funds if the state broadcasted was previously revoked.
*
* [See the BOLT specs]
* <https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation>
* for more information on key derivation details.
*/
export declare class DelayedPaymentKey extends CommonBase {
get_a(): Uint8Array;
set_a(val: Uint8Array): void;
/**
* Constructs a new DelayedPaymentKey given each field
*/
static constructor_new(a_arg: Uint8Array): DelayedPaymentKey;
/**
* Checks if two DelayedPaymentKeys contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
* Two objects with NULL inner values will be considered "equal" here.
*/
eq(b: DelayedPaymentKey): boolean;
clone_ptr(): bigint;
/**
* Creates a copy of the DelayedPaymentKey
*/
clone(): DelayedPaymentKey;
/**
* Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
*/
static constructor_from_basepoint(countersignatory_basepoint: DelayedPaymentBasepoint, per_commitment_point: Uint8Array): DelayedPaymentKey;
/**
* Build a delayedpubkey directly from an already-derived private key
*/
static constructor_from_secret_key(sk: Uint8Array): DelayedPaymentKey;
/**
* Get inner Public Key
*/
to_public_key(): Uint8Array;
/**
* Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
*/
write(): Uint8Array;
/**
* Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
*/
static constructor_read(ser: Uint8Array): Result_DelayedPaymentKeyDecodeErrorZ;
}