{"_id":"@egemengol/mina-credentials","_rev":"7-12c3054ad1531db5de681bdd696706ac","name":"@egemengol/mina-credentials","dist-tags":{"latest":"0.2.11"},"versions":{"0.2.7":{"name":"@egemengol/mina-credentials","version":"0.2.7","keywords":["mina-zkapp","mina-zk-app","mina-dapp","zkapp"],"author":{"name":"zksecurity","email":"hello@zksecurity.xyz"},"license":"Apache-2.0","_id":"@egemengol/mina-credentials@0.2.7","maintainers":[{"name":"egemengol","email":"egemengol@gmail.com"}],"homepage":"https://github.com/egemengol/mina-credentials#readme","bugs":{"url":"https://github.com/egemengol/mina-credentials/issues"},"dist":{"shasum":"2322c81bf102a22bc5c65428bb1da98173d2cfa0","tarball":"https://registry.npmjs.org/@egemengol/mina-credentials/-/mina-credentials-0.2.7.tgz","fileCount":192,"integrity":"sha512-kiQFDdXgxxsMYut4/hbH2Ig1Ju6syCuWFNNFbEZCuiAzHMI1qIzKhJrpJAhuAPImzkQAoi2Fpj75xRZtudrcXA==","signatures":[{"sig":"MEYCIQCqU5haYxoTGz+fPfzANX5D9yzTSIQtxHFf8JwAPSxqogIhAOPxrtYoAVL8O3q7xks7mM8jgmZrK9Y839hy57nJRHt1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1743751},"main":"build/src/index.js","type":"module","types":"build/src/index.d.ts","engines":{"node":">=22.0"},"exports":{".":{"import":"./build/src/index.js"},"./dynamic":{"import":"./build/src/dynamic.js"},"./validation":{"import":"./build/src/validation.js"}},"gitHead":"bda4bee4f726236c3768d90ce6d72f50b94bbffc","scripts":{"test":"node --test --experimental-strip-types --no-warnings {tests,src}/**/*.test.ts","build":"tsc","watch":"tsc --watch","format":"prettier --write --ignore-unknown **/*","examples":"node --test --experimental-strip-types --no-warnings examples/*.eg.ts","test-one":"node --enable-source-maps --test --experimental-strip-types --no-warnings","extension:dev":"vite build --config browser-extension/vite.config.js --watch","prepublishOnly":"rm -rf build && npm run build","extension:build":"vite build --config browser-extension/vite.config.js"},"_npmUser":{"name":"egemengol","email":"egemengol@gmail.com"},"repository":{"url":"git+https://github.com/egemengol/mina-credentials.git","type":"git"},"workspaces":["examples/web-demo","examples/web-demo/api-server"],"_npmVersion":"10.9.2","description":"Private Credentials on Mina","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"zod":"3.23.8","vite":"^4.3.9","prettier":"^2.3.2","typescript":"^5.7.0-beta","@types/node":"^22.5.5","@types/chrome":"^0.0.272"},"peerDependencies":{"o1js":"2.2.0"},"_npmOperationalInternal":{"tmp":"tmp/mina-credentials_0.2.7_1737474022942_0.9181218351929827","host":"s3://npm-registry-packages-npm-production"}},"0.2.10":{"name":"@egemengol/mina-credentials","version":"0.2.10","keywords":["mina-zkapp","mina-zk-app","mina-dapp","zkapp"],"author":{"name":"zksecurity","email":"hello@zksecurity.xyz"},"license":"Apache-2.0","_id":"@egemengol/mina-credentials@0.2.10","maintainers":[{"name":"egemengol","email":"egemengol@gmail.com"}],"homepage":"https://github.com/egemengol/mina-credentials#readme","bugs":{"url":"https://github.com/egemengol/mina-credentials/issues"},"dist":{"shasum":"b14cb3071ed2c61a001f69193c6b2ea0f09d0abc","tarball":"https://registry.npmjs.org/@egemengol/mina-credentials/-/mina-credentials-0.2.10.tgz","fileCount":192,"integrity":"sha512-KUvSRStAdpwHpxf9Rjh6+iM8W1iRXvR0HaIS2W+EeItsHZW1fVqXpQzklZuew/5RJCI9iIiseXjEwa7nyZzDyg==","signatures":[{"sig":"MEUCIQCJ85xOR7oawf8auTrfa49+S6hlXNjw8g1QbKvImvD6TgIgfAd//Hd9s7ARuHphzdCbeg61HNvUXYVMAbuTuGOJTk0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1743933},"main":"build/src/index.js","type":"module","types":"build/src/index.d.ts","engines":{"node":">=22.0"},"exports":{".":{"import":"./build/src/index.js"},"./dynamic":{"import":"./build/src/dynamic.js"},"./validation":{"import":"./build/src/validation.js"}},"gitHead":"1a31eb485d27a588b550d210ddd6894ec2763c1d","scripts":{"test":"node --test --experimental-strip-types --no-warnings {tests,src}/**/*.test.ts","build":"tsc","watch":"tsc --watch","format":"prettier --write --ignore-unknown **/*","examples":"node --test --experimental-strip-types --no-warnings examples/*.eg.ts","test-one":"node --enable-source-maps --test --experimental-strip-types --no-warnings","extension:dev":"vite build --config browser-extension/vite.config.js --watch","prepublishOnly":"rm -rf build && npm run build","extension:build":"vite build --config browser-extension/vite.config.js"},"_npmUser":{"name":"egemengol","email":"egemengol@gmail.com"},"repository":{"url":"git+https://github.com/egemengol/mina-credentials.git","type":"git"},"workspaces":["examples/web-demo","examples/web-demo/api-server"],"_npmVersion":"10.9.2","description":"Private Credentials on Mina","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"zod":"3.23.8","vite":"^4.3.9","prettier":"^2.3.2","typescript":"^5.7.0-beta","@types/node":"^22.5.5","@types/chrome":"^0.0.272"},"peerDependencies":{"o1js":"2.2.0"},"_npmOperationalInternal":{"tmp":"tmp/mina-credentials_0.2.10_1738948950813_0.5521884979429756","host":"s3://npm-registry-packages-npm-production"}},"0.2.11":{"name":"@egemengol/mina-credentials","version":"0.2.11","workspaces":["examples/web-demo","examples/web-demo/api-server"],"description":"Private Credentials on Mina","author":{"name":"zksecurity","email":"hello@zksecurity.xyz"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/egemengol/mina-credentials.git"},"keywords":["mina-zkapp","mina-zk-app","mina-dapp","zkapp"],"type":"module","main":"build/src/index.js","types":"build/src/index.d.ts","exports":{".":{"import":"./build/src/index.js"},"./dynamic":{"import":"./build/src/dynamic.js"},"./validation":{"import":"./build/src/validation.js"}},"scripts":{"build":"tsc","watch":"tsc --watch","format":"prettier --write --ignore-unknown **/*","test":"node --test --experimental-strip-types --no-warnings {tests,src}/**/*.test.ts","test-one":"node --enable-source-maps --test --experimental-strip-types --no-warnings","examples":"node --test --experimental-strip-types --no-warnings examples/*.eg.ts","extension:dev":"vite build --config browser-extension/vite.config.js --watch","extension:build":"vite build --config browser-extension/vite.config.js","prepublishOnly":"rm -rf build && npm run build"},"devDependencies":{"@types/chrome":"^0.0.272","@types/node":"^22.5.5","prettier":"^2.3.2","typescript":"^5.7.0-beta","vite":"^4.3.9","zod":"3.23.8"},"peerDependencies":{"o1js":"2.2.0"},"engines":{"node":">=22.0"},"_id":"@egemengol/mina-credentials@0.2.11","gitHead":"f3e4db3dab2aff148e036411e696c167334a31e7","bugs":{"url":"https://github.com/egemengol/mina-credentials/issues"},"homepage":"https://github.com/egemengol/mina-credentials#readme","_nodeVersion":"22.13.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-8+P0ldqwN05mksX8ekgSRrWDHFqEm7SyNweD/Ypct3dm9M0pFtCtV5VDE3kMdp1QhXXfj1B8YnyTpESfYWJ5qg==","shasum":"cf2afd0b219ac91dc5da7d853159315f9307f15c","tarball":"https://registry.npmjs.org/@egemengol/mina-credentials/-/mina-credentials-0.2.11.tgz","fileCount":192,"unpackedSize":1744114,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIQC3NsHQJD5Z3CEy8e5hTRxO0fbY8ovXeQDXV/nwUHwwZAIfZ0QIbr10WPjhDW5K2Q9I3zKEdGVQhgh/D9K96CHpmA=="}]},"_npmUser":{"name":"egemengol","email":"egemengol@gmail.com"},"directories":{},"maintainers":[{"name":"egemengol","email":"egemengol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mina-credentials_0.2.11_1743769239516_0.20697925344610701"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-21T15:40:22.874Z","modified":"2025-04-04T12:20:39.928Z","0.2.7":"2025-01-21T15:40:23.223Z","0.2.8":"2025-01-22T16:23:06.803Z","0.2.9":"2025-02-07T10:14:23.151Z","0.2.10":"2025-02-07T17:22:31.040Z","0.2.11":"2025-04-04T12:20:39.746Z"},"bugs":{"url":"https://github.com/egemengol/mina-credentials/issues"},"author":{"name":"zksecurity","email":"hello@zksecurity.xyz"},"license":"Apache-2.0","homepage":"https://github.com/egemengol/mina-credentials#readme","keywords":["mina-zkapp","mina-zk-app","mina-dapp","zkapp"],"repository":{"type":"git","url":"git+https://github.com/egemengol/mina-credentials.git"},"description":"Private Credentials on Mina","maintainers":[{"name":"egemengol","email":"egemengol@gmail.com"}],"readme":"# Mina Credentials\n\nThis is where we implement Private Credentials: https://github.com/MinaFoundation/Core-Grants/issues/35#issuecomment-2318685738\n\n## `mina-credentials/dynamic`\n\nUnder the import `mina-credentials/dynamic`, we export an entire library of dynamic data types and hashes with o1js.\n\nFeatures:\n\n- `DynamicSHA2` for hashing dynamic-length inputs with SHA2-256, -224, -384 or -512\n- `DynamicString` and `DynamicBytes` for representing strings and bytes\n- `DynamicArray`, a generalization of the above types to an arbitrary element type\n- `StaticArray`, which provides an API consistent with `DynamicArray` but for _fixed-length_ arrays (which aren't well-supported in o1js either)\n- `DynamicRecord`, a wrapper for objects that you don't necessarily know the exact layout of, but can be hashed and accessed properties of inside a circuit\n- `hashDynamic()`, for Poseidon-hashing pretty much any input (including plain strings, records, o1js types etc) in a way which is compatible to in-circuit hashing of padded data types like `DynamicRecord` and `DynamicArray`\n\nThe library is intended to help with importing **real-world credentials** into the Mina ecosystem: For example, to \"import\" your passport, you have to verify the passport authority's signature on your passport data. The signature relies one of several hashing and signature schemes such as ECDSA, RSA and SHA2-256, SHA2-384, SHA2-512. Also, the signature will be over a dynamic-length string.\n\nExample of SHA-512-hashing a dynamic-length string:\n\n```ts\nimport { Bytes, ZkProgram } from 'o1js';\nimport { DynamicSHA2, DynamicString } from 'mina-credentials/dynamic';\n\n// allow strings up to length 100 as input\nconst String = DynamicString({ maxLength: 100 });\n\nlet sha512Program = ZkProgram({\n  name: 'sha512',\n  publicOutput: Bytes(64); // 64 bytes == 512 bits\n\n  methods: {\n    run: {\n      privateInputs: [String],\n      async method(string: DynamicString) {\n        let publicOutput = DynamicSHA2.hash(512, string);\n        return { publicOutput };\n      },\n    },\n  },\n});\n\nawait sha512Program.compile();\n\nlet result = await sha512Program.run(String.from('Hello, world!'));\nlet provenHash: Bytes = result.proof.publicOutput;\n\nconsole.log(provenHash.toHex());\n```\n\n## License\n\n[Apache-2.0](LICENSE)\n\nCopyright 2024 zkSecurity\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","readmeFilename":"README.md"}