synor/crates/synor-crypto-wasm/Dockerfile
Gulshan Yadav 3041c6d654 feat(crypto-wasm): add deterministic Dilithium3 key derivation and hybrid signatures
This commit enables full wallet recovery from BIP-39 mnemonics by implementing
deterministic Dilithium3 key derivation using HKDF-SHA3-256 with domain separation.

Changes:
- crates/synor-crypto-wasm: Implement deterministic Dilithium keygen
  - Use HKDF with info="synor:dilithium:v1" for key derivation
  - Enable pqc_dilithium's crypto_sign_keypair via dilithium_kat cfg flag
  - Add proper memory zeroization on drop
  - Add tests for deterministic key generation

- apps/web: Update transaction signing for hybrid signatures
  - Add signTransactionHybrid() for Ed25519 + Dilithium3 signatures
  - Add createSendTransactionHybrid() for quantum-resistant transactions
  - Update fee estimation for larger hybrid signature size (~5.5KB/input)
  - Maintain legacy Ed25519-only functions for backwards compatibility

- WASM module: Rebuild with deterministic keygen
  - Update synor_crypto_bg.wasm with new implementation
  - Module size reduced to ~470KB (optimized)

- Documentation updates:
  - Update mobile wallet plan: React Native -> Flutter
  - Add testnet-first approach note
  - Update explorer frontend progress to 90%
2026-01-10 05:34:26 +05:30

46 lines
1 KiB
Docker

# Dockerfile for building synor-crypto-wasm WASM module
# This builds the post-quantum cryptography WASM module for the web wallet
FROM rust:latest AS builder
# Install required tools
RUN apt-get update && apt-get install -y \
curl \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Install wasm-pack
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# Install wasm32 target
RUN rustup target add wasm32-unknown-unknown
# Create workspace
WORKDIR /build
# Copy Cargo files first for dependency caching
COPY Cargo.toml Cargo.lock* ./
COPY .cargo .cargo
# Copy source code
COPY src ./src
# Build for bundler target (for Vite)
RUN wasm-pack build \
--target bundler \
--out-dir /output/pkg \
--out-name synor_crypto \
--release
# Build for web target (direct browser)
RUN wasm-pack build \
--target web \
--out-dir /output/pkg-web \
--out-name synor_crypto \
--release
# Final stage - just copy the built files
FROM scratch AS output
COPY --from=builder /output /output