{"_id":"@based-labs/drand-quicknet-registry","_rev":"4-ffe97dd03f38f2fa4ddc4829653ed7de","name":"@based-labs/drand-quicknet-registry","dist-tags":{"latest":"0.1.0","alpha":"0.1.0-alpha.2"},"versions":{"0.1.0-alpha.1":{"name":"@based-labs/drand-quicknet-registry","version":"0.1.0-alpha.1","license":"MIT","_id":"@based-labs/drand-quicknet-registry@0.1.0-alpha.1","maintainers":[{"name":"bmeredith","email":"whizkid120@gmail.com"}],"dist":{"shasum":"9a8990b5dd9b90cb3eba54ac3664c32013fef813","tarball":"https://registry.npmjs.org/@based-labs/drand-quicknet-registry/-/drand-quicknet-registry-0.1.0-alpha.1.tgz","fileCount":27,"integrity":"sha512-VmyJsihj2LXFK7CbgcpYlbW1HjtF8+Yp6kr0yPvNe3G3pFDp8KJk0ypM5uJNDECbtgjBsxtl8p4Oo8KQ4KtY2g==","signatures":[{"sig":"MEUCIQCZQwnWWamEGnvgsqEKjde5R88jw0agBSp7C2r7NjAqLQIgddwWd/JshKyhgzJaQo56cLwshiqlqAfcVseQcc7K8pw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51395},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bmeredith","email":"whizkid120@gmail.com"},"repository":{"url":"git+https://github.com/Bas3d-Labs/drand-quicknet-evm.git","type":"git","directory":"packages/registry-sdk"},"description":"TypeScript SDK for interacting with the drand Quicknet EVM beacon registry.","directories":{},"_nodeVersion":"26.0.0","dependencies":{"viem":"^2.55.11","@based-labs/drand-quicknet":"0.1.0-alpha.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/drand-quicknet-registry_0.1.0-alpha.1_1786591197884_0.20271951682242628","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.2":{"name":"@based-labs/drand-quicknet-registry","version":"0.1.0-alpha.2","license":"MIT","_id":"@based-labs/drand-quicknet-registry@0.1.0-alpha.2","maintainers":[{"name":"bmeredith","email":"whizkid120@gmail.com"}],"dist":{"shasum":"b72fa0fc9b0137c0573a44059bc6f3d89e07f0ea","tarball":"https://registry.npmjs.org/@based-labs/drand-quicknet-registry/-/drand-quicknet-registry-0.1.0-alpha.2.tgz","fileCount":27,"integrity":"sha512-v+4Hpj1LmqdyNUfVXYL0JX+npg8Nv0PZTmUR5dXQVfdi80RX4j+0uMiJpmDEE/LKxq0l6cP0vS+wdOMroOWgWw==","signatures":[{"sig":"MEUCIHgDxnKgudw1+PrVhv2yze89UzchZvS1NnawPeq5qLbLAiEAhf//DpJfCvsWkfWin6ZsMuEQbVSX8jQq1EUtanCmCs8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58385},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bmeredith","email":"whizkid120@gmail.com"},"repository":{"url":"git+https://github.com/Bas3d-Labs/drand-quicknet-evm.git","type":"git","directory":"packages/registry-sdk"},"description":"TypeScript SDK for interacting with the drand Quicknet EVM beacon registry.","directories":{},"_nodeVersion":"26.0.0","dependencies":{"viem":"^2.55.11","@based-labs/drand-quicknet":"0.1.0-alpha.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/drand-quicknet-registry_0.1.0-alpha.2_1786612038608_0.8262495569055657","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@based-labs/drand-quicknet-registry","version":"0.1.0","type":"module","description":"TypeScript SDK for interacting with the drand Quicknet EVM beacon registry.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Bas3d-Labs/drand-quicknet-evm.git","directory":"packages/registry-sdk"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"engines":{"node":">=24"},"publishConfig":{"access":"public"},"dependencies":{"viem":"^2.55.11","@based-labs/drand-quicknet":"0.1.0"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run","test:watch":"vitest","typecheck":"tsc -p tsconfig.json --noEmit"},"_id":"@based-labs/drand-quicknet-registry@0.1.0","bugs":{"url":"https://github.com/Bas3d-Labs/drand-quicknet-evm/issues"},"homepage":"https://github.com/Bas3d-Labs/drand-quicknet-evm#readme","_integrity":"sha512-qhCRgwHofLrlB9ek2J6C3oa+42Gdckk3BlkLXT+UtbffkZsnj/RBlNGw1vvM2c26exfH12wiQ6YsNBStPZXHsg==","_resolved":"/home/bmeredith/dev/based-labs/drand-quicknet-evm/release/based-labs-drand-quicknet-registry-0.1.0.tgz","_from":"file:/home/bmeredith/dev/based-labs/drand-quicknet-evm/release/based-labs-drand-quicknet-registry-0.1.0.tgz","_nodeVersion":"24.14.1","_npmVersion":"11.19.0","dist":{"integrity":"sha512-qhCRgwHofLrlB9ek2J6C3oa+42Gdckk3BlkLXT+UtbffkZsnj/RBlNGw1vvM2c26exfH12wiQ6YsNBStPZXHsg==","shasum":"3b1b4e5d87d36354928987bca3af6157b1aaaba5","tarball":"https://registry.npmjs.org/@based-labs/drand-quicknet-registry/-/drand-quicknet-registry-0.1.0.tgz","fileCount":27,"unpackedSize":61673,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGblIS4dfSKQewoI00BPzLs6G8kUrtle0WcyxEjnMkCNAiEA8GQRNLFzuJe/r2tv2GRX+C0jtYiZNUvA+HxmVovVqKo="}]},"_npmUser":{"name":"bmeredith","email":"whizkid120@gmail.com"},"directories":{},"maintainers":[{"name":"bmeredith","email":"whizkid120@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/drand-quicknet-registry_0.1.0_1789536289698_0.23332378209298454"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-13T03:19:57.642Z","modified":"2026-09-16T05:24:49.976Z","0.1.0-alpha.1":"2026-08-13T03:19:58.041Z","0.1.0-alpha.2":"2026-08-13T09:07:18.738Z","0.1.0":"2026-09-16T05:24:49.827Z"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Bas3d-Labs/drand-quicknet-evm.git","directory":"packages/registry-sdk"},"description":"TypeScript SDK for interacting with the drand Quicknet EVM beacon registry.","maintainers":[{"name":"bmeredith","email":"whizkid120@gmail.com"}],"readme":"# @based-labs/drand-quicknet-registry\n\nTypeScript SDK for interacting with the Based Labs drand Quicknet EVM beacon registry.\n\nThe package provides:\n\n- Registry ABI\n- Trusted registry and verifier deployment metadata\n- Deployment verification\n- Typed registry reads\n- Beacon submission simulation and submission\n\nBuilt on [Viem](https://viem.sh/).\n\n## Installation\n\n```bash\npnpm add @based-labs/drand-quicknet-registry\n```\n\nRequires Node.js 24 or later.\n\n## Security model\n\nThe registry is a permissionless cache of verified drand Quicknet randomness keyed by exact round:\n\n```text\nround -> official drand randomness\n```\n\nAnyone may submit a beacon. For an unstored round, the registry verifies the\ncanonical 48-byte Quicknet signature through its configured on-chain verifier\nand stores the official drand randomness returned by that verifier.\n\nFor Quicknet, the stored randomness is:\n\n```ts\n    sha256(canonical signature)\n```\n\nStored rounds are immutable and repeated submissions are idempotent.\n\nApplications should commit to an exact future round before it becomes knowable\nand later settle using that same round. A missing round is a liveness\ncondition, not permission to substitute another round.\n\nThe registry address alone is not the complete deployment identity. A trusted\ndeployment pins:\n\n- chain ID\n- registry address\n- registry runtime codehash\n- verifier address\n- verifier runtime codehash\n\nChain-specific policy such as the expected `minimumLeadRounds` belongs in the\nchain-security profile rather than in deployment identity.\n\n## Registry deployment\n\nRegistry operations use a `RegistryDeployment`:\n\n```ts\ninterface RegistryDeployment {\n  chainId: number;\n  address: Address;\n  runtimeCodehash: Hex;\n  verifierAddress: Address;\n  verifierRuntimeCodehash: Hex;\n}\n```\n\nCreate one with:\n\n```ts\nimport {\n  RegistryDeployment,\n} from '@based-labs/drand-quicknet-registry';\n\nconst deployment =\n  RegistryDeployment.create({\n    chainId: <chain id>,\n    address: '<registry address>',\n    runtimeCodehash: '<registry runtime codehash>',\n    verifierAddress: '<verifier address>',\n    verifierRuntimeCodehash: '<verifier runtime codehash>',\n  });\n```\n\nDeployment metadata is a trust root and should come from a trusted manifest or\nother authenticated source.\n\n## Verify a deployment\n\nBefore using a configured registry, verify the full deployment:\n\n```ts\nimport {\n  verifyRegistryDeployment,\n} from '@based-labs/drand-quicknet-registry';\n\nawait verifyRegistryDeployment(\n  publicClient,\n  deployment,\n);\n```\n\nVerification checks:\n\n1. the connected chain ID\n2. registry code exists\n3. registry runtime codehash matches\n4. registry `verifier()` matches the trusted verifier address\n5. registry `verifierCodehash()` matches the trusted verifier codehash\n6. verifier code exists\n7. verifier runtime codehash matches\n\nRegistry runtime authentication occurs before registry configuration getters\nare trusted.\n\nA successful check verifies that the connected chain contains the registry and\nverifier described by the supplied trust root. It does not establish that the\ntrust root itself is canonical.\n\n## Read from the registry\n\nCreate a registry reader:\n\n```ts\nimport {\n  createRegistryReader,\n} from '@based-labs/drand-quicknet-registry';\n\nconst registry =\n  createRegistryReader({\n    client: publicClient,\n    deployment,\n  });\n```\n\nVerify the configured deployment:\n\n```ts\nawait registry.verifyDeployment();\n```\n\nRead the configured verifier:\n\n```ts\nconst verifier =\n  await registry.verifier();\n\nconst verifierCodehash =\n  await registry.verifierCodehash();\n\nconst minimumLeadRounds =\n  await registry.minimumLeadRounds();\n```\n\n`registry.minimumLeadRounds()` reads the immutable consumer floor from the live\nregistry. The expected network policy is intentionally not stored in\n`RegistryDeployment`; chain-profile security tooling owns the comparison\nbetween normative policy and live registry state.\n\nCheck whether a round is stored:\n\n```ts\nconst stored =\n  await registry.isStored(\n    31_250_000n,\n  );\n```\n\nRead an exact beacon:\n\n```ts\nconst randomness =\n  await registry.getBeacon(\n    31_250_000n,\n  );\n```\n\n`getBeacon()` reverts when the exact round is unavailable.\n\nRead Quicknet schedule information:\n\n```ts\nconst latestRound =\n  await registry.latestScheduledRound();\n\nconst timestamp =\n  await registry.roundScheduledTime(\n    latestRound,\n  );\n\nconst round =\n  await registry.roundAt(\n    timestamp,\n  );\n```\n\n`latestScheduledRound()` is schedule information, not a fallback randomness API.\n\n## Submit a beacon\n\nFetch a beacon with `@based-labs/drand-quicknet`, then simulate or submit it:\n\n```ts\nimport {\n  fetchBeacon,\n} from '@based-labs/drand-quicknet';\n\nimport {\n  simulateSubmitBeacon,\n  submitBeacon,\n} from '@based-labs/drand-quicknet-registry';\n\nconst beacon =\n  await fetchBeacon(\n    31_250_000n,\n  );\n\nawait simulateSubmitBeacon({\n  publicClient,\n  deployment,\n  account,\n  round: beacon.round,\n  signature: beacon.signature,\n});\n\nconst result =\n  await submitBeacon({\n    publicClient,\n    walletClient,\n    deployment,\n    account,\n    round: beacon.round,\n    signature: beacon.signature,\n  });\n```\n\nThe registry SDK accepts canonical compressed Quicknet signatures.\n\n`submitBeacon()` simulates before broadcasting and returns the transaction hash\nand official drand randomness.\n\nMultiple independent relayers may safely submit the same round. The registry\nis permissionless and idempotent.\n\n## Consumer safety\n\nThe registry does not enforce application commitment timing.\n\n`minimumLeadRounds` is an immutable registry consumer-safety floor, not a\nrestriction on beacon submission. Its expected network value belongs to the\nchain-security profile rather than deployment identity metadata.\n\nConsumers should:\n\n- authenticate the registry deployment before trusting its configuration\n- require the registry minimum lead to satisfy their own local safety floor\n- commit to an exact future round before it becomes knowable\n- fix all outcome-sensitive inputs before the commitment\n- settle only from the committed round\n- never reroll or substitute another round\n- domain-separate application seeds with a unique request identifier\n\nFor example:\n\n```solidity\nbytes32 seed = keccak256(\n    abi.encode(\n        QUICKNET_SEED_DOMAIN,\n        applicationDomain,\n        block.chainid,\n        address(this),\n        uniqueRequestId,\n        round,\n        randomness\n    )\n);\n```\n\n## Deployment manifest\n\nA trusted deployment manifest represents durable registry and verifier identity\nand provenance. For example:\n\n```json\n{\n  \"manifestVersion\": 1,\n  \"network\": \"<network name>\",\n  \"chainId\": 12345,\n  \"registry\": {\n    \"address\": \"<registry address>\",\n    \"runtimeCodehash\": \"<registry runtime codehash>\",\n    \"deployment\": {\n      \"transactionHash\": \"<deployment transaction>\",\n      \"blockNumber\": 0\n    }\n  },\n  \"verifier\": {\n    \"address\": \"<verifier address>\",\n    \"runtimeCodehash\": \"<verifier runtime codehash>\",\n    \"deployment\": {\n      \"transactionHash\": \"<deployment transaction>\",\n      \"blockNumber\": 0\n    }\n  }\n}\n```\n\nThe verifier is intentionally separate because it is independently deployed\nand independently attested.\n\nPolicy values such as the expected registry `minimumLeadRounds` are not part of\nthe deployment manifest. The chain profile is the normative policy source; the\nlive registry is the runtime source; the security checker compares the two.\n\nThe verifier Solidity implementation is not bundled into this package.\n\n## Robinhood Testnet\n\nUse the repository deployment manifest as the trusted deployment-identity record\nfor the current Robinhood Testnet verifier and registry deployments.\n\nQuicknet schedule:\n\n```text\nchain ID: 46630\ngenesis timestamp: 1692803367\nperiod: 3 seconds\n```\n\nUse the corresponding chain-security profile for normative network policy and\nthe deployment manifest for artifact identity.\n\n## API\n\n### Reads\n\n- `createRegistryReader(options)`\n- `verifyRegistryDeployment(client, deployment)`\n- `verifyDeployment()`\n- `verifier()`\n- `verifierCodehash()`\n- `minimumLeadRounds()`\n- `isStored(round)`\n- `getBeacon(round, blockNumber?)`\n- `roundAt(timestamp)`\n- `roundScheduledTime(round)`\n- `latestScheduledRound()`\n\n### Writes\n\n- `simulateSubmitBeacon(options)`\n- `submitBeacon(options)`\n\n### Exports\n\n- `drandQuicknetBeaconRegistryAbi`\n- `RegistryDeployment`\n- `RegistrySignature`\n\n## Testing\n\n```sh\npnpm --filter @based-labs/drand-quicknet-registry test\npnpm --filter @based-labs/drand-quicknet-registry typecheck\npnpm --filter @based-labs/drand-quicknet-registry build\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","homepage":"https://github.com/Bas3d-Labs/drand-quicknet-evm#readme","bugs":{"url":"https://github.com/Bas3d-Labs/drand-quicknet-evm/issues"}}