From TLS to zkTLS to bkTLS: how to prove what a website said

23 min read

TL;DR. HTTPS tells you what a website said, but you can’t prove it to anyone else. zkTLS adds a third party to the TLS session so it can vouch for the response. Today’s designs (MPC, proxy, TEE) either burn megabytes to gigabytes and seconds per proof, or need an always-on server, so none of them runs as a short serverless or TEE job. And once you ask a second question, can the data source block it?, most of them fail again: one API key, one IP range, one TLS fingerprint. bkTLS answers both: a TEE runs the TLS client and reads the answer, while the bytes leave from an ordinary user’s machine and that user’s login never enters the enclave. On NEAR, a smart contract controls the TEE, so no operator sits in between. One check takes about 0.5 s and a few kilobytes.

Contents

  1. The problem: a web page is not evidence
  2. TLS in five minutes
  3. zkTLS: adding a witness to the session
  4. Existing implementations: heavy, and always on a server
  5. The second requirement: the source must not be able to switch you off
  6. bkTLS: how it works
  7. TEE, NEAR and OutLayer: who controls the enclave
  8. Everything side by side
  9. Numbers
  10. Limits

1. The problem: a web page is not evidence

Smart contracts, AI agents and ordinary apps keep needing facts that live behind HTTPS: a post on X, a bank balance, an order in a shop, a follower count. Fetching them is easy. Proving them to someone else is not.

A screenshot can be edited. A JSON file can be typed by hand. An API call made by a server only proves that the server says it got that answer. Every oracle built this way ends with “trust the operator”.

TLS: a person says "trust me, I saw it". zkTLS: two robots say "we each hold half". bkTLS: a blindfolded robot in a sealed box says "I read it blind".
Who can vouch for a web page?

What we want is a statement like: “x.com returned these bytes for this request, at this time”, that anyone can check without trusting whoever fetched it.

2. TLS in five minutes

TLS is the “S” in HTTPS. It gives three guarantees to the client:

  1. Fresh shared keys. Client and server agree on secret keys that an eavesdropper can’t compute.
  2. The right server. The server signs the handshake with the key from its certificate, so the client knows it’s really x.com.
  3. Sealed records. Every message is encrypted with AES-GCM (or ChaCha20-Poly1305) and carries a 16-byte tag. Change one bit and the tag fails.
A TLS 1.3 connection, step by step
Clientbrowser, app
Serverx.com
  1. ClientHellomy key share: a·G
  2. ServerHellomy key share: b·G
  3. Certificate + Verifysigned by x.com’s key
  4. Key scheduleHKDF(ab·G, transcript)
  5. Request recordAES-GCM + tag
  6. Response recordAES-GCM + tag
shared secret ab·G
client→server key
server→client key
  1. The client sends a random key share. Anyone on the wire can see it.
  2. The server answers with its own share. Both sides now compute the same secret, ab·G. An eavesdropper sees a·G and b·G but cannot get ab·G.
  3. The server signs the whole handshake with the key from its certificate. This is how the client knows it talks to the real site, not to someone in the middle.
  4. Both sides run HKDF and get two traffic keys: one for client→server, one for server→client. Each direction has its own key.
  5. The request is encrypted with the client→server key. A 16-byte tag seals it: change one bit and the server rejects the record.
  6. The response is encrypted with the server→client key. Same rule: no valid tag without that key.
6 / 6

Both ends hold both keys. That is why a TLS session convinces the client but proves nothing to anyone else: the client could have written the “response” itself.

Under the hood, TLS 1.3 turns the shared secret into keys with a chain of HKDF steps. The part that matters for us is at the very end:

flowchart TB
  E["ECDHE shared secret ab·G"] --> HS[Handshake secret]
  HS --> HK["handshake keys<br/>(encrypt certificate, Finished)"]
  HS --> MS[Master secret]
  MS --> C["client_application_traffic_secret<br/>→ client→server key + IV"]
  MS --> S["server_application_traffic_secret<br/>→ server→client key + IV"]
  style C fill:#efe7fb,stroke:#5b4390
  style S fill:#ffe3a3,stroke:#c2610c

Two facts follow:

  • The catch. The keys are symmetric and both ends hold them. Whoever has the server→client key can write a “response from x.com” with a perfect tag. So a TLS transcript convinces the client and nobody else. This is deliberate: TLS is designed to be deniable.
  • The opening. Each direction has its own key. Holding the client→server key lets you send requests, but not forge or read responses. Every zkTLS design, and bkTLS, is a way of making sure the prover never holds the key that would let it forge.

3. zkTLS: adding a witness to the session

zkTLS (also called web proofs or TLS oracles) adds a third party, usually called a notary, verifier or attestor, to the session. The server doesn’t change and doesn’t know. The goal: the prover (the user) can’t fake the response, and the notary can’t see the user’s secrets.

All designs follow the same three phases:

flowchart LR
  A["1. Session<br/>run TLS so the prover<br/>never holds a forging key alone"] --> B["2. Commit<br/>fix the encrypted transcript<br/>before keys are revealed"]
  B --> C["3. Prove<br/>reveal only what's needed<br/>(ZK / selective disclosure)"]
  C --> V[Signed claim<br/>anyone can verify]

The “zk” in zkTLS is mostly phase 3: you can show “balance > 1000” without the whole page. The security comes from phase 1, and that is where the three families differ.

3.1 MPC-TLS

The prover and the notary run the TLS client together with two-party computation. Neither ever holds the full session keys. Encryption and tag computation happen inside garbled circuits and oblivious transfer, so every request byte costs real compute and bandwidth. After the response arrives and is committed, the notary hands over its key share and signs the commitment.

Security: cryptographic, as long as prover and notary don’t collude. Cost: megabytes to hundreds of megabytes of traffic, gigabytes of RAM and seconds per session, plus a notary server that has to be online for every proof.

3.2 Proxy mode

The notary sits on the network path as a proxy and records the encrypted traffic. The prover holds the keys as usual, then proves in zero knowledge that the recorded ciphertext decrypts to the claimed plaintext.

Security rests on extra assumptions: that the proxy really sees the server’s bytes, and that the prover can’t find a second key that turns the same ciphertext into a different plausible message (AES-GCM is not key-committing). Cost: one ZK proof on the prover’s side, much lighter than MPC. But the proxy is a server that has to relay every session.

3.3 TEE mode

The TLS client runs inside a trusted execution environment (Intel SGX/TDX, AMD SEV, AWS Nitro). Remote attestation proves which code ran, and that code signs the result.

Security rests on the chip vendor. Cost: about the same as a normal request. But if the request needs a login, the user’s cookie or API key goes into the enclave, and someone has to run and pay for that enclave.

Click through the tabs to see who holds what in each model:

Who holds what: plain TLS and the three zkTLS families
client→server keyclient
server→client keyclient
your login / cookieclient
cost of one proofnone, it’s not a proof
needs an always-on serverno

Plain HTTPS is just your browser and the site. The browser can check the answer, but it holds both keys, so it could also write any “response” with a valid tag. Anyone else you show it to has to take your word.

client→server keysplit: prover + notary
server→client keysplit until commit
your login / cookieprover only
cost of one proofMBs to 100s of MB, GBs of RAM, seconds
needs an always-on serveryes: the notary

Neither side can forge alone, as long as notary and prover don’t collude. Strong, but every byte goes through heavy 2PC.

client→server keyprover
server→client keyprover
your login / cookieprover (hidden by ZK)
cost of one proofone ZK proof on the prover
needs an always-on serveryes: the proxy

The proxy records the ciphertext; the prover proves in ZK what it decrypts to. Lighter than MPC, but a proxy server must relay every session, and security leans on extra cipher assumptions.

