-
Notifications
You must be signed in to change notification settings - Fork 172
[ZIP 308] Sprout to Sapling Migration #197
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
Conversation
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Eirik Ogilvie-Wigley <eirik@z.cash> Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
|
This is an excellent proposal, and I think overall has everything I was hoping it will have. I had some comments on the RPC interface, but otherwise, this is excellent! |
|
Some feedback from a person who I don't yet have explicit permission to identify:
I don't think there's a need to notify the user. We do need to document that zcashd should be left running during a migration. [Edit: noted here.]
Yes, this was intentional. I think a random distribution is unnecessarily complicated, although @tromer did also suggest that.
Several people suggested being able to configure the destination address, and I think we will include this.
Yes, that's a good point. |
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
|
@str4d @tromer @bitcartel @adityapk00 Can you review the responses provided to your comments and let us know if you're okay with approving this PR? |
|
Looks good to me! |
|
It's quite likely I'm overlooking something obvious, but it's not at all clear to me why there's the batching-of-transactions at a common (500-block) interval. The transactions will still look like "migration" transactions (filled with a certain value of sproutZEC, paying saplingZEC). And a hypothetical network-omniscient adversary will still see the IPs from which the batches of 1-5 transactions emerge. And I can't think of heuristics used by lesser adversaries that get confused by a bunch of transactions appearing at arbitrary intervals. What is the specific de-anonymization fear that this synchronization addresses? |
|
The ZIP currently does not mention specifying a from address (mentioned in earlier comment),also: Thus it appears the ZIP has been written from the perspective of a node being used by just a single user (making it safe to migrate funds to the default diversifier address). However, a node operator might have multiple users in the same wallet, and may have the requirement of migrating users on an ad-hoc basis i.e. users who opt-in. To avoid service disruption, a node operator might want to reduce the time it takes to migrate (within reason) so perhaps there could be range of confirmaton / block magic values. Also, in a multi-user environment, the node operator would probably want support for multiple (concurrent) migrations. Some of this might be out of scope for the ZIP but it would be worth considering how the ZIP would be interpreted by node operators in a multi user environment. |
|
@bitcartel I'll add an explicit comment to the ZIP saying that that the RPC has been designed assuming a single-user wallet. (The migration algorithm itself isn't dependent on that.) Edit: added "It is not required to support the case of single wallet being used by multiple |
|
@gojomo wrote:
The intent is to minimize any information leakage from the times at which transactions are submitted (for example due to when nodes are online). |
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
|
Mentioned in meeting:
|
|
We discussed the issue @bitcartel raised during zcashd sprint planning/review. It's a trade-off between improved privacy by ensuring that all migration transactions happen at the same time versus eliminating the risk that someone might try to exploit that to flood the network. I guesstimate the risk of a successful attack as Low, as it would take a fair amount of effort to fill up 20 blocks in a row (which is what would be required, given that the migration transactions should have the default expiry time of 20 blocks). If someone does mount a successful attack, the impact is limited (migration of users' funds will be delayed but no risk of loss of funds, etc.), and we can mitigate it by changing the migration tool's behaviour in the next suitable release. So, we're going to progress with the common 500-block interval. |
|
Can we add active measures for cycling connections for anti-surveillance and anti-eclipse purposes? I have been sketching up some ideas to disrupt metadata collection around turnstile transactions (both targeted and dragnet). Happy to discuss & get something coded up if this is not already implemented? |
|
I’ve been thinking through the outline of “A glimpse through the turnstile: a statistical post-mortem of the Zcash migration” as a mental exercise to think of heuristics that we can take preemptive action to disrupt. e.g. ToC TL;DR: To spoil the analyses in 4.1 and 4.2 I would lean towards reducing the maximum value per turnstile transaction (currently almost 1000 ZEC). Regarding 4.1: A big question is “how many individuals had funds in the sprout shielded pool?” The number of turnstile transactions provides an upper bound on that headcount (assuming one person will have multiple transactions, and transactions represent at most one person). Then Number_of_heads <= Number_of_turnstile_txns … Lowering the transaction cap to increase number of transactions per person widens the inequality and makes the upper bound less useful/representative. Regarding 4.2: Maybe this is a “bug or feature?” situation, but I personally would like to minimize the ability to empirically fit any economic metric (or its bounds)... There is some “real” Gini coefficient in the sprout shielded pool, and the fact that outputs are broken up means that the observed “fractured” Gini coefficient will be a lower bound on the real value. I have a hunch that a turnstile observer might be able to combine known turnstile breakdown rules with the fractured Gini coefficient to probabilistically reconstruct the real Gini coefficient (e.g. Monte Carlo). The more fractured the observed distribution is, harder it is to model the original distribution. Lowering the maximum turnstile value will add a lot of noise to these heuristics, (also against metadata collection if combined with the practice of connecting to a disjoint set of peers for each turnstile transaction broadcast). Currently the fee is fixed per transaction (to improve fungibility/indistinguishability), so users may object to increasing number of necessary transactions. This could be addressed by fixing the turnstile fee in ZEC/kB, which brings the same fungibility/indistinguishability benefits without incentivizing fewer transactions. I dunno, just some thoughts. Sorry if this is the wrong place to brain-dump, I will relocate if there is a more appropriate channel. :- ) (edit: also a quick note that enforcing this at the consensus protocol level would be a good way to prevent anybody creating "Turbo Turnstile" wallets that exceed the fixed fee or max amount to jump ahead of the crowd, fingerprinting their own software in the process) |
@daira, how would the time-to-migrate table be affected if we reduced the exponent range from |
zip-0308.rst
Outdated
| In particular, if the amount to migrate is large, then this strategy can | ||
| result in large amounts (up to 990 ZEC, worth USD ~49500 at time of writing) | ||
| transferred in each transaction. This leaks the fact that the transaction was | ||
| sent by a user who has at least that amount. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree with @Mitchellpkt that it is worth considering reducing the distribution of exponents, and I think 6 to 8 inclusive would be the point I'd reduce it to.
@daira could your simulation be extended to output "number of transactions required to migrate" in addition to "time required to migrate"? That would give us a sense of the effect on fees of this change.
|
Other than the point above, ACK on the ZIP contents. |
|
I'm inclined to reduce the exponent range to {6..8} as suggested. I will rerun the simulation of how long the migration takes, taking into account that change (and also outputting the number of transactions as suggested). Any dissent for changing this? |
|
Great, lowering to {6..8} should filter out the loudest information leaks. 👍 I updated the turnstile denomination notebook with the new exponent range. I'm still trying to understand benefits of this structure in the probability distribution function. We could achieve some privacy by using a continuous PDF. Alternately, we could use non-overlapping discrete denominations, e.g. 0.001 ZEC, 0.005 ZEC, etc, which would offer privacy from a different angle. The current algorithm effectively produces a compromise between the two options. It's not clear to me whether they interfere constructively or destructively, with respect to privacy. |
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
defuse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. The migration simulator code looks good too.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Eirik Ogilvie-Wigley eirik@z.cash
Co-authored-by: Daira Hopwood daira@jacaranda.org