[Soroban] Support cryptographic primitives for proof verification #1500
Replies: 5 comments
-
There has been substantial discussion (and a prototype implementation!) around adding BLS12-381 stellar/rs-soroban-env#779. BLS12-381 is the de-facto standard pairing-friendly curve of choice, adopted by Ethereum. It is designed to replace BN254 (due to its lower security, as mentioned in notes). The most frequent mention as an alternative is BLS12-377. It has many similar characteristics to BLS12-381 (same embedding degree, similar subgroup order and prime field size etc) and similar performance (see this reference for benchmark between various curves and libraries). However, the same developer of BW6-761 has proposed a similar curve BW6-767 that can be cycled with BLS12-381 for the same benefits. This makes me wonder if BLS12-377's main advantage is still relevant at all. There are other curves such as MNT4 and MNT6, Pallas and Vesta (see ref1 and ref2) that has been adopted by various protocols. I don't understand the cryptographic details beyond the fact that they also enable efficient recursive proof verification. So my conclusion is we have to support BLS12-381 (for the simple reason of interoperability, besides the curve's own strengths).
would love to hear opinions from cryptography experts and ecosystem builders such as @kwantam, @rsinha, @PlamenHristov @heytdep |
Beta Was this translation helpful? Give feedback.
-
Positive signal for BLS12-381 wider ecosystem support: It was just added to CosmWasm. |
Beta Was this translation helpful? Give feedback.
-
Lot of great points already, but here are my 2¢. In general, supporting recursive proofs (and their curve cycles) is useful as the most recent SNARK constructions rely on them for efficiency. These may either be a 2-cycle of pairing friendly curves (e.g. BLS and MNT), or non-pairing (e.g. pallas and vesta) -- in either case, it is sufficient for Soroban to only support one curve, say BLS, as the off-chain prover application is responsible working with both curves. Within BLS, we have the option for 12-377 and 12-381, and it appears that wider ecosystem support may push the case for BLS 12-381. That said, it is worth considering the brief history of SNARKs (I am only mentioning a few works here for brevity).
Today, there is no one-size-fits-all or one winning SNARK amonst these options. An app developer will explore different tradeoffs amongst these options. Moreover, we can expect further improvements, both in SNARK constructions and newer curves, over the next few years. Considering this in mind, and also crypto agility (for addressing new attacks on curves), it might be worth also having a plan for supporting additional families of curves, with a common host function interface. The arkworks library is a great example of this, as the application developer can switch curves by changing a single line defining the import. |
Beta Was this translation helpful? Give feedback.
-
Sorry to chime in late here, I agree with @rsinha. I think we could also directly rely on Arkwork's implementation directly on the host. We cannot directly have guest <> host calls with a generic pairing engine impl such as arkwork does of course, but we can either use the supported curves as a host fn argument to keep the host interface as generic as possible. But yeah, I don't think we can actually have the guest specify a curve without some kind of specific implementation/adapter for the curve on the host. |
Beta Was this translation helpful? Give feedback.
-
Thank you @rsinha and @heytdep for both your feedback. |
Beta Was this translation helpful? Give feedback.
-
Cross-posting notes from @kwantam at the early stage of Soroban (around 06/2022). This is to be used as reference and starting point of discussions around adding new crypto primitives in Soroban.
(@kwantam if you have an updated opinion based on recent developments in the field, feel free to post your comments below)
Beta Was this translation helpful? Give feedback.
All reactions