Back to research
Jun 16, 2023
Keelung Compiler is Now Open Source
We are excited to announce that the Keelung Compiler is now open sourced! Keelung Language Keelung is a programming language specifically designed for creating fast, private and secure zero-knowledge programs, enabling developers to easily generate reliable proofs without cryptographic expertise. Keelung harnesses...
Keelung Compiler is Now Open Source

We are excited to announce that the Keelung Compiler is now open sourced!

Keelung Language

Keelung is a programming language specifically designed for creating fast, private and secure zero-knowledge programs, enabling developers to easily generate reliable proofs without cryptographic expertise.

Keelung code, taken from our implementation of the Poseidon hash function.

Keelung harnesses the strength of the Haskell ecosystem by embedding itself within the language. This integration empowers Keelung developers to leverage Haskell's extensive collection of libraries, tools, and resources.

Keelung Compiler

The compiler takes Keelung programs as inputs and transforms them into constraint systems for proof generation and verification. The compiler is equipped with an interpreter, enabling developers to execute their Keelung programs during development, along with a solver that generates witnesses in constraint systems. During the compilation process, each Keelung program undergoes multiple passes of rewriting and optimization before being translated into a constraint system for proof generation and verification, as shown in the diagram below.

Open sourcing the Keelung toolchain

Although the Keelung language itself has been open sourced, the compiler had not. We acknowledge that in the world of ZKPs, verifiability is the prerequisite for trust. That’s why we are open sourcing the compiler as well. By open sourcing the compiler under the Apache 2.0 license, we are also releasing our rewrite and optimization techniques performed in the compiler. We hope this will enhance the transparency and accessibility of Keelung for developers, thereby fostering a more creative and engaging community. We eagerly welcome contributions to both the language and compiler in order to push the ball forward within the ZKP ecosystem.

Harnessing the power of ZKPs

ZKPs serve as indispensable technology in today's data-centric world, strengthening privacy and security across a range of applications. From facilitating privacy-oriented analytics - which allows businesses to showcase performance benchmarks without disclosing sensitive data - to offering secure identity verification on digital platforms without revealing unnecessary personal information, ZKPs are proving transformative.

They have been instrumental in maintaining the integrity of complex global supply chains and have been a cornerstone in creating reliable, transparent, and anonymous voting systems, thereby increasing confidence in electoral procedures. ZKPs are also making leaps in machine learning and gaming. They facilitate localized machine learning without the need to share sensitive data with untrusted servers, and allow players to validate achievements privately in the world of gaming.

By 100% open sourcing Keelung, we anticipate an expansion of these use cases. By giving developers the keys to this powerful technology, we are eager to see new ways in which they can leverage it to reinforce data privacy and security, and ultimately, drive innovation in digital interactions.

More updates coming

Automatic datatype encoding

We are excited to announce that in our next update, we will be introducing automatic datatype encoding in Keelung. This feature aims to enhance the integration between Keelung and Haskell by automatically translating Haskell datatypes into Keelung primitives. With this improvement, the interoperability between the two languages will become even more seamless.

Big Int

In Keelung, our current support for unsigned integers is constrained to fitting within a single field element. However, we are actively developing an extension that will enable unsigned integers to have arbitrarily long bit-widths. This enhancement will significantly expand the capabilities of unsigned integers in Keelung.

Conclusion

We believe that the Keelung Compiler will become even more powerful with contributions from the community. We can't wait to see what the future holds for the Keelung Compiler and the community of developers who use it!

Join our Discord for more updates about Keelung.

Keelung language repo: https://github.com/btq-ag/keelung

Keelung compiler repo: https://github.com/btq-ag/keelung-compiler/

Keelung examples: https://github.com/btq-ag/keelung-examples