diff --git a/lib/types/proto/lnd/lightning.ts b/lib/types/proto/lnd/lightning.ts index dd70660..d2de120 100644 --- a/lib/types/proto/lnd/lightning.ts +++ b/lib/types/proto/lnd/lightning.ts @@ -60,6 +60,8 @@ export enum CommitmentType { * channel before its maturity date. */ SCRIPT_ENFORCED_LEASE = 'SCRIPT_ENFORCED_LEASE', + /** SIMPLE_TAPROOT - TODO(roasbeef): need script enforce mirror type for the above as well? */ + SIMPLE_TAPROOT = 'SIMPLE_TAPROOT', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -995,6 +997,12 @@ export interface Channel { peerAlias: string; /** This is the peer SCID alias. */ peerScidAlias: string; + /** + * An optional note-to-self to go along with the channel containing some + * useful information. This is only ever stored locally and in no way impacts + * the channel's operation. + */ + memo: string; } export interface ListChannelsRequest { @@ -1460,6 +1468,61 @@ export interface BatchOpenChannel { * the remote peer supports explicit channel negotiation. */ commitmentType: CommitmentType; + /** + * The maximum amount of coins in millisatoshi that can be pending within + * the channel. It only applies to the remote party. + */ + remoteMaxValueInFlightMsat: string; + /** + * The maximum number of concurrent HTLCs we will allow the remote party to add + * to the commitment transaction. + */ + remoteMaxHtlcs: number; + /** + * Max local csv is the maximum csv delay we will allow for our own commitment + * transaction. + */ + maxLocalCsv: number; + /** If this is true, then a zero-conf channel open will be attempted. */ + zeroConf: boolean; + /** + * If this is true, then an option-scid-alias channel-type open will be + * attempted. + */ + scidAlias: boolean; + /** The base fee charged regardless of the number of milli-satoshis sent. */ + baseFee: string; + /** + * The fee rate in ppm (parts per million) that will be charged in + * proportion of the value of each forwarded HTLC. + */ + feeRate: string; + /** + * If use_base_fee is true the open channel announcement will update the + * channel base fee with the value specified in base_fee. In the case of + * a base_fee of 0 use_base_fee is needed downstream to distinguish whether + * to use the default base fee value specified in the config or 0. + */ + useBaseFee: boolean; + /** + * If use_fee_rate is true the open channel announcement will update the + * channel fee rate with the value specified in fee_rate. In the case of + * a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether + * to use the default fee rate value specified in the config or 0. + */ + useFeeRate: boolean; + /** + * The number of satoshis we require the remote peer to reserve. This value, + * if specified, must be above the dust limit and below 20% of the channel + * capacity. + */ + remoteChanReserveSat: string; + /** + * An optional note-to-self to go along with the channel containing some + * useful information. This is only ever stored locally and in no way impacts + * the channel's operation. + */ + memo: string; } export interface BatchOpenChannelResponse { @@ -1608,6 +1671,14 @@ export interface OpenChannelRequest { * be zero and is ignored. */ fundMax: boolean; + /** + * An optional note-to-self to go along with the channel containing some + * useful information. This is only ever stored locally and in no way impacts + * the channel's operation. + */ + memo: string; + /** A list of selected outpoints that are allocated for channel funding. */ + outpoints: OutPoint[]; } export interface OpenStatusUpdate { @@ -1674,6 +1745,8 @@ export interface ChanPointShim { * the value is less than 500,000, or as an absolute height otherwise. */ thawHeight: number; + /** Indicates that the funding output is using a MuSig2 multi-sig output. */ + musig2: boolean; } export interface PsbtShim { @@ -1850,6 +1923,12 @@ export interface PendingChannelsResponse_PendingChannel { chanStatusFlags: string; /** Whether this channel is advertised to the network or not. */ private: boolean; + /** + * An optional note-to-self to go along with the channel containing some + * useful information. This is only ever stored locally and in no way + * impacts the channel's operation. + */ + memo: string; } export interface PendingChannelsResponse_PendingOpenChannel { @@ -1871,6 +1950,18 @@ export interface PendingChannelsResponse_PendingOpenChannel { * transaction. This value can later be updated once the channel is open. */ feePerKw: string; + /** + * The number of blocks until the funding transaction is considered + * expired. If this value gets close to zero, there is a risk that the + * channel funding will be canceled by the channel responder. The + * channel should be fee bumped using CPFP (see walletrpc.BumpFee) to + * ensure that the channel confirms in time. Otherwise a force-close + * will be necessary if the channel confirms after the funding + * transaction expires. A negative value means the channel responder has + * very likely canceled the funding and the channel will never become + * fully operational. + */ + fundingExpiryBlocks: number; } export interface PendingChannelsResponse_WaitingCloseChannel { @@ -1983,7 +2074,13 @@ export interface WalletAccountBalance { unconfirmedBalance: string; } -export interface WalletBalanceRequest {} +export interface WalletBalanceRequest { + /** + * The wallet account the balance is shown for. + * If this is not specified, the balance of the "default" account is shown. + */ + account: string; +} export interface WalletBalanceResponse { /** The balance of the wallet */ @@ -2691,21 +2788,21 @@ export interface Invoice { amtPaid: string; /** * The amount that was accepted for this invoice, in satoshis. This will ONLY - * be set if this invoice has been settled. We provide this field as if the - * invoice was created with a zero value, then we need to record what amount - * was ultimately accepted. Additionally, it's possible that the sender paid - * MORE that was specified in the original invoice. So we'll record that here - * as well. + * be set if this invoice has been settled or accepted. We provide this field + * as if the invoice was created with a zero value, then we need to record what + * amount was ultimately accepted. Additionally, it's possible that the sender + * paid MORE that was specified in the original invoice. So we'll record that + * here as well. * Note: Output only, don't specify for creating an invoice. */ amtPaidSat: string; /** * The amount that was accepted for this invoice, in millisatoshis. This will - * ONLY be set if this invoice has been settled. We provide this field as if - * the invoice was created with a zero value, then we need to record what - * amount was ultimately accepted. Additionally, it's possible that the sender - * paid MORE that was specified in the original invoice. So we'll record that - * here as well. + * ONLY be set if this invoice has been settled or accepted. We provide this + * field as if the invoice was created with a zero value, then we need to + * record what amount was ultimately accepted. Additionally, it's possible that + * the sender paid MORE that was specified in the original invoice. So we'll + * record that here as well. * Note: Output only, don't specify for creating an invoice. */ amtPaidMsat: string; @@ -3878,8 +3975,10 @@ export interface Lightning { ): Promise; /** * lncli: `verifymessage` - * VerifyMessage verifies a signature over a msg. The signature must be - * zbase32 encoded and signed by an active node in the resident node's + * VerifyMessage verifies a signature over a message and recovers the signer's + * public key. The signature is only deemed valid if the recovered public key + * corresponds to a node key in the public Lightning network. The signature + * must be zbase32 encoded and signed by an active node in the resident node's * channel database. In addition to returning the validity of the signature, * VerifyMessage also returns the recovered pubkey from the signature. */ diff --git a/lib/types/proto/lnd/signrpc/signer.ts b/lib/types/proto/lnd/signrpc/signer.ts index 7ab62c8..260a683 100644 --- a/lib/types/proto/lnd/signrpc/signer.ts +++ b/lib/types/proto/lnd/signrpc/signer.ts @@ -364,6 +364,15 @@ export interface MuSig2SessionRequest { * combined key and nonces are created. */ version: MuSig2Version; + /** + * A set of pre generated secret local nonces to use in the musig2 session. + * This field is optional. This can be useful for protocols that need to send + * nonces ahead of time before the set of signer keys are known. This value + * MUST be 97 bytes and be the concatenation of two CSPRNG generated 32 byte + * values and local public key used for signing as specified in the key_loc + * field. + */ + pregeneratedLocalNonce: Uint8Array | string; } export interface MuSig2SessionResponse { diff --git a/lib/types/proto/lnd/walletrpc/walletkit.ts b/lib/types/proto/lnd/walletrpc/walletkit.ts index ca6f491..f786c7b 100644 --- a/lib/types/proto/lnd/walletrpc/walletkit.ts +++ b/lib/types/proto/lnd/walletrpc/walletkit.ts @@ -531,7 +531,11 @@ export interface ImportTapscriptResponse { } export interface Transaction { - /** The raw serialized transaction. */ + /** + * The raw serialized transaction. Despite the field name, this does need to be + * specified in raw bytes (or base64 encoded when using REST) and not in hex. + * To not break existing software, the field can't simply be renamed. + */ txHex: Uint8Array | string; /** An optional label to save with the transaction. Limited to 500 characters. */ label: string; diff --git a/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts b/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts index 10e7735..524019c 100644 --- a/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts +++ b/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts @@ -123,6 +123,13 @@ export interface VerifyAssetOwnershipResponse { validProof: boolean; } +export interface RemoveUTXOLeaseRequest { + /** The outpoint of the UTXO to remove the lease for. */ + outpoint: OutPoint | undefined; +} + +export interface RemoveUTXOLeaseResponse {} + export interface AssetWallet { /** * FundVirtualPsbt selects inputs from the available asset commitments to fund @@ -183,6 +190,13 @@ export interface AssetWallet { verifyAssetOwnership( request?: DeepPartial ): Promise; + /** + * RemoveUTXOLease removes the lease/lock/reservation of the given managed + * UTXO. + */ + removeUTXOLease( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/lib/types/proto/tapd/mintrpc/mint.ts b/lib/types/proto/tapd/mintrpc/mint.ts index 928c8dc..01c017d 100644 --- a/lib/types/proto/tapd/mintrpc/mint.ts +++ b/lib/types/proto/tapd/mintrpc/mint.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import type { AssetType, AssetMeta } from '../taprootassets'; +import type { AssetType, AssetVersion, AssetMeta } from '../taprootassets'; export enum BatchState { BATCH_STATE_UNKNOWN = 'BATCH_STATE_UNKNOWN', @@ -36,6 +36,8 @@ export interface MintAsset { * This asset will be minted with the same group key as the anchor asset. */ groupAnchor: string; + /** The version of asset to mint. */ + assetVersion: AssetVersion; } export interface MintAssetRequest { @@ -46,31 +48,46 @@ export interface MintAssetRequest { * future asset issuance. */ enableEmission: boolean; + /** + * If true, then the assets currently in the batch won't be returned in the + * response. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; } export interface MintAssetResponse { + /** The pending batch the asset was added to. */ + pendingBatch: MintingBatch | undefined; +} + +export interface MintingBatch { /** * A public key serialized in compressed format that can be used to uniquely * identify a pending minting batch. Responses that share the same key will be * batched into the same minting transaction. */ batchKey: Uint8Array | string; -} - -export interface MintingBatch { - /** The internal public key of the batch. */ - batchKey: Uint8Array | string; /** The assets that are part of the batch. */ assets: MintAsset[]; /** The state of the batch. */ state: BatchState; } -export interface FinalizeBatchRequest {} +export interface FinalizeBatchRequest { + /** + * If true, then the assets currently in the batch won't be returned in the + * response. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; + /** The optional fee rate to use for the minting transaction, in sat/kw. */ + feeRate: number; +} export interface FinalizeBatchResponse { - /** The internal public key of the batch. */ - batchKey: Uint8Array | string; + /** The finalized batch. */ + batch: MintingBatch | undefined; } export interface CancelBatchRequest {} @@ -101,7 +118,10 @@ export interface Mint { /** * tapcli: `assets mint` * MintAsset will attempt to mint the set of assets (async by default to - * ensure proper batching) specified in the request. + * ensure proper batching) specified in the request. The pending batch is + * returned that shows the other pending assets that are part of the next + * batch. This call will block until the operation succeeds (asset is staged + * in the batch) or fails. */ mintAsset( request?: DeepPartial diff --git a/lib/types/proto/tapd/taprootassets.ts b/lib/types/proto/tapd/taprootassets.ts index 9fa7e70..539e175 100644 --- a/lib/types/proto/tapd/taprootassets.ts +++ b/lib/types/proto/tapd/taprootassets.ts @@ -25,6 +25,20 @@ export enum AssetMetaType { UNRECOGNIZED = 'UNRECOGNIZED' } +export enum AssetVersion { + /** + * ASSET_VERSION_V0 - ASSET_VERSION_V0 is the default asset version. This version will include + * the witness vector in the leaf for a tap commitment. + */ + ASSET_VERSION_V0 = 'ASSET_VERSION_V0', + /** + * ASSET_VERSION_V1 - ASSET_VERSION_V1 is the asset version that leaves out the witness vector + * from the MS-SMT leaf encoding. + */ + ASSET_VERSION_V1 = 'ASSET_VERSION_V1', + UNRECOGNIZED = 'UNRECOGNIZED' +} + export enum OutputType { /** * OUTPUT_TYPE_SIMPLE - OUTPUT_TYPE_SIMPLE is a plain full-value or split output that is not a @@ -51,6 +65,15 @@ export enum OutputType { * output, as well as passive assets. */ OUTPUT_TYPE_PASSIVE_SPLIT_ROOT = 'OUTPUT_TYPE_PASSIVE_SPLIT_ROOT', + /** + * OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS - OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS is a plain full-value interactive send + * output that also carries passive assets. This is a special case where we + * send the full value of a single asset in a commitment to a new script + * key, but also carry passive assets in the same output. This is useful for + * key rotation (send-to-self) scenarios or asset burns where we burn the + * full supply of a single asset within a commitment. + */ + OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS = 'OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -66,7 +89,8 @@ export enum AddrEventStatus { export interface AssetMeta { /** * The raw data of the asset meta data. Based on the type below, this may be - * structured data such as a text file or PDF. + * structured data such as a text file or PDF. The size of the data is limited + * to 1MiB. */ data: Uint8Array | string; /** The type of the asset meta data. */ @@ -81,6 +105,7 @@ export interface AssetMeta { export interface ListAssetRequest { withWitness: boolean; includeSpent: boolean; + includeLeased: boolean; } export interface AnchorInfo { @@ -139,13 +164,30 @@ export interface AssetGroup { * asset type. */ tweakedGroupKey: Uint8Array | string; - /** A signature over the genesis point using the above key. */ - assetIdSig: Uint8Array | string; + /** + * A witness that authorizes a specific asset to be part of the asset group + * specified by the above key. + */ + assetWitness: Uint8Array | string; +} + +export interface GroupKeyReveal { + /** The raw group key which is a normal public key. */ + rawGroupKey: Uint8Array | string; + /** The tapscript root included in the tweaked group key, which may be empty. */ + tapscriptRoot: Uint8Array | string; +} + +export interface GenesisReveal { + /** The base genesis information in the genesis reveal. */ + genesisBaseReveal: GenesisInfo | undefined; + /** The asset type, not included in the base genesis info. */ + assetType: AssetType; } export interface Asset { /** The version of the Taproot Asset. */ - version: number; + version: AssetVersion; /** The base genesis information of an asset. This information never changes. */ assetGenesis: GenesisInfo | undefined; /** The type of the asset. */ @@ -172,6 +214,21 @@ export interface Asset { prevWitnesses: PrevWitness[]; /** Indicates whether the asset has been spent. */ isSpent: boolean; + /** + * If the asset has been leased, this is the owner (application ID) of the + * lease. + */ + leaseOwner: Uint8Array | string; + /** + * If the asset has been leased, this is the expiry of the lease as a Unix + * timestamp in seconds. + */ + leaseExpiry: string; + /** + * Indicates whether this transfer was an asset burn. If true, the number of + * assets in this output are destroyed and can no longer be spent. + */ + isBurn: boolean; } export interface PrevWitness { @@ -188,7 +245,9 @@ export interface ListAssetResponse { assets: Asset[]; } -export interface ListUtxosRequest {} +export interface ListUtxosRequest { + includeLeased: boolean; +} export interface ManagedUtxo { /** The outpoint of the UTXO. */ @@ -236,6 +295,8 @@ export interface AssetHumanReadable { metaHash: Uint8Array | string; /** The type of the asset. */ type: AssetType; + /** The version of the asset. */ + version: AssetVersion; } export interface GroupedAssets { @@ -357,9 +418,14 @@ export interface TransferOutput { scriptKey: Uint8Array | string; scriptKeyIsLocal: boolean; amount: string; + /** + * The new individual transition proof (not a full proof file) that proves + * the inclusion of the new asset within the new AnchorTx. + */ newProofBlob: Uint8Array | string; splitCommitRootHash: Uint8Array | string; outputType: OutputType; + assetVersion: AssetVersion; } export interface StopRequest {} @@ -407,6 +473,10 @@ export interface Addr { * transfer assets described in this address. */ taprootOutputKey: Uint8Array | string; + /** The address of the proof courier service used in proof transfer. */ + proofCourierAddr: string; + /** The asset version of the address. */ + assetVersion: AssetVersion; } export interface QueryAddrRequest { @@ -458,6 +528,13 @@ export interface NewAddrRequest { * commitment of the asset. */ tapscriptSibling: Uint8Array | string; + /** + * An optional proof courier address for use in proof transfer. If unspecified, + * the daemon configured default address will be used. + */ + proofCourierAddr: string; + /** The asset version to use when sending/receiving to/from this address. */ + assetVersion: AssetVersion; } export interface ScriptKey { @@ -495,14 +572,22 @@ export interface DecodeAddrRequest { } export interface ProofFile { - rawProof: Uint8Array | string; + /** + * The raw proof file encoded as bytes. Must be a file and not just an + * individual mint/transfer proof. + */ + rawProofFile: Uint8Array | string; genesisPoint: string; } export interface DecodedProof { /** The index depth of the decoded proof, with 0 being the latest proof. */ proofAtDepth: number; - /** The total number of proofs contained in the raw proof. */ + /** + * The total number of proofs contained in the decoded proof file (this will + * always be 1 if a single mint/transition proof was given as the raw_proof + * instead of a file). + */ numberOfProofs: number; /** The asset referenced in the proof. */ asset: Asset | undefined; @@ -543,17 +628,43 @@ export interface DecodedProof { * spend the asset. */ challengeWitness: Uint8Array | string[]; + /** + * Indicates whether the state transition this proof represents is a burn, + * meaning that the assets were provably destroyed and can no longer be + * spent. + */ + isBurn: boolean; + /** + * GenesisReveal is an optional field that is the Genesis information for + * the asset. This is required for minting proofs. + */ + genesisReveal: GenesisReveal | undefined; + /** + * GroupKeyReveal is an optional field that includes the information needed + * to derive the tweaked group key. + */ + groupKeyReveal: GroupKeyReveal | undefined; } export interface VerifyProofResponse { valid: boolean; + /** The decoded last proof in the file if the proof file was valid. */ decodedProof: DecodedProof | undefined; } export interface DecodeProofRequest { - /** The raw proof in bytes to decode, which may contain multiple proofs. */ + /** + * The raw proof bytes to decode. This can be a full proof file or a single + * mint/transition proof. If it is a full proof file, the proof_at_depth + * field will be used to determine which individual proof within the file to + * decode. + */ rawProof: Uint8Array | string; - /** The index depth of the decoded proof, with 0 being the latest proof. */ + /** + * The index depth of the decoded proof, with 0 being the latest proof. This + * is ignored if the raw_proof is a single mint/transition proof and not a + * proof file. + */ proofAtDepth: number; /** An option to include previous witnesses in decoding. */ withPrevWitnesses: boolean; @@ -570,13 +681,6 @@ export interface ExportProofRequest { scriptKey: Uint8Array | string; } -export interface ImportProofRequest { - proofFile: Uint8Array | string; - genesisPoint: string; -} - -export interface ImportProofResponse {} - export interface AddrEvent { /** The time the event was created in unix timestamp seconds. */ creationTimeUnixSeconds: string; @@ -620,6 +724,8 @@ export interface AddrReceivesResponse { export interface SendAssetRequest { tapAddrs: string[]; + /** The optional fee rate to use for the minting transaction, in sat/kw. */ + feeRate: number; } export interface PrevInputAsset { @@ -639,6 +745,11 @@ export interface GetInfoResponse { version: string; lndVersion: string; network: string; + lndIdentityPubkey: string; + nodeAlias: string; + blockHeight: number; + blockHash: string; + syncToChain: boolean; } export interface SubscribeSendAssetEventNtfnsRequest {} @@ -678,6 +789,31 @@ export interface FetchAssetMetaRequest { assetId: Uint8Array | string | undefined; /** The 32-byte meta hash of the asset meta. */ metaHash: Uint8Array | string | undefined; + /** The hex encoded asset ID of the asset to fetch the meta for. */ + assetIdStr: string | undefined; + /** The hex encoded meta hash of the asset meta. */ + metaHashStr: string | undefined; +} + +export interface BurnAssetRequest { + /** The asset ID of the asset to burn units of. */ + assetId: Uint8Array | string | undefined; + /** The hex encoded asset ID of the asset to burn units of. */ + assetIdStr: string | undefined; + amountToBurn: string; + /** + * A safety check to ensure the user is aware of the destructive nature of + * the burn. This needs to be set to the value "assets will be destroyed" + * for the burn to succeed. + */ + confirmationText: string; +} + +export interface BurnAssetResponse { + /** The asset transfer that contains the asset burn as an output. */ + burnTransfer: AssetTransfer | undefined; + /** The burn transition proof for the asset burn output. */ + burnProof: DecodedProof | undefined; } export interface TaprootAssets { @@ -768,7 +904,7 @@ export interface TaprootAssets { */ verifyProof(request?: DeepPartial): Promise; /** - * tarocli: `proofs decode` + * tapcli: `proofs decode` * DecodeProof attempts to decode a given proof file into human readable * format. */ @@ -781,15 +917,6 @@ export interface TaprootAssets { * script_key. */ exportProof(request?: DeepPartial): Promise; - /** - * tapcli: `proofs import` - * ImportProof attempts to import a proof file into the daemon. If successful, - * a new asset will be inserted on disk, spendable using the specified target - * script key, and internal key. - */ - importProof( - request?: DeepPartial - ): Promise; /** * tapcli: `assets send` * SendAsset uses one or multiple passed Taproot Asset address(es) to attempt @@ -800,6 +927,17 @@ export interface TaprootAssets { sendAsset( request?: DeepPartial ): Promise; + /** + * tapcli: `assets burn` + * BurnAsset burns the given number of units of a given asset by sending them + * to a provably un-spendable script key. Burning means irrevocably destroying + * a certain number of assets, reducing the total supply of the asset. Because + * burning is such a destructive and non-reversible operation, some specific + * values need to be set in the request to avoid accidental burns. + */ + burnAsset( + request?: DeepPartial + ): Promise; /** * tapcli: `getinfo` * GetInfo returns the information for the node. diff --git a/lib/types/proto/tapd/universerpc/universe.ts b/lib/types/proto/tapd/universerpc/universe.ts index a08b606..0b83b85 100644 --- a/lib/types/proto/tapd/universerpc/universe.ts +++ b/lib/types/proto/tapd/universerpc/universe.ts @@ -1,6 +1,13 @@ /* eslint-disable */ import type { AssetType, Asset } from '../taprootassets'; +export enum ProofType { + PROOF_TYPE_UNSPECIFIED = 'PROOF_TYPE_UNSPECIFIED', + PROOF_TYPE_ISSUANCE = 'PROOF_TYPE_ISSUANCE', + PROOF_TYPE_TRANSFER = 'PROOF_TYPE_TRANSFER', + UNRECOGNIZED = 'UNRECOGNIZED' +} + export enum UniverseSyncMode { /** * SYNC_ISSUANCE_ONLY - A sync node that indicates that only new asset creation (minting) proofs @@ -23,6 +30,13 @@ export enum AssetQuerySort { SORT_BY_TOTAL_SYNCS = 'SORT_BY_TOTAL_SYNCS', SORT_BY_TOTAL_PROOFS = 'SORT_BY_TOTAL_PROOFS', SORT_BY_GENESIS_HEIGHT = 'SORT_BY_GENESIS_HEIGHT', + SORT_BY_TOTAL_SUPPLY = 'SORT_BY_TOTAL_SUPPLY', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export enum SortDirection { + SORT_DIRECTION_ASC = 'SORT_DIRECTION_ASC', + SORT_DIRECTION_DESC = 'SORT_DIRECTION_DESC', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -59,6 +73,7 @@ export interface ID { * REST). */ groupKeyStr: string | undefined; + proofType: ProofType; } export interface UniverseRoot { @@ -70,6 +85,21 @@ export interface UniverseRoot { mssmtRoot: MerkleSumNode | undefined; /** The name of the asset. */ assetName: string; + /** + * A map of hex encoded asset IDs to the number of units minted for that + * asset. This only contains more than one entry for grouped assets and in + * that case represents the whole list of assets currently known to exist + * within the group. For single (non-grouped) assets, this is equal to the + * asset ID above and the sum in the mssmt_root. A hex encoded string is + * used as the map key because gRPC does not support using raw bytes for a + * map key. + */ + amountsByAssetId: { [key: string]: string }; +} + +export interface UniverseRoot_AmountsByAssetIdEntry { + key: string; + value: string; } export interface AssetRootResponse { @@ -91,8 +121,10 @@ export interface AssetRootQuery { } export interface QueryRootResponse { - /** The asset root for the given asset ID or group key. */ - assetRoot: UniverseRoot | undefined; + /** The issuance universe root for the given asset ID or group key. */ + issuanceRoot: UniverseRoot | undefined; + /** The transfer universe root for the given asset ID or group key. */ + transferRoot: UniverseRoot | undefined; } export interface DeleteRootQuery { @@ -126,7 +158,8 @@ export interface AssetLeaf { asset: Asset | undefined; /** * The asset issuance proof, which proves that the asset specified above - * was issued properly. + * was issued properly. This is always just an individual mint/transfer + * proof and never a proof file. */ issuanceProof: Uint8Array | string; } @@ -155,6 +188,16 @@ export interface AssetProofResponse { universeInclusionProof: Uint8Array | string; /** The asset leaf itself, which includes the asset and the issuance proof. */ assetLeaf: AssetLeaf | undefined; + /** + * MultiverseRoot is the root of the multiverse tree that includes this + * asset leaf. + */ + multiverseRoot: MerkleSumNode | undefined; + /** + * MultiverseInclusionProof is the inclusion proof for the asset leaf in the + * multiverse. + */ + multiverseInclusionProof: Uint8Array | string; } export interface AssetProof { @@ -237,6 +280,7 @@ export interface DeleteFederationServerResponse {} export interface StatsResponse { numTotalAssets: string; + numTotalGroups: string; numTotalSyncs: string; numTotalProofs: string; } @@ -248,19 +292,50 @@ export interface AssetStatsQuery { sortBy: AssetQuerySort; offset: number; limit: number; + direction: SortDirection; } export interface AssetStatsSnapshot { - assetId: Uint8Array | string; + /** + * The group key of the asset group. If this is empty, then the asset is + * not part of a group. + */ groupKey: Uint8Array | string; + /** + * The total supply of the asset group. If the asset is not part of an asset + * group then this is always zero. + */ + groupSupply: string; + /** + * The group anchor that was used to group assets together into an asset + * group. This is only set if the asset is part of an asset group. + */ + groupAnchor: AssetStatsAsset | undefined; + /** + * If the asset is not part of an asset group, then this is the asset the + * stats below refer to. + */ + asset: AssetStatsAsset | undefined; + /** + * The total number of syncs either for the asset group or the single asset + * if it is not part of a group. + */ + totalSyncs: string; + /** + * The total number of proofs either for the asset group or the single asset + * if it is not part of a group. + */ + totalProofs: string; +} + +export interface AssetStatsAsset { + assetId: Uint8Array | string; genesisPoint: string; totalSupply: string; assetName: string; assetType: AssetType; genesisHeight: number; genesisTimestamp: string; - totalSyncs: string; - totalProofs: string; } export interface UniverseAssetStats { @@ -283,6 +358,65 @@ export interface GroupedUniverseEvents { newProofEvents: string; } +export interface SetFederationSyncConfigRequest { + globalSyncConfigs: GlobalFederationSyncConfig[]; + assetSyncConfigs: AssetFederationSyncConfig[]; +} + +export interface SetFederationSyncConfigResponse {} + +/** + * GlobalFederationSyncConfig is a global proof type specific configuration + * for universe federation syncing. + */ +export interface GlobalFederationSyncConfig { + /** proof_type is the universe proof type which this config applies to. */ + proofType: ProofType; + /** + * allow_sync_insert is a boolean that indicates whether leaves from + * universes of the given proof type have may be inserted via federation + * sync. + */ + allowSyncInsert: boolean; + /** + * allow_sync_export is a boolean that indicates whether leaves from + * universes of the given proof type have may be exported via federation + * sync. + */ + allowSyncExport: boolean; +} + +/** + * AssetFederationSyncConfig is an asset universe specific configuration for + * federation syncing. + */ +export interface AssetFederationSyncConfig { + /** id is the ID of the universe to configure. */ + id: ID | undefined; + /** + * allow_sync_insert is a boolean that indicates whether leaves from + * universes of the given proof type have may be inserted via federation + * sync. + */ + allowSyncInsert: boolean; + /** + * allow_sync_export is a boolean that indicates whether leaves from + * universes of the given proof type have may be exported via federation + * sync. + */ + allowSyncExport: boolean; +} + +export interface QueryFederationSyncConfigRequest { + /** Target universe ID(s). */ + id: ID[]; +} + +export interface QueryFederationSyncConfigResponse { + globalSyncConfigs: GlobalFederationSyncConfig[]; + assetSyncConfigs: AssetFederationSyncConfig[]; +} + export interface Universe { /** * tapcli: `universe roots` @@ -410,6 +544,20 @@ export interface Universe { queryEvents( request?: DeepPartial ): Promise; + /** + * SetFederationSyncConfig sets the configuration of the universe federation + * sync. + */ + setFederationSyncConfig( + request?: DeepPartial + ): Promise; + /** + * QueryFederationSyncConfig queries the universe federation sync configuration + * settings. + */ + queryFederationSyncConfig( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/package.json b/package.json index b1a5b18..3411e36 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,11 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "config": { - "lnd_release_tag": "v0.16.4-beta", - "loop_release_tag": "v0.26.2-beta", + "lnd_release_tag": "v0.17.0-beta", + "loop_release_tag": "v0.26.4-beta", "pool_release_tag": "v0.6.4-beta", "faraday_release_tag": "v0.2.11-alpha", - "tapd_release_tag": "v0.2.3", + "tapd_release_tag": "v0.3.0", "lit_release_tag": "v0.12.0-alpha", "protoc_version": "21.9" }, diff --git a/protos/lnd/v0.16.4-beta/autopilotrpc/autopilot.proto b/protos/lnd/v0.17.0-beta/autopilotrpc/autopilot.proto similarity index 100% rename from protos/lnd/v0.16.4-beta/autopilotrpc/autopilot.proto rename to protos/lnd/v0.17.0-beta/autopilotrpc/autopilot.proto diff --git a/protos/lnd/v0.16.4-beta/chainrpc/chainnotifier.proto b/protos/lnd/v0.17.0-beta/chainrpc/chainnotifier.proto similarity index 100% rename from protos/lnd/v0.16.4-beta/chainrpc/chainnotifier.proto rename to protos/lnd/v0.17.0-beta/chainrpc/chainnotifier.proto diff --git a/protos/lnd/v0.16.4-beta/invoicesrpc/invoices.proto b/protos/lnd/v0.17.0-beta/invoicesrpc/invoices.proto similarity index 100% rename from protos/lnd/v0.16.4-beta/invoicesrpc/invoices.proto rename to protos/lnd/v0.17.0-beta/invoicesrpc/invoices.proto diff --git a/protos/lnd/v0.16.4-beta/lightning.proto b/protos/lnd/v0.17.0-beta/lightning.proto similarity index 96% rename from protos/lnd/v0.16.4-beta/lightning.proto rename to protos/lnd/v0.17.0-beta/lightning.proto index 48175bf..810e9d8 100644 --- a/protos/lnd/v0.16.4-beta/lightning.proto +++ b/protos/lnd/v0.17.0-beta/lightning.proto @@ -101,8 +101,10 @@ service Lightning { rpc SignMessage (SignMessageRequest) returns (SignMessageResponse); /* lncli: `verifymessage` - VerifyMessage verifies a signature over a msg. The signature must be - zbase32 encoded and signed by an active node in the resident node's + VerifyMessage verifies a signature over a message and recovers the signer's + public key. The signature is only deemed valid if the recovered public key + corresponds to a node key in the public Lightning network. The signature + must be zbase32 encoded and signed by an active node in the resident node's channel database. In addition to returning the validity of the signature, VerifyMessage also returns the recovered pubkey from the signature. */ @@ -1350,6 +1352,13 @@ enum CommitmentType { channel before its maturity date. */ SCRIPT_ENFORCED_LEASE = 4; + + /* + A channel that uses musig2 for the funding output, and the new tapscript + features where relevant. + */ + // TODO(roasbeef): need script enforce mirror type for the above as well? + SIMPLE_TAPROOT = 5; } message ChannelConstraints { @@ -1545,6 +1554,13 @@ message Channel { // This is the peer SCID alias. uint64 peer_scid_alias = 35 [jstype = JS_STRING]; + + /* + An optional note-to-self to go along with the channel containing some + useful information. This is only ever stored locally and in no way impacts + the channel's operation. + */ + string memo = 36; } message ListChannelsRequest { @@ -2119,6 +2135,76 @@ message BatchOpenChannel { the remote peer supports explicit channel negotiation. */ CommitmentType commitment_type = 9; + + /* + The maximum amount of coins in millisatoshi that can be pending within + the channel. It only applies to the remote party. + */ + uint64 remote_max_value_in_flight_msat = 10; + + /* + The maximum number of concurrent HTLCs we will allow the remote party to add + to the commitment transaction. + */ + uint32 remote_max_htlcs = 11; + + /* + Max local csv is the maximum csv delay we will allow for our own commitment + transaction. + */ + uint32 max_local_csv = 12; + + /* + If this is true, then a zero-conf channel open will be attempted. + */ + bool zero_conf = 13; + + /* + If this is true, then an option-scid-alias channel-type open will be + attempted. + */ + bool scid_alias = 14; + + /* + The base fee charged regardless of the number of milli-satoshis sent. + */ + uint64 base_fee = 15; + + /* + The fee rate in ppm (parts per million) that will be charged in + proportion of the value of each forwarded HTLC. + */ + uint64 fee_rate = 16; + + /* + If use_base_fee is true the open channel announcement will update the + channel base fee with the value specified in base_fee. In the case of + a base_fee of 0 use_base_fee is needed downstream to distinguish whether + to use the default base fee value specified in the config or 0. + */ + bool use_base_fee = 17; + + /* + If use_fee_rate is true the open channel announcement will update the + channel fee rate with the value specified in fee_rate. In the case of + a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether + to use the default fee rate value specified in the config or 0. + */ + bool use_fee_rate = 18; + + /* + The number of satoshis we require the remote peer to reserve. This value, + if specified, must be above the dust limit and below 20% of the channel + capacity. + */ + uint64 remote_chan_reserve_sat = 19; + + /* + An optional note-to-self to go along with the channel containing some + useful information. This is only ever stored locally and in no way impacts + the channel's operation. + */ + string memo = 20; } message BatchOpenChannelResponse { @@ -2274,6 +2360,18 @@ message OpenChannelRequest { be zero and is ignored. */ bool fund_max = 26; + + /* + An optional note-to-self to go along with the channel containing some + useful information. This is only ever stored locally and in no way impacts + the channel's operation. + */ + string memo = 27; + + /* + A list of selected outpoints that are allocated for channel funding. + */ + repeated OutPoint outpoints = 28; } message OpenStatusUpdate { oneof update { @@ -2355,6 +2453,11 @@ message ChanPointShim { the value is less than 500,000, or as an absolute height otherwise. */ uint32 thaw_height = 6; + + /* + Indicates that the funding output is using a MuSig2 multi-sig output. + */ + bool musig2 = 7; } message PsbtShim { @@ -2540,6 +2643,13 @@ message PendingChannelsResponse { // Whether this channel is advertised to the network or not. bool private = 12; + + /* + An optional note-to-self to go along with the channel containing some + useful information. This is only ever stored locally and in no way + impacts the channel's operation. + */ + string memo = 13; } message PendingOpenChannel { @@ -2567,6 +2677,17 @@ message PendingChannelsResponse { // Previously used for confirmation_height. Do not reuse. reserved 2; + + // The number of blocks until the funding transaction is considered + // expired. If this value gets close to zero, there is a risk that the + // channel funding will be canceled by the channel responder. The + // channel should be fee bumped using CPFP (see walletrpc.BumpFee) to + // ensure that the channel confirms in time. Otherwise a force-close + // will be necessary if the channel confirms after the funding + // transaction expires. A negative value means the channel responder has + // very likely canceled the funding and the channel will never become + // fully operational. + int32 funding_expiry_blocks = 3; } message WaitingCloseChannel { @@ -2719,6 +2840,9 @@ message WalletAccountBalance { } message WalletBalanceRequest { + // The wallet account the balance is shown for. + // If this is not specified, the balance of the "default" account is shown. + string account = 1; } message WalletBalanceResponse { @@ -3466,22 +3590,22 @@ message Invoice { /* The amount that was accepted for this invoice, in satoshis. This will ONLY - be set if this invoice has been settled. We provide this field as if the - invoice was created with a zero value, then we need to record what amount - was ultimately accepted. Additionally, it's possible that the sender paid - MORE that was specified in the original invoice. So we'll record that here - as well. + be set if this invoice has been settled or accepted. We provide this field + as if the invoice was created with a zero value, then we need to record what + amount was ultimately accepted. Additionally, it's possible that the sender + paid MORE that was specified in the original invoice. So we'll record that + here as well. Note: Output only, don't specify for creating an invoice. */ int64 amt_paid_sat = 19; /* The amount that was accepted for this invoice, in millisatoshis. This will - ONLY be set if this invoice has been settled. We provide this field as if - the invoice was created with a zero value, then we need to record what - amount was ultimately accepted. Additionally, it's possible that the sender - paid MORE that was specified in the original invoice. So we'll record that - here as well. + ONLY be set if this invoice has been settled or accepted. We provide this + field as if the invoice was created with a zero value, then we need to + record what amount was ultimately accepted. Additionally, it's possible that + the sender paid MORE that was specified in the original invoice. So we'll + record that here as well. Note: Output only, don't specify for creating an invoice. */ int64 amt_paid_msat = 20; diff --git a/protos/lnd/v0.16.4-beta/routerrpc/router.proto b/protos/lnd/v0.17.0-beta/routerrpc/router.proto similarity index 100% rename from protos/lnd/v0.16.4-beta/routerrpc/router.proto rename to protos/lnd/v0.17.0-beta/routerrpc/router.proto diff --git a/protos/lnd/v0.16.4-beta/signrpc/signer.proto b/protos/lnd/v0.17.0-beta/signrpc/signer.proto similarity index 98% rename from protos/lnd/v0.16.4-beta/signrpc/signer.proto rename to protos/lnd/v0.17.0-beta/signrpc/signer.proto index 6540252..f704000 100644 --- a/protos/lnd/v0.16.4-beta/signrpc/signer.proto +++ b/protos/lnd/v0.17.0-beta/signrpc/signer.proto @@ -558,6 +558,16 @@ message MuSig2SessionRequest { combined key and nonces are created. */ MuSig2Version version = 6; + + /* + A set of pre generated secret local nonces to use in the musig2 session. + This field is optional. This can be useful for protocols that need to send + nonces ahead of time before the set of signer keys are known. This value + MUST be 97 bytes and be the concatenation of two CSPRNG generated 32 byte + values and local public key used for signing as specified in the key_loc + field. + */ + bytes pregenerated_local_nonce = 7; } message MuSig2SessionResponse { @@ -684,4 +694,4 @@ message MuSig2CleanupRequest { } message MuSig2CleanupResponse { -} \ No newline at end of file +} diff --git a/protos/lnd/v0.16.4-beta/walletrpc/walletkit.proto b/protos/lnd/v0.17.0-beta/walletrpc/walletkit.proto similarity index 99% rename from protos/lnd/v0.16.4-beta/walletrpc/walletkit.proto rename to protos/lnd/v0.17.0-beta/walletrpc/walletkit.proto index a9c7412..0d3fd95 100644 --- a/protos/lnd/v0.16.4-beta/walletrpc/walletkit.proto +++ b/protos/lnd/v0.17.0-beta/walletrpc/walletkit.proto @@ -712,7 +712,9 @@ message ImportTapscriptResponse { message Transaction { /* - The raw serialized transaction. + The raw serialized transaction. Despite the field name, this does need to be + specified in raw bytes (or base64 encoded when using REST) and not in hex. + To not break existing software, the field can't simply be renamed. */ bytes tx_hex = 1; diff --git a/protos/lnd/v0.16.4-beta/walletunlocker.proto b/protos/lnd/v0.17.0-beta/walletunlocker.proto similarity index 100% rename from protos/lnd/v0.16.4-beta/walletunlocker.proto rename to protos/lnd/v0.17.0-beta/walletunlocker.proto diff --git a/protos/lnd/v0.16.4-beta/watchtowerrpc/watchtower.proto b/protos/lnd/v0.17.0-beta/watchtowerrpc/watchtower.proto similarity index 100% rename from protos/lnd/v0.16.4-beta/watchtowerrpc/watchtower.proto rename to protos/lnd/v0.17.0-beta/watchtowerrpc/watchtower.proto diff --git a/protos/lnd/v0.16.4-beta/wtclientrpc/wtclient.proto b/protos/lnd/v0.17.0-beta/wtclientrpc/wtclient.proto similarity index 100% rename from protos/lnd/v0.16.4-beta/wtclientrpc/wtclient.proto rename to protos/lnd/v0.17.0-beta/wtclientrpc/wtclient.proto diff --git a/protos/loop/v0.26.2-beta/client.proto b/protos/loop/v0.26.4-beta/client.proto similarity index 100% rename from protos/loop/v0.26.2-beta/client.proto rename to protos/loop/v0.26.4-beta/client.proto diff --git a/protos/loop/v0.26.2-beta/debug.proto b/protos/loop/v0.26.4-beta/debug.proto similarity index 100% rename from protos/loop/v0.26.2-beta/debug.proto rename to protos/loop/v0.26.4-beta/debug.proto diff --git a/protos/loop/v0.26.2-beta/swapserverrpc/common.proto b/protos/loop/v0.26.4-beta/swapserverrpc/common.proto similarity index 100% rename from protos/loop/v0.26.2-beta/swapserverrpc/common.proto rename to protos/loop/v0.26.4-beta/swapserverrpc/common.proto diff --git a/protos/loop/v0.26.2-beta/swapserverrpc/server.proto b/protos/loop/v0.26.4-beta/swapserverrpc/server.proto similarity index 100% rename from protos/loop/v0.26.2-beta/swapserverrpc/server.proto rename to protos/loop/v0.26.4-beta/swapserverrpc/server.proto diff --git a/protos/tapd/v0.2.3/assetwalletrpc/assetwallet.proto b/protos/tapd/v0.3.0/assetwalletrpc/assetwallet.proto similarity index 94% rename from protos/tapd/v0.2.3/assetwalletrpc/assetwallet.proto rename to protos/tapd/v0.3.0/assetwalletrpc/assetwallet.proto index 3c0950d..5c6cbc0 100644 --- a/protos/tapd/v0.2.3/assetwalletrpc/assetwallet.proto +++ b/protos/tapd/v0.3.0/assetwalletrpc/assetwallet.proto @@ -64,6 +64,13 @@ service AssetWallet { */ rpc VerifyAssetOwnership (VerifyAssetOwnershipRequest) returns (VerifyAssetOwnershipResponse); + + /* + RemoveUTXOLease removes the lease/lock/reservation of the given managed + UTXO. + */ + rpc RemoveUTXOLease (RemoveUTXOLeaseRequest) + returns (RemoveUTXOLeaseResponse); } message FundVirtualPsbtRequest { @@ -206,3 +213,11 @@ message VerifyAssetOwnershipRequest { message VerifyAssetOwnershipResponse { bool valid_proof = 1; } + +message RemoveUTXOLeaseRequest { + // The outpoint of the UTXO to remove the lease for. + OutPoint outpoint = 1; +} + +message RemoveUTXOLeaseResponse { +} diff --git a/protos/tapd/v0.2.3/mintrpc/mint.proto b/protos/tapd/v0.3.0/mintrpc/mint.proto similarity index 75% rename from protos/tapd/v0.2.3/mintrpc/mint.proto rename to protos/tapd/v0.3.0/mintrpc/mint.proto index 921104a..e93e995 100644 --- a/protos/tapd/v0.2.3/mintrpc/mint.proto +++ b/protos/tapd/v0.3.0/mintrpc/mint.proto @@ -9,7 +9,10 @@ option go_package = "github.com/lightninglabs/taproot-assets/taprpc/mintrpc"; service Mint { /* tapcli: `assets mint` MintAsset will attempt to mint the set of assets (async by default to - ensure proper batching) specified in the request. + ensure proper batching) specified in the request. The pending batch is + returned that shows the other pending assets that are part of the next + batch. This call will block until the operation succeeds (asset is staged + in the batch) or fails. */ rpc MintAsset (MintAssetRequest) returns (MintAssetResponse); @@ -59,6 +62,11 @@ message MintAsset { This asset will be minted with the same group key as the anchor asset. */ string group_anchor = 6; + + /* + The version of asset to mint. + */ + taprpc.AssetVersion asset_version = 7; } message MintAssetRequest { @@ -72,20 +80,27 @@ message MintAssetRequest { future asset issuance. */ bool enable_emission = 2; + + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 3; } message MintAssetResponse { + // The pending batch the asset was added to. + MintingBatch pending_batch = 1; +} + +message MintingBatch { /* A public key serialized in compressed format that can be used to uniquely identify a pending minting batch. Responses that share the same key will be batched into the same minting transaction. */ bytes batch_key = 1; -} - -message MintingBatch { - // The internal public key of the batch. - bytes batch_key = 1; // The assets that are part of the batch. repeated MintAsset assets = 2; @@ -107,11 +122,20 @@ enum BatchState { } message FinalizeBatchRequest { + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; + + // The optional fee rate to use for the minting transaction, in sat/kw. + uint32 fee_rate = 2; } message FinalizeBatchResponse { - // The internal public key of the batch. - bytes batch_key = 1; + // The finalized batch. + MintingBatch batch = 1; } message CancelBatchRequest { diff --git a/protos/tapd/v0.2.3/taprootassets.proto b/protos/tapd/v0.3.0/taprootassets.proto similarity index 80% rename from protos/tapd/v0.2.3/taprootassets.proto rename to protos/tapd/v0.3.0/taprootassets.proto index 6cba44b..042d5dc 100644 --- a/protos/tapd/v0.2.3/taprootassets.proto +++ b/protos/tapd/v0.3.0/taprootassets.proto @@ -75,7 +75,7 @@ service TaprootAssets { */ rpc VerifyProof (ProofFile) returns (VerifyProofResponse); - /* tarocli: `proofs decode` + /* tapcli: `proofs decode` DecodeProof attempts to decode a given proof file into human readable format. */ @@ -87,13 +87,6 @@ service TaprootAssets { */ rpc ExportProof (ExportProofRequest) returns (ProofFile); - /* tapcli: `proofs import` - ImportProof attempts to import a proof file into the daemon. If successful, - a new asset will be inserted on disk, spendable using the specified target - script key, and internal key. - */ - rpc ImportProof (ImportProofRequest) returns (ImportProofResponse); - /* tapcli: `assets send` SendAsset uses one or multiple passed Taproot Asset address(es) to attempt to complete an asset send. The method returns information w.r.t the on chain @@ -102,6 +95,15 @@ service TaprootAssets { */ rpc SendAsset (SendAssetRequest) returns (SendAssetResponse); + /* tapcli: `assets burn` + BurnAsset burns the given number of units of a given asset by sending them + to a provably un-spendable script key. Burning means irrevocably destroying + a certain number of assets, reducing the total supply of the asset. Because + burning is such a destructive and non-reversible operation, some specific + values need to be set in the request to avoid accidental burns. + */ + rpc BurnAsset (BurnAssetRequest) returns (BurnAssetResponse); + /* tapcli: `getinfo` GetInfo returns the information for the node. */ @@ -148,7 +150,8 @@ enum AssetMetaType { message AssetMeta { /* The raw data of the asset meta data. Based on the type below, this may be - structured data such as a text file or PDF. + structured data such as a text file or PDF. The size of the data is limited + to 1MiB. */ bytes data = 1; @@ -165,6 +168,7 @@ message AssetMeta { message ListAssetRequest { bool with_witness = 1; bool include_spent = 2; + bool include_leased = 3; } message AnchorInfo { @@ -237,13 +241,44 @@ message AssetGroup { */ bytes tweaked_group_key = 2; - // A signature over the genesis point using the above key. - bytes asset_id_sig = 3; + /* + A witness that authorizes a specific asset to be part of the asset group + specified by the above key. + */ + bytes asset_witness = 3; + + // TODO(jhb): update to include tapscript_root +} + +message GroupKeyReveal { + // The raw group key which is a normal public key. + bytes raw_group_key = 1; + + // The tapscript root included in the tweaked group key, which may be empty. + bytes tapscript_root = 2; +} + +message GenesisReveal { + // The base genesis information in the genesis reveal. + GenesisInfo genesis_base_reveal = 1; + + // The asset type, not included in the base genesis info. + AssetType asset_type = 2; +} + +enum AssetVersion { + // ASSET_VERSION_V0 is the default asset version. This version will include + // the witness vector in the leaf for a tap commitment. + ASSET_VERSION_V0 = 0; + + // ASSET_VERSION_V1 is the asset version that leaves out the witness vector + // from the MS-SMT leaf encoding. + ASSET_VERSION_V1 = 1; } message Asset { // The version of the Taproot Asset. - int32 version = 1; + AssetVersion version = 1; // The base genesis information of an asset. This information never changes. GenesisInfo asset_genesis = 2; @@ -280,6 +315,18 @@ message Asset { // Indicates whether the asset has been spent. bool is_spent = 14; + + // If the asset has been leased, this is the owner (application ID) of the + // lease. + bytes lease_owner = 15; + + // If the asset has been leased, this is the expiry of the lease as a Unix + // timestamp in seconds. + int64 lease_expiry = 16; + + // Indicates whether this transfer was an asset burn. If true, the number of + // assets in this output are destroyed and can no longer be spent. + bool is_burn = 17; } message PrevWitness { @@ -299,6 +346,7 @@ message ListAssetResponse { } message ListUtxosRequest { + bool include_leased = 1; } message ManagedUtxo { @@ -354,6 +402,9 @@ message AssetHumanReadable { // The type of the asset. AssetType type = 7; + + // The version of the asset. + AssetVersion version = 8; } message GroupedAssets { @@ -490,6 +541,14 @@ enum OutputType { // change from a split or a tombstone from a non-interactive full value send // output, as well as passive assets. OUTPUT_TYPE_PASSIVE_SPLIT_ROOT = 3; + + // OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS is a plain full-value interactive send + // output that also carries passive assets. This is a special case where we + // send the full value of a single asset in a commitment to a new script + // key, but also carry passive assets in the same output. This is useful for + // key rotation (send-to-self) scenarios or asset burns where we burn the + // full supply of a single asset within a commitment. + OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS = 4; } message TransferOutput { @@ -501,11 +560,15 @@ message TransferOutput { uint64 amount = 4; + // The new individual transition proof (not a full proof file) that proves + // the inclusion of the new asset within the new AnchorTx. bytes new_proof_blob = 5; bytes split_commit_root_hash = 6; OutputType output_type = 7; + + AssetVersion asset_version = 8; } message StopRequest { @@ -563,6 +626,12 @@ message Addr { transfer assets described in this address. */ bytes taproot_output_key = 9; + + // The address of the proof courier service used in proof transfer. + string proof_courier_addr = 10; + + // The asset version of the address. + AssetVersion asset_version = 11; } message QueryAddrRequest { @@ -621,6 +690,17 @@ message NewAddrRequest { commitment of the asset. */ bytes tapscript_sibling = 5; + + /* + An optional proof courier address for use in proof transfer. If unspecified, + the daemon configured default address will be used. + */ + string proof_courier_addr = 6; + + /* + The asset version to use when sending/receiving to/from this address. + */ + AssetVersion asset_version = 7; } message ScriptKey { @@ -672,7 +752,9 @@ message DecodeAddrRequest { } message ProofFile { - bytes raw_proof = 1; + // The raw proof file encoded as bytes. Must be a file and not just an + // individual mint/transfer proof. + bytes raw_proof_file = 1; string genesis_point = 2; } @@ -681,7 +763,9 @@ message DecodedProof { // The index depth of the decoded proof, with 0 being the latest proof. uint32 proof_at_depth = 1; - // The total number of proofs contained in the raw proof. + // The total number of proofs contained in the decoded proof file (this will + // always be 1 if a single mint/transition proof was given as the raw_proof + // instead of a file). uint32 number_of_proofs = 2; // The asset referenced in the proof. @@ -718,18 +802,38 @@ message DecodedProof { // that the creator of the proof is able to produce a valid signature to // spend the asset. repeated bytes challenge_witness = 10; + + // Indicates whether the state transition this proof represents is a burn, + // meaning that the assets were provably destroyed and can no longer be + // spent. + bool is_burn = 11; + + // GenesisReveal is an optional field that is the Genesis information for + // the asset. This is required for minting proofs. + GenesisReveal genesis_reveal = 12; + + // GroupKeyReveal is an optional field that includes the information needed + // to derive the tweaked group key. + GroupKeyReveal group_key_reveal = 13; } message VerifyProofResponse { bool valid = 1; + + // The decoded last proof in the file if the proof file was valid. DecodedProof decoded_proof = 2; } message DecodeProofRequest { - // The raw proof in bytes to decode, which may contain multiple proofs. + // The raw proof bytes to decode. This can be a full proof file or a single + // mint/transition proof. If it is a full proof file, the proof_at_depth + // field will be used to determine which individual proof within the file to + // decode. bytes raw_proof = 1; - // The index depth of the decoded proof, with 0 being the latest proof. + // The index depth of the decoded proof, with 0 being the latest proof. This + // is ignored if the raw_proof is a single mint/transition proof and not a + // proof file. uint32 proof_at_depth = 2; // An option to include previous witnesses in decoding. @@ -751,15 +855,6 @@ message ExportProofRequest { // file? } -message ImportProofRequest { - bytes proof_file = 1; - - string genesis_point = 2; -} - -message ImportProofResponse { -} - enum AddrEventStatus { ADDR_EVENT_STATUS_UNKNOWN = 0; ADDR_EVENT_STATUS_TRANSACTION_DETECTED = 1; @@ -822,6 +917,8 @@ message AddrReceivesResponse { message SendAssetRequest { repeated string tap_addrs = 1; + // The optional fee rate to use for the minting transaction, in sat/kw. + uint32 fee_rate = 2; // TODO(roasbeef): maybe in future add details re type of ProofCourier or // w/e } @@ -844,6 +941,11 @@ message GetInfoResponse { string version = 1; string lnd_version = 2; string network = 3; + string lnd_identity_pubkey = 4; + string node_alias = 5; + uint32 block_height = 6; + string block_hash = 7; + bool sync_to_chain = 8; } message SubscribeSendAssetEventNtfnsRequest { @@ -888,5 +990,36 @@ message FetchAssetMetaRequest { // The 32-byte meta hash of the asset meta. bytes meta_hash = 2; + + // The hex encoded asset ID of the asset to fetch the meta for. + string asset_id_str = 3; + + // The hex encoded meta hash of the asset meta. + string meta_hash_str = 4; + } +} + +message BurnAssetRequest { + oneof asset { + // The asset ID of the asset to burn units of. + bytes asset_id = 1; + + // The hex encoded asset ID of the asset to burn units of. + string asset_id_str = 2; } + + uint64 amount_to_burn = 3; + + // A safety check to ensure the user is aware of the destructive nature of + // the burn. This needs to be set to the value "assets will be destroyed" + // for the burn to succeed. + string confirmation_text = 4; +} + +message BurnAssetResponse { + // The asset transfer that contains the asset burn as an output. + AssetTransfer burn_transfer = 1; + + // The burn transition proof for the asset burn output. + DecodedProof burn_proof = 2; } diff --git a/protos/tapd/v0.2.3/universerpc/universe.proto b/protos/tapd/v0.3.0/universerpc/universe.proto similarity index 72% rename from protos/tapd/v0.2.3/universerpc/universe.proto rename to protos/tapd/v0.3.0/universerpc/universe.proto index 62e52f0..8272999 100644 --- a/protos/tapd/v0.2.3/universerpc/universe.proto +++ b/protos/tapd/v0.3.0/universerpc/universe.proto @@ -126,6 +126,20 @@ service Universe { period, grouped by day. */ rpc QueryEvents (QueryEventsRequest) returns (QueryEventsResponse); + + /* + SetFederationSyncConfig sets the configuration of the universe federation + sync. + */ + rpc SetFederationSyncConfig (SetFederationSyncConfigRequest) + returns (SetFederationSyncConfigResponse); + + /* + QueryFederationSyncConfig queries the universe federation sync configuration + settings. + */ + rpc QueryFederationSyncConfig (QueryFederationSyncConfigRequest) + returns (QueryFederationSyncConfigResponse); } message AssetRootRequest { @@ -145,6 +159,12 @@ message MerkleSumNode { // exposed via iterative queries } +enum ProofType { + PROOF_TYPE_UNSPECIFIED = 0; + PROOF_TYPE_ISSUANCE = 1; + PROOF_TYPE_TRANSFER = 2; +} + message ID { oneof id { // The 32-byte asset ID specified as raw bytes (gRPC only). @@ -160,6 +180,8 @@ message ID { // REST). string group_key_str = 4; } + + ProofType proof_type = 5; } message UniverseRoot { @@ -171,6 +193,15 @@ message UniverseRoot { // The name of the asset. string asset_name = 4; + + // A map of hex encoded asset IDs to the number of units minted for that + // asset. This only contains more than one entry for grouped assets and in + // that case represents the whole list of assets currently known to exist + // within the group. For single (non-grouped) assets, this is equal to the + // asset ID above and the sum in the mssmt_root. A hex encoded string is + // used as the map key because gRPC does not support using raw bytes for a + // map key. + map amounts_by_asset_id = 5; } message AssetRootResponse { @@ -185,8 +216,11 @@ message AssetRootQuery { } message QueryRootResponse { - // The asset root for the given asset ID or group key. - UniverseRoot asset_root = 1; + // The issuance universe root for the given asset ID or group key. + UniverseRoot issuance_root = 1; + + // The transfer universe root for the given asset ID or group key. + UniverseRoot transfer_root = 2; } message DeleteRootQuery { @@ -234,7 +268,8 @@ message AssetLeaf { // TODO(roasbeef): only needed for display? can get from proof below ^ // The asset issuance proof, which proves that the asset specified above - // was issued properly. + // was issued properly. This is always just an individual mint/transfer + // proof and never a proof file. bytes issuance_proof = 2; } @@ -267,6 +302,14 @@ message AssetProofResponse { // The asset leaf itself, which includes the asset and the issuance proof. AssetLeaf asset_leaf = 4; + + // MultiverseRoot is the root of the multiverse tree that includes this + // asset leaf. + MerkleSumNode multiverse_root = 5; + + // MultiverseInclusionProof is the inclusion proof for the asset leaf in the + // multiverse. + bytes multiverse_inclusion_proof = 6; } message AssetProof { @@ -364,8 +407,9 @@ message DeleteFederationServerResponse { message StatsResponse { int64 num_total_assets = 1; - int64 num_total_syncs = 2; - int64 num_total_proofs = 3; + int64 num_total_groups = 2; + int64 num_total_syncs = 3; + int64 num_total_proofs = 4; } enum AssetQuerySort { @@ -382,6 +426,14 @@ enum AssetQuerySort { SORT_BY_TOTAL_PROOFS = 5; SORT_BY_GENESIS_HEIGHT = 6; + + SORT_BY_TOTAL_SUPPLY = 7; +} + +enum SortDirection { + SORT_DIRECTION_ASC = 0; + + SORT_DIRECTION_DESC = 1; } enum AssetTypeFilter { @@ -404,28 +456,50 @@ message AssetStatsQuery { int32 offset = 5; int32 limit = 6; + + SortDirection direction = 7; } message AssetStatsSnapshot { - bytes asset_id = 1; + // The group key of the asset group. If this is empty, then the asset is + // not part of a group. + bytes group_key = 1; + + // The total supply of the asset group. If the asset is not part of an asset + // group then this is always zero. + int64 group_supply = 2; + + // The group anchor that was used to group assets together into an asset + // group. This is only set if the asset is part of an asset group. + AssetStatsAsset group_anchor = 3; - bytes group_key = 2; + // If the asset is not part of an asset group, then this is the asset the + // stats below refer to. + AssetStatsAsset asset = 4; - string genesis_point = 3; + // The total number of syncs either for the asset group or the single asset + // if it is not part of a group. + int64 total_syncs = 5; + + // The total number of proofs either for the asset group or the single asset + // if it is not part of a group. + int64 total_proofs = 6; +} - int64 total_supply = 4; +message AssetStatsAsset { + bytes asset_id = 1; - string asset_name = 5; + string genesis_point = 2; - taprpc.AssetType asset_type = 6; + int64 total_supply = 3; - int32 genesis_height = 7; + string asset_name = 4; - int64 genesis_timestamp = 8; + taprpc.AssetType asset_type = 5; - int64 total_syncs = 9; + int32 genesis_height = 6; - int64 total_proofs = 10; + int64 genesis_timestamp = 7; } message UniverseAssetStats { @@ -447,3 +521,57 @@ message GroupedUniverseEvents { uint64 sync_events = 2; uint64 new_proof_events = 3; } + +message SetFederationSyncConfigRequest { + repeated GlobalFederationSyncConfig global_sync_configs = 1; + + repeated AssetFederationSyncConfig asset_sync_configs = 2; +} + +message SetFederationSyncConfigResponse { +} + +// GlobalFederationSyncConfig is a global proof type specific configuration +// for universe federation syncing. +message GlobalFederationSyncConfig { + // proof_type is the universe proof type which this config applies to. + ProofType proof_type = 1; + + // allow_sync_insert is a boolean that indicates whether leaves from + // universes of the given proof type have may be inserted via federation + // sync. + bool allow_sync_insert = 2; + + // allow_sync_export is a boolean that indicates whether leaves from + // universes of the given proof type have may be exported via federation + // sync. + bool allow_sync_export = 3; +} + +// AssetFederationSyncConfig is an asset universe specific configuration for +// federation syncing. +message AssetFederationSyncConfig { + // id is the ID of the universe to configure. + ID id = 1; + + // allow_sync_insert is a boolean that indicates whether leaves from + // universes of the given proof type have may be inserted via federation + // sync. + bool allow_sync_insert = 2; + + // allow_sync_export is a boolean that indicates whether leaves from + // universes of the given proof type have may be exported via federation + // sync. + bool allow_sync_export = 3; +} + +message QueryFederationSyncConfigRequest { + // Target universe ID(s). + repeated ID id = 1; +} + +message QueryFederationSyncConfigResponse { + repeated GlobalFederationSyncConfig global_sync_configs = 1; + + repeated AssetFederationSyncConfig asset_sync_configs = 2; +}