core-lightning/doc/lightning-signinvoice.7.md
Carl Dong 1dbc29b8c0 lightningd: Add signinvoice to sign a BOLT11 invoice.
Though there's already a `createinvoice` command, there are usecases where a
user may want to sign an invoice that they don't yet have the preimage to. For
example, they may have an htlc_accepted plugin that pays to obtain the preimage
from someone else and returns a `{ "result": "resolve", ... }`.

This RPC command addresses this usecase without overly complicating the
semantics of the existing `createinvoice` command.

Changelog-Added: JSON-RPC: `signinvoice` new command to sign BOLT11
invoices.
2023-02-06 15:54:32 -06:00

52 lines
1.2 KiB
Markdown

lightning-signinvoice -- Low-level invoice signing
=====================================================
SYNOPSIS
--------
**signinvoice** *invstring*
DESCRIPTION
-----------
The **signinvoice** RPC command signs an invoice. Unlike
**createinvoice** it does not save the invoice into the database and
thus does not require the preimage.
The *invstring* parameter is of bolt11 form, but the final signature
is ignored. Minimal sanity checks are done.
RETURN VALUE
------------
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
- **bolt11** (string): the bolt11 string
[comment]: # (GENERATE-FROM-SCHEMA-END)
On failure, an error is returned.
The following error codes may occur:
- -1: Catchall nonspecific error.
AUTHOR
------
Carl Dong <<contact@carldong.me>> is mainly responsible.
SEE ALSO
--------
lightning-createinvoice(7), lightning-invoice(7), lightning-listinvoices(7),
lightning-delinvoice(7), lightning-getroute(7), lightning-sendpay(7),
lightning-offer(7).
RESOURCES
---------
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:9348784bd3daaed1cd35b29b2e5c91ea17bc8e11bf5bb6e1de9a098241cb74d6)