[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78BJ3TX16KND9HHT4ASMWNB":3,"skill-same:01M78BJ3TX16KND9HHT4ASMWNB":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":14,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M78BJ3TX16KND9HHT4ASMWNB","zk",null,"For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fzk\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: zk\ndescription: \"For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.\"\nmetadata:\n  source: https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fskills\n  documentation: https:\u002F\u002Fwww.zkcompression.com\n  openclaw:\n    requires:\n      env: []\n      bins: [\"node\", \"cargo\", \"light\"]\n---\n# ZK Nullifiers\n\n## Overview\n\nBuilding a ZK Solana program requires:\n- Nullifiers to prevent double spending\n- Proof verification\n- A Merkle tree to store state\n- An indexer to serve Merkle proofs\n- Encrypted state\n\nFor non-ZK applications that use nullifiers, see the `compressed-pda` skill.\n\n## Workflow\n\n1. **Clarify intent**\n   - Recommend plan mode, if it's not activated\n   - Use `AskUserQuestion` to resolve blind spots\n   - All questions must be resolved before execution\n2. **Identify references and skills**\n   - Match task to [resources](#resources) below\n   - Locate relevant documentation and examples\n3. **Write plan file** (YAML task format)\n   - Use `AskUserQuestion` for anything unclear — never guess or assume\n   - Identify blockers: permissions, dependencies, unknowns\n   - Plan must be complete before execution begins\n4. **Execute**\n   - Use `Task` tool with subagents for parallel research\n   - Subagents load skills via `Skill` tool\n   - Track progress with `TodoWrite`\n5. **When stuck**: ask to spawn a read-only subagent with `Read`, `Glob`, `Grep`, and DeepWiki MCP access, loading `skills\u002Fask-mcp`. Scope reads to skill references, example repos, and docs.\n\n## Nullifiers on Solana\n\nA nullifier is a deterministically derived hash to ensure an action can only be performed once. The nullifier cannot be linked to the action or user. For example Zcash uses nullifiers to prevent double spending.\n\nTo implement nullifiers we need a data structure that ensures every nullifier is only created once and never deleted. On Solana a straight forward way to implement nullifiers is to create a PDA account with the nullifier as seed.\n\nPDA accounts cannot be closed and permanently lock 890,880 lamports (per nullifier rent-exemption).\nCompressed PDAs are derived similar to Solana PDAs and cost 15,000 lamports to create (no rent-exemption).\n\n| Storage | Cost per nullifier |\n|---------|-------------------|\n| PDA | 890,880 lamports |\n| Compressed PDA | 15,000 lamports |\n\n\n## Testing\n\n```bash\n# Rust tests\ncargo test-sbf -p nullifier\n\n# TypeScript tests (requires light test-validator)\nlight test-validator  # separate terminal\nnpm run test:ts\n```\n\n## Pattern Overview\n\n```\n1. Client computes nullifier = hash(secret, context)\n2. Client fetches validity proof for derived address (proves it does not exist)\n3. Client calls create_nullifier with nullifier values and proof\n4. Program derives address from nullifier, creates compressed account via CPI\n5. Light system program rejects CPI if address already exists\n```\n\n## Resources\n\n- Full example: [program-examples\u002Fzk\u002Fnullifier](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fprogram-examples\u002Ftree\u002Fmain\u002Fzk\u002Fnullifier)\n- ZK overview: [zkcompression.com\u002Fzk\u002Foverview](https:\u002F\u002Fwww.zkcompression.com\u002Fzk\u002Foverview)\n- Additional ZK examples: [program-examples\u002Fzk](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fprogram-examples\u002Ftree\u002Fmain\u002Fzk) (nullifier, zk-id, mixer, shielded-pool)\n\n## Reference Implementation\n\nSource: [program-examples\u002Fzk\u002Fnullifier](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fprogram-examples\u002Ftree\u002Fmain\u002Fzk\u002Fnullifier)\n\n### Account Structure\n\n```rust\n#[derive(Clone, Debug, Default, BorshSerialize, BorshDeserialize, LightDiscriminator)]\npub struct NullifierAccount {}\n```\n\nEmpty struct since existence alone proves the nullifier was used.\n\n### Address Derivation\n\n```rust\npub const NULLIFIER_PREFIX: &[u8] = b\"nullifier\";\n\nlet (address, address_seed) = derive_address(\n    &[NULLIFIER_PREFIX, nullifier.as_slice()],  \u002F\u002F seeds\n    &address_tree_pubkey,                        \u002F\u002F address tree\n    &program_id,                                 \u002F\u002F program ID\n);\n```\n\nAddress is deterministically derived from:\n- Constant prefix (prevents collisions with other account types)\n- Nullifier value (32 bytes)\n- Address tree pubkey\n- Program ID\n\n### Instruction Data\n\n```rust\n#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]\npub struct NullifierInstructionData {\n    pub proof: ValidityProof,           \u002F\u002F ZK proof that addresses don't exist\n    pub address_tree_info: PackedAddressTreeInfo,\n    pub output_state_tree_index: u8,\n    pub system_accounts_offset: u8,\n}\n```\n\n### Create Nullifiers Function\n\n```rust\npub fn create_nullifiers\u003C'info>(\n    nullifiers: &[[u8; 32]],\n    data: NullifierInstructionData,\n    signer: &AccountInfo\u003C'info>,\n    remaining_accounts: &[AccountInfo\u003C'info>],\n) -> Result\u003C()> {\n    let light_cpi_accounts = CpiAccounts::new(\n        signer,\n        &remaining_accounts[data.system_accounts_offset as usize..],\n        LIGHT_CPI_SIGNER,\n    );\n\n    let address_tree_pubkey = data\n        .address_tree_info\n        .get_tree_pubkey(&light_cpi_accounts)\n        .map_err(|_| ErrorCode::AccountNotEnoughKeys)?;\n\n    let mut cpi_builder = LightSystemProgramCpi::new_cpi(LIGHT_CPI_SIGNER, data.proof);\n    let mut new_address_params: Vec\u003CNewAddressParamsAssignedPacked> =\n        Vec::with_capacity(nullifiers.len());\n\n    for (i, nullifier) in nullifiers.iter().enumerate() {\n        let (address, address_seed) = derive_address(\n            &[NULLIFIER_PREFIX, nullifier.as_slice()],\n            &address_tree_pubkey,\n            &crate::ID,\n        );\n\n        let nullifier_account = LightAccount::\u003CNullifierAccount>::new_init(\n            &crate::ID,\n            Some(address),\n            data.output_state_tree_index,\n        );\n\n        cpi_builder = cpi_builder.with_light_account(nullifier_account)?;\n        new_address_params.push(\n            data.address_tree_info\n                .into_new_address_params_assigned_packed(address_seed, Some(i as u8)),\n        );\n    }\n\n    cpi_builder\n        .with_new_addresses(&new_address_params)\n        .invoke(light_cpi_accounts)?;\n\n    Ok(())\n}\n```\n\n### Program Entry Point\n\n```rust\n#[program]\npub mod nullifier {\n    pub fn create_nullifier\u003C'info>(\n        ctx: Context\u003C'_, '_, '_, 'info, CreateNullifierAccounts\u003C'info>>,\n        data: NullifierInstructionData,\n        nullifiers: Vec\u003C[u8; 32]>,\n    ) -> Result\u003C()> {\n        \u002F\u002F Verify your ZK proof here. Use nullifiers as public inputs.\n        \u002F\u002F Example:\n        \u002F\u002F let public_inputs = [...nullifiers, ...your_other_inputs];\n        \u002F\u002F Groth16Verifier::new(...).verify()?;\n\n        create_nullifiers(\n            &nullifiers,\n            data,\n            ctx.accounts.signer.as_ref(),\n            ctx.remaining_accounts,\n        )\n    }\n}\n\n#[derive(Accounts)]\npub struct CreateNullifierAccounts\u003C'info> {\n    #[account(mut)]\n    pub signer: Signer\u003C'info>,\n}\n```\n\n## Client Implementation (TypeScript)\n\n```typescript\nconst NULLIFIER_PREFIX = Buffer.from(\"nullifier\");\nconst addressTree = new web3.PublicKey(batchAddressTree);\n\n\u002F\u002F Derive addresses for each nullifier\nconst addressesWithTree = nullifiers.map((nullifier) => {\n    const seed = deriveAddressSeedV2([NULLIFIER_PREFIX, nullifier]);\n    const address = deriveAddressV2(seed, addressTree, programId);\n    return { tree: addressTree, queue: addressTree, address: bn(address.toBytes()) };\n});\n\n\u002F\u002F Get validity proof (proves addresses don't exist)\nconst proofResult = await rpc.getValidityProofV0([], addressesWithTree);\n\n\u002F\u002F Build remaining accounts\nconst remainingAccounts = new PackedAccounts();\nremainingAccounts.addSystemAccountsV2(SystemAccountMetaConfig.new(programId));\nconst addressMerkleTreeIndex = remainingAccounts.insertOrGet(addressTree);\nconst outputStateTreeIndex = remainingAccounts.insertOrGet(outputStateTree);\n\n\u002F\u002F Build instruction data\nconst data = {\n    proof: { 0: proofResult.compressedProof },\n    addressTreeInfo: {\n        addressMerkleTreePubkeyIndex: addressMerkleTreeIndex,\n        addressQueuePubkeyIndex: addressMerkleTreeIndex,\n        rootIndex: proofResult.rootIndices[0],\n    },\n    outputStateTreeIndex,\n    systemAccountsOffset: systemStart,\n};\n\n\u002F\u002F Call program\nconst ix = await program.methods\n    .createNullifier(data, nullifiers.map((n) => Array.from(n)))\n    .accounts({ signer: signer.publicKey })\n    .remainingAccounts(remainingAccounts)\n    .instruction();\n```\n\n## Client Implementation (Rust)\n\n```rust\nuse light_sdk::address::v2::derive_address;\n\nlet address_tree_info = rpc.get_address_tree_v2();\n\n\u002F\u002F Derive addresses\nlet address_with_trees: Vec\u003CAddressWithTree> = nullifiers\n    .iter()\n    .map(|n| {\n        let (address, _) = derive_address(\n            &[NULLIFIER_PREFIX, n.as_slice()],\n            &address_tree_info.tree,\n            &program_id,\n        );\n        AddressWithTree {\n            address,\n            tree: address_tree_info.tree,\n        }\n    })\n    .collect();\n\n\u002F\u002F Get validity proof (empty hashes = non-inclusion proof)\nlet rpc_result = rpc\n    .get_validity_proof(vec![], address_with_trees, None)\n    .await?\n    .value;\n\n\u002F\u002F Build accounts\nlet mut remaining_accounts = PackedAccounts::default();\nlet config = SystemAccountMetaConfig::new(program_id);\nremaining_accounts.add_system_accounts_v2(config)?;\n\nlet packed_address_tree_accounts = rpc_result\n    .pack_tree_infos(&mut remaining_accounts)\n    .address_trees;\n\nlet output_state_tree_index = rpc\n    .get_random_state_tree_info()?\n    .pack_output_tree_index(&mut remaining_accounts)?;\n```\n\n## SDK references\n\n| Package | Link |\n|---------|------|\n| `light-sdk` | [docs.rs](https:\u002F\u002Fdocs.rs\u002Flight-sdk\u002Flatest\u002Flight_sdk\u002F) |\n| `@lightprotocol\u002Fstateless.js` | [API docs](https:\u002F\u002Flightprotocol.github.io\u002Flight-protocol\u002Fstateless.js\u002Findex.html) |\n| `light-client` | [docs.rs](https:\u002F\u002Fdocs.rs\u002Flight-client\u002Flatest\u002Flight_client\u002F) |\n| `@lightprotocol\u002Fnullifier-program` | [npm](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@lightprotocol\u002Fnullifier-program) |\n| `light-nullifier-program` | [crates.io](https:\u002F\u002Fcrates.io\u002Fcrates\u002Flight-nullifier-program) |\n| `light-program-test` | [docs.rs](https:\u002F\u002Fdocs.rs\u002Fcrate\u002Flight-program-test\u002Flatest) |\n\n## Security\n\nThis skill provides code patterns and documentation references only.\n\n- **No credentials consumed.** The skill requires no API keys, private keys, or signing secrets. `env: []` is declared explicitly.\n- **Subagent scope.** When stuck, the skill asks to spawn a read-only subagent with `Read`, `Glob`, `Grep` scoped to skill references, example repos, and docs.\n- **Install source.** `npx skills add Lightprotocol\u002Fskills` from [Lightprotocol\u002Fskills](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fskills).\n- **Audited protocol.** Light Protocol smart contracts are independently audited. Reports are published at [github.com\u002FLightprotocol\u002Flight-protocol\u002Ftree\u002Fmain\u002Faudits](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Flight-protocol\u002Ftree\u002Fmain\u002Faudits).\n","# ZK Nullifiers\n\n## Overview\n\nBuilding a ZK Solana program requires:\n- Nullifiers to prevent double spending\n- Proof verification\n- A Merkle tree to store state\n- An indexer to serve Merkle proofs\n- Encrypted state\n\nFor non-ZK applications that use nullifiers, see the `compressed-pda` skill.\n\n## Workflow\n\n1. **Clarify intent**\n   - Recommend plan mode, if it's not activated\n   - Use `AskUserQuestion` to resolve blind spots\n   - All questions must be resolved before execution\n2. **Identify references and skills**\n   - Match task to [resources](#resources) below\n   - Locate relevant documentation and examples\n3. **Write plan file** (YAML task format)\n   - Use `AskUserQuestion` for anything unclear — never guess or assume\n   - Identify blockers: permissions, dependencies, unknowns\n   - Plan must be complete before execution begins\n4. **Execute**\n   - Use `Task` tool with subagents for parallel research\n   - Subagents load skills via `Skill` tool\n   - Track progress with `TodoWrite`\n5. **When stuck**: ask to spawn a read-only subagent with `Read`, `Glob`, `Grep`, and DeepWiki MCP access, loading `skills\u002Fask-mcp`. Scope reads to skill references, example repos, and docs.\n\n## Nullifiers on Solana\n\nA nullifier is a deterministically derived hash to ensure an action can only be performed once. The nullifier cannot be linked to the action or user. For example Zcash uses nullifiers to prevent double spending.\n\nTo implement nullifiers we need a data structure that ensures every nullifier is only created once and never deleted. On Solana a straight forward way to implement nullifiers is to create a PDA account with the nullifier as seed.\n\nPDA accounts cannot be closed and permanently lock 890,880 lamports (per nullifier rent-exemption).\nCompressed PDAs are derived similar to Solana PDAs and cost 15,000 lamports to create (no rent-exemption).\n\n| Storage | Cost per nullifier |\n|---------|-------------------|\n| PDA | 890,880 lamports |\n| Compressed PDA | 15,000 lamports |\n\n\n## Testing\n\n```bash\n# Rust tests\ncargo test-sbf -p nullifier\n\n# TypeScript tests (requires light test-validator)\nlight test-validator  # separate terminal\nnpm run test:ts\n```\n\n## Pattern Overview\n\n```\n1. Client computes nullifier = hash(secret, context)\n2. Client fetches validity proof for derived address (proves it does not exist)\n3. Client calls create_nullifier with nullifier values and proof\n4. Program derives address from nullifier, creates compressed account via CPI\n5. Light system program rejects CPI if address already exists\n```\n\n## Resources\n\n- Full example: [program-examples\u002Fzk\u002Fnullifier](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fprogram-examples\u002Ftree\u002Fmain\u002Fzk\u002Fnullifier)\n- ZK overview: [zkcompression.com\u002Fzk\u002Foverview](https:\u002F\u002Fwww.zkcompression.com\u002Fzk\u002Foverview)\n- Additional ZK examples: [program-examples\u002Fzk](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fprogram-examples\u002Ftree\u002Fmain\u002Fzk) (nullifier, zk-id, mixer, shielded-pool)\n\n## Reference Implementation\n\nSource: [program-examples\u002Fzk\u002Fnullifier](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fprogram-examples\u002Ftree\u002Fmain\u002Fzk\u002Fnullifier)\n\n### Account Structure\n\n```rust\n#[derive(Clone, Debug, Default, BorshSerialize, BorshDeserialize, LightDiscriminator)]\npub struct NullifierAccount {}\n```\n\nEmpty struct since existence alone proves the nullifier was used.\n\n### Address Derivation\n\n```rust\npub const NULLIFIER_PREFIX: &[u8] = b\"nullifier\";\n\nlet (address, address_seed) = derive_address(\n    &[NULLIFIER_PREFIX, nullifier.as_slice()],  \u002F\u002F seeds\n    &address_tree_pubkey,                        \u002F\u002F address tree\n    &program_id,                                 \u002F\u002F program ID\n);\n```\n\nAddress is deterministically derived from:\n- Constant prefix (prevents collisions with other account types)\n- Nullifier value (32 bytes)\n- Address tree pubkey\n- Program ID\n\n### Instruction Data\n\n```rust\n#[derive(Clone, Debug, AnchorSerialize, AnchorDeserialize)]\npub struct NullifierInstructionData {\n    pub proof: ValidityProof,           \u002F\u002F ZK proof that addresses don't exist\n    pub address_tree_info: PackedAddressTreeInfo,\n    pub output_state_tree_index: u8,\n    pub system_accounts_offset: u8,\n}\n```\n\n### Create Nullifiers Function\n\n```rust\npub fn create_nullifiers\u003C'info>(\n    nullifiers: &[[u8; 32]],\n    data: NullifierInstructionData,\n    signer: &AccountInfo\u003C'info>,\n    remaining_accounts: &[AccountInfo\u003C'info>],\n) -> Result\u003C()> {\n    let light_cpi_accounts = CpiAccounts::new(\n        signer,\n        &remaining_accounts[data.system_accounts_offset as usize..],\n        LIGHT_CPI_SIGNER,\n    );\n\n    let address_tree_pubkey = data\n        .address_tree_info\n        .get_tree_pubkey(&light_cpi_accounts)\n        .map_err(|_| ErrorCode::AccountNotEnoughKeys)?;\n\n    let mut cpi_builder = LightSystemProgramCpi::new_cpi(LIGHT_CPI_SIGNER, data.proof);\n    let mut new_address_params: Vec\u003CNewAddressParamsAssignedPacked> =\n        Vec::with_capacity(nullifiers.len());\n\n    for (i, nullifier) in nullifiers.iter().enumerate() {\n        let (address, address_seed) = derive_address(\n            &[NULLIFIER_PREFIX, nullifier.as_slice()],\n            &address_tree_pubkey,\n            &crate::ID,\n        );\n\n        let nullifier_account = LightAccount::\u003CNullifierAccount>::new_init(\n            &crate::ID,\n            Some(address),\n            data.output_state_tree_index,\n        );\n\n        cpi_builder = cpi_builder.with_light_account(nullifier_account)?;\n        new_address_params.push(\n            data.address_tree_info\n                .into_new_address_params_assigned_packed(address_seed, Some(i as u8)),\n        );\n    }\n\n    cpi_builder\n        .with_new_addresses(&new_address_params)\n        .invoke(light_cpi_accounts)?;\n\n    Ok(())\n}\n```\n\n### Program Entry Point\n\n```rust\n#[program]\npub mod nullifier {\n    pub fn create_nullifier\u003C'info>(\n        ctx: Context\u003C'_, '_, '_, 'info, CreateNullifierAccounts\u003C'info>>,\n        data: NullifierInstructionData,\n        nullifiers: Vec\u003C[u8; 32]>,\n    ) -> Result\u003C()> {\n        \u002F\u002F Verify your ZK proof here. Use nullifiers as public inputs.\n        \u002F\u002F Example:\n        \u002F\u002F let public_inputs = [...nullifiers, ...your_other_inputs];\n        \u002F\u002F Groth16Verifier::new(...).verify()?;\n\n        create_nullifiers(\n            &nullifiers,\n            data,\n            ctx.accounts.signer.as_ref(),\n            ctx.remaining_accounts,\n        )\n    }\n}\n\n#[derive(Accounts)]\npub struct CreateNullifierAccounts\u003C'info> {\n    #[account(mut)]\n    pub signer: Signer\u003C'info>,\n}\n```\n\n## Client Implementation (TypeScript)\n\n```typescript\nconst NULLIFIER_PREFIX = Buffer.from(\"nullifier\");\nconst addressTree = new web3.PublicKey(batchAddressTree);\n\n\u002F\u002F Derive addresses for each nullifier\nconst addressesWithTree = nullifiers.map((nullifier) => {\n    const seed = deriveAddressSeedV2([NULLIFIER_PREFIX, nullifier]);\n    const address = deriveAddressV2(seed, addressTree, programId);\n    return { tree: addressTree, queue: addressTree, address: bn(address.toBytes()) };\n});\n\n\u002F\u002F Get validity proof (proves addresses don't exist)\nconst proofResult = await rpc.getValidityProofV0([], addressesWithTree);\n\n\u002F\u002F Build remaining accounts\nconst remainingAccounts = new PackedAccounts();\nremainingAccounts.addSystemAccountsV2(SystemAccountMetaConfig.new(programId));\nconst addressMerkleTreeIndex = remainingAccounts.insertOrGet(addressTree);\nconst outputStateTreeIndex = remainingAccounts.insertOrGet(outputStateTree);\n\n\u002F\u002F Build instruction data\nconst data = {\n    proof: { 0: proofResult.compressedProof },\n    addressTreeInfo: {\n        addressMerkleTreePubkeyIndex: addressMerkleTreeIndex,\n        addressQueuePubkeyIndex: addressMerkleTreeIndex,\n        rootIndex: proofResult.rootIndices[0],\n    },\n    outputStateTreeIndex,\n    systemAccountsOffset: systemStart,\n};\n\n\u002F\u002F Call program\nconst ix = await program.methods\n    .createNullifier(data, nullifiers.map((n) => Array.from(n)))\n    .accounts({ signer: signer.publicKey })\n    .remainingAccounts(remainingAccounts)\n    .instruction();\n```\n\n## Client Implementation (Rust)\n\n```rust\nuse light_sdk::address::v2::derive_address;\n\nlet address_tree_info = rpc.get_address_tree_v2();\n\n\u002F\u002F Derive addresses\nlet address_with_trees: Vec\u003CAddressWithTree> = nullifiers\n    .iter()\n    .map(|n| {\n        let (address, _) = derive_address(\n            &[NULLIFIER_PREFIX, n.as_slice()],\n            &address_tree_info.tree,\n            &program_id,\n        );\n        AddressWithTree {\n            address,\n            tree: address_tree_info.tree,\n        }\n    })\n    .collect();\n\n\u002F\u002F Get validity proof (empty hashes = non-inclusion proof)\nlet rpc_result = rpc\n    .get_validity_proof(vec![], address_with_trees, None)\n    .await?\n    .value;\n\n\u002F\u002F Build accounts\nlet mut remaining_accounts = PackedAccounts::default();\nlet config = SystemAccountMetaConfig::new(program_id);\nremaining_accounts.add_system_accounts_v2(config)?;\n\nlet packed_address_tree_accounts = rpc_result\n    .pack_tree_infos(&mut remaining_accounts)\n    .address_trees;\n\nlet output_state_tree_index = rpc\n    .get_random_state_tree_info()?\n    .pack_output_tree_index(&mut remaining_accounts)?;\n```\n\n## SDK references\n\n| Package | Link |\n|---------|------|\n| `light-sdk` | [docs.rs](https:\u002F\u002Fdocs.rs\u002Flight-sdk\u002Flatest\u002Flight_sdk\u002F) |\n| `@lightprotocol\u002Fstateless.js` | [API docs](https:\u002F\u002Flightprotocol.github.io\u002Flight-protocol\u002Fstateless.js\u002Findex.html) |\n| `light-client` | [docs.rs](https:\u002F\u002Fdocs.rs\u002Flight-client\u002Flatest\u002Flight_client\u002F) |\n| `@lightprotocol\u002Fnullifier-program` | [npm](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@lightprotocol\u002Fnullifier-program) |\n| `light-nullifier-program` | [crates.io](https:\u002F\u002Fcrates.io\u002Fcrates\u002Flight-nullifier-program) |\n| `light-program-test` | [docs.rs](https:\u002F\u002Fdocs.rs\u002Fcrate\u002Flight-program-test\u002Flatest) |\n\n## Security\n\nThis skill provides code patterns and documentation references only.\n\n- **No credentials consumed.** The skill requires no API keys, private keys, or signing secrets. `env: []` is declared explicitly.\n- **Subagent scope.** When stuck, the skill asks to spawn a read-only subagent with `Read`, `Glob`, `Grep` scoped to skill references, example repos, and docs.\n- **Install source.** `npx skills add Lightprotocol\u002Fskills` from [Lightprotocol\u002Fskills](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fskills).\n- **Audited protocol.** Light Protocol smart contracts are independently audited. Reports are published at [github.com\u002FLightprotocol\u002Flight-protocol\u002Ftree\u002Fmain\u002Faudits](https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Flight-protocol\u002Ftree\u002Fmain\u002Faudits).\n",{"name":5,"metadata":24,"description":7},{"source":25,"openclaw":26,"documentation":33},"https:\u002F\u002Fgithub.com\u002FLightprotocol\u002Fskills",{"requires":27},{"env":28,"bins":29},[],[30,31,32],"node","cargo","light","https:\u002F\u002Fwww.zkcompression.com","main","be3de0244dc1a57e323d8160787ebb40fb64930e","public\u002Fapi\u002Fskills\u002Fzk","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add Solizardking\u002Fskillhub-main --skill zk",{"tool":49,"command":50},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill zk",{"tool":52,"command":53},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill zk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fzk\u002FSKILL.md",true,[57,63],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"metadata.json","REFERENCE","参考文档",297,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fzk\u002Fmetadata.json",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"verification.json",963,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fzk\u002Fverification.json",[68,75,80,87,94,102],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],{"skillNo":76,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]