Serai is a new DEX, built from the ground up, initially planning on listing Bitcoin, Ethereum, DAI, and Monero, offering a liquidity-pool-based trading experience. Funds are stored in an economically secured threshold-multisig wallet.
Find a file
Luke Parker 081b9a1975
FROST Ed448 (#107)
* Theoretical ed448 impl

* Fixes

* Basic tests

* More efficient scalarmul

Precomputes a table to minimize additions required.

* Add a torsion test

* Split into a constant and variable time backend

The variable time one is still far too slow, at 53s for the tests (~5s a 
scalarmul). It should be usable as a PoC though.

* Rename unsafe Ed448

It's not only unworthy of the Serai branding and deserves more clarity
in the name.

* Add wide reduction to ed448

* Add Zeroize to Ed448

* Rename Ed448 group.rs to point.rs

* Minor lint to FROST

* Ed448 ciphersuite with 8032 test vector

* Macro out the backend fields

* Slight efficiency improvement to point decompression

* Disable the multiexp test in FROST for Ed448

* fmt + clippy ed448

* Fix an infinite loop in the constant time ed448 backend

* Add b"chal" to the 8032 context string for Ed448

Successfully tests against proposed vectors for the FROST IETF draft.

* Fix fmt and clippy

* Use a tabled pow algorithm in ed448's const backend

* Slight tweaks to variable time backend

Stop from_repr(MODULUS) from passing.

* Use extended points

Almost two orders of magnitude faster.

* Efficient ed448 doubling

* Remove the variable time backend

With the recent performance improvements, the constant time backend is 
now 4x faster than the variable time backend was. While the variable 
time backend remains much faster, and the constant time backend is still 
slow compared to other libraries, it's sufficiently performant now.

The FROST test, which runs a series of multiexps over the curve, does 
take 218.26s while Ristretto takes 1 and secp256k1 takes 4.57s.

While 50x slower than secp256k1 is horrible, it's ~1.5 orders of 
magntiude, which is close enough to the desire stated in 
https://github.com/serai-dex/serai/issues/108 to meet it.

Largely makes this library safe to use.

* Correct constants in ed448

* Rename unsafe-ed448 to minimal-ed448

Enables all FROST tests against it.

* No longer require the hazmat feature to use ed448

* Remove extraneous as_refs
2022-08-29 02:32:59 -05:00
.github BP Verification (#75) 2022-07-31 21:45:53 -05:00
coins Update Monero crate description 2022-08-25 04:02:30 -04:00
contracts Clarify licensing per https://github.com/serai-dex/serai/issues/13 2022-08-25 04:02:13 -04:00
crypto FROST Ed448 (#107) 2022-08-29 02:32:59 -05:00
docs Lint Getting Started document 2022-08-21 00:45:41 -04:00
processor Fix https://github.com/serai-dex/serai/issues/105 2022-08-22 12:15:14 -04:00
substrate Clarify licensing per https://github.com/serai-dex/serai/issues/13 2022-08-25 04:02:13 -04:00
.gitignore Add a patch for zip so ethereum-serai doesn't conflict with Substrate 2022-07-16 17:49:35 -04:00
.gitmodules Move the Monero create to coins/ 2022-04-27 00:09:05 -04:00
.rustfmt.toml Apply an initial set of rustfmt rules 2022-07-16 15:16:30 -05:00
AGPL-3.0 Add an initial Substrate instantiation 2022-07-15 00:05:00 -04:00
Cargo.lock FROST Ed448 (#107) 2022-08-29 02:32:59 -05:00
Cargo.toml FROST Ed448 (#107) 2022-08-29 02:32:59 -05:00
CONTRIBUTING.md Add a basic CONTRIBUTING file (#77) 2022-08-26 07:41:00 -05:00
LICENSE Clarify licensing per https://github.com/serai-dex/serai/issues/13 2022-08-25 04:02:13 -04:00
README.md Clarify licensing per https://github.com/serai-dex/serai/issues/13 2022-08-25 04:02:13 -04:00

Serai

Serai is a new DEX, built from the ground up, initially planning on listing Bitcoin, Ethereum, Monero, DAI, and USDC, offering a liquidity pool trading experience. Funds are stored in an economically secured threshold multisig wallet.

Layout

  • docs: Documentation on the Serai protocol.

  • crypto: A series of composable cryptographic libraries built around the ff/group APIs achieving a variety of tasks. These range from generic infrastructure, to our IETF-compliant FROST implementation, to a DLEq proof as needed for Bitcoin-Monero atomic swaps.

  • coins: Various coin libraries intended for usage in Serai yet also by the wider community. This means they will always support the functionality Serai needs, yet won't disadvantage other use cases when possible.

  • processor: A generic chain processor to process data for Serai and process events from Serai, executing transactions as expected and needed.

  • contracts: Smart Contracts implementing Serai's functionality.

  • substrate: Substrate crates used to instantiate the Serai network.