client→server keyenclave
server→client keyenclave
your login / cookiegiven to the enclave
cost of one proofone TEE run, light
needs an always-on serveryes: the enclave host

Fast and simple, but your cookie lives in someone else’s enclave, and someone has to run that enclave.

4. Existing implementations: heavy, and always on a server

Why does any of this need to be light? First, and most important, for adoption. An HTTPS request is about the cheapest thing a computer does: a few kilobytes and a few hundred milliseconds. Nobody wants to turn it into something that needs gigabytes of RAM, seconds of compute or even a GPU just to prove what came back. That’s the main problem of zk proofs in many places: the cryptography works, but the computation is too expensive to use everywhere. If proving a web response costs a hundred times more than fetching it, most apps will simply keep trusting a server.

Second, more practically: during the NEAR hackathon we wanted zkTLS for GM Coin, a token minted by posting on X, so its contract could check posts without trusting a server. NEAR has OutLayer: a smart contract can call off-chain code (wasm) that runs inside a TEE (Intel TDX), and gets the result back with proof of exactly which code produced it. In effect, it’s an oracle the contract runs itself, with no operator in between. So the plan was simple: run the zkTLS prover or notary as an OutLayer job. An OutLayer job gets about 512 MB of memory and 120 seconds, runs once and exits. (The whole hackathon story, from TLSNotary to bkTLS, is in bkTLS: how we made GM Coin unstoppable.)

That gives us the target: a short serverless job that starts, does one request, returns a signed result and exits. The same limit applies to any serverless platform. Let’s judge existing solutions against it: how much they cost per proof, and what has to be running for them to work.

Project Model What stands out Main drawbacks
TLSNotary MPC-TLS Open source, most mature, strong cryptography ~28 MB upload and 3 to 12 s per proof in our test; a notary server must be online for every session. No TLS 1.3: it speaks only TLS 1.2, so it can’t reach sites that require 1.3, and its traffic doesn’t look like a browser’s (see section 5)
DECO 3-party handshake (2PC) The original academic design (2019) Research; not available as an open library
DiStefano (Brave research) 2PC for TLS 1.3 TLS 1.3 support ~257 MiB traffic, ~19 s and ~2.4 GB RAM per side in our test; ~850 MB of circuit files
Reclaim Protocol Proxy (attestor) Light proofs, runs on phones Attestor server relays every session; ZK proving on the client; extra cipher assumptions. All requests leave from the attestor’s IP (see section 5)
zkPass, Primus Hybrid MPC + proxy, VOLE-based ZK Faster ZK, both modes Needs an always-on notary or proxy server. Lighter than full MPC, but still interactive MPC/ZK on every request. In proxy mode all requests leave from the proxy’s IP (see section 5)
Opacity MPC-TLS with notaries in TEEs Adds TEE and restaking on top of MPC Still runs full MPC-TLS, so traffic, RAM and time are like TLSNotary’s; the TEE adds a trust assumption without making it lighter; notary servers must stay online
Town Crier and TEE modes (Pluto, Primus and others) TEE Fast and simple: one normal TLS request inside the enclave None on cost: it’s about as light as a plain HTTPS fetch. But all requests leave from the enclave server’s IP, and your login goes into the enclave (see section 5)
Reclaim TEE Two TEEs, split AES-GCM Closest to bkTLS in spirit Two TEE servers that must run all the time. Computation sits in between: lighter than full MPC, but still OT precomputation, a garbled-circuit OPRF and client-side ZK proofs, and no published numbers to confirm it. All requests leave from the TEE server’s IP (see section 5)

Why TLS 1.3 matters. TLS 1.2 is from 2008; TLS 1.3 replaced it in 2018. 1.3 drops old, weaker options (RSA key exchange, CBC ciphers, SHA-1), always uses fresh keys per connection, encrypts the server’s certificate and needs one round trip less. Every modern browser uses it by default. TLS 1.0 and 1.1 were already deprecated in 2021 and removed from browsers, and 1.2 is next in line: some sites and guidelines already require 1.3. A proof system that only speaks 1.2 is building on a protocol with an expiry date.

