The
audit:sign command is part of the Node.js CLI interface. Run it with node dist/index.js audit:sign after building the TypeScript source.Overview
Erst includes utilities to generate deterministic, cryptographically signed audit logs from simulation results. Audit logs provide:- Tamper-proof records: Ed25519 signatures ensure integrity
- Hardware attestation: Optional HSM/hardware token integration
- Reproducible verification: Anyone can verify the signature
- Compliance support: Meet regulatory requirements for transaction analysis
Audit log format
Audit logs are JSON documents with this structure:Fields
Audit log schema version (currently
1.1.0)ISO 8601 timestamp when the audit log was generated
Stellar transaction hash being audited
SHA-256 hash of the payload (hex-encoded)
Ed25519 signature of the trace hash (hex-encoded)
Ed25519 public key for signature verification (hex-encoded)
The actual trace data being signedContains:
envelope_xdr- Transaction enveloperesult_meta_xdr- Transaction result metadataevents- Contract eventslogs- Diagnostic logs
Optional hardware attestation data from HSM/hardware tokenWhen present, provides cryptographic proof that the signing key:
- Resides on a hardware device
- Is non-exportable
- Meets specific security standards
Generating audit logs
Software signing (Ed25519 private key)
Use an in-memory private key for signing:Hardware signing (PKCS#11 HSM)
Use a hardware security module for signing:Verifying audit logs
Verify the integrity and signature of an audit log:Hardware attestation
Hardware attestation provides cryptographic proof that:- The signing key is stored on a hardware device
- The key is non-exportable
- The device meets specific security standards
- Certificate chain: X.509 certificates from device to root CA
- Token info: Hardware device model and serial number
- Key properties: Whether key is non-exportable
- Retrieval timestamp: When attestation was captured
Supported hardware
- YubiKey 5 Series (PIV)
- SoftHSM 2.x (testing)
- Any PKCS#11-compliant HSM
Use cases
Compliance and auditing
Generate verifiable records of transaction analysis:Forensic analysis
Create tamper-proof records of security incidents:Reproducible debugging
Share signed simulation results with team:Security considerations
- Use environment variables for private keys
- Prefer hardware signing for production use
- Rotate keys periodically
- Store audit logs in secure, append-only storage
- Verify signatures before trusting audit data