Skip to content

Moving funds Bitcoin transaction #3767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 19, 2024
Merged

Moving funds Bitcoin transaction #3767

merged 13 commits into from
Feb 19, 2024

Conversation

tomaszslabon
Copy link
Contributor

@tomaszslabon tomaszslabon commented Jan 29, 2024

#Refs: #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:

  • initial validation of the moving funds proposal against the Ethereum network
  • waiting 32 Ethereum blocks to ensure the commitment transaction has permanently entered the blockchain and will not be removed by a chain reorganisation
  • final validation of the moving funds proposal against the Ethereum network which is needed to ensure the commitment was not changed during waiting
  • assembling the moving funds Bitcoin transaction
  • signing the moving funds Bitcoin transaction
  • broadcasting the moving funds Bitcoin transaction

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.

@tomaszslabon tomaszslabon self-assigned this Jan 29, 2024
@tomaszslabon tomaszslabon changed the base branch from main to moving-funds-commitment January 29, 2024 17:06
@tomaszslabon tomaszslabon force-pushed the moving-funds-commitment branch from 62e8f0a to d2b5cc0 Compare February 5, 2024 14:21
Base automatically changed from moving-funds-commitment to main February 8, 2024 10:23
@tomaszslabon tomaszslabon force-pushed the moving-funds-btc-tx branch 2 times, most recently from d3e5e8b to b2114a1 Compare February 14, 2024 16:21
@tomaszslabon tomaszslabon marked this pull request as ready for review February 16, 2024 11:30
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just some small comments and I'm happy to merge

@lukasz-zimnoch lukasz-zimnoch merged commit f80bb55 into main Feb 19, 2024
@lukasz-zimnoch lukasz-zimnoch deleted the moving-funds-btc-tx branch February 19, 2024 11:23
@lukasz-zimnoch lukasz-zimnoch added this to the v2.1.0 milestone Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants