{"_id":"@dokimon/webcrypto-ed25519-polyfill","name":"@dokimon/webcrypto-ed25519-polyfill","dist-tags":{"canary":"2.1.0","latest":"2.1.0"},"versions":{"2.1.0":{"name":"@dokimon/webcrypto-ed25519-polyfill","version":"2.1.0","description":"A polyfill that adds Ed25519 key manipulation capabilities to `SubtleCrypto` in environments where it is not yet supported","exports":{"edge-light":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"workerd":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"react-native":"./dist/index.native.mjs","types":"./dist/types/index.d.ts"},"browser":{"./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs"},"main":"./dist/index.node.cjs","module":"./dist/index.node.mjs","react-native":"./dist/index.native.mjs","types":"./dist/types/index.d.ts","type":"commonjs","sideEffects":true,"keywords":["blockchain","dokimon","web3"],"author":{"name":"Dokimon Labs Maintainers","email":"maintainers@dokimonlabs.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dokimon-labs/kit.git"},"bugs":{"url":"https://github.com/dokimon-labs/kit/issues"},"browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@noble/ed25519":"^2.2.3"},"peerDependencies":{"typescript":">=5"},"engines":{"node":">=20.18.0"},"scripts":{"compile:js":"tsup --config build-scripts/tsup.config.package.ts","compile:typedefs":"tsc -p ./tsconfig.declarations.json","dev":"jest -c ../../node_modules/@dokimon/test-config/jest-dev.config.ts --rootDir . --watch","publish-impl":"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \"$PUBLISH_TAG\" != \"canary\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))","publish-packages":"pnpm prepublishOnly && pnpm publish-impl","style:fix":"pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*","test:lint":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@dokimon/test-config/jest-lint.config.ts --rootDir . --silent","test:prettier":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@dokimon/test-config/jest-prettier.config.ts --rootDir . --silent","test:typecheck":"tsc --noEmit","test:unit:browser":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@dokimon/test-config/jest-unit.config.browser.ts --rootDir . --silent","test:unit:node":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@dokimon/test-config/jest-unit.config.node.ts --rootDir . --silent"},"_id":"@dokimon/webcrypto-ed25519-polyfill@2.1.0","homepage":"https://github.com/dokimon-labs/kit#readme","_integrity":"sha512-WoWNRw3fXQOqMKmqUVshBNsTMU91A6W9+hZETPsnUQpAzZBd8ezrb9OFdeLmx2WD3H80WmRKjvVZ71NCN7eLAA==","_resolved":"/tmp/56e7e44883ca3e898bc9a9a0ffed4686/dokimon-webcrypto-ed25519-polyfill-2.1.0.tgz","_from":"file:dokimon-webcrypto-ed25519-polyfill-2.1.0.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-WoWNRw3fXQOqMKmqUVshBNsTMU91A6W9+hZETPsnUQpAzZBd8ezrb9OFdeLmx2WD3H80WmRKjvVZ71NCN7eLAA==","shasum":"d514bb5479480252356d818972b6144a613917ed","tarball":"https://registry.npmjs.org/@dokimon/webcrypto-ed25519-polyfill/-/webcrypto-ed25519-polyfill-2.1.0.tgz","fileCount":19,"unpackedSize":385832,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCh3Y4KOEeR3g43XQ7ssZAU2hjgzVJpMcuEaQbkgdkEEwIgEB1j2HurlSiIW7w3WCHJyIXqTGvf9EzBsy1PKDH4wB0="}]},"_npmUser":{"name":"m67846088848","email":"m67846088848@gmail.com"},"directories":{},"maintainers":[{"name":"m67846088848","email":"m67846088848@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/webcrypto-ed25519-polyfill_2.1.0_1747646491079_0.2786621771133291"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-19T09:21:30.971Z","2.1.0":"2025-05-19T09:21:31.272Z","modified":"2025-05-19T09:21:31.518Z"},"maintainers":[{"name":"m67846088848","email":"m67846088848@gmail.com"}],"description":"A polyfill that adds Ed25519 key manipulation capabilities to `SubtleCrypto` in environments where it is not yet supported","homepage":"https://github.com/dokimon-labs/kit#readme","keywords":["blockchain","dokimon","web3"],"repository":{"type":"git","url":"git+https://github.com/dokimon-labs/kit.git"},"author":{"name":"Dokimon Labs Maintainers","email":"maintainers@dokimonlabs.com"},"bugs":{"url":"https://github.com/dokimon-labs/kit/issues"},"license":"MIT","readme":"[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n<br />\n[![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]\n\n[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\n[code-style-prettier-url]: https://github.com/prettier/prettier\n[npm-downloads-image]: https://img.shields.io/npm/dm/@dokimon/webcrypto-ed25519-polyfill?style=flat\n[npm-image]: https://img.shields.io/npm/v/@dokimon/webcrypto-ed25519-polyfill?style=flat\n[npm-url]: https://www.npmjs.com/package/@dokimon/webcrypto-ed25519-polyfill\n\n# @dokimon/webcrypto-ed25519-polyfill\n\nThis package contains a polyfill that enables Ed25519 key manipulation in environments where it is not yet implemented. It does so by proxying calls to `SubtleCrypto` instance methods to an Ed25519 implementation in userspace.\n\n> [!WARNING]\n> Because this package's implementation of Ed25519 key generation exists in userspace, it can't guarantee that the keys you generate with it are non-exportable. Untrusted code running in your JavaScript context may still be able to gain access to and/or exfiltrate secret key material.\n\n> [!NOTE]\n> Native `CryptoKeys` can be stored in IndexedDB but the keys created by this polyfill can not. This is because, unlike native `CryptoKeys`, our polyfilled key objects can not implement the [structured clone algorithm](https://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface-clone).\n\n## Usage\n\nEnvironments that support Ed25519 (see https://github.com/WICG/webcrypto-secure-curves/issues/20) do not require this polyfill.\n\nFor all others, simply import this polyfill before use.\n\n```ts\nimport { install } from '@dokimon/webcrypto-ed25519-polyfill';\n\n// Calling this will shim methods on `SubtleCrypto`, adding Ed25519 support.\ninstall();\n\n// Now you can do this, in environments that do not otherwise support Ed25519.\nconst keyPair = await crypto.subtle.generateKey('Ed25519', false, ['sign']);\nconst publicKeyBytes = await crypto.subtle.exportKey('raw', keyPair.publicKey);\nconst data = new Uint8Array([1, 2, 3]);\nconst signature = await crypto.subtle.sign('Ed25519', keyPair.privateKey, data);\nif (await crypto.subtle.verify('Ed25519', keyPair.publicKey, signature, data)) {\n    console.log('Data was signed using the private key associated with this public key');\n} else {\n    throw new Error('Signature verification error');\n}\n```\n","readmeFilename":"README.md","_rev":"1-81442e5d6c10ed98b439d3aadcb2a808"}