{"id":15920167,"url":"https://github.com/paulmillr/trusted-setups","last_synced_at":"2025-07-03T18:09:43.403Z","repository":{"id":257326609,"uuid":"857888024","full_name":"paulmillr/trusted-setups","owner":"paulmillr","description":"Easily access trusted setups in JS. Includes KZG / ETH","archived":false,"fork":false,"pushed_at":"2025-05-14T11:06:34.000Z","size":480,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T11:53:38.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulmillr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","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},"funding":{"github":"paulmillr"}},"created_at":"2024-09-15T21:28:46.000Z","updated_at":"2025-05-14T11:06:36.000Z","dependencies_parsed_at":"2024-09-16T02:42:45.717Z","dependency_job_id":"b436a39b-a35f-4b68-8933-91bbd3e46281","html_url":"https://github.com/paulmillr/trusted-setups","commit_stats":null,"previous_names":["paulmillr/trusted-setups"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/paulmillr/trusted-setups","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmillr%2Ftrusted-setups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmillr%2Ftrusted-setups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmillr%2Ftrusted-setups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmillr%2Ftrusted-setups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulmillr","download_url":"https://codeload.github.com/paulmillr/trusted-setups/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmillr%2Ftrusted-setups/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263376148,"owners_count":23457338,"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","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":"2024-10-06T19:21:22.611Z","updated_at":"2025-07-03T18:09:43.389Z","avatar_url":"https://github.com/paulmillr.png","language":"JavaScript","funding_links":["https://github.com/sponsors/paulmillr"],"categories":[],"sub_categories":[],"readme":"# trusted-setups\n\nEasily access KZG + PeerDAS / ETH [trusted setups](https://vitalik.eth.limo/general/2022/03/14/trustedsetup.html) in JS.\n\nExports 5 files:\n\n- `small-kzg.js` (default) - 400KB KZG setup\n- `small-peerdas.js` - ~800KB KZG+PeerDAS setup\n- `fast-kzg.js` - fast ~800KB KZG setup for [eth-signer](https://github.com/paulmillr/micro-eth-signer)\n- `fast-peerdas.js` - fast 3.1MB KZG+PeerDAS setup for [eth-signer](https://github.com/paulmillr/micro-eth-signer)\n- `trusted_setup.json`, for c-kzg and others\n\n## Usage\n\n\u003e npm install @paulmillr/trusted-setups\n\nThe package is located in namespace for security / anti-squatting reasons.\n\nWe test against [eth-signer](https://github.com/paulmillr/micro-eth-signer),\n[kzg-wasm](https://github.com/ethereumjs/kzg-wasm) and\n[c-kzg](https://github.com/ethereum/c-kzg-4844).\nOther libraries with similar API should also work.\n\n```js\nimport { trustedSetup } from '@paulmillr/trusted-setups/small-kzg.js';\n// import { trustedSetup } from '@paulmillr/trusted-setups/small-peerdas.js';\n// import { trustedSetup } from '@paulmillr/trusted-setups/fast-kzg.js';\n// import { trustedSetup } from '@paulmillr/trusted-setups/fast-peerdas.js';\n\n// Typed as:\ntype trustedSetup = {\n  g1_lagrange: string[];\n  g2_monomial: string[];\n  g1_monomial: string[];\n}\n\n// eth-signer\nimport { KZG } from 'micro-eth-signer/kzg';\nconst kzg = new KZG(trustedSetup);\n\n// kzg-wasm\nconst strip0x = items =\u003e items.map((i) =\u003e i.substring(2)).join('');\nconst g1 = strip0x(trustedSetup.g1_lagrange);\nconst g2 = strip0x(trustedSetup.g2_monomial);\nconst opts = { n1: 4096, n2: 65, g1, g2 };\nconst kzg = await loadKZG(opts);\n\n// c-kzg can't receive object, requires path\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nckzg.loadTrustedSetup(1, __dirname + '/trusted_setup.json');\n\ntrustedSetup.g1_lagrange.slice(0, 2)\n// [\n//   '0xa0413c0dcafec6dbc9f47d66785cf1e8c981044f7d13cfe3e4fcbb71b5408dfde6312493cb3c1d30516cb3ca88c03654',\n//   '0x8b997fb25730d661918371bb41f2a6e899cac23f04fc5365800b75433c0a953250e15e7a98fb5ca5cc56a8cd34c20c57'\n// ]\ntrustedSetup.g2_monomial.slice(0, 2)\n// [\n//   '0x93e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8',\n//   '0xb5bfd7dd8cdeb128843bc287230af38926187075cbfbefa81009a2ce615ac53d2914e5870cb452d2afaaab24f3499f72185cbfee53492714734429b7b38608e23926c911cceceac9a36851477ba4c60b087041de621000edc98edada20c1def2'\n// ]\n```\n\n## Verification\n\n`npm install \u0026\u0026 npm run build` will build files from `trusted_setup.txt`, which was copied from\n[c-kzg-4844](https://github.com/ethereum/c-kzg-4844/blob/445387f7dfd95b2b0d74b537b9d28f7b603b6f24/src/trusted_setup.txt).\n\nIts checksum is `d39b9f2d047cc9dca2de58f264b6a09448ccd34db967881a6713eacacf0f26b7`.\n\n## License\n\nMIT License\n\nCopyright (c) 2024 Paul Miller (https://paulmillr.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulmillr%2Ftrusted-setups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulmillr%2Ftrusted-setups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulmillr%2Ftrusted-setups/lists"}