-
Notifications
You must be signed in to change notification settings - Fork 80
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
Consider Switch commitments for future supply security #105
Comments
This may not be compatible with the Seraphis squashed enote model. |
I realized that this is a bigger issue for Monero because unmasked amounts also break ring signatures (unless some of the decoys happen to have the same amount). This can be prevented by hiding the ElGamal commitment
V3 outputs would use the derived Pedersen commitment Advantages
Drawbacks
I think the tiny drawback is more than worth it.
It has no effect on the proof construction. You use the switch commitment the same way you would use a normal Pedersen commitment until the full verification is needed in the future (then you would need a modified range proof and membership proof). |
Here is an even more efficient scheme:
This saves one commitment calculation compared to the previous scheme. When the "switch" happens, spent outputs will have to reveal |
So the more efficient scheme has the benefit of preserving the perfectly blinding property, yet can be converted to a perfectly binding scheme for the cost of a scalar add, a scalar mul, and a hash (solely on the wallet side), without bandwidth nor integration difficulties. I appreciate that. The part I don't appreciate is this doesn't solve the underlying problem IMO. Given a quantum adversary, or the likelihood of a near quantum adversary, Monero will have to ban all RCT outputs. This proposal allows Seraphis outputs to be migrated after the fact without Monero's integrity being compromised. The reason for this would be to allow Monero to be a secure, long-term store of value without a liveliness requirement which I appreciate. While this already isn't possible for RCT outputs due to the inflation possible, it is possible for pre-RCT outputs and Seraphis outputs, without risking inflation. The issue is that it's still not possible for pre-RCT outputs and Seraphis outputs as while it'd be secure for the Monero protocol, it'd be insecure from the perspective of the users. Their keys could still be compromised enabling theft of their funds. Monero, as a protocol, would be enabling this despite knowing it's a risk AND would be giving users a false belief they can migrate whenever when the clock is ticking. I'd rather Monero NOT enable a quantum adversary to commit theft, and NOT communicate to users they can migrate whenever in a race condition setting. When we have PQ cryptography, and the likelihood if a quantum adversary is high enough, I'd rather ban all outputs, clearly establishing the requirement to spend them for safety and not enabling theft. While aggressive, it's the only actually secure method. Alternatively, spend authorization keys may be augmentable with a PQ-secure scheme, just like we're discussing augmenting commitments here. Side note: Why H(D')? Why nor H(r')? If D' is factored, v can be brute forced. We can save a scalarmul by removing the privacy of this scheme, which is only intended to be used in scenarios where privacy can already be broken. I guess its private to the majority for longer, and the scalarmul is cheap enough? |
Actually, this scheme also protects from theft to a certain degree. See the security proof below.
I'm sure that Monero will quite strongly recommend users to migrate to a new scheme as soon as there is evidence that the DLP might be broken in the future. Switch commitments just give users the chance to migrate later instead of burning all unspent outputs. Also there is some chance that the discrete log of the generator
The quantum adversary will be able to learn the amount hidden in the commitment, but it doesn't mean we need to tell everyone what the original amount was. What if an adversary only knows the discrete log of Security proof sketchLet's assume a quantum adversary who can easily break DLP. Given an amount commitment The following relations are known to the adversary:
To pass consensus, the adversary must produce:
such that:
Equation 2. can be rewritten as:
Here The adversary can select a random
Assuming the output of the hash function is uniform on the interval Using the Grover's algorithm [1], the adversary can find a value of Some research suggests that SHA-3/Keccak is one of the most susceptible hash functions to quantum attacks [2], so we should probably prefer Blake2 or SHA256 for the [1] https://en.wikipedia.org/wiki/Grover%27s_algorithm |
The security estimate above also shows that the scheme where both If we set then the adversary must solve
Since both |
ACK re: theft protection which is great. NACK towards any suggestion it's unlikely for addresses to be known. It was phrased as "if" here, not unlikely, yet I do believe it's largely likely and should be considered as such. Regardless, this is now a system extending the time in which outputs can be migrated due to the protocol security offered AND the theft-resistance offered. It also has no impact on the protocol itself as we know it. Since this is now constructed as a perfectly hiding solution extending security in a PQ scenario via a conversion to a binding solution, I'm interested* to include it. When the discussion comes to activating it/relying on it, this will be yet another discussion, yet right now it's solely a minor computational burden on the wallet protocol. I don't believe this changes how it will be inevitable to ban ECC solutions entirely one day, and we are forced to accept RCT will need to banned when the time comes. This does provide a longer migration period for Seraphis though :) *it seems functional. I'm sure there can be some comment on how much it increases the time it takes to receive an output. I also can't comment on the security analysis. |
I'm expecting at least a couple decades until the switch, which would make RCT outputs only a negligible fraction of all historical outputs.
Good observation. This proposal is actually just a wallet-side change and thus does not require a hard fork. But the problem is that both the sender and the receiver need to be aware of the new protocol, so it's best to couple it to Seraphis, which will force everyone to update anyways.
This protocol could be paired with a similar change of the spend keys, which could allow for some future migration path. It was first proposed here: monero-project/monero#8418 For example, let I think CRYSTALS-Dilithium would be a good candidate for the signature scheme. It has very fast keygen (~microseconds) and the public key size is about 1.5 KB. It's also patent-free and likely to be standardized by NIST., which means it has had a fair amount of peer review. |
I am having a hard time understanding exactly how this scheme is supposed to work.
|
To prevent inflation, the requirement is
An output created at time Since the ElGamal commitment is perfectly binding, no inflation is possible when |
This still leaves a lot of questions.
|
|
This absolutely should be done with Seraphis if done. My note on it being a wallet protocol only change was solely to endorse the privacy implications, not to suggest it shouldn't be done with a hard fork. ACK on the possibility of using Dilithium, yet preferably with IETF-standardization or at least a draft close to it. NACK to usage of any PQ scheme in a wallet protocol at this time. H(P) = private spend key has the benefit of not requiring wallet software to implement a full PQ scheme on top of everything else since its single sided. So if the proposal is kept to that, ACK. |
Since we ideally need to activate the PQ mitigation long before you can go to the store and buy your personal QC to crack keys, it's not a good idea to leak the spend key. Since the view keys are derived from the spend key, publishing a large number of spend keys would essentially transform the currently opaque blockchain into a transparent one, leaking the whole history of transactions to everyone. Here is a better method. The Seraphis output key has the following format:
where The following wallet-side changes would be needed:
After "the switch", you would spend an output protected by the public key Verifiers can check that All of the partial keys are strongly bound by hashes, so they are secure against a DLP break. Advantages
Disadvantages
I think the disadvantages are quite minor. |
I confess I haven't read carefully the whole thread (sorry) because I've just discover it trying to chase after MRL matrix room.. however I would like to underline something seeming subtle to me about the starting point.... Monero uses Pedersen commitments, however I'm not sure it's theoretically hiding amounts. That's because of how RingCT are built. I have written something about it on stackexchange: https://monero.stackexchange.com/questions/11238/should-monero-use-elgamal-commitments-instead-of-pedersen-commitments/12982#12982 |
This is true for legacy Monero key recovery. I always pictured that (for normal wallets) the Seraphis
You don't need the intermediate keys
If the DLP between
This will reveal that past transactions have shared enote destinations ( |
Perfect. That means point 1. of my proposal is already taken care of.
The intermediate key The reason for the intermediate key But these are just implementation details.
The hashes bind the Knowing
which can be rewritten in terms of
The adversary can choose One attack strategy would be to select some values of
Now the expression on the right side is a constant, so satisfying the equation requires finding 2 hash preimages that sum to a specific value. One could use the Wagner's algorithm to remove a few bits of security, but nowhere near enough to make the attack feasible AFAIK.
I don't think Of course, the migrated output will be provably spent, but that's the price to pay for the secure migration. This should only affect relatively recent rings. |
If the DLP between
Any enote you are spending is the output of a past transaction. What you mean is "... past transactions with no unspent outputs should be secure." |
Good point. The spend key should then be defined as |
Here is my general take on this proposal. Seraphis is a transaction protocol loaded to the brim with complex changes compared to RingCT. All of those changes are concise and directly usable after launch. This proposal recommends adding changes that are not useful now, and may never become useful. It looks like scope creep that increases the material and cognitive costs to actually implement and validate Seraphis (who is going to write the security proofs justifying these changes? are we willing to wait an extra 3-12 months to get the implementation, proofs, and reviews?). If Monero needs to transition to a quantum-secure protocol, then it should do so in a separate update that is complete in itself, instead of tacked-on to Seraphis. A complete solution that evolves Monero to the next level, without privacy or utility losses, using state-of-the-art cryptography, when it is needed and not before. |
I actually believe the modified switch commitment scheme, which would be a wallet protocol change with minimal performance costs and trivial implementation, should be done with Seraphis. While any Dilithium discussion does fall under Ukoe's commentary, its ability to be adopted arbitrarily to protect all future outputs let us delay such a large and complicated change. The switch commitment scheme has to be effectively done with a hard fork and is trivial however, as its just an additional addition to the mask. |
The switch commitment is pointless without a defense against double spends. It isn't just a 'trivial implementation' - you need a comprehensive security proof showing that the solution embedded in Seraphis will prevent inflation if triggered before the DLP is broken. |
It's a relatively cheap contigency plan. Wearing a seatbelt when driving may also never be useful, but it's a relatively cheap mitigation.
It has no effect on the validation of Seraphis. You could think of it as having 4 black-box key derivation functions:
I understand that you feel overwhelmed with Seraphis. I can code the derivation functions as a separate wallet component if needed.
|
The changes in this proposal would only be needed at consensus - you are effectively embedding a transaction protocol under the surface of Seraphis. That makes it absolutely part of validating Seraphis. It also means this 'secondary transaction protocol' needs the same implementation, proof, and review rigor as Seraphis itself. We can't shoehorn major protocol changes.
Seraphis is not overwhelming, but its complexity is at capacity. Additional changes like this proposal would definitely push it over the brim. If Seraphis becomes too complex, it may have long-term impacts on the health of Monero R&D by discouraging and exhausting existing and new contributors.
If this is the case then we shouldn't be relying on the DLP at all right now. The point of cryptographic assumptions is they will be unbroken within any meaningful timeframe. |
Major parts of the "secondary protocol" don't even need to be implemented in code yet, perhaps beyond some PoC. The only code that would need review are the 4 derivation functions I mentioned earlier. The protocol itself would need a review, but it's a relatively simple protocol compared to Seraphis, since it lacks a privacy layer and consists of cryptographic primitives that are not new (ElGamal commitments, hash commitments and a quantum-secure signature scheme). Nobody is asking you personally to review or implement the protocol. I'm quite sure that the Monero community can raise enough funds to have it done in time. Seraphis is most likely the only time that a change like this can be rolled out. |
Well... multisig would require quite a bit of work to make it compatible with the changes to |
I present a PoC. This embeds an ElGamal commitment into the Pedersen commitments at a wallet-protocol level. If we realize this scheme is ineffective at creating a PQ-viable migration plan, we can never use it for a minor performance cost. If it is effective, and we can prove it as such, we have this benefit available. This also is more resistant against theft as described (which is why I originally dismissed the idea as partial, yet now am advocating for it). While I believe we would still also want to augment private keys in another, much longer, much more annoying discussion, that isn't effectively required to be a hard fork therefore letting us delay such a discussion. I'll also note this passes all tests on my end, including ones for multisig, though sure, the Monero codebase is not laid out as mine is and there would be more leg work when moving it into Monero. The important distinction is the proof that this is purely on the wallet level, since they ran against an unmodified Monero daemon. Due to the location of the modification, no changes to scanning (including rebuilding the commitment) nor the higher level TX creation process were necessary (though the CLSAG code did need to not use this modified function, of course). @tevador Would you mind confirming that this is a correct implementation of the currently proposed idea? As a side note, we would need to discuss the sender being able to clawback funds under such a scheme. We can simply comment that it's infeasible to break all one-time keys, and unknown which are valuable due to the perfectly blinding properties, so those are still sufficiently viable. But yes, this scheme only truly makes sense with a PQ augmentation for private spend keys. This is a halfway point usable for a limited amount of time that may preserve an extra year or two of outputs however. |
LGTM
The switch commitment scheme is not enough to prevent undetectable inflation. The reason for this is that a quantum adversary can easily double spend due to the Seraphis key image format. See my post-quantum proposal, which offers a comprehensive solution: https://gist.github.com/tevador/23a84444df2419dd658cba804bf57f1a |
Right, sorry. I have reviewed that do believe we should move forward there :) |
Monero currently uses Pedersen commitments to hide real transaction amounts. The commitments have the form of
C = r*G + v*H
, wherer
is the blinding factor,v
the amount andH
is a random generator with an unknown discrete logarithm with respect toG
.Pedersen commitments are perfectly hiding, but only computationally binding. That means that even an adversary with an infinite computational power cannot reveal the amount
v
that was hidden in the commitment.On the other hand, if the discrete logarithm of
H
is ever found, the commitment scheme is no longer binding and an adversary can open the commitment to any monetary value, effectively creating undetectable inflation.We should consider adopting the idea od Switch commitments[1], which instead use perfectly binding ElGamal commitments with two verification modes:
H
is broken.Thanks to the "partial" verification mode, there would be absolutely no performance cost of using switch commitments for now. The size cost is one additional curve point
D = r*J
per commitment. This curve point can be completely ignored until we switch to the full verification mode in the future (which will also require a different range proof algorithm).A side-effect of the perfect bindingness of the ElGamal commitment is that a future computationally unbound adversary can unmask transaction amounts, which is arguably a better outcome than undetectable inflation. People who would prefer unconditional privacy can set
D
to a random curve point. This will keep their commitments perfectly hiding, but will make their outputs unspendable with full verification.A good time to adopt switch commitments would be with Seraphis. The reason is that when the full verification is activated in the future, old RingCT outputs (with just the Pedersen commitment) would become unspendable. This could be done just by disabling the v2 -> v4 output migration path.
[1] https://eprint.iacr.org/2017/237.pdf
The text was updated successfully, but these errors were encountered: