{
  "swagger": "2.0",
  "info": {
    "title": "signrpc/signer.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "Signer"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/v2/signer/inputscript": {
      "post": {
        "summary": "ComputeInputScript generates a complete InputIndex for the passed\ntransaction with the signature as defined within the passed SignDescriptor.\nThis method should be capable of generating the proper input script for both\nregular p2wkh/p2tr outputs and p2wkh outputs nested within a regular p2sh\noutput.",
        "description": "Note that when using this method to sign inputs belonging to the wallet,\nthe only items of the SignDescriptor that need to be populated are pkScript\nin the TxOut field, the value in that same field, and finally the input\nindex.",
        "operationId": "Signer_ComputeInputScript",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcInputScriptResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcSignReq"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/cleanup": {
      "post": {
        "summary": "MuSig2Cleanup (experimental!) allows a caller to clean up a session early in\ncases where it's obvious that the signing session won't succeed and the\nresources can be released.",
        "description": "NOTE: The MuSig2 BIP is not final yet and therefore this API must be\nconsidered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2Cleanup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2CleanupResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2CleanupRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/combinekeys": {
      "post": {
        "summary": "MuSig2CombineKeys (experimental!) is a stateless helper RPC that can be used\nto calculate the combined MuSig2 public key from a list of all participating\nsigners' public keys. This RPC is completely stateless and deterministic and\ndoes not create any signing session. It can be used to determine the Taproot\npublic key that should be put in an on-chain output once all public keys are\nknown. A signing session is only needed later when that output should be\n_spent_ again.",
        "description": "NOTE: The MuSig2 BIP is not final yet and therefore this API must be\nconsidered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2CombineKeys",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2CombineKeysResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2CombineKeysRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/combinesig": {
      "post": {
        "summary": "MuSig2CombineSig (experimental!) combines the given partial signature(s)\nwith the local one, if it already exists. Once a partial signature of all\nparticipants is registered, the final signature will be combined and\nreturned.",
        "description": "NOTE: The MuSig2 BIP is not final yet and therefore this API must be\nconsidered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2CombineSig",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2CombineSigResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2CombineSigRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/createsession": {
      "post": {
        "summary": "MuSig2CreateSession (experimental!) creates a new MuSig2 signing session\nusing the local key identified by the key locator. The complete list of all\npublic keys of all signing parties must be provided, including the public\nkey of the local signing key. If nonces of other parties are already known,\nthey can be submitted as well to reduce the number of RPC calls necessary\nlater on.",
        "description": "NOTE: The MuSig2 BIP is not final yet and therefore this API must be\nconsidered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2CreateSession",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2SessionResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2SessionRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/getcombinednonce": {
      "post": {
        "summary": "MuSig2GetCombinedNonce (experimental!) retrieves the combined nonce for a\nsigning session. This will be available after either all individual nonces\nhave been registered via MuSig2RegisterNonces, or a combined nonce has been\nregistered via MuSig2RegisterCombinedNonce.",
        "description": "NOTE: The MuSig2 BIP is not final yet and therefore this API must be\nconsidered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2GetCombinedNonce",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2GetCombinedNonceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2GetCombinedNonceRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/registercombinednonce": {
      "post": {
        "summary": "MuSig2RegisterCombinedNonce (experimental!) registers a pre-aggregated\ncombined nonce for a signing session. This is an alternative to\nMuSig2RegisterNonces and is used when a coordinator has already aggregated\nall individual nonces and wants to distribute the combined nonce to\nparticipants.",
        "description": "NOTE: This method is mutually exclusive with MuSig2RegisterNonces for the\nsame session. The MuSig2 BIP is not final yet and therefore this API must\nbe considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2RegisterCombinedNonce",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2RegisterCombinedNonceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2RegisterCombinedNonceRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/registernonces": {
      "post": {
        "summary": "MuSig2RegisterNonces (experimental!) registers one or more public nonces of\nother signing participants for a session identified by its ID. This RPC can\nbe called multiple times until all nonces are registered.",
        "description": "NOTE: The MuSig2 BIP is not final yet and therefore this API must be\nconsidered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2RegisterNonces",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2RegisterNoncesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2RegisterNoncesRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/musig2/sign": {
      "post": {
        "summary": "MuSig2Sign (experimental!) creates a partial signature using the local\nsigning key that was specified when the session was created. This can only\nbe called when all public nonces of all participants are known and have been\nregistered with the session. If this node isn't responsible for combining\nall the partial signatures, then the cleanup flag should be set, indicating\nthat the session can be removed from memory once the signature was produced.",
        "description": "NOTE: The MuSig2 BIP is not final yet and therefore this API must be\nconsidered to be HIGHLY EXPERIMENTAL and subject to change in upcoming\nreleases. Backward compatibility is not guaranteed!",
        "operationId": "Signer_MuSig2Sign",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2SignResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcMuSig2SignRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/sharedkey": {
      "post": {
        "summary": "DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key\nderivation between the ephemeral public key in the request and the node's\nkey specified in the key_desc parameter. Either a key locator or a raw\npublic key is expected in the key_desc, if neither is supplied, defaults to\nthe node's identity private key:\nP_shared = privKeyNode * ephemeralPubkey\nThe resulting shared public key is serialized in the compressed format and\nhashed with sha256, resulting in the final key length of 256bit.",
        "operationId": "Signer_DeriveSharedKey",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcSharedKeyResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcSharedKeyRequest"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/signmessage": {
      "post": {
        "summary": "SignMessage signs a message with the key specified in the key locator. The\nreturned signature is fixed-size LN wire format encoded.",
        "description": "The main difference to SignMessage in the main RPC is that a specific key is\nused to sign the message instead of the node identity private key.",
        "operationId": "Signer_SignMessage",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcSignMessageResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcSignMessageReq"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/signraw": {
      "post": {
        "summary": "SignOutputRaw is a method that can be used to generated a signature for a\nset of inputs/outputs to a transaction. Each request specifies details\nconcerning how the outputs should be signed, which keys they should be\nsigned with, and also any optional tweaks. The return value is a fixed\n64-byte signature (the same format as we use on the wire in Lightning).",
        "description": "If we are  unable to sign using the specified keys, then an error will be\nreturned.",
        "operationId": "Signer_SignOutputRaw",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcSignResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcSignReq"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    },
    "/v2/signer/verifymessage": {
      "post": {
        "summary": "VerifyMessage verifies a signature over a message using the public key\nprovided. The signature must be fixed-size LN wire format encoded.",
        "description": "The main difference to VerifyMessage in the main RPC is that the public key\nused to sign the message does not have to be a node known to the network.",
        "operationId": "Signer_VerifyMessage",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/signrpcVerifyMessageResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/signrpcVerifyMessageReq"
            }
          }
        ],
        "tags": [
          "Signer"
        ]
      }
    }
  },
  "definitions": {
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "signrpcInputScript": {
      "type": "object",
      "properties": {
        "witness": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "The serializes witness stack for the specified input."
        },
        "sig_script": {
          "type": "string",
          "format": "byte",
          "description": "The optional sig script for the specified witness that will only be set if\nthe input specified is a nested p2sh witness program."
        }
      }
    },
    "signrpcInputScriptResp": {
      "type": "object",
      "properties": {
        "input_scripts": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/signrpcInputScript"
          },
          "description": "The set of fully valid input scripts requested."
        }
      }
    },
    "signrpcKeyDescriptor": {
      "type": "object",
      "properties": {
        "raw_key_bytes": {
          "type": "string",
          "format": "byte",
          "description": "The raw bytes of the public key in the key pair being identified. Either\nthis or the KeyLocator must be specified."
        },
        "key_loc": {
          "$ref": "#/definitions/signrpcKeyLocator",
          "description": "The key locator that identifies which private key to use for signing.\nEither this or the raw bytes of the target public key must be specified."
        }
      }
    },
    "signrpcKeyLocator": {
      "type": "object",
      "properties": {
        "key_family": {
          "type": "integer",
          "format": "int32",
          "description": "The family of key being identified."
        },
        "key_index": {
          "type": "integer",
          "format": "int32",
          "description": "The precise index of the key being identified."
        }
      }
    },
    "signrpcMuSig2CleanupRequest": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "format": "byte",
          "description": "The unique ID of the signing session that should be removed/cleaned up."
        }
      }
    },
    "signrpcMuSig2CleanupResponse": {
      "type": "object"
    },
    "signrpcMuSig2CombineKeysRequest": {
      "type": "object",
      "properties": {
        "all_signer_pubkeys": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "A list of all public keys (serialized in 32-byte x-only format for v0.4.0\nand 33-byte compressed format for v1.0.0rc2!) participating in the signing\nsession. The list will always be sorted lexicographically internally. This\nmust include the local key which is described by the above key_loc."
        },
        "tweaks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/signrpcTweakDesc"
          },
          "description": "A series of optional generic tweaks to be applied to the aggregated\npublic key."
        },
        "taproot_tweak": {
          "$ref": "#/definitions/signrpcTaprootTweakDesc",
          "description": "An optional taproot specific tweak that must be specified if the MuSig2\ncombined key will be used as the main taproot key of a taproot output\non-chain."
        },
        "version": {
          "$ref": "#/definitions/signrpcMuSig2Version",
          "description": "The mandatory version of the MuSig2 BIP draft to use. This is necessary to\ndifferentiate between the changes that were made to the BIP while this\nexperimental RPC was already released. Some of those changes affect how the\ncombined key and nonces are created."
        }
      }
    },
    "signrpcMuSig2CombineKeysResponse": {
      "type": "object",
      "properties": {
        "combined_key": {
          "type": "string",
          "format": "byte",
          "description": "The combined public key (in the 32-byte x-only format) with all tweaks\napplied to it. If a taproot tweak is specified, this corresponds to the\ntaproot key that can be put into the on-chain output."
        },
        "taproot_internal_key": {
          "type": "string",
          "format": "byte",
          "description": "The raw combined public key (in the 32-byte x-only format) before any tweaks\nare applied to it. If a taproot tweak is specified, this corresponds to the\ninternal key that needs to be put into the witness if the script spend path\nis used."
        },
        "version": {
          "$ref": "#/definitions/signrpcMuSig2Version",
          "description": "The version of the MuSig2 BIP that was used to combine the keys."
        }
      }
    },
    "signrpcMuSig2CombineSigRequest": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "format": "byte",
          "description": "The unique ID of the signing session to combine the signatures for."
        },
        "other_partial_signatures": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "The list of all other participants' partial signatures to add to the current\nsession."
        }
      }
    },
    "signrpcMuSig2CombineSigResponse": {
      "type": "object",
      "properties": {
        "have_all_signatures": {
          "type": "boolean",
          "description": "Indicates whether all partial signatures required to create a final, full\nsignature are known yet. If this is true, then the final_signature field is\nset, otherwise it is empty."
        },
        "final_signature": {
          "type": "string",
          "format": "byte",
          "description": "The final, full signature that is valid for the combined public key."
        }
      }
    },
    "signrpcMuSig2GetCombinedNonceRequest": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "format": "byte",
          "description": "The unique ID of the signing session to get the combined nonce for."
        }
      }
    },
    "signrpcMuSig2GetCombinedNonceResponse": {
      "type": "object",
      "properties": {
        "combined_public_nonce": {
          "type": "string",
          "format": "byte",
          "description": "The 66-byte combined public nonce. This is a concatenation of two 33-byte\ncompressed public keys (R1 || R2)."
        }
      }
    },
    "signrpcMuSig2RegisterCombinedNonceRequest": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "format": "byte",
          "description": "The unique ID of the signing session the combined nonce should be registered\nwith."
        },
        "combined_public_nonce": {
          "type": "string",
          "format": "byte",
          "description": "The 66-byte combined public nonce that was aggregated externally. This is a\nconcatenation of two 33-byte compressed public keys (R1 || R2)."
        }
      }
    },
    "signrpcMuSig2RegisterCombinedNonceResponse": {
      "type": "object"
    },
    "signrpcMuSig2RegisterNoncesRequest": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "format": "byte",
          "description": "The unique ID of the signing session those nonces should be registered with."
        },
        "other_signer_public_nonces": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "A list of all public nonces of other signing participants that should be\nregistered."
        }
      }
    },
    "signrpcMuSig2RegisterNoncesResponse": {
      "type": "object",
      "properties": {
        "have_all_nonces": {
          "type": "boolean",
          "description": "Indicates whether all nonces required to start the signing process are known\nnow."
        }
      }
    },
    "signrpcMuSig2SessionRequest": {
      "type": "object",
      "properties": {
        "key_loc": {
          "$ref": "#/definitions/signrpcKeyLocator",
          "description": "The key locator that identifies which key to use for signing."
        },
        "all_signer_pubkeys": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "A list of all public keys (serialized in 32-byte x-only format for v0.4.0\nand 33-byte compressed format for v1.0.0rc2!) participating in the signing\nsession. The list will always be sorted lexicographically internally. This\nmust include the local key which is described by the above key_loc."
        },
        "other_signer_public_nonces": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "An optional list of all public nonces of other signing participants that\nmight already be known."
        },
        "tweaks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/signrpcTweakDesc"
          },
          "description": "A series of optional generic tweaks to be applied to the aggregated\npublic key."
        },
        "taproot_tweak": {
          "$ref": "#/definitions/signrpcTaprootTweakDesc",
          "description": "An optional taproot specific tweak that must be specified if the MuSig2\ncombined key will be used as the main taproot key of a taproot output\non-chain."
        },
        "version": {
          "$ref": "#/definitions/signrpcMuSig2Version",
          "description": "The mandatory version of the MuSig2 BIP draft to use. This is necessary to\ndifferentiate between the changes that were made to the BIP while this\nexperimental RPC was already released. Some of those changes affect how the\ncombined key and nonces are created."
        },
        "pregenerated_local_nonce": {
          "type": "string",
          "format": "byte",
          "description": "A set of pre generated secret local nonces to use in the musig2 session.\nThis field is optional. This can be useful for protocols that need to send\nnonces ahead of time before the set of signer keys are known. This value\nMUST be 97 bytes and be the concatenation of two CSPRNG generated 32 byte\nvalues and local public key used for signing as specified in the key_loc\nfield."
        }
      }
    },
    "signrpcMuSig2SessionResponse": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "format": "byte",
          "description": "The unique ID that represents this signing session. A session can be used\nfor producing a signature a single time. If the signing fails for any\nreason, a new session with the same participants needs to be created."
        },
        "combined_key": {
          "type": "string",
          "format": "byte",
          "description": "The combined public key (in the 32-byte x-only format) with all tweaks\napplied to it. If a taproot tweak is specified, this corresponds to the\ntaproot key that can be put into the on-chain output."
        },
        "taproot_internal_key": {
          "type": "string",
          "format": "byte",
          "description": "The raw combined public key (in the 32-byte x-only format) before any tweaks\nare applied to it. If a taproot tweak is specified, this corresponds to the\ninternal key that needs to be put into the witness if the script spend path\nis used."
        },
        "local_public_nonces": {
          "type": "string",
          "format": "byte",
          "description": "The two public nonces the local signer uses, combined into a single value\nof 66 bytes. Can be split into the two 33-byte points to get the individual\nnonces."
        },
        "have_all_nonces": {
          "type": "boolean",
          "description": "Indicates whether all nonces required to start the signing process are known\nnow."
        },
        "version": {
          "$ref": "#/definitions/signrpcMuSig2Version",
          "description": "The version of the MuSig2 BIP that was used to create the session."
        }
      }
    },
    "signrpcMuSig2SignRequest": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "format": "byte",
          "description": "The unique ID of the signing session to use for signing."
        },
        "message_digest": {
          "type": "string",
          "format": "byte",
          "description": "The 32-byte SHA256 digest of the message to sign."
        },
        "cleanup": {
          "type": "boolean",
          "description": "Cleanup indicates that after signing, the session state can be cleaned up,\nsince another participant is going to be responsible for combining the\npartial signatures."
        }
      }
    },
    "signrpcMuSig2SignResponse": {
      "type": "object",
      "properties": {
        "local_partial_signature": {
          "type": "string",
          "format": "byte",
          "description": "The partial signature created by the local signer."
        }
      }
    },
    "signrpcMuSig2Version": {
      "type": "string",
      "enum": [
        "MUSIG2_VERSION_UNDEFINED",
        "MUSIG2_VERSION_V040",
        "MUSIG2_VERSION_V100RC2"
      ],
      "default": "MUSIG2_VERSION_UNDEFINED",
      "description": " - MUSIG2_VERSION_UNDEFINED: The default value on the RPC is zero for enums so we need to represent an\ninvalid/undefined version by default to make sure clients upgrade their\nsoftware to set the version explicitly.\n - MUSIG2_VERSION_V040: The version of MuSig2 that lnd 0.15.x shipped with, which corresponds to the\nversion v0.4.0 of the MuSig2 BIP draft.\n - MUSIG2_VERSION_V100RC2: The current version of MuSig2 which corresponds to the version v1.0.0rc2 of\nthe MuSig2 BIP draft."
    },
    "signrpcSharedKeyRequest": {
      "type": "object",
      "properties": {
        "ephemeral_pubkey": {
          "type": "string",
          "format": "byte",
          "description": "The ephemeral public key to use for the DH key derivation."
        },
        "key_loc": {
          "$ref": "#/definitions/signrpcKeyLocator",
          "description": "Deprecated. The optional key locator of the local key that should be used.\nIf this parameter is not set then the node's identity private key will be\nused."
        },
        "key_desc": {
          "$ref": "#/definitions/signrpcKeyDescriptor",
          "description": "A key descriptor describes the key used for performing ECDH. Either a key\nlocator or a raw public key is expected, if neither is supplied, defaults to\nthe node's identity private key."
        }
      }
    },
    "signrpcSharedKeyResponse": {
      "type": "object",
      "properties": {
        "shared_key": {
          "type": "string",
          "format": "byte",
          "description": "The shared public key, hashed with sha256."
        }
      }
    },
    "signrpcSignDescriptor": {
      "type": "object",
      "properties": {
        "key_desc": {
          "$ref": "#/definitions/signrpcKeyDescriptor",
          "description": "A descriptor that precisely describes *which* key to use for signing. This\nmay provide the raw public key directly, or require the Signer to re-derive\nthe key according to the populated derivation path.\n\nNote that if the key descriptor was obtained through walletrpc.DeriveKey,\nthen the key locator MUST always be provided, since the derived keys are not\npersisted unlike with DeriveNextKey."
        },
        "single_tweak": {
          "type": "string",
          "format": "byte",
          "description": "derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N",
          "title": "A scalar value that will be added to the private key corresponding to the\nabove public key to obtain the private key to be used to sign this input.\nThis value is typically derived via the following computation:"
        },
        "double_tweak": {
          "type": "string",
          "format": "byte",
          "description": "A private key that will be used in combination with its corresponding\nprivate key to derive the private key that is to be used to sign the target\ninput. Within the Lightning protocol, this value is typically the\ncommitment secret from a previously revoked commitment transaction. This\nvalue is in combination with two hash values, and the original private key\nto derive the private key to be used when signing.\n\nk = (privKey*sha256(pubKey || tweakPub) +\ntweakPriv*sha256(tweakPub || pubKey)) mod N"
        },
        "tap_tweak": {
          "type": "string",
          "format": "byte",
          "description": "The 32 byte input to the taproot tweak derivation that is used to derive\nthe output key from an internal key: outputKey = internalKey +\ntagged_hash(\"tapTweak\", internalKey || tapTweak).\n\nWhen doing a BIP 86 spend, this field can be an empty byte slice.\n\nWhen doing a normal key path spend, with the output key committing to an\nactual script root, then this field should be: the tapscript root hash."
        },
        "witness_script": {
          "type": "string",
          "format": "byte",
          "description": "The full script required to properly redeem the output. This field will\nonly be populated if a p2tr, p2wsh or a p2sh output is being signed. If a\ntaproot script path spend is being attempted, then this should be the raw\nleaf script."
        },
        "output": {
          "$ref": "#/definitions/signrpcTxOut",
          "description": "A description of the output being spent. The value and script MUST be\nprovided."
        },
        "sighash": {
          "type": "integer",
          "format": "int64",
          "description": "The target sighash type that should be used when generating the final\nsighash, and signature."
        },
        "input_index": {
          "type": "integer",
          "format": "int32",
          "description": "The target input within the transaction that should be signed."
        },
        "sign_method": {
          "$ref": "#/definitions/signrpcSignMethod",
          "description": "The sign method specifies how the input should be signed. Depending on the\nmethod, either the tap_tweak, witness_script or both need to be specified.\nDefaults to SegWit v0 signing to be backward compatible with older RPC\nclients."
        }
      }
    },
    "signrpcSignMessageReq": {
      "type": "object",
      "properties": {
        "msg": {
          "type": "string",
          "format": "byte",
          "description": "The message to be signed. When using REST, this field must be encoded as\nbase64."
        },
        "key_loc": {
          "$ref": "#/definitions/signrpcKeyLocator",
          "description": "The key locator that identifies which key to use for signing."
        },
        "double_hash": {
          "type": "boolean",
          "description": "Double-SHA256 hash instead of just the default single round."
        },
        "compact_sig": {
          "type": "boolean",
          "description": "Use the compact (pubkey recoverable) format instead of the raw lnwire\nformat. This option cannot be used with Schnorr signatures."
        },
        "schnorr_sig": {
          "type": "boolean",
          "description": "Use Schnorr signature. This option cannot be used with compact format."
        },
        "schnorr_sig_tap_tweak": {
          "type": "string",
          "format": "byte",
          "title": "The optional Taproot tweak bytes to apply to the private key before creating\na Schnorr signature. The private key is tweaked as described in BIP-341:\nprivKey + h_tapTweak(internalKey || tapTweak)"
        },
        "tag": {
          "type": "string",
          "format": "byte",
          "description": "An optional tag that can be provided when taking a tagged hash of a\nmessage. This option can only be used when schnorr_sig is true."
        }
      }
    },
    "signrpcSignMessageResp": {
      "type": "object",
      "properties": {
        "signature": {
          "type": "string",
          "format": "byte",
          "description": "The signature for the given message in the fixed-size LN wire format."
        }
      }
    },
    "signrpcSignMethod": {
      "type": "string",
      "enum": [
        "SIGN_METHOD_WITNESS_V0",
        "SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086",
        "SIGN_METHOD_TAPROOT_KEY_SPEND",
        "SIGN_METHOD_TAPROOT_SCRIPT_SPEND"
      ],
      "default": "SIGN_METHOD_WITNESS_V0",
      "description": " - SIGN_METHOD_WITNESS_V0: Specifies that a SegWit v0 (p2wkh, np2wkh, p2wsh) input script should be\nsigned.\n - SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086: Specifies that a SegWit v1 (p2tr) input should be signed by using the\nBIP0086 method (commit to internal key only).\n - SIGN_METHOD_TAPROOT_KEY_SPEND: Specifies that a SegWit v1 (p2tr) input should be signed by using a given\ntaproot hash to commit to in addition to the internal key.\n - SIGN_METHOD_TAPROOT_SCRIPT_SPEND: Specifies that a SegWit v1 (p2tr) input should be spent using the script\npath and that a specific leaf script should be signed for."
    },
    "signrpcSignReq": {
      "type": "object",
      "properties": {
        "raw_tx_bytes": {
          "type": "string",
          "format": "byte",
          "description": "The raw bytes of the transaction to be signed."
        },
        "sign_descs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/signrpcSignDescriptor"
          },
          "description": "A set of sign descriptors, for each input to be signed."
        },
        "prev_outputs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/signrpcTxOut"
          },
          "description": "The full list of UTXO information for each of the inputs being spent. This\nis required when spending one or more taproot (SegWit v1) outputs."
        }
      }
    },
    "signrpcSignResp": {
      "type": "object",
      "properties": {
        "raw_sigs": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "A set of signatures realized in a fixed 64-byte format ordered in ascending\ninput order."
        }
      }
    },
    "signrpcTaprootTweakDesc": {
      "type": "object",
      "properties": {
        "script_root": {
          "type": "string",
          "format": "byte",
          "description": "The root hash of the tapscript tree if a script path is committed to. If\nthe MuSig2 key put on chain doesn't also commit to a script path (BIP-0086\nkey spend only), then this needs to be empty and the key_spend_only field\nbelow must be set to true. This is required because gRPC cannot\ndifferentiate between a zero-size byte slice and a nil byte slice (both\nwould be serialized the same way). So the extra boolean is required."
        },
        "key_spend_only": {
          "type": "boolean",
          "description": "Indicates that the above script_root is expected to be empty because this\nis a BIP-0086 key spend only commitment where only the internal key is\ncommitted to instead of also including a script root hash."
        }
      }
    },
    "signrpcTweakDesc": {
      "type": "object",
      "properties": {
        "tweak": {
          "type": "string",
          "format": "byte",
          "description": "Tweak is the 32-byte value that will modify the public key."
        },
        "is_x_only": {
          "type": "boolean",
          "description": "Specifies if the target key should be converted to an x-only public key\nbefore tweaking. If true, then the public key will be mapped to an x-only\nkey before the tweaking operation is applied."
        }
      }
    },
    "signrpcTxOut": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "format": "int64",
          "description": "The value of the output being spent."
        },
        "pk_script": {
          "type": "string",
          "format": "byte",
          "description": "The script of the output being spent."
        }
      }
    },
    "signrpcVerifyMessageReq": {
      "type": "object",
      "properties": {
        "msg": {
          "type": "string",
          "format": "byte",
          "description": "The message over which the signature is to be verified. When using\nREST, this field must be encoded as base64."
        },
        "signature": {
          "type": "string",
          "format": "byte",
          "description": "The fixed-size LN wire encoded signature to be verified over the given\nmessage. When using REST, this field must be encoded as base64."
        },
        "pubkey": {
          "type": "string",
          "format": "byte",
          "description": "The public key the signature has to be valid for. When using REST, this\nfield must be encoded as base64. If the is_schnorr_sig option is true, then\nthe public key is expected to be in the 32-byte x-only serialization\naccording to BIP-340."
        },
        "is_schnorr_sig": {
          "type": "boolean",
          "description": "Specifies if the signature is a Schnorr signature."
        },
        "tag": {
          "type": "string",
          "format": "byte",
          "description": "An optional tag that can be provided when taking a tagged hash of a\nmessage. This option can only be used when is_schnorr_sig is true."
        }
      }
    },
    "signrpcVerifyMessageResp": {
      "type": "object",
      "properties": {
        "valid": {
          "type": "boolean",
          "description": "Whether the signature was valid over the given message."
        }
      }
    }
  }
}
