cyphernode icon indicating copy to clipboard operation
cyphernode copied to clipboard

Elements function: pegin

Open FrancisPouliot opened this issue 5 years ago • 3 comments

An automated function: pegin

  • amount
  • (optional) from_wallet [default = default spender wallet]
  • (optional) to_wallet [default = default elements wallet]

Calling this function will do this:

  1. getpeginaddress from Liquid
  2. sendtoaddress from Bitcoin Core Wallet
  3. gettransactiondetails on Bitcoin Core
  4. gettxoutproof on Bitcoin Core
  5. watchtxid and wait 102 confirmation
  6. after 102 confirmations claimpegin with Liquid with BitcoinTX and txoutproof

Ideally this would also save the peginaddress alongside the mainchain txid and the sidechain txid

getpeginaddresses

returns all pegin addresses created with

  • amount
  • txid
  • confirmations
  • claimed
  • unclaimed

FrancisPouliot avatar Feb 07 '20 17:02 FrancisPouliot

Expected user experience outcome is that a client app calls the "pegin" api endpoint and only has to specify an amount. If there are enough funds in the Bitcoin Core wallet which is used to make the pegin, there should be nothing else the client needs to do.

The client can specify a callback URL and receive notifications about the pegin, which would include the Bitcoin txid and the liquidtxid. Client should be notified when the pegin is completed.

BullishNode avatar Jan 08 '24 02:01 BullishNode

https://github.com/Impa10r/peerswap-web

BullishNode avatar Apr 30 '24 22:04 BullishNode