Compare commits
14 Commits
72ef5c2929
...
286972c766
Author | SHA1 | Date |
---|---|---|
|
286972c766 | |
|
2ace01cf1a | |
|
2ec7833e8e | |
|
56c8556855 | |
|
0bc0c7d317 | |
|
91c2a8a8c9 | |
|
db5b8c7d4a | |
|
00218c6de9 | |
|
32bd6de504 | |
|
3a09d4aa7c | |
|
459b10793a | |
|
a8ea432727 | |
|
3a1393a861 | |
|
5d4d79228a |
18
47.md
18
47.md
|
@ -667,3 +667,21 @@ Here are some properties that are recognized by some NWC clients:
|
|||
"sig": "31f57b369459b5306a5353aa9e03be7fbde169bc881c3233625605dd12f53548179def16b9fe1137e6465d7e4d5bb27ce81fd6e75908c46b06269f4233c845d8"
|
||||
}
|
||||
```
|
||||
|
||||
### Deep-links
|
||||
|
||||
Wallet applications can register deeplinks in mobile systems to make it possible to create a linking UX that doesn't require the user scanning a QR code or pasting some code.
|
||||
|
||||
`nostrnwc://connect` and `nostrnwc+{app_name}://connect` can be registered by wallet apps and queried by apps that want to receive an NWC pairing code.
|
||||
|
||||
All URI parameters, MUST be URI-encoded.
|
||||
|
||||
URI parameters:
|
||||
* `appicon` -- URL to an icon of the client that wants to create a connection.
|
||||
* `appname` -- Name of the client that wants to create a connection.
|
||||
* `callback` -- URI schema the wallet should open with the connection string
|
||||
|
||||
Once a connection has been created by the wallet, it should be returned to the client by opening the callback with the following parameters
|
||||
* `value` -- NWC pairing code (e.g. `nostr+walletconnect://...`)
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
NIP-83
|
||||
======
|
||||
|
||||
Wallet connect/bridge
|
||||
--------------
|
||||
|
||||
`draft` `optional` `author:arcbtc` `author:blackcoffeexbt`
|
||||
|
||||
Useful for clients wanting to intergrate wallet features, could be custodial or non-custodial or both.
|
||||
|
||||
> Intended for use with bitcoin, but could be used with any invoice payment system that can pay invoices/create invoices/check payment status.
|
||||
|
||||
## Motivation
|
||||
|
||||
All bitcoin lightning wallet clients connected to nodes use http, they should also be able to use nostr.
|
||||
|
||||
Simple plugins/middleware/libraries could be easily made for existing nodes and lightning wallet software.
|
||||
|
||||
## Examples
|
||||
|
||||
There are two simple clients sending json over [NIP04](https://github.com/nostr-protocol/nips/blob/master/04.md). These clients could be standalone or built into clients/services.
|
||||
|
||||
1. `funding source client`: Connected to the funding source.
|
||||
|
||||
2. `service client`: Built into service/client that wants wallet functions.
|
||||
|
||||
### Permissions
|
||||
|
||||
In `funding source client` nostr pubkeys used by `service client` are given and permissions granted (such as `read`/`create_invoice_only`/`pay_invoices`)
|
||||
|
||||
### Creating an invoice
|
||||
|
||||
`service client` sends `create_invoice` event:
|
||||
|
||||
```json
|
||||
{
|
||||
"create_invoice":{
|
||||
"amount":"int",
|
||||
"memo":"<Optional[str]>",
|
||||
"description_hash":"<Optional[bytes]>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`funding source client` checks the pubkey has permission and sends `generated_invoice` event:
|
||||
|
||||
```json
|
||||
{
|
||||
"generated_invoice":{
|
||||
"payment_hash":"<string>",
|
||||
"payment_request":"<string>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Paying an invoice
|
||||
|
||||
`service client` sends `pay_invoice` event:
|
||||
|
||||
```json
|
||||
{
|
||||
"pay_invoice":{
|
||||
"invoice":"<string>",
|
||||
"note":"<Optional[str]>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`funding source client` checks the pubkey has permission and attempts to pay the invoice.
|
||||
|
||||
### Checking a payment in/out
|
||||
|
||||
`service client` sends `check_payment` event:
|
||||
|
||||
```json
|
||||
{
|
||||
"check_payment":{
|
||||
"payment_hash":"<string>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`funding source client` checks the pubkey has permission, checks the payment status and sends `payment_status` event:
|
||||
|
||||
```json
|
||||
{
|
||||
"payment_status":{
|
||||
"payment_hash":"<string>",
|
||||
"paid":"<bool>"
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue