New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

o1js-pack

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

o1js-pack

Make the most of your zkApp state!

latest
npmnpm
Version
0.8.0
Version published
Maintainers
0
Created
Source

o1js Pack

Make the most of your zkApp state!

What is it

o1js Pack is a library for o1js that allows a zkApp developer to pack extra data into a single Field.

Usage in a zkApp

Smart Contract

The primary benefit of using this library in a smart contract is that it allows you to use more of your allotted 8 Fields of storage.

Check out example usage in a smart contract in Smart Contract Examples.

ZK Program

The benefit to using this library in a zk program is less obvious. In some cases, the number of gates required in a circuit is less using this library than with provable arrays. Especially in applications where the array is hashed many times, packing and unpacking ends up being more effecient than doing a lot of Poseidon hashes. In other cases, you may just prefer the API of o1js Pack compared to using provable arrays.

Check out example usage in a zk program in Zk Program Examples.

How to build

npm run build

How to run tests

npm run test src # non-proof tests
npm run test tests/provable # provable tests

Credits

Thanks to @mario_zito for seeding the idea for this library on Discord (Thread 1, Thread 2), and to @gregor for sounding out the early implementation.

Thanks to @iam-dev for early adoption!

License

Apache-2.0

Keywords

mina-zkapp

FAQs

Package last updated on 22 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts