What’s New in o1js: November 2023

ZK Hack, ZkProgram, Custom Gates, and Lookup Tables


Features and optimizations

We are excited to announce a significant update to o1js, bringing both new features and optimizations to enhance the performance and capabilities of our library. With these changes, it is easier and more efficient to build and work with zkApps on Mina Protocol.

o1js highlights


Custom Gates and Lookup Tables

Internal support has been added for various custom gates (such as range check, bitwise operations, and foreign field operations) and lookup tables. (0.14.0, #1176) These additions enhance the capability of the o1js prover to work with more complex proofs, improving both functionality and performance.

New Gadgets

Gadgets are amalgamations of the lowest level gates in the proof system (addition, multiplication) into more sophisticated boolean operations (XOR, NOT). This simplifies the process of creating new cryptographic primitives. In this case, the gadgets will form the basis of upcoming ECDSA signature verification. These gadgets will also allow the community to implement other crypto algorithms, such as SHA.

  • Gadgets.rangeCheck64(): A provable method for efficient 64-bit range checks using lookup tables. (0.14.0, #1181)
  • Gadgets.rotate(): A provable method to support bitwise rotation for native field elements. (0.14.0, #1182)
  • Gadgets.xor(): A provable method to support bitwise XOR operations for native field elements. (0.14.0, #1177)

Dummy Proofs: The Proof.dummy() method has been introduced to create dummy proofs, aiding in the construction of ZkPrograms that cover both base and recursive cases within the same method (0.14.0, #1188). This can significantly reduce proof time in recursive chains without impacting the efficiency of the base case.

Lightnet Namespace: A new namespace has been added to interact with the account manager provided by the Lightnet Mina network. (0.14.0, #1167) This namespace is part of our initiative to streamline the deployment and testing of zkApps on Mina, making them more accessible and efficient for developers.


ZkProgram Enhancements: The ZkProgram class has been moved out of the Experimental namespace and is now a top-level import. A new name input argument is required in the non-experimental API to help identify a ZkProgram when caching prover keys. See [ZkProgram Overview](https://docs.minaprotocol.com/zkapps/o1js/recursion#zkprogram-overview). TheExperimental.ZkProgram has been deprecated. (0.14.0, #1200)

Breaking Changes

Verification Key Changes: Due to optimizations in Field methods and core cryptographic changes, you must redeploy your smart contracts to regenerate all verification keys to ensure compatibility with the latest version of o1js. (0.14.0, #1171, #1178)

zkApp CLI Updates


zkApp CLI release 0.14.0 corresponds with o1js release 0.14.0. The o1js release includes constraint optimizations in Field methods and core crypto changes that break all verification keys. You must redeploy all contracts. Use the zk deploy command to compute a verification key for your zkApp (takes ~1-2 minutes). See How to Deploy a zkApp. (0.14.0, #514)

  • o1js minor version dependency updated in package.json to 0.14.*.
  • o1js minor version peer dependency updated in template/example contract package.json to 0.14.*.

DX improvements: Husky and the pre-commit hooks have been removed from the project templates to remove friction and create a better DX when building zkApps. (0.13.1, #505) and (0.13.2, #507)

Shout out

Community member Furkan wrote Exploring Mina Protocol: Building zkApps w/ ‘o1js’ to make developer onboarding easier for zkApp newbies. Thank you, Furkan.

Are you building zkApps with o1js? Help us celebrate you. Tag @o1_labs on Twitter/X when you share your work.

ZK Hack Istanbul

O(1) Labs is all about fueling innovation in the zk space. As a ZK Hack Istanbul partner sponsor, we are offering $10K in bounties across various tracks: ZK Gaming, ZK Voting, Crypto Primitive, ZK Data Structure, and Build your own idea. Be sure to register for this hackathon for the opportunity to build with o1js and potentially win bounties.

To stay up to date

Follow the official O(1) Labs Twitter/X.

To participate

Mina Protocol Discord is the most popular place where Mina enthusiasts and technical contributors gather.

Join us in these zkApps channels:

To contribute

To learn how you can help us improve the functionality and user experience, which in turn helps you build better projects, see: