@lightprotocol/zk.js

Light Protocol

Light Protocol

Discord Workflow Status

The ZK Layer for Solana

Light is a zkLayer enabling private program execution, purpose-built for Solana.

Developers can use Light to build applications such as

  • fast private payments
  • encrypted orderbooks
  • public on-chain games with private state

Development environment

Development Containers

Light Protocol supports Development Containers and provides a container image with all dependencies which are needed for building and testing.

Visual Studio Code comes with out of the box support for Development Containers, but they are also supported by other editors:

Manual setup

If you still want to setup dependencies manually, these are the requirements:

Building

To build the project, use the following commands:

./build.sh
./build-sdk.sh

Git hook

In order to properly execute the prettier format pre-commit hook, you may first need to configure light-zk.js/husky/pre-commit as executable:

chmod ug+x ./light-zk.js/husky/*

Solana keypair

Before doing any development or running any tets, you need to generate a new local keypair:

solana-keygen new -o ~/.config/solana/id.json

Tests

Global

./test.sh

Rust tests

cd light-verifier-sdk/
cargo test

SDK tests

cd light-zk.js/
yarn test

Circuit tests

cd light-circuits
yarn test

Anchor tests

Tests are located in tests/ directory.

The default test is a functional test, setting up a test environment with a Merkle tree and an spl token, conducting two shields and unshields.

Tests can be executed in bulk or one by one.

cd light-system-programs/
yarn test
yarn test-verifiers
yarn test-merkle-tree

Generated using TypeDoc