I am very proud to release the very first version of Constantine, a high-performance modular cryptography stack for blockchains and proof systems.
I thank Ethereum Protocol Fellowship Program and Status for sponsoring the part-time work of 2 fellows on Constantine (then hiring them!) as well as a couple hours a week of my time for several months to prepare an upcoming complete refactoring of the Ethereum blockchain called Verkle Tries/Trees.
I also thank Araq, ringabout and all other contributors to the Nim compiler: the static ICE must flow.
Today Constantine is focused on the Ethereum blockchain, tomorrow I hope it will also address the need of (potentially Zero-Knowledge) proof systems and privacy-preserving protocols.
It currently exposes the following high-level protocols:
On Ethereum protocols, Constantine is noticeably faster than other alternatives on x86 thanks to a mix of theoretical math, engineering and hardware-specific optimizations.
Those high-level protocols hide a modular stack of generic math and cryptography that can be reused to build optimized cryptographic protocols. This even includes a JIT assembler as macro for x86 and a code generator for Nvidia GPU assembly through LLVM IR, skipping Cuda and Nvidia toolchain woes.
On the security side:
Constantine is built with use-cases beyond Nim:
The future:
Please refer to https://github.com/mratsim/constantine/blob/v0.1.0/PLANNING.md and the issue tracker https://github.com/mratsim/constantine/issues?q=is%3Aopen+is%3Aissue+label%3A%22enhancement+%3Ashipit%3A%22
This includes:
Some potential goals that I have no time for at the moment:
ποΈ
Congratulations :)
I hope your Constantine will be the foundamental stones of blockchain.
And I've released v0.2.0 yesterday!
Announcement: https://github.com/mratsim/constantine/releases/tag/v0.2.0
I'll skip the cryptography-heavy part to present the Nim specific features developed within that time.
- Assembler: https://github.com/mratsim/constantine/blob/v0.2.0/constantine/platforms/isa_arm64/macro_assembler_arm64.nim
- complex example usage, big int mul: https://github.com/mratsim/constantine/blob/v0.2.0/constantine/math/arithmetic/assembly/limbs_asm_mul_arm64.nim#L23-L125