{"_id":"@aintivirus-ai/snarkjs-to-solana","_rev":"6-8fb4f7dfa2b5d88970ad5b4bafb6ff28","name":"@aintivirus-ai/snarkjs-to-solana","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@aintivirus-ai/snarkjs-to-solana","version":"1.0.0","keywords":["convert-snarkjs-proof","snarkjs-proof-convert","groth16-proof-convert","solana-verifier","verification-key-to-rust","cryptography","zero-knowledge","zk-proofs","blockchain"],"author":{"name":"Aintivirus-AI","email":"eityeily@gmail.com"},"license":"MIT","_id":"@aintivirus-ai/snarkjs-to-solana@1.0.0","maintainers":[{"name":"goldliondev","email":"eityeily@gmail.com"}],"homepage":"https://github.com/Aintivirus-AI/snarkjs-to-solana#readme","bugs":{"url":"https://github.com/Aintivirus-AI/snarkjs-to-solana/issues"},"bin":{"snarkjs-to-solana":"bin/cli.js"},"dist":{"shasum":"63db859ab7d9ad268f6978d59a66b92658fde2bc","tarball":"https://registry.npmjs.org/@aintivirus-ai/snarkjs-to-solana/-/snarkjs-to-solana-1.0.0.tgz","fileCount":38,"integrity":"sha512-Wl5SZnTUeHViMTCAF+32ypku8sMDoQhDeDSTXkvJrsjNFc4FMtt3dVaSdr7QazrnkPteFv5WjDOosfSjm2Vkug==","signatures":[{"sig":"MEQCICOlQOMW2a6k4q4F+syeRCx5IfG3kfN4vUJLYwjat7EjAiA3a5rNbaPs6s4ADsJ4SkmAPjnt+HwiRqC8WBp57gDPZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":196874},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"import":"./dist/index.js","browser":"./dist/index.browser.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"de33697519ac205e36314bdb72068c735897aa4e","scripts":{"lint":"eslint src/**/*.ts","test":"jest","build":"tsc","prepare":"npm run build","lint:fix":"eslint src/**/*.ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage","prePublishOnly":"npm run build && npm test","build:proofUtils":"cd proof_utils && ./build.sh && cd -","build:proofUtils:web":"cd proof_utils && wasm-pack build --target web --out-dir pkg-web && cd -","build:proofUtils:bundler":"cd proof_utils && wasm-pack build --target bundler --out-dir pkg-bundler && cd -"},"_npmUser":{"name":"goldliondev","email":"eityeily@gmail.com"},"repository":{"url":"git+https://github.com/Aintivirus-AI/snarkjs-to-solana.git","type":"git"},"_npmVersion":"11.6.2","description":"A comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's gr","directories":{},"_nodeVersion":"25.1.0","dependencies":{"commander":"^12.1.0","typescript":"^5.8.3","ffjavascript":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.2","eslint":"^9.29.0","ts-jest":"^29.4.0","@types/jest":"^30.0.0","@types/node":"^25.0.3","@typescript-eslint/parser":"^8.34.1","@typescript-eslint/eslint-plugin":"^8.34.1"},"_npmOperationalInternal":{"tmp":"tmp/snarkjs-to-solana_1.0.0_1766159344411_0.011486195101989782","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aintivirus-ai/snarkjs-to-solana","version":"1.0.1","keywords":["convert-snarkjs-proof","snarkjs-proof-convert","groth16-proof-convert","solana-verifier","verification-key-to-rust","cryptography","zero-knowledge","zk-proofs","blockchain"],"author":{"name":"Aintivirus-AI","email":"eityeily@gmail.com"},"license":"MIT","_id":"@aintivirus-ai/snarkjs-to-solana@1.0.1","maintainers":[{"name":"goldliondev","email":"eityeily@gmail.com"}],"homepage":"https://github.com/Aintivirus-AI/snarkjs-to-solana#readme","bugs":{"url":"https://github.com/Aintivirus-AI/snarkjs-to-solana/issues"},"bin":{"snarkjs-to-solana":"bin/cli.js"},"dist":{"shasum":"087ae9579a268ef3e78917aa0c5c64e3ee08d2b6","tarball":"https://registry.npmjs.org/@aintivirus-ai/snarkjs-to-solana/-/snarkjs-to-solana-1.0.1.tgz","fileCount":38,"integrity":"sha512-AGvUn/tWWNmhILiHD7GrwcrTrjny0TEKo645OAd/OrY894E4/lE5l1rRBEyqmw/uiWsqdePLHi1zD1HOVZMKLw==","signatures":[{"sig":"MEYCIQD51t+Vpe2hsYO8FaBLd9uRT1XHVp/UqL9bpjdVDfqvYQIhAPE0NAaQQPNcK/uDEAAhJevdMaB6Wdm53gXkjXU2nSrg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":197503},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"import":"./dist/index.js","browser":"./dist/index.browser.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"863ff555bd879fc7be1d2a7a6665858677f01626","scripts":{"lint":"eslint src/**/*.ts","test":"jest","build":"tsc","prepare":"npm run build","lint:fix":"eslint src/**/*.ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage","prePublishOnly":"npm run build && npm test","build:proofUtils":"cd proof_utils && ./build.sh && cd -","build:proofUtils:web":"cd proof_utils && wasm-pack build --target web --out-dir pkg-web && cd -","build:proofUtils:bundler":"cd proof_utils && wasm-pack build --target bundler --out-dir pkg-bundler && cd -"},"_npmUser":{"name":"goldliondev","email":"eityeily@gmail.com"},"repository":{"url":"git+https://github.com/Aintivirus-AI/snarkjs-to-solana.git","type":"git"},"_npmVersion":"11.6.2","description":"A comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's gr","directories":{},"_nodeVersion":"25.1.0","dependencies":{"commander":"^12.1.0","typescript":"^5.8.3","ffjavascript":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.2","eslint":"^9.29.0","ts-jest":"^29.4.0","@types/jest":"^30.0.0","@types/node":"^25.0.3","@typescript-eslint/parser":"^8.34.1","@typescript-eslint/eslint-plugin":"^8.34.1"},"_npmOperationalInternal":{"tmp":"tmp/snarkjs-to-solana_1.0.1_1766307233000_0.9555355455059014","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aintivirus-ai/snarkjs-to-solana","version":"1.0.2","keywords":["convert-snarkjs-proof","snarkjs-proof-convert","groth16-proof-convert","solana-verifier","verification-key-to-rust","cryptography","zero-knowledge","zk-proofs","blockchain"],"author":{"name":"Aintivirus-AI","email":"eityeily@gmail.com"},"license":"MIT","_id":"@aintivirus-ai/snarkjs-to-solana@1.0.2","maintainers":[{"name":"goldliondev","email":"eityeily@gmail.com"}],"homepage":"https://github.com/Aintivirus-AI/snarkjs-to-solana#readme","bugs":{"url":"https://github.com/Aintivirus-AI/snarkjs-to-solana/issues"},"bin":{"snarkjs-to-solana":"bin/cli.js"},"dist":{"shasum":"d3f54a9f71ed7e0ba6c1d0ed87ee3286509a7cd2","tarball":"https://registry.npmjs.org/@aintivirus-ai/snarkjs-to-solana/-/snarkjs-to-solana-1.0.2.tgz","fileCount":38,"integrity":"sha512-xsi+7GOSiQkAugN3hPXpdtpJ1mrO42NSBQSFfN4xI0I2WDVzHiyRx/9Js/3rRr7ooCFcuGbu1IC1nmeT3Ld3Yw==","signatures":[{"sig":"MEQCIBU70TE8IWKZu3fzAxcKv4ukrNs6RzsXFfN83v3rtQJgAiAl+bWcscv8LSZBOrQMFSVKN9U1XiHISWIBPexXlZ1dSw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":197503},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"import":"./dist/index.js","browser":"./dist/index.browser.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"44b5207c7468336983eb6daa734c36c4d7cd7ec4","scripts":{"lint":"eslint src/**/*.ts","test":"jest","build":"tsc","prepare":"npm run build","lint:fix":"eslint src/**/*.ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage","prePublishOnly":"npm run build && npm test","build:proofUtils":"cd proof_utils && ./build.sh && cd -","build:proofUtils:web":"cd proof_utils && wasm-pack build --target web --out-dir pkg-web && cd -","build:proofUtils:bundler":"cd proof_utils && wasm-pack build --target bundler --out-dir pkg-bundler && cd -"},"_npmUser":{"name":"goldliondev","email":"eityeily@gmail.com"},"repository":{"url":"git+https://github.com/Aintivirus-AI/snarkjs-to-solana.git","type":"git"},"_npmVersion":"11.6.2","description":"A comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's gr","directories":{},"_nodeVersion":"25.1.0","dependencies":{"commander":"^12.1.0","typescript":"^5.8.3","ffjavascript":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.2","eslint":"^9.29.0","ts-jest":"^29.4.0","@types/jest":"^30.0.0","@types/node":"^25.0.3","@typescript-eslint/parser":"^8.34.1","@typescript-eslint/eslint-plugin":"^8.34.1"},"_npmOperationalInternal":{"tmp":"tmp/snarkjs-to-solana_1.0.2_1766307850894_0.7817418304769299","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@aintivirus-ai/snarkjs-to-solana","version":"1.0.3","keywords":["convert-snarkjs-proof","snarkjs-proof-convert","groth16-proof-convert","solana-verifier","verification-key-to-rust","cryptography","zero-knowledge","zk-proofs","blockchain"],"author":{"name":"Aintivirus-AI","email":"eityeily@gmail.com"},"license":"MIT","_id":"@aintivirus-ai/snarkjs-to-solana@1.0.3","maintainers":[{"name":"goldliondev","email":"eityeily@gmail.com"}],"homepage":"https://github.com/Aintivirus-AI/snarkjs-to-solana#readme","bugs":{"url":"https://github.com/Aintivirus-AI/snarkjs-to-solana/issues"},"bin":{"snarkjs-to-solana":"bin/cli.js"},"dist":{"shasum":"aa73e09f8db663d93a5e4054bde44f3df38d2b51","tarball":"https://registry.npmjs.org/@aintivirus-ai/snarkjs-to-solana/-/snarkjs-to-solana-1.0.3.tgz","fileCount":38,"integrity":"sha512-t5+4xS+DQH/xNzCv7jFM/7fcq0cDsLKi48sxoQtV+n8VBCdY4tQVsZ9SKJhW9M+JUio7SrmnETDoH9G4BqLGPQ==","signatures":[{"sig":"MEUCIQDs13oAzl9RvKsSZKvyXWZMHsiqQhQLrzpmAZn4SwGblwIgONkpRwgLJVrkqZKXEDVldXnw9M/D2HZcmFPshtUIh9w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":197327},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"import":"./dist/index.js","browser":"./dist/index.browser.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"75134c21e40b374299ad0d746d28e94a3ea672da","scripts":{"lint":"eslint src/**/*.ts","test":"jest","build":"tsc","prepare":"npm run build","lint:fix":"eslint src/**/*.ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage","prePublishOnly":"npm run build && npm test","build:proofUtils":"cd proof_utils && ./build.sh && cd -","build:proofUtils:web":"cd proof_utils && wasm-pack build --target web --out-dir pkg-web && cd -","build:proofUtils:bundler":"cd proof_utils && wasm-pack build --target bundler --out-dir pkg-bundler && cd -"},"_npmUser":{"name":"goldliondev","email":"eityeily@gmail.com"},"repository":{"url":"git+https://github.com/Aintivirus-AI/snarkjs-to-solana.git","type":"git"},"_npmVersion":"11.6.2","description":"A comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's gr","directories":{},"_nodeVersion":"25.1.0","dependencies":{"commander":"^12.1.0","typescript":"^5.8.3","ffjavascript":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.2","eslint":"^9.29.0","ts-jest":"^29.4.0","@types/jest":"^30.0.0","@types/node":"^25.0.3","@typescript-eslint/parser":"^8.34.1","@typescript-eslint/eslint-plugin":"^8.34.1"},"_npmOperationalInternal":{"tmp":"tmp/snarkjs-to-solana_1.0.3_1766662283298_0.5891428844401185","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@aintivirus-ai/snarkjs-to-solana","version":"1.0.4","keywords":["convert-snarkjs-proof","snarkjs-proof-convert","groth16-proof-convert","solana-verifier","verification-key-to-rust","cryptography","zero-knowledge","zk-proofs","blockchain"],"author":{"name":"Aintivirus-AI","email":"eityeily@gmail.com"},"license":"MIT","_id":"@aintivirus-ai/snarkjs-to-solana@1.0.4","maintainers":[{"name":"goldliondev","email":"eityeily@gmail.com"}],"homepage":"https://github.com/Aintivirus-AI/snarkjs-to-solana#readme","bugs":{"url":"https://github.com/Aintivirus-AI/snarkjs-to-solana/issues"},"bin":{"snarkjs-to-solana":"bin/cli.js"},"dist":{"shasum":"8a500e51b58de0a5cfdd04808c9ff9ec206e9724","tarball":"https://registry.npmjs.org/@aintivirus-ai/snarkjs-to-solana/-/snarkjs-to-solana-1.0.4.tgz","fileCount":38,"integrity":"sha512-QvPQ17fUGCttFPVKmSCtH/yA5+KuZ8dFE4nn4jqeX72BrKcWEeZ3M3G8yPWstF/vRume72Q4LuQUfh7h69EfOQ==","signatures":[{"sig":"MEQCIGgmr999Okt3hdNI7PVcZCHrCyRZxpRxbrx0pe6cd6mSAiB6GHH2y4PGZ7w5q93KO9fsW0smmEC3KTuPZrsexov0Gg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":197322},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"node":"./dist/index.node.js","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"7399a2d56fbfe55563ab2b76bb890bad302dd0e5","scripts":{"lint":"eslint src/**/*.ts","test":"jest","build":"tsc","prepare":"npm run build","lint:fix":"eslint src/**/*.ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage","prePublishOnly":"npm run build && npm test","build:proofUtils":"cd proof_utils && ./build.sh && cd -","build:proofUtils:web":"cd proof_utils && wasm-pack build --target web --out-dir pkg-web && cd -","build:proofUtils:bundler":"cd proof_utils && wasm-pack build --target bundler --out-dir pkg-bundler && cd -"},"_npmUser":{"name":"goldliondev","email":"eityeily@gmail.com"},"repository":{"url":"git+https://github.com/Aintivirus-AI/snarkjs-to-solana.git","type":"git"},"_npmVersion":"11.6.2","description":"A comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's gr","directories":{},"_nodeVersion":"25.1.0","dependencies":{"commander":"^12.1.0","typescript":"^5.8.3","ffjavascript":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.2","eslint":"^9.29.0","ts-jest":"^29.4.0","@types/jest":"^30.0.0","@types/node":"^25.0.3","@typescript-eslint/parser":"^8.34.1","@typescript-eslint/eslint-plugin":"^8.34.1"},"_npmOperationalInternal":{"tmp":"tmp/snarkjs-to-solana_1.0.4_1774027397440_0.6993872612438696","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@aintivirus-ai/snarkjs-to-solana","version":"1.0.5","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","bin":{"snarkjs-to-solana":"bin/cli.js"},"exports":{".":{"node":"./dist/index.node.js","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"}},"author":{"name":"Aintivirus-AI","email":"eityeily@gmail.com"},"license":"MIT","dependencies":{"commander":"^12.1.0","ffjavascript":"^0.3.1","typescript":"^5.8.3"},"scripts":{"build":"tsc","build:proofUtils":"cd proof_utils && ./build.sh && cd -","build:proofUtils:web":"cd proof_utils && wasm-pack build --target web --out-dir pkg-web && cd -","build:proofUtils:bundler":"cd proof_utils && wasm-pack build --target bundler --out-dir pkg-bundler && cd -","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"eslint src/**/*.ts","lint:fix":"eslint src/**/*.ts --fix","prePublishOnly":"npm run build && npm test","prepare":"npm run build"},"keywords":["convert-snarkjs-proof","snarkjs-proof-convert","groth16-proof-convert","solana-verifier","verification-key-to-rust","cryptography","zero-knowledge","zk-proofs","blockchain"],"repository":{"type":"git","url":"git+https://github.com/Aintivirus-AI/snarkjs-to-solana.git"},"bugs":{"url":"https://github.com/Aintivirus-AI/snarkjs-to-solana/issues"},"homepage":"https://github.com/Aintivirus-AI/snarkjs-to-solana#readme","engines":{"node":">=14.0.0"},"devDependencies":{"@types/jest":"^30.0.0","@types/node":"^25.0.3","@typescript-eslint/eslint-plugin":"^8.34.1","@typescript-eslint/parser":"^8.34.1","eslint":"^9.29.0","jest":"^30.0.2","ts-jest":"^29.4.0"},"gitHead":"af38457155eef6de76f5e292f6efa1d9fe8583e7","_id":"@aintivirus-ai/snarkjs-to-solana@1.0.5","description":"A comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's gr","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-x9hV3fs407fOxDko9N4TTYspSd9z2CiKvoQsHEpdmLGHc4RJ2qU04Dzs9KVmLU0J0NeCXtJala2/7xu3LCQ0cA==","shasum":"6b903d30582de4581dcdb3839cc10dd270797fb9","tarball":"https://registry.npmjs.org/@aintivirus-ai/snarkjs-to-solana/-/snarkjs-to-solana-1.0.5.tgz","fileCount":38,"unpackedSize":197394,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGnrij7q0AUAG2NcIHcNQbixEcnz3Df/dDbR+pbIbAEzAiEAmSJYFxC/eh7gXRNkNueYFbh/w1Al6q73/pjvRyWuGcA="}]},"_npmUser":{"name":"goldliondev","email":"eityeily@gmail.com"},"directories":{},"maintainers":[{"name":"goldliondev","email":"eityeily@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/snarkjs-to-solana_1.0.5_1774287726548_0.4919002967006789"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-19T15:49:04.332Z","modified":"2026-03-23T17:42:06.836Z","1.0.0":"2025-12-19T15:49:04.579Z","1.0.1":"2025-12-21T08:53:53.143Z","1.0.2":"2025-12-21T09:04:11.047Z","1.0.3":"2025-12-25T11:31:23.447Z","1.0.4":"2026-03-20T17:23:17.581Z","1.0.5":"2026-03-23T17:42:06.684Z"},"bugs":{"url":"https://github.com/Aintivirus-AI/snarkjs-to-solana/issues"},"author":{"name":"Aintivirus-AI","email":"eityeily@gmail.com"},"license":"MIT","homepage":"https://github.com/Aintivirus-AI/snarkjs-to-solana#readme","keywords":["convert-snarkjs-proof","snarkjs-proof-convert","groth16-proof-convert","solana-verifier","verification-key-to-rust","cryptography","zero-knowledge","zk-proofs","blockchain"],"repository":{"type":"git","url":"git+https://github.com/Aintivirus-AI/snarkjs-to-solana.git"},"description":"A comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's gr","maintainers":[{"name":"goldliondev","email":"eityeily@gmail.com"}],"readme":"# @aintivirus-ai/snarkjs-to-solana\r\n\r\nA comprehensive toolkit for converting snarkjs artifacts to Solana-compatible formats. This package provides both CLI tools and programmatic APIs for converting zero-knowledge proofs and verification keys from snarkjs to formats that work with Solana's groth16 verifier.\r\n\r\n## Features\r\n\r\n- **Triple-target WASM compilation**: Optimized for web, bundler, and Node.js/CommonJS environments\r\n- **CLI interface**: Convert verification keys directly from the command line\r\n- **Programmatic API**: Integrate proof conversion into your applications\r\n- **Automatic environment detection**: Seamlessly works in Node.js, browsers, and bundlers\r\n- **TypeScript support**: Full type definitions included\r\n- **CommonJS and ESM compatibility**: Works with both module systems\r\n\r\n## Installation\r\n\r\n### Global Installation (Recommended for CLI usage)\r\n\r\n```bash\r\nnpm install -g @aintivirus-ai/snarkjs-to-solana\r\n```\r\n\r\n### Local Installation\r\n\r\n```bash\r\nnpm install @aintivirus-ai/snarkjs-to-solana\r\n```\r\n\r\nIf installed locally, you can run CLI commands using `npx`:\r\n\r\n```bash\r\nnpx snarkjs-to-solana verification-key-to-rust verification_key.json\r\n```\r\n\r\n## CLI Usage\r\n\r\n### Convert Verification Key to Rust\r\n\r\nConvert a snarkjs verification key JSON file to a Rust file compatible with Solana's groth16 verifier.\r\n\r\n**Usage:**\r\n\r\n```bash\r\nsnarkjs-to-solana verification-key-to-rust <verification-key-path> [options]\r\n```\r\n\r\n**Arguments:**\r\n\r\n- `<verification-key-path>`: Path to the verification key JSON file generated by snarkjs\r\n\r\n**Options:**\r\n\r\n- `-o, --output <directory>`: Output directory (defaults to current directory)\r\n- `-h, --help`: Display help for the command\r\n\r\n**Examples:**\r\n\r\n```bash\r\n# Convert verification key to current directory\r\nsnarkjs-to-solana verification-key-to-rust verification_key.json\r\n\r\n# Convert verification key to specific directory\r\nsnarkjs-to-solana verification-key-to-rust verification_key.json --output ./rust_files\r\n\r\n# Short form\r\nsnarkjs-to-solana verification-key-to-rust verification_key.json -o ./rust_files\r\n\r\n# Show help\r\nsnarkjs-to-solana verification-key-to-rust --help\r\n```\r\n\r\n**Output:**\r\nThe command generates a `verifying_key.rs` file containing:\r\n\r\n- A Rust struct compatible with `groth16_solana::groth16::Groth16Verifyingkey`\r\n- All verification key parameters properly formatted for Solana\r\n- Ready-to-use constants for your Solana verification program\r\n\r\n## Programmatic Usage\r\n\r\n### Node.js / CommonJS Environment\r\n\r\n```javascript\r\n// Works with both CommonJS (require) and ESM (import) in Node.js\r\nconst {\r\n  getSolanaCompatibleProof,\r\n} = require(\"@aintivirus-ai/snarkjs-to-solana\");\r\n// OR\r\nimport { getSolanaCompatibleProof } from \"@aintivirus-ai/snarkjs-to-solana\";\r\n\r\n// This automatically uses the Node.js-targeted WASM package (CommonJS compatible)\r\nconst result = await getSolanaCompatibleProof(proof);\r\n```\r\n\r\n### Modern Bundler Environment (Webpack, Vite, etc.)\r\n\r\n```javascript\r\n// In bundler environments like Webpack, Vite, Rollup, etc.\r\nimport { getSolanaCompatibleProof } from \"@aintivirus-ai/snarkjs-to-solana\";\r\n\r\n// This automatically uses the bundler-targeted WASM package\r\nconst result = await getSolanaCompatibleProof(proof);\r\n```\r\n\r\n### Browser Environment\r\n\r\n```javascript\r\n// In a browser environment, the package automatically uses the web-targeted WASM\r\nimport { getSolanaCompatibleProof } from \"@aintivirus-ai/snarkjs-to-solana\";\r\n\r\n// This automatically uses the web-targeted WASM package\r\nconst result = await getSolanaCompatibleProof(proof);\r\n```\r\n\r\n### Manual Target Selection\r\n\r\n```javascript\r\n// If you need to explicitly control which target to use:\r\n\r\n// For bundler environments (Node.js, Webpack, Vite, etc.)\r\nimport { getSolanaCompatibleProof } from \"@aintivirus-ai/snarkjs-to-solana/dist/index.js\";\r\n\r\n// For web environments (browsers)\r\nimport { getSolanaCompatibleProof } from \"@aintivirus-ai/snarkjs-to-solana/dist/index.browser.js\";\r\n```\r\n\r\n## Complete Example\r\n\r\nHere's a full example showing how to generate proofs with snarkjs and convert them for Solana:\r\n\r\n```javascript\r\nimport * as snarkjs from \"snarkjs\";\r\nimport { getSolanaCompatibleProof } from \"@aintivirus-ai/snarkjs-to-solana\";\r\n\r\n// 1. Generate proof using snarkjs\r\nconst { proof: circuitProof, publicSignals } = await snarkjs.groth16.fullProve(\r\n  circuitInputs,\r\n  \"../circom/ethDepositProof_js/ethDepositProof.wasm\",\r\n  \"../circom/ethDepositProof_js/1_0000.zkey\"\r\n);\r\n\r\n// 2. Convert proof to Solana-compatible format\r\nconst { proofA, proofB, proofC } = await getSolanaCompatibleProof(circuitProof);\r\n\r\n// 3. Use proofA, proofB, proofC in your Solana on-chain instruction\r\n// These can now be passed to your Solana program for verification\r\n```\r\n\r\n## Integration with snarkjs Workflow\r\n\r\n1. **Generate your circuit and verification key with snarkjs:**\r\n\r\n   ```bash\r\n   snarkjs groth16 setup circuit.r1cs powersOfTau28_hez_final_10.ptau circuit_0000.zkey\r\n   snarkjs zkey export verificationkey circuit_0000.zkey verification_key.json\r\n   ```\r\n\r\n2. **Convert verification key to Rust format:**\r\n\r\n   ```bash\r\n   snarkjs-to-solana verification-key-to-rust verification_key.json\r\n   ```\r\n\r\n3. **Generate and convert proofs in your application:**\r\n\r\n   ```javascript\r\n   // Generate proof with snarkjs\r\n   const { proof: circuitProof, publicSignals } =\r\n     await snarkjs.groth16.fullProve(\r\n       circuitInputs,\r\n       \"circuit.wasm\",\r\n       \"circuit.zkey\"\r\n     );\r\n\r\n   // Convert for Solana\r\n   const { proofA, proofB, proofC } = await getSolanaCompatibleProof(\r\n     circuitProof\r\n   );\r\n   ```\r\n\r\n4. **Use in your Solana program:**\r\n\r\n   ```rust\r\n   use groth16_solana::groth16::Groth16Verifyingkey;\r\n\r\n   // Include the generated verification key file\r\n   mod verifying_key;\r\n   use verifying_key::VERIFYINGKEY;\r\n\r\n   // Verify the proof on-chain\r\n   groth16_solana::groth16::verify(&VERIFYINGKEY, &proof, &public_inputs)?;\r\n   ```\r\n\r\n5. **Call Solana on-chain instruction with converted proofs:**\r\n   The `proofA`, `proofB`, and `proofC` values from step 3 are passed to your Solana program instruction for on-chain verification.\r\n\r\n## How It Works\r\n\r\nThe package automatically detects the environment and loads the appropriate WASM target:\r\n\r\n- **Bundler Target**: Optimized for Node.js and bundler environments (Webpack, Vite, Rollup, etc.)\r\n- **Web Target**: Optimized for direct browser usage with proper ES6 module support\r\n\r\nThe conditional exports in `package.json` ensure that:\r\n\r\n- Modern bundlers get the bundler-optimized version\r\n- Browsers get the web-optimized version\r\n- The appropriate WASM files are loaded dynamically\r\n\r\n## Build Process\r\n\r\nThe package uses a dual-target build system:\r\n\r\n1. **WASM Compilation**: Rust code is compiled to two WASM targets using `wasm-pack`\r\n2. **Unified Package**: Both targets are combined into a single package structure\r\n3. **Conditional Exports**: Package.json exports map environments to appropriate entry points\r\n4. **TypeScript Compilation**: TypeScript code is compiled to JavaScript for both targets\r\n\r\n## Error Handling\r\n\r\nThe CLI provides clear error messages for common issues:\r\n\r\n- **File not found**: If the verification key file doesn't exist\r\n- **Invalid JSON**: If the verification key file is not valid JSON\r\n- **Parse errors**: If the verification key format is not compatible with ffjavascript\r\n- **Permission errors**: If the output directory cannot be written to\r\n\r\n## Troubleshooting\r\n\r\n### CommonJS/ESM Compatibility Issues\r\n\r\nIf you encounter module loading errors in Node.js:\r\n\r\n```javascript\r\n// Try using require for CommonJS environments\r\nconst {\r\n  getSolanaCompatibleProof,\r\n} = require(\"@aintivirus-ai/snarkjs-to-solana\");\r\n\r\n// Or dynamic import for ESM environments\r\nconst { getSolanaCompatibleProof } = await import(\r\n  \"@aintivirus-ai/snarkjs-to-solana\"\r\n);\r\n```\r\n\r\n### Command not found\r\n\r\nIf you get \"command not found\" error:\r\n\r\n1. Ensure the package is installed globally: `npm install -g @aintivirus-ai/snarkjs-to-solana`\r\n2. Or use with npx: `npx @aintivirus-ai/snarkjs-to-solana`\r\n\r\n### Permission denied\r\n\r\nIf you get permission errors:\r\n\r\n1. Check that you have write permissions to the output directory\r\n2. Try specifying a different output directory with `-o`\r\n\r\n### Invalid verification key format\r\n\r\nEnsure your verification key was generated by snarkjs and follows the expected format:\r\n\r\n```json\r\n{\r\n  \"vk_alpha_1\": [...],\r\n  \"vk_beta_2\": [...],\r\n  \"vk_gamma_2\": [...],\r\n  \"vk_delta_2\": [...],\r\n  \"IC\": [...]\r\n}\r\n```\r\n\r\n## Package Structure\r\n\r\n```\r\nproof_utils/\r\n├── pkg/\r\n│   ├── web/           # Web-targeted WASM files\r\n│   ├── bundler/       # Bundler-targeted WASM files\r\n│   ├── index.js       # Main entry point (bundler)\r\n│   ├── index-web.js   # Web entry point\r\n│   └── package.json   # Unified package configuration\r\n├── src/\r\n│   ├── index.ts       # Main TypeScript entry (bundler)\r\n│   └── index.browser.ts # Browser TypeScript entry (web)\r\n└── dist/\r\n    ├── index.js       # Compiled bundler version\r\n    └── index.browser.js # Compiled web version\r\n```\r\n\r\n## API Reference\r\n\r\n### `getSolanaCompatibleProof(proof: any): Promise<object>`\r\n\r\nConverts a snarkjs proof to Solana-compatible format.\r\n\r\n**Parameters:**\r\n\r\n- `proof`: A proof object generated by snarkjs\r\n\r\n**Returns:**\r\n\r\n- Promise resolving to an object with `proofA`, `proofB`, and `proofC` properties\r\n\r\n## Dependencies\r\n\r\n- `ffjavascript`: For handling finite field arithmetic and proof parsing\r\n- `commander`: For CLI argument parsing\r\n- Custom WASM module for proof conversion\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n## Keywords\r\n\r\n- convert-snarkjs-proof\r\n- snarkjs-proof-convert\r\n- groth16-proof-convert\r\n- solana-verifier\r\n- verification-key-to-rust\r\n- cryptography\r\n- zero-knowledge\r\n- zk-proofs\r\n- blockchain\r\n","readmeFilename":"README.md"}