keep-network / keep-core

The smart contracts and reference client behind the Keep network
https://keep.network
MIT License
118 stars 73 forks source link

Moving funds Bitcoin transaction #3767

Closed tomaszslabon closed 6 months ago

tomaszslabon commented 7 months ago

Refs: https://github.com/keep-network/keep-core/issues/3734.

This PR introduces the creation of Bitcoin moving funds transaction which allows funds to be transferred between source wallet and target wallets.

The creation of the Bitcoin moving funds transaction is the responsibility of movingFundsAction which is executed after moving funds commitment has been submitted. Executing the movingFundsAction consists of several steps:

The moving funds Bitcoin transaction consists of one input (main wallet UTXO of the source wallet) and one or more outputs (one output for each target wallet). The outputs are all P2WPKH.

The three moving funds transactions used in tests were actually broadcasted within the Bitcoin testnet network to get the final confirmation that the transactions were correctly contructed.