SatoshiPortal / cyphernode

Modular Bitcoin full-node microservices API server architecture and utilities toolkit to build scalable, secure and featureful apps and services without trusted third parties
MIT License
363 stars 68 forks source link

Elements function: pegin #163

Open FrancisPouliot opened 4 years ago

FrancisPouliot commented 4 years ago

An automated function: pegin

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

BullishNode commented 8 months ago

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 commented 4 months ago

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