-
Notifications
You must be signed in to change notification settings - Fork 27
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 sound rangeproofs #1
base: secp256k1-mw
Are you sure you want to change the base?
Conversation
…amaterized contexts
…etain compatibility
(moved from BlockstreamResearch#4 (comment)) Note that this multi-generator trick works only for a single-asset blockchain, but if you need to balance values per-asset, and assets are themselves blinded, then you cannot commit to a shared blinding factor as a second part of the commitment. So this:
won't work if
Now, balancing Vs and Fs will guarantee that Quantum computers are %@#$!@#^@. |
Oleg, if I have Since the soundness changes affect only the rangeproof, and the total balancing equation is independent of this, I don't see why it should matter at all if I have multiple assets. Note that each rangeproof only works on a single asset; you can't have multiple asset types in a single output. |
Hmm... Lets say you commit to
Therefore,
Since So the attack looks like this:
I'd be glad to be proven wrong to regain that 20% in space savings. |
Dammit. I see. It is simpler in the small-assets case where Consider your asset commitment
A real attacker would also change Basically, the soundness of the surjection proof cannot stop a DLP attacker from recharacterizing asset commitments like this. (It does require they create a transaction to do it since they can't change the proofs' meaning after the fact. And in the presence of issuance I think you're right that you need to have inputs of both asset types, though the values are not important.) The way that asset commitments are defined, as repeatedly-reblinded NUMS points plus a blinding factor, seems to make this inherent, no matter how your surjection proof is structured....do you think you can do better without the optimized sound rangeproof? |
If I'm not mistaken, the following approach is PQ-sound:
Value rangeproof proves that Balancing Vs and Fs ensures that
Then, I assume that ECDLP is broken for Now, the only way to morph assets is to:
In both cases the space of In other words, restricted ranges of v1, v2 make it computationally hard (even for QC) to satisfy that equation. The challenge I have is to have a good upper bound on |
Ah, yeah, I think this is correct -- and I see that we lose the space savings because when you decompose Edit: Have you thought about doing a normal rangeproof for Here "normal rangeproof" means the thing in this PR. Note that with the latter idea we'd need to decompose |
Yes, I explored additional proofs "transferring" |
Offtopic for this PR, but what'd be your take on this problem?:
|
I thought about it briefly. I think it's roughly Consider starting with all So the total underestimate is I ran through this calculation in sage (using floating-point approximations) for N = 10, 15, 20 and in those cases I did not even shave an entire bit off of 2^2N. |
That was helpful! Could it be that other parts of |
Unfortunately no, because the integers mod Btw I just completed a check for 2^32. Again not even a bit of reduction. In all cases it seems like the space is reduced by a factor of roughly 1.645, I think only the first few primes really matter to the calculation. |
That's the same factor I get in my simulation as well for low ranges and precise modulo arithmetic. Nice. |
I spent a while last night thinking about your solution. It's really clever, I guess the core of the technique is to force I'm worried now about your claim that the only way to break this is to find I think with Wagner's algorithm an attacker should be able to produce the remaining Edit: "small assets", with a fixed list of asset types that can't be grinded, is not vulnerable to this because there are only a couple |
I hope you'd need an order of 2^N inputs and outputs (or, alternatively, 2^N transactions) to make that transmutation. |
Nope, you produce some large but doable number of Unfortunately I'm not aware of a simple writeup of this. The original paper is http://link.springer.com/chapter/10.1007/3-540-45708-9_19 but it takes a bit of work to translate it from xor into an ordinary sum of |
Dammit. Will the Ed448 Goldilocks curve be of help here with its 448-bit order? |
I believe increasing the curve size will make Wagner's algorithm slower, but not exponentially slower. I'd be really really hesitant to rely on this, especially in the face of a quantum computer. (I don't know if anyone has studied quantum speedups of Wagner's algo.) I also don't like the idea of using the performance of Wagner as a measure of security, the fact that Wagner's algorithm exists at all was a surprise to me and without some proven computational lower bound, I don't like the idea of using any sum of independent adversarially-choosable random numbers in cryptography. Who knows what other algorithms might exist. |
Maybe you can increase the collision space by having M asset ID representations to which the same value is committed. And maybe that M could be proportional to number of inputs/outputs. So for short transactions where you don't have a lot of space for shenanigans, you have lower overhead. |
Lets say, asset Even better, what if we have the whole value encoded as Edit: this poses another problem, though: how do we implement homomorphic addition of commitments and handle overflow of 1+1=>2. |
Just a note: producing 2^30 |
Heh, yes, that is pretty important as a practical consideration. |
Let's ignore the Wagner problem for now. It needs further study, but can be prevented by having a fixed list of assets at least. For issuance it might be sufficient to just require a spend of a utxo, and to take entropy not only from that utxo's txid:vout pair but also from the hash of the block in which it appeared...then an attacker can't precompute asset IDs, they'd actually have to put 2^30 outputs on the blockchain and see which ones were worth issuing assets out of. So. To get your security model, how about this? As you described, we have a blind asset tag As discussed I don't want to do a simultaneous rangeproof because this requires adding complexity to the rangeproof, pregenerating a split of Here's an alterate scheme. Prover thinks up a random scalar Verification of the extra proofs costs the same as doing six signature verifications. I'll need some more work to show this is actually zero-knowledge in |
That's an interesting mitigation, thank you. Sadly, it's not cryptographically robust, but it's pretty reasonable in practice. My concern is how much it would stifle the existing patterns involving asset issuance. Will have to investigate that further.
Sounds good. I've tried something very similar, but was having trouble with soundness without a direct |
It's worth analyzing to see if it's necessary, but we can prove Edit: Yeah, I think it's necessary. Good catch. |
Additional dlog proof within a rangeproof cannot be fiatshamirred under the rug due to soundness requirement, so it will require extra 2N scalar mults for N-bit number. Which is +33% CPU cost to 4N that you'd have already in a sound rangeproof with 2-point digits. |
I'm saying that |
1069b22
to
ec5311b
Compare
Updated commit to allow normal Boneh-sound borromean sigs with different Specifically, I want the surjection proofs to be sound, but also support 2^4 denominations using this scheme of amiller's. |
Oh, nice link to the Andrew Miller's exponent optimization. I've considered that too, but was also looking into a more generic solution that allows encoding a number with an arbitrary combination of constant-multiplication (with a variable base or variable exponent across the ring) and with proofs of multiplication of two commitments (sort of "blinded DDH proof"). I haven't got much time to extensively study that approach, maybe you did? My worry is that complicated ad-hoc encoding while saving space allows for a more efficient adversarial analysis and makes it harder to estimate privacy guarantees. |
Well, today there is an explicit exponent in the rangeproofs (I'm not sure how often it is used), so hiding the exponent is definitely an improvement on that. It's also an improvement on the "denominations" scheme I had been thinking about, where basically there is a small fixed list of possible exponents people can use. You can do a blinded DDH proof, I think my 3-step change-of-bases proof above for mapping In general I agree with your worry about ad-hoc encodings. But the exponent provides a huge space savings for common (round) amounts, so it's hard to take this tradeoff all the way to the "full privacy" direction, which would pretty-much require 52-bit rangeproofs everywhere. |
I think I'm going to call the 3-step proof an "asset transfer proof" because it's a fairly general thing that lets you prove that two commitments have the same amount, while showing that you're changing the asset commitment. This may be important in the future for cross-chain pegs where asset IDs differ. |
Implements a design by Oleg Andreev to create sound rangeproofs with identical size and format to the original Elements ones (though of course, neither will validate as the other).