Skip to main content
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

string
required
Audit log schema version (currently 1.1.0)
string
required
ISO 8601 timestamp when the audit log was generated
string
required
Stellar transaction hash being audited
string
required
SHA-256 hash of the payload (hex-encoded)
string
required
Ed25519 signature of the trace hash (hex-encoded)
string
required
Ed25519 public key for signature verification (hex-encoded)
object
required
The actual trace data being signedContains:
  • envelope_xdr - Transaction envelope
  • result_meta_xdr - Transaction result metadata
  • events - Contract events
  • logs - Diagnostic logs
object
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:
  1. The signing key is stored on a hardware device
  2. The key is non-exportable
  3. The device meets specific security standards
The attestation includes:
  • 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

Private key security: Never commit private keys to version control or expose them in logs.
  • 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
  • debug - Generate simulation data for auditing
  • session - Sessions can include audit logs
  • export - Export simulation results for signing