2022-06-30 09:42:29 +00:00
# Discrete Log Equality
2022-07-07 13:52:10 +00:00
Implementation of discrete log equality proofs for curves implementing
2023-03-21 00:10:00 +00:00
`ff` /`group`.
There is also a highly experimental cross-group DLEq proof, under
2022-07-07 13:52:10 +00:00
the `experimental` feature, which has no formal proofs available yet is
2023-03-16 22:46:48 +00:00
available here regardless.
This library, except for the `experimental` feature, was
2023-03-21 00:10:00 +00:00
[audited by Cypher Stack in March 2023 ](https://github.com/serai-dex/serai/raw/e1bb2c191b7123fd260d008e31656d090d559d21/audits/Cypher%20Stack%20crypto%20March%202023/Audit.pdf ),
culminating in commit
[669d2dbffc1dafb82a09d9419ea182667115df06 ](https://github.com/serai-dex/serai/tree/669d2dbffc1dafb82a09d9419ea182667115df06 ).
Any subsequent changes have not undergone auditing.
2022-06-30 09:42:29 +00:00
2022-07-07 13:34:35 +00:00
### Cross-Group DLEq
The present cross-group DLEq is based off
[MRL-0010 ](https://web.getmonero.org/resources/research-lab/pubs/MRL-0010.pdf ),
which isn't computationally correct as while it proves both keys have the same
2022-07-07 13:52:10 +00:00
discrete logarithm for their `G'` /`H'` component, it doesn't prove a lack of a
`G` /`H` component. Accordingly, it was augmented with a pair of Schnorr Proof of
Knowledges, proving a known `G'` /`H'` component, guaranteeing a lack of a
`G` /`H` component (assuming an unknown relation between `G` /`H` and `G'` /`H'`).
2022-07-07 13:34:35 +00:00
The challenges for the ring signatures were also merged, removing one-element
from each bit's proof with only a slight reduction to challenge security (as
instead of being uniform over each scalar field, they're uniform over the
mutual bit capacity of each scalar field). This reduction is identical to the
one applied to the proved-for scalar, and accordingly should not reduce overall
security. It does create a lack of domain separation, yet that shouldn't be an
issue.
The following variants are available:
- `ClassicLinear` . This is only for reference purposes, being the above
described proof, with no further optimizations.
- `ConciseLinear` . This proves for 2 bits at a time, not increasing the
signature size for both bits yet decreasing the amount of
commitments/challenges in total.
2022-07-07 13:52:10 +00:00
- `EfficientLinear` . This provides ring signatures in the form
`((R_G, R_H), s)` , instead of `(e, s)` , and accordingly enables a batch
verification of their final step. It is the most performant, and also the
largest, option.
2022-07-07 13:34:35 +00:00
2022-07-07 13:52:10 +00:00
- `CompromiseLinear` . This provides signatures in the form `((R_G, R_H), s)` AND
2022-07-07 13:34:35 +00:00
proves for 2-bits at a time. While this increases the amount of steps in
verifying the ring signatures, which aren't batch verified, and decreases the
amount of items batched (an operation which grows in efficiency with
quantity), it strikes a balance between speed and size.
2022-07-07 13:52:10 +00:00
The following numbers are from benchmarks performed with k256/curve25519_dalek
on a Intel i7-118567:
2022-07-07 13:34:35 +00:00
2022-07-07 18:28:53 +00:00
| Algorithm | Size | Verification Time |
2022-07-07 13:34:35 +00:00
|--------------------|-------------------------|-------------------|
| `ClassicLinear` | 56829 bytes (+27%) | 157ms (0%) |
| `ConciseLinear` | 44607 bytes (Reference) | 156ms (Reference) |
| `EfficientLinear` | 65145 bytes (+46%) | 122ms (-22%) |
| `CompromiseLinear` | 48765 bytes (+9%) | 137ms (-12%) |
2022-07-07 13:52:10 +00:00
`CompromiseLinear` is the best choice by only being marginally sub-optimal
2022-07-07 13:34:35 +00:00
regarding size, yet still achieving most of the desired performance
improvements. That said, neither the original postulation (which had flaws) nor
any construction here has been proven nor audited. Accordingly, they are solely
experimental, and none are recommended.
2022-07-07 13:52:10 +00:00
All proofs are suffixed "Linear" in the hope a logarithmic proof makes itself
2022-07-07 13:34:35 +00:00
available, which would likely immediately become the most efficient option.