Lightning Rod Solana is the home of the Dapp Developer Kit (DDK) for Inco Lightning network on Solana.
To start working with Inco Lightning on Solana and the Lightning Rod template repository, work through the Quick Start section below.
Further documentation is linked below.
We require recent versions of
- Rust (1.70+)
- Solana CLI (1.18+)
- Anchor (0.31+)
- Node.js (18+)
- Yarn
to be installed.
To install the dependencies, run:
yarn installTo build the Solana program, run:
anchor buildThe tests run against Solana Devnet where the Inco Lightning infrastructure is deployed.
Make sure you have a Solana wallet configured with some devnet SOL:
# Create a new wallet (if needed)
solana-keygen new
# Set cluster to devnet
solana config set --url devnet
# Airdrop some SOL for testing
solana airdrop 2Then run the tests:
# Run all tests
anchor test
# Run standard token tests only
yarn test:token
# Run Token 2022 tests only
yarn test:token2022An example of a confidential token using Inco Lightning is provided in programs/inco-token/.
The program implements:
- Encrypted token balances using
Euint128handles - Confidential transfers, minting, and burning
- SPL Token compatible interface
- Token 2022 extensions with decimal validation
To test run:
yarn install
anchor build
anchor testlightning-rod-solana/
├── programs/
│ └── inco-token/ # Confidential token program
│ ├── src/
│ │ ├── lib.rs # Program entry point
│ │ ├── token.rs # Core token operations
│ │ ├── token_2022.rs # Token 2022 extensions
│ │ └── ...
│ └── Cargo.toml
├── tests/
│ ├── inco-token.ts # Standard token tests
│ └── inco-token-2022.ts # Token 2022 tests
└── ...
anchor-lang0.31.1anchor-spl0.31.1inco-lightning0.1.2
@coral-xyz/anchor@inco/solana-sdk@solana/web3.js