1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * One counterparty's public keys which do not change over the life of a channel.
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class ChannelPublicKeys extends CommonBase {
14 ChannelPublicKeys(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.ChannelPublicKeys_free(ptr); }
22 * The public key which is used to sign all commitment transactions, as it appears in the
23 * on-chain channel lock-in 2-of-2 multisig output.
25 public byte[] get_funding_pubkey() {
26 byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr);
31 * The public key which is used to sign all commitment transactions, as it appears in the
32 * on-chain channel lock-in 2-of-2 multisig output.
34 public void set_funding_pubkey(byte[] val) {
35 bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, val);
39 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
40 * revocation keys. This is combined with the per-commitment-secret generated by the
41 * counterparty to create a secret which the counterparty can reveal to revoke previous
44 public byte[] get_revocation_basepoint() {
45 byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr);
50 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
51 * revocation keys. This is combined with the per-commitment-secret generated by the
52 * counterparty to create a secret which the counterparty can reveal to revoke previous
55 public void set_revocation_basepoint(byte[] val) {
56 bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val);
60 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
61 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
62 * static across every commitment transaction.
64 public byte[] get_payment_point() {
65 byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this.ptr);
70 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
71 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
72 * static across every commitment transaction.
74 public void set_payment_point(byte[] val) {
75 bindings.ChannelPublicKeys_set_payment_point(this.ptr, val);
79 * The base point which is used (with derive_public_key) to derive a per-commitment payment
80 * public key which receives non-HTLC-encumbered funds which are only available for spending
81 * after some delay (or can be claimed via the revocation path).
83 public byte[] get_delayed_payment_basepoint() {
84 byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr);
89 * The base point which is used (with derive_public_key) to derive a per-commitment payment
90 * public key which receives non-HTLC-encumbered funds which are only available for spending
91 * after some delay (or can be claimed via the revocation path).
93 public void set_delayed_payment_basepoint(byte[] val) {
94 bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val);
98 * The base point which is used (with derive_public_key) to derive a per-commitment public key
99 * which is used to encumber HTLC-in-flight outputs.
101 public byte[] get_htlc_basepoint() {
102 byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr);
107 * The base point which is used (with derive_public_key) to derive a per-commitment public key
108 * which is used to encumber HTLC-in-flight outputs.
110 public void set_htlc_basepoint(byte[] val) {
111 bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val);
115 * Constructs a new ChannelPublicKeys given each field
117 public static ChannelPublicKeys constructor_new(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg) {
118 long ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg);
119 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
120 ret_hu_conv.ptrs_to.add(ret_hu_conv);
125 * Creates a copy of the ChannelPublicKeys
127 public ChannelPublicKeys clone() {
128 long ret = bindings.ChannelPublicKeys_clone(this.ptr);
129 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
130 ret_hu_conv.ptrs_to.add(this);
135 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
137 public byte[] write() {
138 byte[] ret = bindings.ChannelPublicKeys_write(this.ptr);
143 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
145 public static Result_ChannelPublicKeysDecodeErrorZ constructor_read(byte[] ser) {
146 long ret = bindings.ChannelPublicKeys_read(ser);
147 Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);