{"id":26825125,"url":"https://github.com/chancehudson/poseidon-solidity","last_synced_at":"2025-08-25T10:03:38.870Z","repository":{"id":65902541,"uuid":"601003661","full_name":"chancehudson/poseidon-solidity","owner":"chancehudson","description":"Poseidon hash function implemented in Solidity","archived":false,"fork":false,"pushed_at":"2024-08-14T17:20:56.000Z","size":1099,"stargazers_count":52,"open_issues_count":1,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-24T02:03:04.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chancehudson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-13T06:45:29.000Z","updated_at":"2025-07-22T01:17:36.000Z","dependencies_parsed_at":"2025-03-30T10:31:05.538Z","dependency_job_id":null,"html_url":"https://github.com/chancehudson/poseidon-solidity","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"e0079dcdc641b4343bb9c8a6115354f9e70aaa15"},"previous_names":["chancehudson/poseidon-solidity","vimwitch/poseidon-solidity"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/chancehudson/poseidon-solidity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-solidity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-solidity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-solidity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-solidity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chancehudson","download_url":"https://codeload.github.com/chancehudson/poseidon-solidity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-solidity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272044734,"owners_count":24864018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-30T10:19:18.348Z","updated_at":"2025-08-25T10:03:38.821Z","avatar_url":"https://github.com/chancehudson.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# poseidon-solidity [![CircleCI](https://img.shields.io/circleci/build/github/vimwitch/poseidon-solidity/main)](https://dl.circleci.com/status-badge/redirect/gh/vimwitch/poseidon-solidity/tree/main)\n\nPoseidon implementation in Solidity over alt_bn128 (aka BN254).\n\n**This implementation has not been audited.**\n\n## Benchmark\n\n```yaml\nT2 hash\n  - poseidon-solidity: 13,488 gas\n  - circomlibjs: 19,395 gas\n  - address: 0x22233340039aAB0C858bc6086f508d9A4f2fA4db\n\nT3 hash\n  - poseidon-solidity: 21,124 gas\n  - circomlibjs: 32,173 gas\n  - address: 0x3333333C0A88F9BE4fd23ed0536F9B6c427e3B93\n\nT4 hash\n  - poseidon-solidity: 37,617 gas\n  - circomlibjs: 48,267 gas\n  - address: 0x4443338EF595F44e0121df4C21102677B142ECF0\n\nT5 hash\n  - poseidon-solidity: 54,326 gas\n  - circomlibjs: 73,307 gas\n  - address: 0x555333f3f677Ca3930Bf7c56ffc75144c51D9767\n\nT6 hash\n  - poseidon-solidity: 74,039 gas\n  - circomlibjs: 100,197 gas\n  - address: 0x666333F371685334CdD69bdDdaFBABc87CE7c7Db\n\n# ---\n\nDeploy cost (T3)\n  - poseidon-solidity: 5,129,638 gas\n  - circomlibjs: 2,156,516 gas\n```\n\n## Use\n\n```sh\nnpm i poseidon-solidity\n```\n\n```solidity\nimport \"poseidon-solidity/PoseidonT3.sol\";\n\ncontract Example {\n\n  function combine(uint input0, uint input1) public {\n    uint out = PoseidonT3.hash([input0, input1]);\n  }\n\n}\n```\n\n## Deploy\n\nThis package includes config info for deploying with a [deterministic proxy](https://github.com/Arachnid/deterministic-deployment-proxy). The proxy itself is deployed using [Nick's method](https://eips.ethereum.org/EIPS/eip-1820#deployment-method) with a pre-signed transaction from a keyless address. The poseidon contracts are deployed through this proxy to get the same address in any evm.\n\nTo deploy in a hardhat/ethers type environment:\n\n```js\nconst { proxy, PoseidonT3 } = require('poseidon-solidity')\n\nconst [sender] = await ethers.getSigners()\n\n// First check if the proxy exists\nif (await ethers.provider.getCode(proxy.address) === '0x') {\n  // fund the keyless account\n  await sender.sendTransaction({\n    to: proxy.from,\n    value: proxy.gas,\n  })\n\n  // then send the presigned transaction deploying the proxy\n  await ethers.provider.sendTransaction(proxy.tx)\n}\n\n// Then deploy the hasher, if needed\nif (await ethers.provider.getCode(PoseidonT3.address) === '0x') {\n  await send.sendTransaction({\n    to: proxy.address,\n    data: PoseidonT3.data\n  })\n}\n\nconsole.log(`PoseidonT3 deployed to: ${PoseidonT3.address}`)\n```\n\n## Testing\n\n```sh\nnpm install\nnpm test\n```\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://appliedzkp.org\"\u003e\n\u003cimg width=\"50px\" height=\"auto\" src=\"https://raw.githubusercontent.com/vimwitch/poseidon-solidity/main/pse_logo.svg\" /\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchancehudson%2Fposeidon-solidity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchancehudson%2Fposeidon-solidity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchancehudson%2Fposeidon-solidity/lists"}