Two problems repeat:

  1. Heavy computation. MPC turns every encrypted byte into garbled circuits and oblivious transfer. That means hundreds of megabytes of traffic, gigabytes of RAM and many seconds per proof. Proxy mode moves the weight to a ZK proof on the client.
  2. A full server. The notary in MPC, the attestor in proxy mode and the enclave host in TEE mode are long-running servers. Someone has to operate them, keep them online and pay for them, and the whole system depends on them.

Together, that rules out the serverless target. A 512 MB, 120 s job can’t hold 2.4 GB of MPC state, and a design that needs an always-on notary isn’t a job at all.

What one verified request costs
bkTLSwhole check
~8 KB
TLSNotaryupload per proof
28 MB
DiStefanoper session
~257 MiB

Log scale: each gridline is 1,000× more. MPC-TLS pays for every encrypted byte in garbled circuits and OT.

bkTLS3 to 7 relay calls
~0.5 s
TLSNotary20 Mbit/s uplink
~11 s
DiStefanopreprocess + online
~19 s

Linear scale. TLSNotary time is mostly upload, so it drops to ~3 s on a 100 Mbit/s line.

bkTLSjob limit, wasm 1.5 MB
≤ 256 MB
DiStefanoper side
~2.4 GB

Log scale. A typical TEE job (OutLayer) gets about 512 MB and 120 s, so only one of these fits. TLSNotary memory was not measured.

MPC-TLS (TLSNotary, DiStefano) Proxy zkTLS TEE with your login
Who can fake data prover + notary together depends on proxy and cipher assumptions the TEE vendor
Who sees your login nobody nobody the enclave
Traffic per proof 28 MB to 257 MiB small + a ZK proof one normal request
Memory up to ~2.4 GB per side ZK prover on the client small
Time 3 to 19 s seconds of proving sub-second
Always-on server notary proxy enclave host
Fits a serverless / OutLayer job no no yes, but someone sees your login

On these axes alone, TEE mode wins on cost and MPC wins on privacy. Nothing gives both. And that is before the second question.

5. The second requirement: the source must not be able to switch you off

So far we assumed the website plays along. It doesn’t have to.

A proof of what a site said is only useful if you can keep getting it. The data source is a company. It can change its rules, revoke API keys, rate-limit or block traffic, and it has every reason to do so when someone builds a business on top of its data without paying for it. This is not hypothetical. In January 2026, X changed its developer rules to ban apps that reward users for posting, cut API access for that whole category, and the largest of them shut down within days. Nobody hacked those apps. One company changed one policy.

For a smart contract that reads the web, the source is the most powerful party in the system. Trustless isn’t enough. The pipeline also has to be unstoppable: no single key, account, IP or fingerprint whose loss stops it.

What can a source block?

flowchart LR
  subgraph Block["What a data source can block"]
    K["API key or account<br/>revoke one key"]
    I["IP range<br/>one firewall rule for a datacenter"]
    T["TLS fingerprint<br/>TLS 1.2, or a ClientHello that isn't a browser"]
    R["Request pattern<br/>same endpoint, same query, same timing"]
    O["Operator<br/>legal letter to whoever runs the server"]
  end
  K --> S((Proofs stop))
  I --> S
  T --> S
  R --> S
  O --> S
  style S fill:#e0475e,stroke:#2a1650,color:#fff

Now look at the same solutions again with this in mind:

  • API oracle or backend. One key, one server, one IP. Each is enough.
  • MPC-TLS. The best of the zkTLS family here: each user connects from their own IP with their own account. But TLSNotary speaks only TLS 1.2, while every modern browser uses 1.3, so a site can filter by version alone. And the notary server is still one operator to pressure.
  • Proxy zkTLS. Every user’s traffic leaves from the proxy. One IP range, one block.
  • TEE mode. Every request leaves from the enclave’s datacenter. And because logins go into the enclave, users can’t safely lend their accounts, so it usually runs on a few API keys. And whoever runs the enclave server can be told to switch it off.
