nacho-common-o1js
v1.0.0
Published
The common o1js utilities for Nacho.
Downloads
26
Maintainers
Readme
nacho-common-o1js
The common o1js utilities for Nacho.
nacho-common-o1js
package is intended to be used for Nacho only as it contains naive implementations of the things Nacho needs.
📦 Installation
If you are using npm
:
npm install nacho-common-o1js
If you are using yarn
:
yarn add nacho-common-o1js
If you are using pnpm
:
pnpm add nacho-common-o1js
🔍 Details
Nacho's common o1js utilities are some provable data structures, functions and constant values.
🧱 Provable Data Structures
Represents a token balance of a user in the layer 2.
Burn
:Represents a token burn of a user in the layer 2.
Represents a token deposit of a user in the layer 1.
Represents the witness of two leaves in the Merkle tree that storesbalances.
Represents an AMM pool liquidity of a user in the layer 2.
Pool
:Represents an AMM pool in the layer 2.
Represents the witness of a leaf in the Merkle tree that stores balances.
Represents the witness of a leaf in the Merkle tree that stores burns.
Represents the witness of a leaf in the Merkle tree that stores AMM liquidities.
Represents the witness of a leaf in the Merkle tree that stores AMM pools.
Represents the witness of a leaf in the Merkle tree that stores withdrawals.
Represents the Merkle roots of the layer 2's state in the layer 1.
Represents a token withdrawal of a user in the layer 1.
🛠️ Provable Functions
Multiplies the given number by
1.001
.Equivalent of conditional operator.
Normal division operation on field elements.
Swaps the order of given elements based on given the condition.
🏷️ Constant Values
The height of the Merkle tree that stores balances which is
23
.The height of the Merkle tree that stores burns which is
20
.The height of the Merkle tree that stores AMM liquidities which is
22
.The height of the Merkle tree that stores AMM pools which is
21
.The height of the Merkle tree that stores withdrawals which is
19
.
📝 License
This project is licensed under the MIT License.
You may use the source code of this project accordingly.
👤 About Me
I am Berzan and I am developing Nacho to express my skills in the real world.
I built this library to use inside Nacho.