-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] Atomic trade #4414
Closed
Closed
[WIP] Atomic trade #4414
Conversation
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
Move donation address validation to its own class. Will be needed for atomic transaction validation.
Add a hidden account type that's automatically used for BSQ trades. This means old orders not using AtomicAccount can still complete the trades as per normal and new offers placed with AtomicAccount can be taken by anyone with an upgraded client, but won't be possible to take by users with older clients. The atomic account is added on startup if not already added. There is no data associated with the account, a new BSQ address will be chosen automatically during the atomic trade process.
Refactor signTx and allow for signing of only some inputs
Atomic trade protocol is completed in one request -> response interaction between taker and maker. 1. Taker sends a CreateAtomicTxRequest to maker. This includes all the data needed to create and sign the atomic tx from maker's side. 1. Maker verifies all inputs and answers with CreateAtomicTxResponse that includes an atomic tx with maker's inputs signed. 1. Taker verifies the inputs and that their own outputs are paid as expected, signs and publishes the completed atomic tx. 1. Fin There is only one TakerVerifies and one MakerVerifies task as the buy and sell side are very similar, the main difference lies in whether the actor is taker or maker. It's currently not possible to verify BTC inputs, but bad inputs (such as spent ones) would generate a tx that won't broadcast. No funds can be lost as the outputs are verified on both sides.
Show atomic trades as such in transaction views, both BTC and BSQ transaction view.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This looks amazing. Looking forward to seeing it implemented! |
This is great thanks for this. Looking forward to try it out. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a new account type, Atomic BSQ with a separate trade protocol, see bisq-network/proposals#50
Atomic trade protocol is completed in one request -> response interaction between taker and maker.
There is still a minimum 15% deposit to avoid messing around too much with current trade protocol. It's not actually needed since the trade is an atomic transaction, but I leave that as a future improvement.
Can't be taken by an old client since the account type doesn't exist
Take with new client, requires to have the deposit, but it's not used apart from checking that it's available during the take offer process.
Trade completes immediately.
Shows in transactions as atomic
Need a confirmation before it can show the type of BSQ tx
After confirmation