Censorship resistance of existing solutions
No single API key or accountNot one IP rangeLooks like a browser (TLS 1.3)Users can lend accounts safelyNo operator to pressureFits a serverless job
API oracle / backendnonopartlynonoyes
TLSNotary (MPC)yesyesnoyesnono
DiStefano (MPC, 1.3)yesyespartlyyesnono
Proxy zkTLSyesnopartlyyesnono
TEE with your loginpartlynopartlynonoyes

yes partly (possible, but not the default, or not browser-shaped) no

The pattern is clear. The designs that resist censorship (MPC) are too heavy to run as a job. The design light enough to run as a job (TEE) sends everything from one place with someone else’s login. What we want is:

  1. Light: kilobytes and under a second, so it fits a TEE job a contract can call.
  2. Many exits: requests leave from many ordinary IPs, with many ordinary accounts.
  3. Logins stay home: whoever lends an account never hands over the cookie.
  4. Looks like a browser: TLS 1.3 with a real browser’s fingerprint.
  5. No operator: nothing that a letter, a bill or a ban can switch off.

That’s the list bkTLS was built against.

6. bkTLS: how it works

bkTLS stands for “blind knowledge” TLS. zkTLS keeps the notary from knowing anything. bkTLS lets the notary hold the data, but inside a TEE that only runs code pinned on chain, so it works with the data blindly. The one thing it never gets, even inside the enclave, is the user’s login. That part is cryptography, not hardware.

In one line: split-key TEE TLS. The TEE holds the keys. Someone else holds the network connection and the login.

Against the list from section 5:

Requirement How bkTLS meets it
Light One TEE job: ~8 KB of traffic, ~0.5 s, no MPC on the payload
Many exits Requests leave from providers’ own machines and home IPs
Logins stay home The provider encrypts its own cookie; the notary never sees it
Looks like a browser TLS 1.3 with Chrome’s ClientHello and HTTP/2 shape
No operator On NEAR, only the contract starts the notary and picks its build (section 7)

6.1 The cast

Party Runs where Holds Can’t do
Contract NEAR rules, allowed notary build, notary public keys make HTTP calls
Notary wasm in a TEE (Intel TDX via OutLayer) both TLS traffic keys, a signing key bound to its code hash see the provider’s login
Provider anyone’s laptop or server a login (cookie or API key), a TCP connection to the site read or change the response; change the request
Website e.g. x.com its certificate tell it apart from a normal Chrome visit

6.2 One check, step by step

