{"_id":"@asentum/crypto","name":"@asentum/crypto","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@asentum/crypto","version":"0.1.0","description":"Post-quantum cryptography primitives for AsentumChain. ML-DSA-65 (Dilithium3), BLAKE3, address derivation.","license":"Apache-2.0","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"keywords":["asentum","post-quantum","dilithium","ml-dsa","blake3","fips204"],"repository":{"type":"git","url":"git+https://github.com/asentum-network/chain.git","directory":"packages/crypto"},"homepage":"https://asentum.com","bugs":{"url":"https://github.com/asentum-network/chain/issues"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"dependencies":{"@noble/hashes":"^1.4.0","@noble/post-quantum":"^0.2.0"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0","vitest":"^1.0.0"},"_id":"@asentum/crypto@0.1.0","gitHead":"e4cfc125e035292301d583245f16895c792cff38","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-qevQoIkTq151EbppR4Mf3f4PATV8bEBBMZYS7tgQGBfrPc/jjEcOg0aGDyZe8HA1cayG92VYC+cub6SMyKwF5Q==","shasum":"48dc1930e1efc3c548552cca5244dacea5c8da5d","tarball":"https://registry.npmjs.org/@asentum/crypto/-/crypto-0.1.0.tgz","fileCount":10,"unpackedSize":38740,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC82vLNixmF/4SyVLBpAhPXeGb3SHHdpPIiRkb+4xyveAIgSFJOLOadbA624XZDvqV9QGGdRd3NFxmF86kTz/3XW24="}]},"_npmUser":{"name":"milkie_eth","email":"its.quo.eth@gmail.com"},"directories":{},"maintainers":[{"name":"milkie_eth","email":"its.quo.eth@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/crypto_0.1.0_1778938273180_0.711416777044297"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-16T13:31:13.101Z","0.1.0":"2026-05-16T13:31:13.326Z","modified":"2026-05-16T13:31:13.528Z"},"maintainers":[{"name":"milkie_eth","email":"its.quo.eth@gmail.com"}],"description":"Post-quantum cryptography primitives for AsentumChain. ML-DSA-65 (Dilithium3), BLAKE3, address derivation.","homepage":"https://asentum.com","keywords":["asentum","post-quantum","dilithium","ml-dsa","blake3","fips204"],"repository":{"type":"git","url":"git+https://github.com/asentum-network/chain.git","directory":"packages/crypto"},"bugs":{"url":"https://github.com/asentum-network/chain/issues"},"license":"Apache-2.0","readme":"# @asentum/crypto\n\nPost-quantum cryptography primitives for AsentumChain.\n\n## What's in here\n\n- **ML-DSA-65 (Dilithium3)** signing and verification: the NIST-standardized post-quantum signature scheme. Wraps `@noble/post-quantum/ml-dsa`.\n- **BLAKE3** and **SHA-256** hashing. BLAKE3 is the chain-wide canonical hash; SHA-256 is kept around for Ethereum-compatibility surfaces only. Wraps `@noble/hashes`.\n- **Address derivation**: 20-byte addresses derived as `BLAKE3(pubkey)[0:20]` with an EIP-55-style mixed-case checksum.\n\n## Install\n\nThis package is part of the AsentumChain monorepo and is not yet published to npm. From the repo root:\n\n```sh\npnpm install\npnpm --filter @asentum/crypto build\npnpm --filter @asentum/crypto test\n```\n\n## Usage\n\n```ts\nimport {\n  generateKeypair,\n  sign,\n  verify,\n  blake3,\n  addressFromPublicKey,\n} from '@asentum/crypto';\n\n// Generate a keypair and derive an address\nconst { publicKey, secretKey } = generateKeypair();\nconst address = addressFromPublicKey(publicKey);\nconsole.log('New account:', address);\n\n// Sign a message\nconst message = new TextEncoder().encode('hello asentum');\nconst signature = sign(message, secretKey);\n\n// Verify\nconst isValid = verify(message, signature, publicKey);\nconsole.log('Signature valid?', isValid);\n\n// Hash some data\nconst digest = blake3(message);\n```\n\n## Design notes\n\n- All inputs and outputs are `Uint8Array`. Hex/base58 encoding helpers live in `@asentum/sdk`, not here.\n- `verify()` never throws on invalid input: it returns `false`. This makes it safe to call on untrusted data without wrapping in `try/catch`.\n- Addresses are `0x`-prefixed 40-character mixed-case hex strings. The case pattern encodes a checksum of the address bytes hashed with BLAKE3, matching EIP-55's mechanism but using our chain hash instead of Keccak256.\n\nSee `docs/post-quantum.md` in the repo root for the full reference on the cryptographic choices.\n\n## Status\n\n**Phase 0 scaffold, not yet benchmarked.** The implementation is thin wrappers around well-audited upstream libraries, but we haven't measured it on the actual target hardware yet. Performance numbers (keygen / sign / verify on consumer PC vs Pi 4) will land in Phase 0's benchmarks task.\n\nThe exact import path for `@noble/post-quantum/ml-dsa` may need adjustment depending on the installed version: verify against the actual package when you first run `pnpm install`.\n\n## License\n\nApache License 2.0. See the root `LICENSE` file.\n","readmeFilename":"README.md","_rev":"1-3564206130088b8313cbff0605f0e7dd"}