ARCHITECTURAL SPECIFICATION & LEGAL STANDARD

RFC 3161 Cryptographic Timestamping

Anchoring Git commit Merkle trees against qualified Time Stamp Authorities (DigiCert, Sectigo). Irrefutable legal proof that code existed before a precise second without blockchain fees or third-party code exposure.

⚖️ The Git Timestamp Vulnerability

In Git, commit timestamps are notoriously trivial to forge. The standard GIT_AUTHOR_DATE and GIT_COMMITTER_DATE environment variables are unverified client-side strings. Anyone can execute:

BASHVulnerability Demonstration
git commit --amend --date="2018-01-01T00:00:00Z"

Because Git records whatever timestamp the local system clock reports, a git commit history alone possesses zero legal weight regarding when the software was actually authored. In an IP ownership dispute, patent priority contest, or trade secret litigation, opposing counsel can immediately impeach Git commit timestamps as self-serving, unauthenticated hearsay under Federal Rule of Evidence 802.

🛡️ The RFC 3161 Standard Solution

RFC 3161 (Internet X.509 Public Key Infrastructure Time-Stamp Protocol) solves this decisively. A trusted Time Stamp Authority (TSA)—such as DigiCert or Sectigo—acts as an independent, cryptographic notary public.

The client hashes the target data (in GitProof, the SHA-256 Merkle root of the repository commit tree) and transmits only the hash imprint inside an ASN.1 DER-encoded TimeStampReq message. The TSA verifies the hash, combines it with the atomic time received from calibrated atomic clocks (GPS / NIST standards), signs the bundle with its certified X.509 private key, and returns an ASN.1 TimeStampResp token.

🔒 Absolute Privacy: Zero Code Exposure

The TSA receives only the 32-byte SHA-256 message imprint. Zero bytes of source code, commit messages, file paths, or committer identities ever leave your workstation. The TSA cannot reconstruct what was hashed; it only certifies that whatever produced that hash existed prior to the timestamp.

🔬 ASN.1 Structure & Certificate Verification

A qualified RFC 3161 timestamp response encapsulates a Cryptographic Message Syntax (CMS) SignedData structure:

💻 Implementation in GitProof (`pkg/notarize`)

GitProof implements pure-Go RFC 3161 notarization and verification without external C libraries or system openssl dependencies:

TERMINALGenerate Notarized Proof
# Notarize current Git commit tree against DigiCert TSA
gproof seal --notarize

# Inspect cryptographic verification & TSA timestamp
gproof verify

During gproof verify, the engine performs mathematical verification:

  1. Recomputes the repository Merkle DAG leaf hashes to confirm working tree integrity.
  2. Parses the ASN.1 TimeStampResp token embedded in proof.json.
  3. Validates that the token's MessageImprint matches the computed Merkle root.
  4. Verifies the TSA's X.509 signature against the embedded certificate chain and public trust anchors.