Skip to content
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

implement protocol v2 #107

Merged
merged 2 commits into from
Sep 7, 2021
Merged

implement protocol v2 #107

merged 2 commits into from
Sep 7, 2021

Conversation

woodser
Copy link
Contributor

@woodser woodser commented Aug 18, 2021

This PR reaches parity with master using the new trade protocol:

  • Outputs are reserved locally until used in a trade to avoid unecessary on-chain tx
  • Trades complete after 10 confirmations by direct depositing to multisig
  • Arbitrator signs "reserve tx" from maker and taker to secure trades
  • Arbitrator broadcasts deposit txs so neither maker nor taker "go first"
  • Sensitive payment account info is shared after funds are committed to multisig
  • Uses monero-java 0.5.4 to freeze and thaw outputs

@erciccione
Copy link
Contributor

erciccione commented Aug 20, 2021

Pinging @haveno-dex/developers. Reviews and feedbacks are appreciated :)

@woodser woodser force-pushed the protocol_v2 branch 3 times, most recently from b60639d to a3e737b Compare August 20, 2021 15:31
@woodser
Copy link
Contributor Author

woodser commented Aug 20, 2021

The 3 codacy checks are a result of open todos which are documented so we're ignoring them.

To test this PR:

  1. git clone https://github.com/haveno-dex/haveno.git
  2. cd haveno
  3. git pull origin pull/107/head
  4. delete existing application folders for the arbitrator, alice, and bob if haveno was previously launched
  5. follow the usual instructions to launch a test network: https://github.com/haveno-dex/haveno/blob/master/docs/installing.md

Copy link
Contributor

@erciccione erciccione left a comment

Choose a reason for hiding this comment

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

Tested it and everything went flawlessly :)

@HoverHalver
Copy link

Hello,
I did follow the above recommendations in order to test.
Everything seems fine (I just had to install monero-wallet-rpc in my ~github/haveno directory).
I'm however stupidelly stucked at the end of step 5 from
https://github.com/haveno-dex/haveno/blob/master/docs/installing.md

In monerod, I did
start_mining ADDRESS 1, for Alice's address
stop_mining
start_mining ADDRESS 1, for Bob's address
stop_mining

But :
I don't see a "funds" tab in the haveno appli ?
(like in Bisq, in order to see the funds). Is this normal ?

https://github.com/haveno-dex/haveno/blob/master/docs/installing.md
says : Remember to send funds to both Alice and Bob.
... but how to do that ?
and I though that start_mining ADDRESS 1, for Alice's address would directly put the funds on this address.

Sorry but I have never mined before.

@woodser
Copy link
Contributor Author

woodser commented Aug 23, 2021

@HoverHalver There is no funds tab for the Monero wallet in this GUI. You should see your locked balance in the upper right increase with each block mined to the trader's address. Funds received from each mined block become available to spend after 60 blocks. Your available balance is shown next to "Balance" in the upper right.

@HoverHalver
Copy link

First remarks while testing.
Concerning the funds in the upper right :
1/ probably there are way too much digits used, which doesn't help at all imo.
2/ for my Alice funds, there is ~2500 XMR available, and ~2000 XMR locked, and the Haveno appli is open for more than 10 hours. Is it normal to still have so much locked funds ? (For Bob's funds, 100% of funds are available).

@woodser
Copy link
Contributor Author

woodser commented Aug 24, 2021

for my Alice funds, there is ~2500 XMR available, and ~2000 XMR locked, and the Haveno appli is open for more than 10 hours. Is it normal to still have so much locked funds

The funds should become unlocked after 60 blocks if from mining. If you mine new blocks to the address, you'll continue to have locked funds.

@HoverHalver
Copy link

The funds should become unlocked after 60 blocks if from mining.
If you mine new blocks to the address, you'll continue to have locked funds.

I mined for Alice's address for blocks 1681 to 2125
I mined for Bob's address for blocks 2126 to 2250
Now, Status tells : 2251/2251 100% on Stagenet,
So, this is more than 126 blocks after last block mined for Alice (2125).
It seems me that Alice should have all it's funds available (?)

@woodser
Copy link
Contributor Author

woodser commented Aug 24, 2021

Do the locked funds go to zero if you restart Alice?

@HoverHalver
Copy link

Do the locked funds go to zero if you restart Alice?

My apologies, I confused Bob's account and Alice's account.
Everything is fine at this point.
Sorry for the annoyance.

@HoverHalver
Copy link

I created an offer to buy XMR with USD.
Everything seems ok at this point.
I just noticed that, in the portfolio tab, the enabled button for the offer, is red.
I would have though that green would seem more logical (?)

@woodser
Copy link
Contributor Author

woodser commented Aug 24, 2021

I just noticed that, in the portfolio tab, the enabled button for the offer, is red.
I would have though that green would seem more logical (?)

This is inherited from Bisq's UI which we are redesigning.

@HoverHalver
Copy link

I just noticed that, in the portfolio tab, the enabled button for the offer, is red.
I would have though that green would seem more logical (?)

This is inherited from Bisq's UI which we are redesigning.

Indeed, but this seems to be a Bisq v1.6.2 GUI error,
because in Bisq v1.7.2 (the last), the enabled button is green when activated.

@HoverHalver
Copy link

I just completed successfully a XMR/USD trade.
Things seems to work nicely.
If we should test some specific points, please just tell it.

It's not very clear for me what are the differences between the current Haveno protocol (https://github.com/haveno-dex/haveno/blob/master/docs/trade_protocol/trade-protocol.md) used in this PR, and the Bisq protocol ?
Would it be possible to know what are the differences ?

@erciccione
Copy link
Contributor

Would it be possible to know what are the differences ?

The main difference is that Bisq uses 2/2 multisig instead of 2/3, but there are more. You can find more info here: https://github.com/haveno-dex/haveno/wiki/FAQ and here: https://bisq.wiki/Trading_rules

@woodser woodser merged commit 58696fe into haveno-dex:master Sep 7, 2021
@erciccione erciccione mentioned this pull request Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants