synor/crates/synor-crypto-wasm/build-wasm.sh
Gulshan Yadav 1606776394 feat: Phase 7 critical tasks - security, formal verification, WASM crypto
## Formal Verification
- Add TLA+ specs for UTXO conservation (formal/tla/UTXOConservation.tla)
- Add TLA+ specs for GHOSTDAG ordering (formal/tla/GHOSTDAGOrdering.tla)
- Add mathematical proof of DAA convergence (formal/proofs/)
- Document Kani verification approach (formal/kani/)

## Bug Bounty Program
- Add SECURITY.md with vulnerability disclosure process
- Add docs/BUG_BOUNTY.md with $500-$100,000 reward tiers
- Define scope, rules, and response SLA

## Web Wallet Dilithium3 WASM Integration
- Build WASM module via Docker (498KB optimized)
- Add wasm-crypto.ts lazy loader for Dilithium3
- Add createHybridSignatureLocal() for full client-side signing
- Add createHybridSignatureSmart() for auto-mode selection
- Add Dockerfile.wasm and build scripts

## Security Review ($0 Approach)
- Add .github/workflows/security.yml CI workflow
- Add deny.toml for cargo-deny license/security checks
- Add Dockerfile.security for audit container
- Add scripts/security-audit.sh for local audits
- Configure cargo-audit, cargo-deny, cargo-geiger, gitleaks
2026-01-10 01:40:03 +05:30

35 lines
988 B
Bash
Executable file

#!/bin/bash
# Build script for synor-crypto-wasm WASM module
# Outputs to pkg/ directory for use in web wallet
set -e
echo "Building synor-crypto-wasm for web..."
# Ensure wasm-pack is available
if ! command -v wasm-pack &> /dev/null; then
echo "Installing wasm-pack..."
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
fi
# Build for web target (bundler - ES modules for Vite)
wasm-pack build \
--target bundler \
--out-dir pkg \
--out-name synor_crypto \
--release
# Also build for web target (direct browser usage without bundler)
wasm-pack build \
--target web \
--out-dir pkg-web \
--out-name synor_crypto \
--release
echo "WASM build complete!"
echo " - pkg/ : For bundlers (Vite, Webpack)"
echo " - pkg-web/ : For direct browser import"
echo ""
echo "To use in web wallet:"
echo " 1. Copy pkg/ to apps/web/src/wasm/"
echo " 2. Import: import init, { DilithiumSigningKey } from './wasm/synor_crypto'"