You build recursive zkApps by using ZkProgram, the o1js general purpose API for creating zero knowledge proofs.
A ZkProgram is similar to zkApp smart contracts but isn't tied to an on-chain account. This tutorial code is an example of a simple zkRollup. This tutorial guides you through a review of a simple zkRollup example that can be used to implement a zkRollup or an app chain.
For the step-by-step tutorial, see Tutorial 9: Recursion.
-
Clone the repository:
git clone https://github.com/o1-labs/docs2.git
-
Change directory to the project location:
cd docs2/examples/zkapps/09-recursion
-
Install dependencies:
npm install
-
Build the project:
npm run build
-
Run the compiled code:
node build/src/add.js
To run and build the compiled code with a single command:
npm run build && node build/src/add.js