xanimo / dogecoin-payment-server-archive

MIT License
1 stars 3 forks source link

Create `close` api endpoint #20

Open rllola opened 2 years ago

rllola commented 2 years ago

Abstract

The close api endpoint allows payer to ask the payee to close a payment channel before. In this scenario the merchant (aka the payee) will broadcast to a dogecoin node the most recent commitment received.

Specifications

The request would look like :

{
  "redeemscript" : "<redeemscript-hex>"
}

Using the redeem script we can determine the p2sh address to look for it in the databse. The following scenarios might happened: