-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add atomic swap htlc sending and claiming (#3552)
Description --- This Pr adds in the ability to send and claim HTLC transactions. This is added to the console wallet UI and GRPC commands. UI: `tari_console_wallet --command "init-sha-atomic-swap <Amount> <Bob pubkey> <Message>"` This is used to initialize an atomic swap for the XTR side `tari_console_wallet --command "finalise-sha-atomic-swap <Output hash> <pre_image hex>"` This is used to finalize and claim an HTLC transaction for the XTR side. GRPC: `rpc SendShaAtomicSwapTransaction(SendShaAtomicSwapRequest) returns (SendShaAtomicSwapResponse);` This is used to initialize an atomic swap for the XTR side `rpc ClaimShaAtomicSwapTransaction(ClaimShaAtomicSwapRequest) returns (ClaimShaAtomicSwapResponse);` This is used to finalize and claim an HTLC transaction for the XTR side. Motivation and Context --- This is the first step in allowing Atomic swaps for Tari and coins that have SHA256 as a pre_image. Currently, the available commands in this PR and tools available we can do the happy path of an atomic swap for: Bitcoin Bitcoin Cash (Bitcoin ABC, Bitcoin Unlimited, Bitcoin XT) Decred Litecoin Monacoin Particl Qtum Vertcoin Viacoin Zcoin How Has This Been Tested? --- Added unit and cucumber tests for the Tari side. Did a manual XTR BTC atomic swap XTR UTXO hash: `186a95239d16ebf800cb3b7991521585b569253255002b009b16f11faab8d115` BTC tx_ids: `1f770ce82aeb1f6c0d0345a6a88f1b3eb2e226595063491c93ad442625f678ae` `2b6e2e2566577e8e52da685e2abb4252b98fc4a60dc9a1b09a56e6b003900bc9`
- Loading branch information
1 parent
433bc46
commit a185506
Showing
24 changed files
with
5,740 additions
and
459 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.