Skip to content

Commit fe7a91c

Browse files
committed
recvpsbt: New onchain command for PSBT output
ChangeLog-Added: New `recvpsbt` command for creating a PSBT that can receive funds to the on-chain wallet.
1 parent ce2a618 commit fe7a91c

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Core Lightning Documentation
100100
lightning-preapproveinvoice <lightning-preapproveinvoice.7.md>
101101
lightning-preapprovekeysend <lightning-preapprovekeysend.7.md>
102102
lightning-recoverchannel <lightning-recoverchannel.7.md>
103+
lightning-recvpsbt <lightning-recvpsbt.7.md>
103104
lightning-renepay <lightning-renepay.7.md>
104105
lightning-renepaystatus <lightning-renepaystatus.7.md>
105106
lightning-reserveinputs <lightning-reserveinputs.7.md>

doc/lightning-recvpsbt.7.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
lightning-recvpsbt -- Command to populate PSBT outputs from the wallet
2+
================================================================
3+
4+
SYNOPSIS
5+
--------
6+
7+
**recvpsbt** *satoshi* [*initialpsbt*] [*locktime*]
8+
9+
DESCRIPTION
10+
-----------
11+
12+
`recvpsbt` is a low-level RPC command which creates or modifies a PSBT
13+
by adding a single output of amount *satoshi*.
14+
15+
This is used to receive funds into the on-chain wallet interactively
16+
using PSBTs.
17+
18+
*satoshi* is the satoshi value of the output. It can
19+
be a whole number, a whole number ending in *sat*, a whole number
20+
ending in *000msat*, or a number with 1 to 8 decimal places ending in
21+
*btc*.
22+
23+
*initialpsbt* is a PSBT to add the output to. If not speciifed, a PSBt
24+
will be created automatically.
25+
26+
*locktime* is an optional locktime: if not set, it is set to a recent
27+
block height (if no initial psbt is specified).
28+
29+
EXAMPLE USAGE
30+
-------------
31+
32+
Here is a command to make a PSBT with a 100,000 sat output that leads
33+
to the on-chain wallet.
34+
```shell
35+
lightning-cli recvpsbt 100000sat
36+
```
37+
38+
RETURN VALUE
39+
------------
40+
41+
[comment]: # (GENERATE-FROM-SCHEMA-START)
42+
On success, an object is returned, containing:
43+
44+
- **psbt** (string): Unsigned PSBT which fulfills the parameters given
45+
- **estimated\_added\_weight** (u32): The estimated weight of the added output
46+
- **outnum** (u32): The 0-based number where the output was placed
47+
48+
[comment]: # (GENERATE-FROM-SCHEMA-END)
49+
50+
AUTHOR
51+
------
52+
53+
@dusty\_daemon
54+
55+
SEE ALSO
56+
--------
57+
58+
lightning-fundpsbt(7), lightning-utxopsbt(7)
59+
60+
RESOURCES
61+
---------
62+
63+
Main web site: <https://github.com/ElementsProject/lightning>
64+
65+
[comment]: # ( SHA256STAMP:fad04aa277b18392570cc1ba6302506dadc71d1e3844720cb5c1b74812d731f2)

doc/schemas/recvpsbt.request.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"required": [
6+
"satoshi"
7+
],
8+
"added": "v23.08.1",
9+
"properties": {
10+
"satoshi": {
11+
"type": "msat"
12+
},
13+
"locktime": {
14+
"type": "u32"
15+
},
16+
"initialpsbt": {
17+
"type": "string",
18+
"description": "the (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically"
19+
}
20+
}
21+
}

doc/schemas/recvpsbt.schema.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"required": [
6+
"psbt",
7+
"estimated_added_weight",
8+
"outnum"
9+
],
10+
"added": "v23.08.1",
11+
"properties": {
12+
"psbt": {
13+
"type": "string",
14+
"description": "Unsigned PSBT which fulfills the parameters given"
15+
},
16+
"estimated_added_weight": {
17+
"type": "u32",
18+
"description": "The estimated weight of the added output"
19+
},
20+
"outnum": {
21+
"type": "u32",
22+
"description": "The 0-based number where the output was placed"
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)