Skip to content

Commit

Permalink
Merge pull request o1-labs#989 from o1-labs/feat/o1js-vs-protokit
Browse files Browse the repository at this point in the history
zkApps development frameworks.
  • Loading branch information
shimkiv authored Jun 4, 2024
2 parents 17074b6 + 81bc629 commit 76594b5
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ keywords:
- mina archive node
---

:::caution Warning

When creating updates to unknown accounts in a reducer function, care should be taken to avoid introducing security vulnerabilities.

Please follow the guidelines [**here**](/zkapps/writing-a-zkapp/introduction-to-zkapps/secure-zkapps#best-practices-for-zkapp-security).

:::

# Actions & Reducer

Like events, **actions** are _public_ arbitrary information that are passed along with a zkApp transaction. However, actions give you additional power: you can process previous actions in a smart contract! Under the hood, this is possible because a commitment is stored to the history of dispatched actions on every account -- the **actionState**. It allows you to prove that the actions you process are, in fact, the actions that were dispatched to the same smart contract.
Expand Down
77 changes: 77 additions & 0 deletions docs/zkapps/zkapp-development-frameworks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: zkApps Development Frameworks
sidebar_label: zkApps Development Frameworks
hide_title: true
description: zkApps (zero knowledge apps) are Mina Protocol smart contracts powered by zero knowledge proofs, specifically using zk-SNARKs.
keywords:
- zkapps
- mina protocol
- smart contracts
- zero knowledge proofs
- off-chain execution
- typescript
- quickstart zkapps
- o1js
- protokit
---

# zkApps Development Frameworks

Developers building `zkApps` in the `Mina ecosystem` can leverage a variety of specialized frameworks, each tailored to optimize different types of solutions.
This documentation selection ensures that you can select the most suitable framework to meet the unique demands of your project.
Explore the options below to find the perfect fit for your development needs.

If you are unsure about any of the information presented here and need guidance on choosing the most suitable framework for you, drop by [Discord](https://discord.gg/minaprotocol) and let us help!

## [o1js](/zkapps/o1js)

`o1js` is the framework used for building `zkApps` on the `Mina L1` and new infrastructure such as `rollups`.
o1js is Typescript based for ease of use, comes with a host of built-in features, is extensible to suit various use cases, and takes full advantage of the unique aspects of the Mina protocol.

o1js is also the `zkDSL` used for:

- Writing general-purpose `zk circuits`.
- Constructing `new primitives` and `data structures`.

There are some key considerations when choosing to build a zkApp with o1js on Mina L1:

- zkApps are subject to protocol throughput limitations.
- At present, zkApps that require support for multiple concurrent users require specific architecture to avoid race conditions:
- Where more than the eight on-chain field elements are required to manage state, and access to that state is not shared, the experimental `Off-chain Storage API` will suffice.
- Where `concurrent` access to `shared state` is required, this architecture is available "**out of the box**", when using the `Protokit` framework to build your zkApp as an zkApp-chain (L2).

Start here:

- [Developer documentation](/zkapps/o1js)
- [o1js repository](https://github.com/o1-labs/o1js)
- [Discord](https://discord.gg/minaprotocol)

## [Protokit](https://protokit.dev/)

`Protokit` is a powerful framework designed to build `ZK appchains` and smart contracts that are user-facing, privacy-preserving, interoperable.
It offers a familiar developer experience similar to `Solidity dApps`, making it easier and intuitive for developers to leverage ZK in their blockchain solutions.

It provides a full set of tools necessary for:

- zkApps that require `high throughput` or multiple `concurrent` users.
- zkApps that require `shared` or `global` state access.
- Developers familiar with execution environments such as `EVM`.
- Developers who wish to leverage the `modular architecture` of Protokit.

Start here:

- [Developer documentation](https://github.com/proto-kit)
- [Protokit repository](https://github.com/proto-kit)
- [Starter Kit](https://github.com/proto-kit/starter-kit)
- [Discord](https://discord.gg/AMGnGAxsKp)

## Framework comparison

|| o1js SmartContract | Protokit |
|--|--|--|
|**Production readiness**|v1.0 released, internal audit complete, 3rd party audit in progress.|Not production ready - work in progress. Unaudited. Testnet deployments available.|
|**Censorship resistance**|Decentralized and censorship resistant.|Censorship resistance via hybrid sequencing model.|
|**Support for multi-user apps**|Many multi-user use cases require sophisticated architecture and are limited by L1 throughput.|Capable of handling higher throughput and multiple concurrent users, thanks to Protokit's modular sequencer.|
|**Execution environment**|Proving off-chain, verification on-chain, transaction ordering possible on-chain.|Hybrid execution model, both on-chain (sequencer) and off-chain thanks to recursive zk-proofs, verification on-chain (MINA L1).|
|**DX**|New programming model, distinct from traditional web3.0 development.|Module oriented app-chain development, similiar to Substrate Pallets, Cosmos SDK Modules or EVM smart contracts.|
|**Composability**|Fully composable. Contracts can call other contracts directly within a single transaction.|Protokit supports bi-directional L2 ↔ L1 messaging out of the box.|
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
label: 'zkApp Developers',
link: {
type: 'doc',
id: 'zkapps/o1js/index',
id: 'zkapps/zkapp-development-frameworks',
},
items: [
{
Expand Down

0 comments on commit 76594b5

Please sign in to comment.