Scope: TLSNotary (MPC-TLS) verification at the application layer that this package owns. The Oracle interface itself is a host-side contract, summarised below for context. Other zkTLS providers (Reclaim, zkPass, …) would each be a sibling package; the protocol does not change.
The host treats every verification provider through the same shape:
Oracle
info: OracleInfo { id, name, endpoint?, fee_ppm }
verify(query, result, blossomKeys?) → OracleAttestation
OracleAttestation:
| Field | Description |
|---|---|
oracle_id |
Identifier of the attesting Oracle |
query_id |
Query being attested |
passed |
Whether verification succeeded |
checks |
List of checks that passed |
failures |
List of checks that failed |
attested_at |
Unix timestamp of attestation |
tlsn_verified |
Extracted TLSNotary data (when applicable — see TlsnVerifiedData below) |
This package implements the TLSNotary slice of verify().
A Requester opts into TLSNotary verification by including "tlsn" in
verification_requirements. The factor is deterministic: given the
same presentation and conditions, every honest Oracle reaches the same
verdict.
- Worker initiates an MPC-TLS session with a TLSNotary Verifier.
- Worker and Verifier jointly hold TLS key shares — neither sees the other's share.
- Worker sends the HTTPS request to the target server through the co-signed TLS session.
- Target server responds. Verifier co-signs without seeing plaintext.
- Verifier produces a
.presentation.tlsnfile — a cryptographic proof that the specific server returned specific data.
The Rust verifier crate gives raw cryptographic verification. This package adds the application-layer hardening that real Oracle deployments need:
-
Cryptographic verification. Validate signatures in the presentation; extract
server_name(TLS certificate) andrevealed_body. -
Server identity match.
server_namemust match thetlsn_requirements.target_urldomain. -
Condition evaluation against
revealed_body:Condition Type Description containsBody contains the expected string regexBody matches the regex pattern jsonpathJSONPath expression extracts expected value -
ReDoS-safe condition language.
regexpatterns are screened for nested quantifiers / catastrophic backtracking before they are compiled (isSuspiciousRegex). -
Attestation freshness against
max_attestation_age_seconds(default: 300 s). -
Replay protection. SHA-256 dedup of accepted presentations.
-
Credential leakage guard —
validateNoCredentials()blocksAuthorization,Cookie,X-API-Key, etc., from being published.
On successful verification the Oracle produces:
| Field | Description |
|---|---|
server_name |
Domain from TLS certificate |
revealed_body |
Response body from the proof |
revealed_headers |
Response headers (optional) |
session_timestamp |
Unix timestamp from the cryptographic proof |
The host's visibility field controls whether the .presentation.tlsn
is published:
| Value | Behavior |
|---|---|
public |
Proof published to Nostr relays. Anyone can independently verify. |
requester_only |
Proof delivered only to the Requester via encrypted channel. |
visibility is required when tlsn_requirements is set — there is no
default. Before publishing, validateNoCredentials() redacts request
headers (Authorization, Cookie, X-API-Key) and blocks any leftover
authentication credentials.
Selective disclosure: only fields needed for condition evaluation are revealed.
The Oracle's verify() interface accepts any proof format that
demonstrates "server X returned data Y." TLSNotary is the only
implemented provider in this codebase.
| Provider | Technique | Status |
|---|---|---|
| TLSNotary | MPC-TLS (Verifier holds independent key share) | Implemented (this package) |
| Reclaim Protocol | HTTPS proxy + ZK proofs | No adapter yet |
| zkPass | TEE + ZK circuits | No adapter yet |
| Opacity Network | MPC-TLS (alternative implementation) | No adapter yet |
Adding a new provider means writing a sibling package that exposes the
same verify() shape. The protocol does not change.
- Unit:
packages/tlsn-toolkit/src/tlsn-validation.test.ts(mock verifier binary; runs without the Rust crate built). - E2E:
e2e/tlsn.test.ts,e2e/tlsn-browser.test.ts(real verifier binary + browser-extension prover). - Threat-model invariant
INV-01(seedocs/threat-model.md). - Companion Rust crates:
crates/tlsn-verifier/,crates/tlsn-prover/,crates/tlsn-server/.