{"_id":"@scure/sr25519","_rev":"6-cb3fa055069fa7d905429afce2acec80","name":"@scure/sr25519","dist-tags":{"latest":"2.4.0"},"versions":{"0.2.0":{"name":"@scure/sr25519","version":"0.2.0","keywords":["sr25519","polkadot","merlin","strobe","schnorr","schnorrkel","ristretto","ed25519"],"author":{"url":"https://paulmillr.com","name":"Paul Miller"},"license":"MIT","_id":"@scure/sr25519@0.2.0","maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"homepage":"https://github.com/paulmillr/scure-sr25519","bugs":{"url":"https://github.com/paulmillr/scure-sr25519/issues"},"dist":{"shasum":"b2de2407a2d59522d7d0f26fafbac260fd9314d2","tarball":"https://registry.npmjs.org/@scure/sr25519/-/sr25519-0.2.0.tgz","fileCount":13,"integrity":"sha512-uUuLP7Z126XdSizKtrCGqYyR3b3hYtJ6Fg/XFUXmc2//k2aXHDLqZwFeXxL97gg4XydPROPVnuaHGF2+xriSKg==","signatures":[{"sig":"MEUCIBHjOxedYaZA0AZEPbHT1V5hNbNX6vX/DQM3vDWKMp49AiEAgnYkUteiZlWMy3QHdgpql1BPl9NifXawzXggUophcd8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":114322},"main":"lib/index.js","types":"lib/index.d.ts","module":"lib/esm/index.js","exports":{".":{"import":"./lib/esm/index.js","require":"./lib/index.js"}},"funding":"https://paulmillr.com/funding/","gitHead":"a4a538b18ffecebacdacc9e862adc47938b9a82d","scripts":{"lint":"prettier --check index.ts test/*.test.js","test":"node test/index.js","bench":"cd test/benchmark; npm i; node index.js","build":"tsc && tsc -p tsconfig.cjs.json","format":"prettier --write index.ts test/*.test.js","test:bun":"bun test/index.js","test:deno":"deno --allow-env --allow-read test/index.js","build:release":"npx jsbt esbuild test/build"},"_npmUser":{"name":"paulmillr","actor":{"name":"paulmillr","type":"user","email":"paul@paulmillr.com"},"email":"paul@paulmillr.com"},"repository":{"url":"git+https://github.com/paulmillr/scure-sr25519.git","type":"git"},"_npmVersion":"11.3.0","description":"Audited & minimal implementation of sr25519 (polkadot) cryptography, with Merlin and Strobe","directories":{},"sideEffects":false,"_nodeVersion":"24.1.0","dependencies":{"@noble/curves":"~1.9.2","@noble/hashes":"~1.8.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.5.2","typescript":"5.8.3","micro-bmark":"0.4.1","micro-should":"0.5.3","@paulmillr/jsbt":"0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/sr25519_0.2.0_1750190169288_0.937055556897008","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@scure/sr25519","version":"0.3.0","keywords":["sr25519","polkadot","merlin","strobe","schnorr","schnorrkel","ristretto","ed25519"],"author":{"url":"https://paulmillr.com","name":"Paul Miller"},"license":"MIT","_id":"@scure/sr25519@0.3.0","maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"homepage":"https://paulmillr.com/noble/#scure","bugs":{"url":"https://github.com/paulmillr/scure-sr25519/issues"},"dist":{"shasum":"1fb075ef05086c1dc59f16bdda1327627a552352","tarball":"https://registry.npmjs.org/@scure/sr25519/-/sr25519-0.3.0.tgz","fileCount":8,"integrity":"sha512-SKsinX2sImunfcsH3seGrwH/OayBwwaJqVN8J1cJBNRCfbBq5q0jyTKGa9PcW1HWv9vXT6Yuq41JsxFLvF59ew==","signatures":[{"sig":"MEQCIHBLTUO9NaQVdEFFmuWHqdHwlqBTdV2xsTA+JpxLCEqIAiBlZ3rgOUJUsxXkghRNypPz13rNSZBN/DxBvSW41LVpug==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69504},"main":"index.js","type":"module","types":"index.d.ts","module":"index.js","engines":{"node":">= 20.19.0"},"funding":"https://paulmillr.com/funding/","gitHead":"8d71046118cd897019f3318de25f4a073350d0d5","scripts":{"test":"node test/index.ts","bench":"cd test/benchmark; npm i; node index.ts","build":"tsc","format":"prettier --write index.ts 'test/**/*.{js,ts}'","test:bun":"bun test/index.ts","test:deno":"deno --allow-env --allow-read test/index.ts","test:node20":"cd test; npx tsc; node compiled/test/index.js","build:release":"npx --no @paulmillr/jsbt esbuild test/build"},"_npmUser":{"name":"paulmillr","email":"paul@paulmillr.com"},"repository":{"url":"git+https://github.com/paulmillr/scure-sr25519.git","type":"git"},"_npmVersion":"11.4.2","description":"Audited & minimal implementation of sr25519 (polkadot) cryptography, with Merlin and Strobe","directories":{},"sideEffects":false,"_nodeVersion":"24.4.1","dependencies":{"@noble/curves":"~2.0.0","@noble/hashes":"~2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.6.2","typescript":"5.9.2","@paulmillr/jsbt":"0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/sr25519_0.3.0_1756139615158_0.44524138013692904","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@scure/sr25519","version":"1.0.0","keywords":["sr25519","polkadot","merlin","strobe","schnorr","schnorrkel","ristretto","ed25519"],"author":{"url":"https://paulmillr.com","name":"Paul Miller"},"license":"MIT","_id":"@scure/sr25519@1.0.0","maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"homepage":"https://paulmillr.com/noble/#scure","bugs":{"url":"https://github.com/paulmillr/scure-sr25519/issues"},"dist":{"shasum":"27b61458c6038e42d00ddb220188cdb3ebd32c60","tarball":"https://registry.npmjs.org/@scure/sr25519/-/sr25519-1.0.0.tgz","fileCount":8,"integrity":"sha512-b+uhK5akMINXZP95F3gJGcb5CMKYxf+q55fwMl0GoBwZDbWolmGNi1FrBSwuaZX5AhqS2byHiAueZgtDNpot2A==","signatures":[{"sig":"MEUCIEiRdBgiDzGqDPC5n8qCNNBq5Z+DmJQdJpmSNm6bR7fNAiEAuyZwAeQ1GWGinywYLJiM4NrFXtw2nO0NV2X3C1ap3tA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scure%2fsr25519@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":69541},"main":"index.js","type":"module","types":"index.d.ts","module":"index.js","engines":{"node":">= 20.19.0"},"funding":"https://paulmillr.com/funding/","gitHead":"44c4e4b931ec6568dd6826feff43d9e4b6f20207","scripts":{"test":"node test/index.ts","bench":"cd test/benchmark; npm i; node index.ts","build":"tsc","format":"prettier --write index.ts 'test/**/*.{js,ts}'","test:bun":"bun test/index.ts","test:deno":"deno --allow-env --allow-read test/index.ts","test:node20":"cd test; npx tsc; node compiled/test/index.js","build:release":"npx --no @paulmillr/jsbt esbuild test/build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8e285372-b759-47f1-b540-d0d5462bd395"}},"repository":{"url":"git+https://github.com/paulmillr/scure-sr25519.git","type":"git"},"_npmVersion":"11.6.1","description":"Audited & minimal implementation of sr25519 (polkadot) cryptography, with Merlin and Strobe","directories":{},"sideEffects":false,"_nodeVersion":"24.11.0","dependencies":{"@noble/curves":"~2.0.0","@noble/hashes":"~2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.6.2","typescript":"5.9.2","@paulmillr/jsbt":"0.4.5"},"_npmOperationalInternal":{"tmp":"tmp/sr25519_1.0.0_1765223209614_0.45328568923159307","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@scure/sr25519","version":"2.2.0","keywords":["sr25519","polkadot","merlin","strobe","schnorr","schnorrkel","ristretto","hdkd","ed25519"],"author":{"url":"https://paulmillr.com","name":"Paul Miller"},"license":"MIT","_id":"@scure/sr25519@2.2.0","maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"homepage":"https://paulmillr.com/noble/#scure","bugs":{"url":"https://github.com/paulmillr/scure-sr25519/issues"},"dist":{"shasum":"92361077ca70c569ed563502b7a603e71ba9ed17","tarball":"https://registry.npmjs.org/@scure/sr25519/-/sr25519-2.2.0.tgz","fileCount":8,"integrity":"sha512-UTOZb6Hzw44REQdl2SWNBhBFIoqOIhMLNIz3zYyVQLbqdshhuyuuxYoibKHlDg9oqdwdCHQe5LkTsevugPpUbw==","signatures":[{"sig":"MEQCIDoX4ZR5zs6rBu0m2MwlmMr0DeaRAgmqpVZEPdvknpaOAiAS5MtY/FJXTo9zQBSNhHcLUPnOyRNpC49ItcPE5FFmZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scure%2fsr25519@2.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":100363},"main":"index.js","type":"module","types":"index.d.ts","module":"index.js","engines":{"node":">= 20.19.0"},"funding":"https://paulmillr.com/funding/","gitHead":"948db4da7769a2d8e3cb9239a9c4d61804b83400","scripts":{"test":"node test/index.ts","bench":"cd test/benchmark; npm i; node index.ts","build":"tsc","check":"npx --no @paulmillr/jsbt check package.json","format":"prettier --write index.ts 'test/**/*.{js,ts}'","test:bun":"bun test/index.ts","test:deno":"deno --allow-env --allow-read test/index.ts","check:jsdoc":"npx --no @paulmillr/jsbt tsdoc package.json","test:node20":"cd test; npx tsc; node compiled/test/index.js","check:readme":"npx --no @paulmillr/jsbt readme package.json","build:release":"npx --no @paulmillr/jsbt esbuild test/build","check:treeshake":"npx --no @paulmillr/jsbt treeshake package.json test/build/out-treeshake"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8e285372-b759-47f1-b540-d0d5462bd395"}},"repository":{"url":"git+https://github.com/paulmillr/scure-sr25519.git","type":"git"},"_npmVersion":"11.6.1","description":"Audited & minimal implementation of sr25519 (polkadot) cryptography, with Merlin and Strobe","directories":{},"sideEffects":false,"_nodeVersion":"24.11.0","dependencies":{"@noble/curves":"~2.2.0","@noble/hashes":"~2.2.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.6.2","typescript":"6.0.2","@paulmillr/jsbt":"0.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sr25519_2.2.0_1776849456718_0.7928993483842424","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@scure/sr25519","version":"2.3.0","keywords":["sr25519","polkadot","merlin","strobe","schnorr","schnorrkel","ristretto","hdkd","ed25519"],"author":{"url":"https://paulmillr.com","name":"Paul Miller"},"license":"MIT","_id":"@scure/sr25519@2.3.0","maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"homepage":"https://paulmillr.com/noble/#scure","bugs":{"url":"https://github.com/paulmillr/scure-sr25519/issues"},"dist":{"shasum":"4efb169fbf1ae6c9d05d93dc4b03de799261b91a","tarball":"https://registry.npmjs.org/@scure/sr25519/-/sr25519-2.3.0.tgz","fileCount":6,"integrity":"sha512-BVXcSoPYjt16qPn3JZVDiIxYBnjJ8Vh6w/E8rVAlsjCmU8lw41YwbHLT85dkUqQdX7H6dMybF0cMv70uHcwJPA==","signatures":[{"sig":"MEUCIQDsq+y5kUS0NPmWkiEDws5s/0XMozPou4A0VzWZBNQ1mAIgXJlGvrk6LsH9USDckNwk2X75eK1TaUd8LgwLPXsr7b0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scure%2fsr25519@2.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":74313},"main":"index.js","type":"module","types":"index.d.ts","module":"index.js","engines":{"node":">= 20.19.0"},"funding":"https://paulmillr.com/funding/","gitHead":"5aebe7b44bee5f98715ce1e170fede366cfe8aae","scripts":{"test":"node test/index.ts","build":"tsc","check":"jsbt-check","format":"prettier --write index.ts 'test/**/*.{js,ts}'","benchmark":"cd test/benchmark; npm i; node index.ts","benchmark:size":"npx bismar@0.1.3 -s"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"paulmillr","email":"paul@paulmillr.com"},"trustedPublisher":{"id":"github","oidcConfigId":"oidc:f4f84de0-e497-42f4-a88d-7df7a13b67c7"}},"repository":{"url":"git+https://github.com/paulmillr/scure-sr25519.git","type":"git"},"_npmVersion":"12.0.2","description":"Audited & minimal implementation of sr25519 (polkadot) cryptography, with Merlin and Strobe","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"@noble/curves":"~2.3.0","@noble/hashes":"~2.3.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.6.2","typescript":"6.0.2","@paulmillr/jsbt":"0.6.5"},"_npmOperationalInternal":{"tmp":"tmp/sr25519_2.3.0_1786166896288_0.10020777331392638","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"_id":"@scure/sr25519@2.4.0","bugs":{"url":"https://github.com/paulmillr/scure-sr25519/issues"},"dist":{"shasum":"d29c098592d970967a412397ed3943b07fd928d3","tarball":"https://registry.npmjs.org/@scure/sr25519/-/sr25519-2.4.0.tgz","integrity":"sha512-Xzpy/MuVqR8wNHrXrz6HHLqCI8nPirQmJEhOMabZ8jSrM6bQiDg+1xkUgw4+Kr7857u3xxQL/PfKFeav9rodZg==","fileCount":6,"unpackedSize":74326,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@scure%2fsr25519@2.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBMEKdRyevblyQJ2O+4aZx8M9qb0+L8hLVeCSZ2Z90C8AiA+uviZW2m7CvIkuIs2d3cWQsTpWWyZeEx1KwJTg4DYAg=="}]},"main":"index.js","name":"@scure/sr25519","type":"module","types":"index.d.ts","author":{"url":"https://paulmillr.com","name":"Paul Miller"},"module":"index.js","engines":{"node":">= 20.19.0"},"funding":"https://paulmillr.com/funding/","gitHead":"01a53b660827ddd10556c32eb34629e8942a5c1c","license":"MIT","scripts":{"test":"node test/index.ts","build":"tsc","check":"jsbt-check","format":"prettier --write index.ts 'test/**/*.{js,ts}'","benchmark":"cd test/benchmark; npm i; node index.ts","benchmark:size":"bismar -bsm"},"version":"2.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f4f84de0-e497-42f4-a88d-7df7a13b67c7"},"approver":{"name":"paulmillr","email":"paul@paulmillr.com"}},"homepage":"https://paulmillr.com/noble/#scure","keywords":["sr25519","polkadot","merlin","strobe","schnorr","schnorrkel","ristretto","hdkd","ed25519"],"repository":{"url":"git+https://github.com/paulmillr/scure-sr25519.git","type":"git"},"_npmVersion":"12.0.2","description":"Audited & minimal implementation of sr25519 (polkadot) cryptography, with Merlin and Strobe","directories":{},"maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"@noble/curves":"2.4.0","@noble/hashes":"2.4.0"},"devDependencies":{"bismar":"0.1.8","prettier":"3.9.6","typescript":"6.0.3","@paulmillr/jsbt":"0.7.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sr25519_2.4.0_1788007523895_0.18855860652223067"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-17T19:56:09.184Z","modified":"2026-08-29T12:45:24.389Z","0.2.0":"2025-06-17T19:56:09.469Z","0.3.0":"2025-08-25T16:33:35.350Z","1.0.0":"2025-12-08T19:46:49.769Z","2.2.0":"2026-04-22T09:17:36.865Z","2.3.0":"2026-08-08T05:28:16.462Z","2.4.0":"2026-08-29T12:45:23.974Z"},"bugs":{"url":"https://github.com/paulmillr/scure-sr25519/issues"},"author":{"url":"https://paulmillr.com","name":"Paul Miller"},"license":"MIT","homepage":"https://paulmillr.com/noble/#scure","keywords":["sr25519","polkadot","merlin","strobe","schnorr","schnorrkel","ristretto","hdkd","ed25519"],"repository":{"url":"git+https://github.com/paulmillr/scure-sr25519.git","type":"git"},"description":"Audited & minimal implementation of sr25519 (polkadot) cryptography, with Merlin and Strobe","maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"readme":"# scure-sr25519\n\nAudited & minimal JS implementation of sr25519 cryptography for Polkadot.\n\n- 🧮 [sr25519 curve](https://wiki.polkadot.network/docs/learn-cryptography) - schnorr signature on ristretto-compressed ed25519\n- HDKD: Hierarchical Deterministic Key Derivation\n- VRF: Verifiable random function\n- Works with [Merlin](https://merlin.cool/index.html), which is based on [Strobe128](https://strobe.sourceforge.io).\n- ➰ Uses [noble-curves](https://github.com/paulmillr/noble-curves) for underlying arithmetics\n- 15KB (gzipped) with bundled deps\n\n### This library belongs to _scure_\n\n> **scure** — audited micro-libraries.\n\n- Zero or minimal dependencies\n- Highly readable TypeScript / JS code\n- PGP-signed releases and transparent NPM builds\n- Check out [homepage](https://paulmillr.com/noble/#scure) & all libraries:\n  [base](https://github.com/paulmillr/scure-base),\n  [bip32](https://github.com/paulmillr/scure-bip32),\n  [bip39](https://github.com/paulmillr/scure-bip39),\n  [btc-signer](https://github.com/paulmillr/scure-btc-signer),\n  [sr25519](https://github.com/paulmillr/scure-sr25519),\n  [starknet](https://github.com/paulmillr/scure-starknet)\n\n## Usage\n\n> `npm install @scure/sr25519`\n\n> `deno add jsr:@scure/sr25519`\n\nWe support all major platforms and runtimes.\n\n### Basic\n\n```ts\nimport * as sr25519 from '@scure/sr25519';\nimport { randomBytes } from '@noble/hashes/utils.js';\n\nconst seed = randomBytes(32);\nconst secretKey = sr25519.secretFromSeed(seed);\nconst peerSecretKey = sr25519.secretFromSeed(randomBytes(32));\nconst msg = new Uint8Array([1, 2, 3]);\nconst signature = sr25519.sign(secretKey, msg);\nconst publicKey = sr25519.getPublicKey(secretKey);\nconst peerPublicKey = sr25519.getPublicKey(peerSecretKey);\nconst isValid = sr25519.verify(msg, signature, publicKey);\nconst sharedSecret = sr25519.getSharedSecret(secretKey, peerPublicKey);\n```\n\n### HDKD\n\n```ts\nimport * as sr25519 from '@scure/sr25519';\nimport { randomBytes } from '@noble/hashes/utils.js';\n\nconst seed = randomBytes(32);\nconst cc = randomBytes(32);\nconst parentSecret = sr25519.secretFromSeed(seed);\nconst parentPublic = sr25519.getPublicKey(parentSecret);\n\n// hard\nconst hardSecret = sr25519.HDKD.secretHard(parentSecret, cc);\nconst hardPublic = sr25519.getPublicKey(hardSecret);\n\n// soft\nconst softSecret = sr25519.HDKD.secretSoft(parentSecret, cc);\nconst softPublic = sr25519.getPublicKey(softSecret);\n\n// public\nconst derivedPublic = sr25519.HDKD.publicSoft(parentPublic, cc);\n```\n\n### VRF\n\n```ts\nimport * as sr25519 from '@scure/sr25519';\nimport { randomBytes } from '@noble/hashes/utils.js';\n\nconst seed = randomBytes(32);\nconst msg = new Uint8Array([1, 2, 3]);\nconst secretKey = sr25519.secretFromSeed(seed);\nconst publicKey = sr25519.getPublicKey(secretKey);\nconst signature = sr25519.vrf.sign(msg, secretKey);\nconst isValid = sr25519.vrf.verify(msg, signature, publicKey);\n```\n\n### Import schnorrkel / polkadot keypairs\n\n`fromKeypair()` expects the 96-byte schnorrkel \"half-Ed25519\" layout:\n`secret.to_ed25519_bytes() || public.to_bytes()`.\nThis is the same format used by schnorrkel `Keypair::to_half_ed25519_bytes()`.\nThe example below uses the same test vector shown in schnorrkel's\n`Keypair::from_half_ed25519_bytes()` docs.\n\n```ts\nimport * as sr25519 from '@scure/sr25519';\nimport { hexToBytes } from '@noble/hashes/utils.js';\n\nconst pair = hexToBytes(\n  // secret.to_ed25519_bytes()\n  '28b0ae221c6bb06856b287f60d7ea0d98552ea5a16db16956849aa371db3eb51' +\n    'fd190cce74df356432b410bd64682309d6dedb27c76845daf388557cbac3ca34' +\n    // public.to_bytes()\n    '46ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a'\n);\nconst normalized = sr25519.fromKeypair(pair);\nconst publicKey = sr25519.getPublicKey(normalized.subarray(0, 64));\n```\n\n### Merlin and Strobe\n\nWe implement only the parts of these protocols that sr25519 requires.\n\n### Migration from `@polkadot/utils-crypto`\n\n- most derive methods in original return `{publicKey, privateKey}`, we always return only privateKey,\n  you can get publicKey via `getPublicKey`\n- privateKey is 64 byte (instead of 32 byte in ed25519), this is because we need nonce and privateKey can be\n  derived from others (HDKD), and there would be no seed for that.\n\n## Security\n\nThe library has been audited:\n\n- at version 2.2.0, in Apr 2026, by ourselves (self-audited)\n  - Scope: everything\n  - [Changes since audit](https://github.com/paulmillr/scure-sr25519/compare/2.2.0..main)\n- at version 0.3.0, in Aug 2025, independently, by [Oak Security](https://www.oaksecurity.io)\n  - PDFs: [website](https://github.com/oak-security/audit-reports/tree/8f30dd4b59eae97194fb612aa8e773824a37bf65/Polkadot), [2025-08-22](./audit/2025-08-22-oak-security-audit.pdf), [2025-06-12](./audit/2025-06-12-oak-security-audit.pdf), [2025-06-12-fuzz](./audit/2025-06-12-oak-security-fuzzing.pdf)\n  - [Changes since audit](https://github.com/paulmillr/scure-sr25519/compare/0.3.0..main)\n  - Scope: everything\n  - The audit has been funded by Polkadot, coordinated by [Edgeware](https://www.edgeware.io)\n\nIf you see anything unusual: investigate and report.\n\nLow-level operations are done using noble-curves and noble-hashes.\nConsult their README for more information about constant-timeness, memory dumping and supply chain security.\nA few notes:\n\n- Bigints are used, which are not const-time, but our elliptic curve cryptography\n  implementation ensures algorithmic const-time for high-level items, which is more important\n- Secrets are zeroized, but this is pointless, since at some point they are converted to bigints,\n  and bigints cannot be zeroized in JS. Even zeroization of uint8arrays provides no guarantees.\n\n## Speed\n\nBenchmark results on Apple M4:\n\n```\nsecretFromSeed x 493,827 ops/sec @ 2μs/op\ngetSharedSecret x 1,135 ops/sec @ 880μs/op\nHDKD.secretHard x 54,121 ops/sec @ 18μs/op\nHDKD.secretSoft x 4,108 ops/sec @ 243μs/op\nHDKD.publicSoft x 4,499 ops/sec @ 222μs/op\nsign x 2,475 ops/sec @ 403μs/op\nverify x 955 ops/sec @ 1ms/op\nvrfSign x 442 ops/sec @ 2ms/op\nvrfVerify x 344 ops/sec @ 2ms/op\n```\n\nComparison with wasm:\n\n```\nsecretFromSeed wasm x 21,615 ops/sec @ 46μs/op\ngetSharedSecret wasm x 6,681 ops/sec @ 149μs/op\nHDKD.secretHard wasm x 16,958 ops/sec @ 58μs/op\nHDKD.secretSoft wasm x 16,075 ops/sec @ 62μs/op\nHDKD.publicSoft wasm x 16,981 ops/sec @ 58μs/op\nsign wasm x 16,559 ops/sec @ 60μs/op\nverify wasm x 6,741 ops/sec @ 148μs/op\nvrfSign wasm x 2,470 ops/sec @ 404μs/op\nvrfVerify wasm x 2,917 ops/sec @ 342μs/op\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2024 Paul Miller [(https://paulmillr.com)](https://paulmillr.com)\n\nSee LICENSE file.\n","readmeFilename":"README.md"}