bisq-network / projects

@bisq-network project management
https://bisq.wiki/Project_management
9 stars 2 forks source link

Migrate to Tor v3 onion service protocol #23

Closed freimair closed 3 years ago

freimair commented 4 years ago

This project is about migrating from Tor Hidden Services version 2 to Tor onion services version 3 and the required steps to do so.

Rationale

Why do we want to update?

Why do we want to update now?

Risks

Details The Onion Router (TOR) offers a [version 3 of its hidden service technology](https://blog.torproject.org/tors-fall-harvest-next-generation-onion-services) (HSv3) for quite [some time](https://blog.torproject.org/we-want-you-test-next-gen-onion-services) now. Bisq, until now, held onto HSv2 because the Tor devs themselves did not consider HSv3 as ["BEST"](https://gitweb.torproject.org/torspec.git/commit/?id=b32a9bf315e270cbb35a65f2c0db1dc2f4861810), at least until Tor [v0.3.5.1](https://gitweb.torproject.org/torspec.git/commit/?id=b32a9bf315e270cbb35a65f2c0db1dc2f4861810). However, a [tiny line of code](https://trac.torproject.org/projects/tor/ticket/29669) prevented HSv3 to actually become the expected default back then, so we spent our time working on other Bisq issues. Now, motivated by an upcoming tor [0.4.2](https://trac.torproject.org/projects/tor/query?id=29669) and https://github.com/bisq-network/bisq/issues/2873 it is time to seriously think about HSv3 and how Bisq can make a transition from HSv2 to HSv3. ### Tor Hidden Service Versions - non-functional differences [source](https://2019.www.torproject.org/docs/tor-onion-service.html.en#four) - HSv3 has improves security/privacy - HSv3 features new introduction/rendezvous protocol (may boost performance - source needed!) - HSv3 features a cleaner codebase - technical differences [source](https://trac.torproject.org/projects/tor/wiki/doc/HiddenServiceNames) - 56 char address HSv3 vs. 16 char address in HSv2 - HSv3 is based on SHA3 and EC cryptography, HSv2 is based on SHA1 and RSA cryptography (in words, SHA1 is on the brink of being broken, and Elliptic Curve Cryptography (ECC) is more futureproof AND faster than the old and trusty RSA)

Tasks

Milestone: Get Bisq ready to talk to HSv3

### Tasks - [x] upgrade v2 to v3 in a branch ([via](https://github.com/bisq-network/bisq/pull/4028)) - [x] deploy a test network and test all platforms, mix of v2 clients and v3 - [x] measure performance improvements, if any - [x] decide whether to move forward ### Criteria for delivery - [x] successful TestPlan test run - all major platforms - mix of v2 and v3 clients - mix of v2 and v3 seed nodes - [x] publish performance eval here and [there](https://github.com/bisq-network/proposals/issues/101) - client startup time - message RTT using Ping/Pong - get baseline from https://monitor.bisq.network ### Estimates - USD 400,00 to update tor - USD 1200,00 for testing - USD 400,00 to create performance reports

Milestone: Ship it

### Tasks - [x] make Bisq report its HS version to the pricenodes, similar to the Bisq version [via](https://github.com/bisq-network/bisq/pull/4027) - [x] amend version spread metric infrastructure to also collect hidden service version spread [via](https://github.com/bisq-network/bisq/pull/4027) - [x] deploy/upgrade the metric infrastructure - [x] configure https://monitor.bisq.network to display HS version spread similarly to Bisq version spread - [x] create one new seednode to use v3 hostname ([here it is](https://monitor.bisq.network/d/qclhStdWz/server-metrics?orgId=1&var-Server=wizseedscybbttk4bmb2lzvbuk2jtect37lcpva4l3twktmkzemwbead)) - [x] add it to the main seed nodes for the upcoming release ([via](https://github.com/bisq-network/bisq/pull/4113)) - [x] look to support team to report potential issues - brief them - alert them to specific error cases - [x] release feature - [x] wait and see how it goes over time ### Criteria for delivery - [x] all new clients use v3 hostnames (release the feature) - [x] create one new seednode use v3 hostname - [x] deliver a report to foster a decision on whether we proceed to milestone 3 - report is due on 2020-06-30 ### Estimates - USD 950,00 for additional metrics - USD 250,00 for v3 seednode (200) + make it a default seednode in Bisq-update (50) - USD 500,00 for report

Milestone: Allow old clients to upgrade

Since Tor has officially deprecated Tor onion services v2 source we should prepare Bisq as well. Final deadline (v2 is no longer available) is 2021-07-15, although, we can delay adapting to new tor binaries and thus gain a few days, on the other hand, Tor will show warnings in upcoming releases (as soon as 2020-09-15, i.e. next week) and we do not know how good their v2 "DNS" servers will hold up. Finally, on 2021-10-15 there will be no v2 "DNS" servers anymore and thus, v2 onion addresses will not be accessible anymore.

Tasks

Please note that compensation for the first three points should be available as soon as these tools make it into master. There is no point in delaying the compensation for a year. The tools necessary for executing the timeline may only be created according to the timeline.

Milestone: Cleanup

Tasks

cbeams commented 4 years ago

Reflecting our call last week on this project, I've just applied the has:approval and has:budget labels with regard to the first (proof of concept) milestone. @freimair, please transition this issue to the In progress column if indeed work is underway (which I believe it is).

freimair commented 4 years ago

Report Review Meeting 2020-03-19

cbeams commented 4 years ago

Roger that, @freimair. Thanks for the update even in the absence of yesterday's planned (but cancelled) review meeting.

freimair commented 4 years ago

Performance eval

TL;DR hidden service publishing time has dropped from around 33 seconds to <5 seconds, no significant changes otherwise

Recent changes to Bisq had an impact on the startup times already, so I decided to get the baseline manually instead of relying on the monitor.

Isolated Tor measurements

Screenshot from 2020-03-30 21-38-46 Screenshot from 2020-03-30 21-41-08 Screenshot from 2020-03-30 21-39-54 raw data

Integration Tests

![Screenshot from 2020-03-31 11-08-40](https://user-images.githubusercontent.com/1070734/78014210-e5976d00-7347-11ea-9781-fe562ac4f831.png) ![Screenshot from 2020-03-31 11-09-21](https://user-images.githubusercontent.com/1070734/78014222-e92af400-7347-11ea-9d47-cb11e2040f65.png) [raw data](https://github.com/bisq-network/projects/files/4408264/bisq-results.zip)
cbeams commented 4 years ago

@freimair, could you give a status update about this project?

freimair commented 4 years ago

Everything is done for Milestone 2 except the "wait and see how it goes over time" part which will be concluded by the upcoming report.

Overall, it seems that v3 onion services did the project no harm whatsoever. I have been monitoring support and issues and there is not a single hint that something does not work - quite the contrary, it feels like support issues regarding tor connection issues and/or startup-issues for people using system tor have vanished. Will do a proper report as scheduled.

freimair commented 4 years ago

Closing report on milestone: "Ship it"

There have been no reports that would indicate something not working properly or causing issues with Tor onion services v3. Quite the contrary, it seems like connection issues have gone down. It even seems that people have upgraded to v3 on their own - at least that is one explanation of the number of v3 hosts in the Bisq P2P network has reached the neighborhood of 40% already.

Screenshot from 2020-07-16 14-08-45

All in all, although we could and probably should have done it earlier, moving to Tor onion services v3 has been a success.

ripcurlx commented 4 years ago

Regarding the next steps for this project. I would only add the option to update to a new v3 address without taking the reputation over. I don't think it is worth the hassle to do this.

wiz commented 4 years ago

Well, now that V2 is officially deprecated, migrating to V3 is required and we will need to force all users to migrate to V3 onions at some point in the future. Some kind of migration plan like:

freimair commented 4 years ago

basically:

  1. do we want to just move users to v3 once or
  2. do we want to allow them to change their address at will?

both need similar preparations. in order to safely change the hidden service host users need to

violating these preconditions will result in unrecoverable trade states and lost funds.

Once we hit wiz's third step, we need to do these checks automatically.

My suggestion is to reactivate this one year old PR: https://github.com/bisq-network/bisq/pull/3044. It provides the tools to follow wiz's proposed timeline.

Your opinion?

chimp1984 commented 3 years ago

@ripcurlx @cbeams Can we close that project?

cbeams commented 3 years ago

Closing as complete given that we have in fact migrated to Tor v3. The milestone on allowing clients to upgrade was not completed, but it appears to be a separate concern at this point.

cbeams commented 3 years ago

I've also closed the associated project board at https://github.com/orgs/bisq-network/projects/15.