sequenceDiagram
  autonumber
  participant C as Contract (NEAR)
  participant N as Notary (TEE)
  participant P as Provider
  participant W as Website
  C->>N: start job (task, allowed build)
  N->>P: TLS 1.3 handshake bytes
  P->>W: forwards bytes (can't read them)
  W-->>P: ServerHello, certificate
  P-->>N: forwards bytes
  N->>N: check certificate, derive keys
  N->>P: sealed request line + path
  N->>P: keystream for the secret record only
  P->>W: login record, encrypted on the provider (OT for the tag)
  W-->>P: encrypted response
  P-->>N: forwards bytes
  N->>N: decrypt + authenticate every record
  N-->>C: signed claim
  C->>C: verify signature, use the data
  1. The notary does the handshake. A real TLS 1.3 client (rustls) runs in the TEE. The provider only relays bytes. The notary checks the certificate itself, so the provider can’t point it at a fake server.
  2. The notary writes the question. It encrypts the request line, host and path: which account, which page, which parameters. The provider can’t redirect the check.
  3. The provider adds only its login. The login goes in a separate TLS record. The notary hands over the keystream for that one record, and the provider encrypts the login on its own machine. The tag needs a secret the provider doesn’t have, so the two compute it jointly with oblivious transfer. The notary never learns the login.
  4. The notary reads the answer. The response flows back through the provider, but only the notary holds the server→client key. A provider that flips one bit breaks the tag.
  5. The notary signs a claim with a key that only this exact build can derive. The contract checks the signature against public keys it already knows.
Notaryin a TEE
Providerown laptop, own IP
x.comsees Chrome
AGET /path · Host: x.com
BCookie: ●●●●●●
CConnection: close
🔒🔓response record
🔒🔓response record
  1. The TEE seals A and C: which host, which path, which user. The provider can't change them.
  2. The provider seals B, its own cookie, on its own machine. The TEE never sees it.
  3. X answers. Only the TEE has the response key: it reads the answer, and the provider can't fake it.

6.3 Locking the secret record

If the provider could write anything into its record, it could add headers or smuggle a second request. So the record is a template: every byte is fixed by the notary except the credential value (“holes”), and each hole byte must come from a published character set.

Profile Template Hole rules
none no secret record none
x.cookie.v1 Cookie: auth_token=‹hex40›; ct0=‹hex32..160› hex only
x.api.bearer.v1 Authorization: Bearer ‹token› [A-Za-z0-9%], 1..512

The character sets contain no CR, LF, space, ;, : or =. The tag is computed with one 1-of-N oblivious transfer per hole byte, so the provider can only get a valid tag for a record that fits the template. Anything else is a GCM forgery, with ~2⁻¹²⁸ odds and one attempt before the server closes the connection.

Try to cheat the secret record

The provider fills only the holes. Every other byte is fixed by the notary, and each hole byte must come from a short character set. Type anything, or try a preset.

What a dishonest provider tries Result
Point the check at another host Fails: notary checks the certificate
Change the path or parameters Fails: request line sealed by the notary
Add headers or smuggle a request Fails: fixed bytes, no CR/LF in holes
Alter the response Fails: no server→client key
Refuse or stall The check fails; liveness only
Use an account that hides some content Still possible: omission, never forgery

6.4 Looking like a browser

A default rustls ClientHello doesn’t look like Chrome. The notary has a chrome TLS profile (a rustls fork from impit) that sends Chrome’s ClientHello byte shape, including the post-quantum X25519MLKEM768 key share, plus Chrome’s HTTP/2 settings and header order. To the website, a check looks like a normal Chrome visit from the provider’s home IP.

6.5 Many providers, no single IP

Anyone can be a provider: a desktop app, a CLI with an API key, or a custom node with SDKs in Rust, Node, Python or Go. Providers set a price per check, and the cheapest online one gets the job. There is no single account, key or IP range to block, and a dishonest provider can only fail a check, never fake one.

7. TEE, NEAR and OutLayer: who controls the enclave

A TEE answers one question: which code is running? It doesn’t answer who decides which code runs, when, and with what input. On a normal TEE deployment, the answer is an operator. That operator can’t read the enclave’s memory, but they can:

  • swap the code. Deploy a new image tomorrow; most users never re-check the attestation.
  • cherry-pick. Run the same job ten times and publish the one result they like.
  • choose inputs. Decide which requests get notarized and which are dropped.
  • switch it off. Stop paying for the machine, or get told to.

So “it runs in a TEE” moves trust from the code to the operator. The fix is to remove the operator: let a smart contract be the only thing that can start the enclave and pick its code.

7.1 What OutLayer adds

OutLayer is a TEE co-processor for NEAR. A contract calls off-chain wasm, which runs inside Intel TDX, and the result comes back in a callback with an attestation that this code hash produced it.

  • Only the contract starts jobs. Every run and every result is a NEAR transaction. Nobody can run it ten times in private.
  • Secrets are bound to a code hash. The notary’s root signing secret can be read only by that exact wasm build, not by whoever deployed it. A different build gets different keys.
  • The code hash is on chain. Anyone can rebuild the wasm and compare.
flowchart TB
  G["Governance<br/>timelock or DAO"] -->|"propose → wait → activate"| C["Contract<br/>allowed wasm hash<br/>notary public keys"]
  C -->|"start job"| O["OutLayer<br/>Intel TDX"]
  O -->|"only this hash<br/>can read"| S[("Root secret")]
  O <-->|TLS bytes| P[Provider] <--> W[Website]
  O -->|"signed claim + attestation"| C
  style G fill:#efe7fb,stroke:#5b4390
  style S fill:#ffe3a3,stroke:#c2610c

7.2 Why a timelock or a DAO

If one admin key can change the allowed wasm hash, that key is the new operator. So the contract has no admin key that can do it alone. A new notary build goes through one of:

  • a timelock. The new hash is proposed on chain and only becomes active after a waiting period, for example 7 days. Anyone can rebuild and review it, and providers and users who disagree can leave before it takes effect.
  • a DAO vote. Token holders or a council approve the new hash, and the vote is public.

Either way, a change to the code is public and slow, and no single person can rush a bad build through.

sequenceDiagram
  participant Dev as Anyone
  participant C as Contract
  participant U as Users and providers
  participant O as OutLayer
  Dev->>C: propose new notary wasm hash
  C-->>U: event: new build proposed
  Note over U: timelock: rebuild, review, or leave
  U->>C: (DAO) vote
  C->>C: activate after delay
  C->>O: next jobs run only the new hash
  O-->>C: new public keys (new hash, new secret)

7.3 Four ways to run the same notary

The notary code is the same in all four. What changes is who stands between the rules and the enclave:

Same notary code, four ways to run it

A normal server runs the notary

You trust:operatorcloud host
Who can change the code?operator, silently
Will you see a change before it happens?no
Who can read the signing key and secrets?operator, host
Who decides when it runs?operator
Can someone re-run it and keep the result they like?yes, or just sign anything
Who can switch it off?operator, host

A signature from this server means “the operator says so”. That is an oracle you trust, not a proof.

The notary runs in an enclave on a TEE cloud or your own TDX/SGX box

You trust:chip vendoroperatorcloud host
Who can change the code?operator deploys a new image
Will you see a change before it happens?only if you re-check attestation
Who can read the signing key and secrets?only the attested code
Who decides when it runs?operator
Can someone re-run it and keep the result they like?yes: run 10 times, publish 1
Who can switch it off?operator, host

The enclave stops the operator from reading keys, but not from swapping the code, choosing inputs, replaying jobs or pulling the plug.

A NEAR contract calls the notary on OutLayer; one admin key manages the contract

You trust:chip vendorOutLayeradmin key
Who can change the code?admin, instantly (on chain)
Will you see a change before it happens?visible after the fact
Who can read the signing key and secrets?only that wasm hash
Who decides when it runs?the contract
Can someone re-run it and keep the result they like?no: every run is on chain
Who can switch it off?admin, or OutLayer downtime

Much better: runs and results are public, secrets are bound to the wasm hash. But one key can still push a bad build tomorrow morning.

Same, but the contract has no admin key: a new build needs a timelock or a DAO vote

You trust:chip vendorOutLayer
Who can change the code?only a public proposal
Will you see a change before it happens?yes: days ahead, can exit
Who can read the signing key and secrets?only that wasm hash
Who decides when it runs?the contract
Can someone re-run it and keep the result they like?no: every run is on chain
Who can switch it off?OutLayer downtime only

No person sits between the rules and the enclave. What is left to trust is the hardware and the TEE network, and both are checkable.

Plain server TEE server (cloud or self-hosted) OutLayer + admin key OutLayer + timelock / DAO
Example VPS running the notary Phala, AWS Nitro, GCP Confidential Space, own TDX box NEAR contract with an owner key NEAR contract, no owner key
You trust operator, host chip vendor, operator, host chip vendor, OutLayer, admin chip vendor, OutLayer
Code change silent new image; re-check attestation instant, but on chain public, delayed, voted
Cherry-picking runs possible possible no no
Who can stop it operator, host operator, host admin, OutLayer downtime OutLayer downtime only

bkTLS can run in any of the TEE setups: the notary is a wasm32-wasip2 binary that reads a task on stdin and prints a signed claim. It can also run with no chain at all, as a verifiable web-fetch service for apps or AI agents that check the attestation once and then each signature. But only the last column has no person with power over the enclave. The contract decides when the notary runs, which build is allowed and which secrets that build can read. That is why we think NEAR + OutLayer + a governed contract is the strongest home for a TLS notary today.

8. Everything side by side

Own backend / API oracle MPC-TLS (TLSNotary, DiStefano) Proxy zkTLS TEE with your login bkTLS
Who can fake data the operator prover + notary together depends on proxy and cipher assumptions the TEE vendor the TEE vendor
Who sees your login the operator nobody nobody the enclave nobody: it stays on your machine
Cost per check API fees 28 MB to 257 MiB, GBs of RAM, seconds one ZK proof one TEE run ~8 KB, ~0.5 s
Server someone runs yes notary proxy enclave host no: a job the contract starts
IP the site sees datacenter prover’s proxy’s datacenter provider’s own
TLS version any 1.2 (TLSNotary) / 1.3 (DiStefano) 1.2 / 1.3 any 1.3, Chrome-shaped
What each approach gets you
Nobody alone can fake dataLogin stays with the userSite sees a normal home IPNo always-on serverFits a small TEE jobTLS 1.3, browser-shaped
Own backend / API oraclenonononoyespartly
TLSNotary (MPC)yesyesyesnonono
DiStefano (MPC, 1.3)yesyesyesnonopartly
Proxy zkTLSpartlyyesnonopartlypartly
TEE with your loginpartlynononoyespartly
bkTLSpartlyyesyesyesyesyes

yes partly (you trust a TEE vendor, a proxy or a cipher assumption) no

9. Numbers

Approach Traffic per check Time Memory Fits a TEE job
TLSNotary ~28 MB upload 3 to 12 s (100 to 20 Mbit/s) not measured no (needs a notary server)
DiStefano ~257 MiB total ~17 s + ~2 s online ~2.4 GB per side no
bkTLS a few KB (+ OT for login bytes) ~0.5 s, 3 to 7 calls ≤ 256 MB job limit, 1.5 MB wasm yes

The first split-key test against x.com: TLS 1.3 with AES-256-GCM, 5 of 5 response records authenticated, 200 OK, same body hash as a direct fetch.

The bkTLS code has about 650 Rust tests, including end-to-end runs (real notary wasm, SDK provider, mock site, local NEAR sandbox), attack suites (tampered bytes, swapped or smuggled requests, CRLF in a hole, wrong OT index) and a leak detector that fails if the login shows up anywhere in notary traffic, in raw, hex, base64 or keystream-masked form.

10. Limits

  • You trust the TEE. Integrity and the login’s privacy both rest on Intel TDX and on the pinned build. This is not zero-knowledge, and there are no ZK proofs.
  • A broken enclave is bad for providers. It holds both keys, so a compromised notary could send other requests as a provider’s account. Providers are protected by the attested build, not by cryptography alone.
  • The provider picks the account. Mutes, blocks or private follows change what a logged-in page shows. That’s omission, never forgery. Prefer account-free endpoints, and re-check a sample through a second provider.
  • Liveness. No online providers, no checks. And the TEE network itself has to be up.
  • Testnet. Today everything runs on NEAR testnet.

Code: gitlab.com/neverknower/gm (Apache-2.0) · Spec: relay/SPEC.md · Story: how GM Coin got to bkTLS

Join the discussion

Reply on X

More articles