{"_id":"@dytallix/pqc-wasm","name":"@dytallix/pqc-wasm","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@dytallix/pqc-wasm","type":"module","description":"Post-Quantum Cryptography WASM bindings for Dytallix (ML-DSA)","version":"0.1.0","license":"Apache-2.0","author":{"name":"Dytallix Network"},"repository":{"type":"git","url":"git+https://github.com/HisMadRealm/dytallix.git","directory":"dytallix-fast-launch/pqc-wasm"},"bugs":{"url":"https://github.com/HisMadRealm/dytallix/issues"},"homepage":"https://dytallix.network","keywords":["post-quantum","cryptography","ml-dsa","dilithium","wasm","blockchain","quantum-resistant"],"main":"pqc_wasm.js","types":"pqc_wasm.d.ts","sideEffects":["./snippets/*"],"publishConfig":{"access":"public"},"_id":"@dytallix/pqc-wasm@0.1.0","gitHead":"99cab495ae08e8163083791dc48a934f1d0b2386","_nodeVersion":"24.5.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-ajlWtUmQig4IwRtlnbt8NHs7KTQ0Iq6PaKy8cH5uqkOAZI7xUJ81sAuQFSIZoax89s09EQR6X0Wh5zgOFlLNNQ==","shasum":"ec86d1056ab47d5afa819eae87ffdff2c8df3a51","tarball":"https://registry.npmjs.org/@dytallix/pqc-wasm/-/pqc-wasm-0.1.0.tgz","fileCount":6,"unpackedSize":222979,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDA/aZLHpC5PD4C5ALcRrBUjLCdpluDoP3RCjjF1I4Y1AiBh2JRuy3sBSLh9Cmuum4eRQ0+VlBb6n/PDzDn90HaATA=="}]},"_npmUser":{"name":"dytallix","email":"therickglenn@gmail.com"},"directories":{},"maintainers":[{"name":"dytallix","email":"therickglenn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pqc-wasm_0.1.0_1760453330081_0.6071413702639064"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-14T14:48:49.971Z","0.1.0":"2025-10-14T14:48:50.261Z","modified":"2025-10-14T14:48:50.546Z"},"maintainers":[{"name":"dytallix","email":"therickglenn@gmail.com"}],"description":"Post-Quantum Cryptography WASM bindings for Dytallix (ML-DSA)","homepage":"https://dytallix.network","keywords":["post-quantum","cryptography","ml-dsa","dilithium","wasm","blockchain","quantum-resistant"],"repository":{"type":"git","url":"git+https://github.com/HisMadRealm/dytallix.git","directory":"dytallix-fast-launch/pqc-wasm"},"author":{"name":"Dytallix Network"},"bugs":{"url":"https://github.com/HisMadRealm/dytallix/issues"},"license":"Apache-2.0","readme":"# @dytallix/pqc-wasm\n\nPost-Quantum Cryptography WASM bindings for the Dytallix blockchain network. This package provides WebAssembly-compiled implementations of ML-DSA (FIPS 204, formerly CRYSTALS-Dilithium) for quantum-resistant digital signatures.\n\n## Features\n\n- 🔐 **Quantum-Resistant**: ML-DSA-65 (FIPS 204) implementation\n- 🚀 **High Performance**: WebAssembly for near-native speed\n- 🌐 **Universal**: Works in Node.js, browsers, and edge runtimes\n- 📦 **Zero Dependencies**: Self-contained cryptographic implementation\n- 🔒 **Secure**: Zeroization of sensitive key material\n\n## Installation\n\n```bash\nnpm install @dytallix/pqc-wasm\n```\n\n## Usage\n\n### Node.js / Modern Bundlers\n\n```typescript\nimport init, * as pqc from '@dytallix/pqc-wasm';\n\n// Initialize the WASM module (required once)\nawait init();\n\n// Generate a new keypair\nconst { publicKey, privateKey } = pqc.generate_keypair();\n\n// Sign a message\nconst message = new TextEncoder().encode(\"Hello, Quantum World!\");\nconst signature = pqc.sign(privateKey, message);\n\n// Verify signature\nconst isValid = pqc.verify(publicKey, message, signature);\nconsole.log('Signature valid:', isValid);\n```\n\n### Browser with CDN\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n  <script type=\"module\">\n    import init, * as pqc from 'https://unpkg.com/@dytallix/pqc-wasm/pqc_wasm.js';\n    \n    async function demo() {\n      await init();\n      const { publicKey, privateKey } = pqc.generate_keypair();\n      console.log('Generated PQC keypair:', publicKey);\n    }\n    \n    demo();\n  </script>\n</head>\n<body>\n  <h1>Dytallix PQC Demo</h1>\n</body>\n</html>\n```\n\n### With Dytallix SDK\n\nThis package is designed to work seamlessly with `@dytallix/sdk`:\n\n```typescript\nimport { Wallet } from '@dytallix/sdk';\n\n// The SDK automatically uses @dytallix/pqc-wasm for cryptography\nconst wallet = await Wallet.createRandom();\nconst address = wallet.getAddress();\n```\n\n## API Reference\n\n### `generate_keypair(): { publicKey: Uint8Array, privateKey: Uint8Array }`\n\nGenerates a new ML-DSA-65 keypair.\n\n**Returns:**\n- `publicKey` - 1,952 bytes (ML-DSA-65 public key)\n- `privateKey` - 4,032 bytes (ML-DSA-65 private key)\n\n### `sign(privateKey: Uint8Array, message: Uint8Array): Uint8Array`\n\nSigns a message using ML-DSA-65.\n\n**Parameters:**\n- `privateKey` - The 4,032-byte private key\n- `message` - The message to sign\n\n**Returns:**\n- Signature bytes (3,293 bytes for ML-DSA-65)\n\n### `verify(publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean`\n\nVerifies an ML-DSA-65 signature.\n\n**Parameters:**\n- `publicKey` - The 1,952-byte public key\n- `message` - The original message\n- `signature` - The signature to verify\n\n**Returns:**\n- `true` if signature is valid, `false` otherwise\n\n### `public_key_to_address(publicKey: Uint8Array): string`\n\nConverts a public key to a Dytallix bech32 address.\n\n**Parameters:**\n- `publicKey` - The ML-DSA-65 public key\n\n**Returns:**\n- Bech32-encoded address with `dyt` prefix\n\n### `derive_public_key(privateKey: Uint8Array): Uint8Array`\n\nDerives the public key from a private key.\n\n**Parameters:**\n- `privateKey` - The 4,032-byte private key\n\n**Returns:**\n- The corresponding 1,952-byte public key\n\n## Technical Details\n\n### Algorithm\n\nThis package implements **ML-DSA-65** (Module-Lattice-Based Digital Signature Algorithm, security level 3) as specified in [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final).\n\n- **Public Key Size**: 1,952 bytes\n- **Private Key Size**: 4,032 bytes\n- **Signature Size**: 3,293 bytes\n- **Security Level**: NIST Level 3 (equivalent to AES-192)\n\n### Performance\n\nTypical performance on modern hardware:\n- **Key Generation**: ~1ms\n- **Signing**: ~2ms\n- **Verification**: ~1ms\n\n### Browser Compatibility\n\n- Chrome/Edge 91+\n- Firefox 89+\n- Safari 15+\n- Node.js 18+\n\nRequires WebAssembly and ES modules support.\n\n## Development\n\nThis package is built from Rust using `wasm-pack`:\n\n```bash\n# Build from source (requires Rust toolchain)\ncd dytallix-fast-launch/pqc-wasm\nwasm-pack build --target web --out-dir pkg\n```\n\n## Security Considerations\n\n1. **Key Storage**: Private keys should be encrypted at rest\n2. **Key Zeroization**: Keys are automatically zeroized when dropped\n3. **Side-Channel Resistance**: Uses constant-time operations where possible\n4. **Random Number Generation**: Uses cryptographically secure RNG\n\n## License\n\nApache-2.0 OR MIT\n\n## Resources\n\n- [Dytallix Website](https://dytallix.network)\n- [GitHub Repository](https://github.com/HisMadRealm/dytallix)\n- [FIPS 204 Standard](https://csrc.nist.gov/pubs/fips/204/final)\n- [Post-Quantum Cryptography FAQ](https://csrc.nist.gov/projects/post-quantum-cryptography/faqs)\n\n## Support\n\nFor issues and questions:\n- [GitHub Issues](https://github.com/HisMadRealm/dytallix/issues)\n- [Discord Community](https://discord.gg/dytallix)\n\n---\n\n**Note**: This is quantum-resistant cryptography designed to protect against future quantum computers. Current ECDSA-based systems will become vulnerable when large-scale quantum computers are available.\n","readmeFilename":"README.md","_rev":"1-c8c6216458ab587e519449304104c8b6"}