Skip to content
Open
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
51aa4ce
Adding support for main bolt12 commands to NIP-47
21M4TW Jun 11, 2025
114f8a0
-Generalising the description of invoice strings (from bolt11 to
21M4TW Jun 11, 2025
00acfb4
-Removing the fetch_invoice command as it is not needed.
21M4TW Jun 17, 2025
a155602
-Adding offer issuer field where applicable
21M4TW Jun 17, 2025
3de36b4
-Adding support for other currencies when making and listing offers, for
21M4TW Jun 17, 2025
1cffc22
-Adding offer_id field for bolt12 invoices, when applicable.
21M4TW Jun 17, 2025
c9938b5
-multi_pay_invoice: -Update description for amount
21M4TW Jun 17, 2025
50ea1c1
Merge branch 'nostr-protocol:master' into nip47_add_bolt12_support
21M4TW Jul 12, 2025
e1a6c01
Merge branch 'nostr-protocol:master' into nip47_add_bolt12_support
21M4TW Jul 25, 2025
eb3b4b9
get_offer_info: Fixing the input parameter (offer instead of offer_id).
21M4TW Jul 25, 2025
bcc18d3
-Dropping the lookup_offer method. Integrating the functionality into
21M4TW Jul 26, 2025
7b743aa
-Splitting the pay_invoice and multi_pay_invoice methods into
21M4TW Jul 28, 2025
6c69b2c
Update 47.md
staab Nov 12, 2025
98dbb60
Merge branch 'master' into nip47_add_bolt12_support
21M4TW Nov 18, 2025
e62d132
-Removing multi_pay_offer as these multi_* methods are not used
21M4TW Nov 18, 2025
3a4633d
Merge branch 'nostr-protocol:master' into nip47_add_bolt12_support
21M4TW Dec 2, 2025
5041c0d
-Removing the possibility of activating/disabling an offer.
21M4TW Dec 6, 2025
687154a
Merge branch 'master' into nip47_add_bolt12_support
21M4TW Dec 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 200 additions & 3 deletions 47.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Request:
{
"method": "pay_invoice",
"params": {
"invoice": "lnbc50n1...", // bolt11 invoice
"invoice": "lnbc50n1...", // bolt11/bolt12 invoice
Comment thread
21M4TW marked this conversation as resolved.
Outdated
"amount": 123, // invoice amount in msats, optional
Comment thread
21M4TW marked this conversation as resolved.
Outdated
}
}
Expand Down Expand Up @@ -176,7 +176,7 @@ Request:
"method": "multi_pay_invoice",
"params": {
"invoices": [
{"id":"4da52c32a1", "invoice": "lnbc1...", "amount": 123}, // bolt11 invoice and amount in msats, amount is optional
{"id":"4da52c32a1", "invoice": "lnbc1...", "amount": 123}, // bolt11/bolt12 invoice and amount in msats, amount is optional
{"id":"3da52c32a1", "invoice": "lnbc50n1..."},
],
}
Expand Down Expand Up @@ -413,6 +413,203 @@ Response:
}
```

### `make_offer`

Request:
```jsonc
{
"method": "make_offer",
"params": {
"amount": 123, // minimum value in msats, optional
"description": "string", // offer's description, optional
"absolute_expiry": unixtimestamp, // absolute expiry time of the offer, optional
"single_use": false // only allow the offer to be used once, optional, default false
Comment thread
21M4TW marked this conversation as resolved.
Outdated
}
}
```

Response:
```jsonc
{
"result_type": "make_offer",
"result": {
"offer": "lno1pgx...", // encoded offer
"description": "string", // offer's description, optional
"amount": 123, // minimum value in msats, optional
"offer_id": "string", // the id of the offer
"active": true, // whether the offer is enabled
"single_use": false, // whether the offer can only be used once
"used": false, // whether the offer has been used
"created_at": unixtimestamp, // offer creation time
"updated_at": unixtimestamp // offer update time
}
}
```

### `lookup_offer`

Request:
```jsonc
{
"method": "lookup_offer",
"params": {
"offer_id": "string", // the id of the offer
Comment thread
21M4TW marked this conversation as resolved.
Outdated
}
}
```

Response:
```jsonc
{
"result_type": "lookup_offer",
Comment thread
21M4TW marked this conversation as resolved.
Outdated
"result": {
"offer": "lno1pgx...", // encoded offer
"description": "string", // offer's description, optional
"amount": 123, // minimum value in msats, optional
"offer_id": "string", // the id of the offer
"active": true, // whether the offer is enabled
Comment thread
21M4TW marked this conversation as resolved.
Outdated
"single_use": false, // whether the offer can only be used once
"used": false, // whether the offer has been used
Comment thread
21M4TW marked this conversation as resolved.
"created_at": unixtimestamp, // offer creation time
"updated_at": unixtimestamp // offer update time
}
}
```

Errors:
- `NOT_FOUND`: The offer could not be found by the given parameters.

### `enable_offer`

Request:
```jsonc
{
"method": "enable_offer",
"params": {
"offer_id": "string", // the id of the offer
}
}
```

Response:
```jsonc
{
"result_type": "enable_offer",
"result": {
"offer_id": "string", // the id of the offer
"active": true, // the offer is enabled, always true
}
}
```

Errors:
- `NOT_FOUND`: The offer could not be found by the given parameters.

### `disable_offer`
Comment thread
21M4TW marked this conversation as resolved.
Outdated

Request:
```jsonc
{
"method": "disable_offer",
"params": {
"offer_id": "string", // the id of the offer
}
}
```

Response:
```jsonc
{
"result_type": "disable_offer",
"result": {
"offer_id": "string", // the id of the offer
"active": false, // the offer is enable, always false
}
}
```

Errors:
- `NOT_FOUND`: The offer could not be found by the given parameters.

### `list_offers`

Lists offers. The `from` and `until` parameters are timestamps in seconds since epoch. If `from` is not specified, it defaults to 0.
If `until` is not specified, it defaults to the current time. Offers are returned in descending order of creation
time.

Request:
```jsonc
{
"method": "list_offers",
"params": {
"from": 1693876973, // starting timestamp in seconds since epoch (inclusive), optional
"until": 1703225078, // ending timestamp in seconds since epoch (inclusive), optional
"limit": 10, // maximum number of invoices to return, optional
"offset": 0, // offset of the first invoice to return, optional
"active": true, // whether the offer is enabled, optional
"single_use": false, // whether the offer can only be used once, optional
"used": false // whether the offer has been used, optional
}
}
```

Response:
```jsonc
{
"result_type": "list_offers",
Comment thread
21M4TW marked this conversation as resolved.
"result": {
"offers": [
{
"offer": "lno1pgx...", // encoded offer
"description": "string", // offer's description, optional
"amount": 123, // minimum value in msats, optional
"offer_id": "string", // the id of the offer
"active": true, // whether the offer is enabled
"single_use": false, // whether the offer can only be used once
"used": false, // whether the offer has been used
"created_at": unixtimestamp, // offer creation time
"updated_at": unixtimestamp // offer update time
}
],
},
}
```

### `fetch_invoice`

Request:
```jsonc
{
"method": "fetch_invoice",
"params": {
"offer": "lno1pgx...", // encoded offer
"amount": 123, // value in msats, optional
"payer_note": "string", // note to be included in fetched invoice, optional
}
}
```

Response:
```jsonc
{
"result_type": "fetch_invoice",
"result": {
"invoice": "lni1qqg...", // encoded bolt12 invoice
"description": "string", // invoice's description, optional
"description_hash": "string", // invoice's description hash, optional
"payer_note": "string", // note from payer included in fetched invoice, optional
"payment_hash": "string", // Payment hash for the payment
"amount": 123, // value in msats, optional
"offer_id": "string", // the id of the offer
"created_at": unixtimestamp, // invoice/payment creation time
"expires_at": unixtimestamp, // invoice expiration time, optional if not applicable
}
}
```

Errors:
- `FETCH_INVOICE_FAILED`: The invoice fetching failed. This may be due to an invalid offer, a timeout, or another issue.

### `get_info`

Request:
Expand All @@ -434,7 +631,7 @@ Response:
"network": "string", // mainnet, testnet, signet, or regtest
"block_height": 1,
"block_hash": "hex string",
"methods": ["pay_invoice", "get_balance", "make_invoice", "lookup_invoice", "list_transactions", "get_info"], // list of supported methods for this connection
"methods": ["pay_invoice", "get_balance", "make_invoice", "lookup_invoice", "list_transactions", "make_offer", "lookup_offer", "enable_offer", "disable_offer", "list_offers", "fetch_invoice", "get_info"], // list of supported methods for this connection
"notifications": ["payment_received", "payment_sent"], // list of supported notifications for this connection, optional.
}
}
Expand Down