Template repository for a World ID On-Chain Integration on Solana.
Like world-id-onchain-template, but make it Solana.
Create a staging on-chain app in the Worldcoin Developer Portal.
Ensure you have installed Anchor.
Set your app ID and action ID from the developer portal in verify_and_execute.rs and VerifyAndExecuteButton.tsx.
Build your program with anchor build
.
Get the newly generated program ID with solana address -k target/deploy/solana_world_id_onchain_template-keypair.json
.
Update the declare_id!
macro in lib.rs and the solana_world_id_onchain_template
address in Anchor.toml with the above key.
Start localnet with anchor localnet
.
In a new shell, install project dependencies:
npm ci
Start the development server:
npm start -w app
After making changes to the contract, you should:
- close and restart
anchor localnet
When using localnet, the UI will airdrop funds to the connected wallet on the first transaction. You can also airdrop funds manually via the CLI with solana airdrop -u l <AMOUNT> [RECIPIENT_ADDRESS]
.
Use the Worldcoin Simulator in place of World App to scan the IDKit QR codes and generate the zero-knowledge proofs.