Skip to main content

zkApp Developer Tutorials

zkApp developer tutorials are a hands-on walk-through of use cases that guide you to achieve a defined goal.

o1js, fka. SnarkyJS, is a TypeScript (TS) library for writing general-purpose zk programs and writing zk smart contracts for Mina.

To meet other developers building zkApps with o1js, participate in the #zkapps-developers channel on Mina Protocol Discord.

Prerequisites

Each tutorial has been tested with the latest versions:

  • zkApp CLI

  • o1js

    o1js is automatically included when you create a project using the zkApp CLI.

  • Other dependencies as noted.

Install the zkApp CLI

To install the zkApp CLI:

$ npm install -g zkapp-cli

To confirm successful installation:

$ zk --version

Dependencies

To use the zkApp CLI and o1js, your environment requires:

  • NodeJS v18 and later
  • NPM v10 and later
  • git v2 and later

Use a package manager to install the required versions and upgrade older versions if needed. Package managers for the supported environments are:

  • MacOS Homebrew

  • Windows Chocolatey

  • Linux

    • apt, yum, and others

    On Linux, you might need to install a recent Node.js version by using NodeSource. Use deb or rpm as recommended by the Node.js project.

To verify your installed versions, use npm -v, node -v, and git -v.

Tips

The full source code for tutorials is provided in the examples/zkapps/ directory on GitHub. While you're there, give the /docs2 repository a star so that other zk developers can learn to build a zkApp!

Line numbers are provided for convenience. To prevent copying line numbers and command prompts as shown in the tutorials, use the copy code to clipboard button that appears at the top right of the snippet box when you hover over it.

Useful Resources

The API Reference docs are a detailed resource that is useful after you have familiarized yourself with the basics. See the o1js Reference docs for an in-depth explanation of all the methods, properties, and interfaces available in o1js.

See the O(1) Labs blog at https://blog.o1labs.org/. For updates about o1js, see https://blog.o1labs.org/tagged/o1js.

If you're just getting started, watch these step-by-step zkApp Explainer Videos that go over how to get started building zkApps. Each tutorial includes a link to the corresponding video. While you're on the Mina Foundation YouTube channel, select Subscribe so that new videos will show in your Subscriptions feed.