WIP: onchain bitcoin payment method #283
No reviewers
Labels
No labels
breaking change
bug
documentation
enhancement
needs discussion
needs implementation
new nut
ready
wallet-only
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo-admin/nuts!283
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nut26-onchain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -0,0 +299,4 @@"unit": "sat","fee": 5000,"estimated_blocks": 1,"state": "PENDING",should a melt be considered PAID as soon as the mint broadcasts the transaction, or should PENDING mean the transaction was broadcast but not yet mined?
Also, what happens if fees spike and the transaction does not confirm? Is it the mint or wallet's responsibility?
It seems to me like the mint should pick a
fee_reservethat it is comfortable with and then it is the mint's responsibility to make sure the transaction gets mined.UPDATE:
after discussions with tsk I made some changes to this nut and now PENDING means that the transaction is being processed by the mint. Processing can either be waiting for a batched transaction to be broadcast or while the tx is in the mempool. COMPLETED means the transaction has been mined into a block.
On fees, the mint can return multiple melt quotes with absolute fees based on user's desired confirmation time. If fees spike the mint can choose to fail the melt quote and release the pending proofs, or the mint can dip into some fee reserve wallet to cover it's bad estimate
@ -0,0 +1,339 @@# NUT-26: OnchainThe unconfirmed amount should be optional, since it could be omitted by certain PaymentBackend implementations.
@ -0,0 +32,4 @@"unit": <str_enum[UNIT]>,"expiry": <int|null>,"pubkey": <str>,"amount_paid": <int>,Suggesting to rename
amount_paidtoamount_confirmed@ -0,0 +1,339 @@# NUT-26: OnchainThe nice thing about keeping this as
amount_paidis its the same for bolt12 so the implementation is easier because for bolt12 and onchain quote you can compareamount_paidwithamount_issued.@ -0,0 +1,339 @@# NUT-26: OnchainI would prefer to keep it for this reason as well.
@ -0,0 +285,4 @@**Melt request**:```bashcurl -X POST https://mint.host:3338/v1/melt/onchain -d \I think we need to revist this for onchain and we should just do it for all of them while were at it. https://github.com/cashubtc/nuts/issues/37.
But for onchain specifically it make no sense to wait for the melt to confirm and request should return okay once it is received.
@ -0,0 +285,4 @@**Melt request**:```bashcurl -X POST https://mint.host:3338/v1/melt/onchain -d \If we are going to say that a melt quote does not complete until the transaction is confirmed, then yeah. If a completed melt quote means the transaction was broadcast, then it seems fine to wait.
Was that the consensus that the quote stays pending until the transaction is confirmed?
@ -0,0 +285,4 @@**Melt request**:```bashcurl -X POST https://mint.host:3338/v1/melt/onchain -d \What if a mint wants to batch then it doesn't work for broadcast even.
@ -0,0 +1,339 @@# NUT-26: OnchainThis should be outpoint not just txid.
txid:vout@ -0,0 +241,4 @@**Melt quote response**:```json@ -0,0 +241,4 @@**Melt quote response**:```jsonoh duh, thanks I updated it
@ -0,0 +285,4 @@**Melt request**:```bashcurl -X POST https://mint.host:3338/v1/melt/onchain -d \Is there a change you suggest I make here? In NUT-05 it says:
"For methods that involve external payments (like Lightning), this call may block until the payment either succeeds or fails. This can take a long time. Make sure to use no (or a very long) timeout when making this call!"
The way this nut is now seems fine as it shows that a "successful melt response" returns the quote as PENDING and NUT-05 is pretty open-ended in that it says, "this call may block".
close for https://github.com/cashubtc/nuts/pull/365
Pull request closed