TL;DR. GM Coin mints tokens when you say “gm” on X. To do that honestly, a smart contract has to know what X said, without trusting me, an oracle company or one X API key. We tried a backend, an oracle network, a pool of API keys, TLSNotary, DiStefano and proxy-mode zkTLS. Each one left a single point of failure or didn’t fit. So during the NEAR hackathon we built bkTLS (“blind knowledge” TLS): a TLS 1.3 notary that runs inside a TEE on NEAR’s OutLayer, talks to X through anyone’s laptop, and is blind to that person’s X login. One check takes about half a second and a few kilobytes. Code: gitlab.com/neverknower/gm (Apache-2.0).
Contents
- The idea: tweet and mint
- Memecoin nobody can rug: what does it mean?
- Oracles: how a blockchain learns about the world
- GM Coin v1: Gelato on Base, and how it died
- NEAR and OutLayer: an oracle you write yourself
- Single points of failure, one by one
- Everything we tried
- TLS in five minutes
- bkTLS: how it works
- Comparison with other solutions
- Where bkTLS can run: NEAR, any TEE, or standalone
- Use cases beyond GM
- Measurements and tests
- Hackathon timeline
- Try it yourself
- Honest limits
- Prior art and credits
- What’s next
1. The idea: tweet and mint
It was 2024, the peak of memecoins, and I thought: I can do this too.
But as a tech guy, I wasn’t excited about launching just-another-memecoin where all you do is pick a name and a picture. I wanted to build something new and unique, leveraging the tech crypto already had at that point: all that cryptography, blockchains, zk proofs, etc. Like test what crypto really could do at this point.
I supposed it will take like 1-2 month to do. Turned out - it took 2 years 💀
2 years to build memecoin - how crazy am I??
Memecoins live on X, so I came up with tweet-and-mint: every time you tweet a keyword, you get tokens. Not sent from someone’s wallet: your post mints them. Post gm, get GM.
And it had to be truly Web3. No server of mine deciding who said gm, no admin key, and if I disappear, the coin keeps working, controlled by community.
In Web2 that’s a one-day job. In Web3 a smart contract can’t read X, and whoever brings that data on chain can lie, get blocked or switch off.
This is the story of those two years: what I tried, what broke, and how I came to bkTLS, and why it matters not only for memecoins, but especially for them.
2. Memecoin nobody can rug: what does it mean?
The rule I set for myself: the project must not depend on anybody’s own server. Mine first of all.
As the author, I should not be able to:
- falsify data,
- mint myself a pile of tokens,
- rug the coin,
- make the system lie at any point, even with admin permissions.
And from the outside, nobody should be able to switch it off: not a cloud provider, not an oracle company, and not X itself.
That gives two requirements that pull against each other:
| Requirement | Means | Threat it answers |
|---|---|---|
| Trustless | Every mint is backed by proof of what X really served | Me, an operator or a data provider lying |
| Unstoppable | No single account, key, IP or server whose loss stops the coin | X revoking access, a service shutting down, a ban |
Smart contracts give you the first half for free. They are about as trustless as software gets: everyone can read the code, and every result is verified by the chain. But a contract can’t make a single HTTP call. For an app whose whole point is reading X, that is the entire problem.
3. Oracles: how a blockchain learns about the world
In Web3 we have a lot of blockchains, and they have smart contracts: programs that run on the blockchain network and follow its rules. Without going deep, they are quite limited. Not in what code they can run (almost anything), but in what they can see. A smart contract isn’t connected to the outside world. It lives inside its blockchain and knows only about it: the block number, a transaction amount, a wallet address. That’s it.
That’s why we see so many financial projects in crypto and so few of anything else. Crypto was made for financial products, and money is the one thing a chain already knows about.
flowchart LR
subgraph Chain[Blockchain]
SC[Smart contract] --- K[Knows: block number, amounts, wallets]
end
subgraph World[Outside world]
X[X posts]
WEB[Websites, APIs]
end
Chain x--x|no connection| WorldAt some point that changed, and the solution is an oracle, or an oracle network.
An oracle is just somebody’s server that fetches information from the outside world, with a normal HTTP request, and sends it to a smart contract as a parameter of a function call. That’s it. The only difference from running your own server is trust: an oracle network has mechanics to check the data, so everybody can trust it, not only its owner.
The usual way is consensus. The network sends the same request from several independent machines, say 3, 5 or 7, compares the responses, and only if they match does it send the result to the contract.
sequenceDiagram
participant C as Smart contract
participant N as Oracle network
participant S as Data source (API)
C->>N: request: fetch this URL
par node 1
N->>S: HTTP request
and node 2
N->>S: HTTP request
and node 3..7
N->>S: HTTP request
end
S-->>N: responses
N->>N: compare: all the same?
N->>C: callback(result)Why does that work? If 7 machines got the same answer, the data is probably correct. If something broke between the source and one node, or one node was hacked and tried to lie, its answer won’t match the others and gets thrown out. To fake the data you’d have to break most of the nodes at once.
| What goes wrong | Your own server | Oracle network |
|---|---|---|
| The server or one node is hacked | The contract gets a lie | That node disagrees and is ignored |
| A glitch between a node and the source | Wrong data on chain | An outlier, ignored |
| The operator wants to cheat | Nothing stops them | Most nodes would have to collude |
| The source blocks the oracle | Stops | Stops too: every node asks the same source |
So that’s the idea of oracles, it’s how most of them work, and it’s actually a good solution. The most popular oracle network, as you probably know, is Chainlink.
One disclaimer. Crypto has a lot of oracles, but most of them are price oracles: they deliver the price of BTC or ETH, and that’s a quite different story. Oracles that can run arbitrary code, make any HTTP request and verify it through their network are rare. The most popular is Chainlink (Chainlink Functions). Another one was Gelato Network. “Was” is not an accident, and I’ll tell you why.
4. GM Coin v1: Gelato on Base, and how it died
So here’s why. The first GM Coin was an ERC-20 on Base, with Gelato Network as its oracle. At the time it was the only option I found that could run my own code, read X and pass the result to a contract. A Gelato function checked posts through the X API, and the contract minted GM for every gm it found.
It worked. Then Gelato shut that service down. GM Coin lost its data layer overnight, the market went down too, and in January 2026 I stopped working on it.
flowchart LR A[Post gm on X] --> B[Gelato Web3 Function<br/>reads X API] B --> C[ERC-20 on Base<br/>mints GM] B -. service shut down .-> X((dead)) style X fill:#e0475e,stroke:#2a1650,color:#fff
That was lesson one: an oracle you don’t control can still disappear. Trustless isn’t enough. It also has to be unstoppable.
After that I lost my enthusiasm, together with all crypto market that went down, so I stopped working on memecoin.
5. NEAR and OutLayer: an oracle you write yourself
Then, in October 2026 the NEAR hackathon was announced (Oct 19). I dug into NEAR and was surprised that it had almost everything out of the box:
- OutLayer: a NEAR contract can call off-chain code, which runs inside a trusted execution environment (TEE) on Intel TDX. Each run comes with proof that exactly this code (by wasm hash) ran with exactly these inputs. Secrets can be bound to a wasm hash, so only that exact build can read them. Not even the person who deployed it.
- Chain Signatures: a NEAR contract can sign transactions for other chains, so GM can be minted directly on Solana and Base with no operator holding a mint key.
- Meta transactions: users don’t need gas.
- Cheap storage and fast finality.
So the contract can call code that does anything. In the simplest version: one HTTP request to the X API, take the answer, hand it back. It’s an oracle we write ourselves, and it can still be trusted, because:
- it runs only when the contract asks for it,
- only contract can manage it
- the code is open, and its hash is pinned on chain,
- every run carries an attestation that this code produced this result.
sequenceDiagram participant C as GM contract (NEAR) participant O as OutLayer TEE (our wasm) participant X as X API C->>O: run check(user) O->>X: HTTPS request (one API key) X-->>O: posts O-->>C: signed result (key bound to wasm hash) C->>C: score, mint GM
Great. Except one more big threat that appeared at January 2026 in X..
6. Single points of failure, one by one
In January 2026 X changed its developer rules: apps that reward people for posting were no longer allowed. API access for these “post-to-earn” projects was cut, and Kaito, the biggest of them, had to shut down its Yaps program within days. A whole category of crypto apps lost their data overnight. Nobody hacked them; one company just changed a policy.
GM Coin is exactly that kind of app: tweet gm, get tokens. So even with a perfectly trustless oracle on NEAR, X could switch GM off with one decision. That’s when I understood the hard part wasn’t only getting data into a smart contract, or making it trustworthy. It also had to be anti-fragile, with no single point of failure. But is that even possible?
Look at that diagram again and ask: what can X do to stop it?
flowchart TB
subgraph SPOF["What X can block"]
K[One API key]
I[One IP range<br/>OutLayer's datacenter]
R[One request shape<br/>same endpoint, same search word]
T[One TLS fingerprint<br/>a rustls client, not a browser]
end
K --> Dead((GM stops))
I --> Dead
R --> Dead
T --> DeadFor a coin that lives on one API account, any one of these is simply the end.
At first I thought this was a problem cryptography can’t solve and we’d have to live with it. Then I started looking for a way around it anyway.
7. Everything we tried
Here is the honest list, in the order we hit the walls.
7.1 A pool of community API keys
The first idea needed no new crypto at all. Let anyone add their own X API key to the contract through OutLayer. The keys are stored as OutLayer secrets, so nobody sees them, not even me. Ban one key, and the others keep working; anyone can add another.
What it fixed: the single API key point of failure. What it didn’t: it will be harder to X, but still quite possible to get all api banned one by one. Especially because they can see that all requests are made within IP range of OutLayer servers. Also, it breaks X API rules too. Paid API plans with search also cost real money per provider.
Hackathon was ongoing, and I wanted to go deeper and find better solution. We have tech on our side!
7.2 An oracle network or a reseller
Chainlink-style networks, data resellers like Apify, or our own backend with a key. Problem: it moves trust to the operator, someone still pays for X API access, and X can revoke the network’s keys and cut every node off at once. And as v1 showed, the network can simply stop offering the service.
7.3 Optimistic oracles
Anyone reports what X said; others can dispute within a window; stakes get slashed for lies. We designed a version with five assigned providers and a 4-of-5 quorum (Oct 29 research). Problem: agreement isn’t proof. Ten domains, ten wallets or ten IPs don’t make ten independent sources. Each answer needs extra reporters, watchers, dispute delays and a bonded crowd. That’s a lot of infrastructure to stand up and keep honest for a small project.
7.4 TLSNotary (MPC-TLS)
The real cryptographic answer. The user and a notary run TLS together with multi-party computation, so neither holds the full keys, and the notary can attest to what the server sent.
On Oct 27, the day the repo was created, we ran a spike against X: three real proofs (x.com/robots.txt, api.x.com/1.1/guest/activate.json, a public post via the syndication CDN), all verified.
What we learned:
- It works, and Cloudflare didn’t block it even from a datacenter IP.
- Each session uploads a fixed ~28 MB, about 11 s on a 20 Mbit/s home uplink.
- It speaks TLS 1.2 only. Every modern browser talks to X over TLS 1.3, so in theory X could spot and ban these requests by version alone.
- Someone has to keep the notary server running, and making that server trustless is a whole other project.
We designed a full “verifier network” around it (desktop app, coordinator, 3% of the pool to verifiers) but it still had our backend in the middle.
7.5 DiStefano (MPC-TLS for TLS 1.3)
Brave’s research project does 2PC TLS 1.3. On Nov 9 we built it and ran a full-reveal check against publish.x.com (jack’s first tweet via oEmbed). It worked: all 6 AES-GCM tags valid, certificate chain and CertificateVerify checked.
Then we measured it:
| What | DiStefano (measured) |
|---|---|
| Preprocessing traffic | 220 MiB per session |
| Preprocessing time | 17 to 19 s |
| Peak RAM | ~2.4 GB notary, ~2.3 GB provider |
| Round trips | ~100 per session |
| Circuit files on disk | ~850 MB |
| Post-handshake code | empty stubs |
An OutLayer job gets about 512 MB and 120 s, and wasm has no AES-NI. DiStefano was never going to fit. The honest estimate to productionize it was 2 to 3 months plus an audit, and it would still need a notary server.
7.6 zkTLS proxy mode
A proxy watches the encrypted traffic and the user proves what it contained. Much lighter. Problem: the proxy’s IP is the one talking to X, and security rests on extra assumptions about the cipher.
7.7 A TEE that logs in for you
Put the TLS client in an enclave and give it your credentials (Town Crier did this in 2016; many zkTLS vendors now have a TEE mode). Problem: your cookie or API key sits inside someone else’s enclave, and every request comes from the enclave’s datacenter IP, which X rate-limits and blocks in one place.
The pattern
Every option failed on one of the same few axes: someone trusted, someone who sees the credential, one IP, or too heavy to run inside a TEE job. That table became the design spec.
8. TLS in five minutes
Before bkTLS makes sense, three facts about TLS (the “S” in HTTPS):
- Handshake. Client and server agree on fresh secret keys for this connection. An eavesdropper can’t work them out.
- Certificate. The server proves it really is
x.comby signing the handshake with a key a certificate authority vouched for. - Encrypted records. Every request and response is encrypted with AES-GCM, and each record carries an authentication tag. Change one bit and the tag fails.
sequenceDiagram participant C as Client participant S as x.com C->>S: ClientHello (my key share) S->>C: ServerHello (its key share) + certificate + signature Note over C,S: 1. Handshake: both derive the same fresh keys<br/>2. Certificate: client checks it's really x.com C->>S: request, encrypted with the client→server key + tag S->>C: response, encrypted with the server→client key + tag Note over C,S: 3. Records: change one bit and the tag fails
And two facts that make bkTLS possible:
- The catch: the keys are shared by both ends. Whoever holds them can forge “server” traffic. So a plain TLS session convinces the client, but proves nothing to anyone else. That’s why “here’s what X told me” is worthless as evidence.
- The gift: in TLS 1.3, the client→server key and the server→client key are separate. Holding one doesn’t let you forge the other direction.
flowchart LR
subgraph Plain["Plain TLS: the client holds both keys"]
direction TB
C1[Client] --> K1[client→server key]
C1 --> K2[server→client key]
K2 --> F["can write a fake 'response from X'<br/>with a valid tag"]
end
subgraph Split["TLS 1.3: the two keys are separate"]
direction TB
A[Whoever sends requests] --> K3[client→server key]
B[Someone else] --> K4[server→client key]
K4 --> V["only they can read X's answer,<br/>and the sender can't fake it"]
end
style F fill:#fde3e6,stroke:#e0475e
style V fill:#dff3ea,stroke:#1f8a5bThat second fact is the whole trick.
9. bkTLS: how it works
9.1 The name
zkTLS is “zero knowledge”: the notary knows nothing about the provider or the request, because everything stays encrypted and split between the parties with MPC. Ours is bkTLS, “blind knowledge”: the notary runs inside a TEE and actually has the request data, but it can’t “see” it. Nobody can look inside the enclave, and the notary can’t do anything with that data except run the code pinned on chain. It works with the data, blindly. That blindness doesn’t come from cryptography but from the nature of the TEE and OutLayer.
The one thing the notary never gets at all is the provider’s X cookie or API key. That part is cryptography: oblivious transfer, explained below.
In one line: split-key TEE TLS.
9.2 The cast
| Party | Runs where | Holds | Can’t do |
|---|---|---|---|
GM contracts (core, providers) |
NEAR | Rules, notary public keys, payments | Make HTTP calls |
| Notary | wasm in an OutLayer TEE (Intel TDX) | Both TLS traffic keys, a signing key bound to its wasm hash | See the provider’s cookie |
| Provider node | Anyone’s laptop or server | Its X cookie or API key, a TCP connection to X | Read or change X’s response; change the request |
| X | x.com / api.x.com | Its certificate | Tell it apart from a normal Chrome visit |
9.3 One check, step by step
sequenceDiagram autonumber actor U as User participant C as core (NEAR) participant P as providers (NEAR) participant N as Notary (OutLayer TEE) participant D as Provider node participant X as X U->>C: Check now C->>P: request a check P->>P: pick the cheapest online node P->>N: start OutLayer job N->>D: TLS 1.3 handshake, relayed through the node D->>X: bytes (node can't read them) X-->>D: ServerHello, certificate D-->>N: bytes N->>N: verify X's certificate, derive keys N->>D: request line + path (sealed by notary) N->>D: keystream for the secret record only D->>X: cookie record, encrypted on the node (OT for the tag) X-->>D: encrypted response D-->>N: response bytes N->>N: decrypt + authenticate every record N-->>P: signed claim P->>D: pay USDC for the check P-->>C: claim C->>C: re-derive each post, score, mint GM C-->>U: +GM
In words:
- The notary does the handshake. It runs a real TLS 1.3 client (rustls) inside the TEE. The provider only forwards bytes. The notary checks X’s certificate itself, so the provider can’t point it at a fake server.
- The notary writes the question. It encrypts the request line, host and path itself: which user, which post, which count, which cursor. The provider can’t redirect the check to another account or page.
- The provider adds only its secret. For logged-in requests, the cookie goes in a separate TLS record. The notary hands over the keystream for that one record. The provider encrypts its cookie on its own machine. The AES-GCM tag needs a secret the provider doesn’t have, so the two compute it jointly with oblivious transfer: the notary never learns the cookie, and the provider can only get a valid tag for bytes that match a fixed template.
- The notary reads the answer. The response flows back through the provider, but only the notary holds the server→client key. It decrypts and authenticates every record. A provider that flips one bit breaks the tag.
- The notary signs a claim. The signing key is derived daily from a root secret that only this exact wasm build can read (an OutLayer protected secret bound to the wasm hash). Public keys are published on chain (
get_notary_keys). - The contract re-checks. The provider can return its own parsed JSON; a recipe-free checker verifies every value against the raw response, and the GM contract re-derives each post before minting.
One check takes about 0.5 s, 3 to 7 calls and a few kilobytes.
9.4 The split, visually
- The TEE seals A and C: which host, which path, which user. The provider can't change them.
- The provider seals B, its own cookie, on its own machine. The TEE never sees it.
- X answers. Only the TEE has the response key: it reads the answer, and the provider can't fake it.
9.5 Locking the secret record (gm-relay/3)
The first version had one hole: inside its secret record, a provider could write anything, not only a cookie. Extra headers, a language hint, even a second smuggled request. Response checks caught some of it, not all.
On the last day (Nov 14) we closed it. Record B is now a template: every byte is fixed by a credential profile compiled into the notary, except the credential value bytes (“holes”). Each hole byte must come from a published character set, for example:
| Profile | Template | Hole rules | Used by |
|---|---|---|---|
none |
no secret record | none | public timeline (x.user.timeline.html.v1) |
x.cookie.v1 |
Cookie: auth_token=‹hex40›; ct0=‹hex32..160› |
hex only | logged-in X web |
x.api.bearer.v1 |
Authorization: Bearer ‹token› |
[A-Za-z0-9%], 1..512 |
official X API |
These character sets contain no CR, LF, space, ;, : or =, so a hole byte can’t end a line, add a header, add a cookie or change an HTTP/2 length. The tag is computed with one 1-of-N oblivious transfer per hole byte, so the provider can only obtain a valid tag for a record that matches the template. Anything else is a GCM forgery, with the standard 2⁻¹²⁸-ish odds and exactly one attempt before X closes the connection.
| What a dishonest provider could try | Result |
|---|---|
| Send the check to a host other than X | Impossible: notary checks X’s certificate |
| Change the path, tweet id, user, count or cursor | Impossible: request line sealed by notary |
| Add hidden headers or smuggle a second request | Impossible since gm-relay/3: fixed bytes, no CR/LF |
| Alter X’s response | Impossible: no server→client key |
| Return made-up JSON | Rejected by the derive-checker |
| Refuse or stall | Liveness only: the check fails, the success rate drops |
| Use an account that mutes people | Still possible: omission, never forgery (see Limits) |
9.6 Looking like a browser
A rustls ClientHello doesn’t look like Chrome, and X could block on that. The notary has a chrome TLS profile (on a vendored rustls fork from impit) that sends a ClientHello with the byte shape of current stable Chrome, including the post-quantum X25519MLKEM768 key share in pure Rust, plus Chrome’s HTTP/2 settings and header order. To X, a check looks like a normal Chrome visit from the provider’s own home IP.
9.7 The provider network
Because anyone can be a provider, there’s no account, key or IP for X to ban. Providers:
- run the GM Provider desktop app (log in to X in its window, press Start my node), a CLI with an official X API key, or their own node with SDKs in Rust, Node, Python or Go,
- set a USDC price per check; the cheapest online node wins,
- share 10% of each day’s GM pool, but only for real checks of users’ posts (probes and self-tests earn nothing),
- can sit behind NAT: a Cloudflare tunnel lets the notary reach them.
A dishonest provider can only fail a check, never fake one. Failures lower its public success rate.
10. Comparison with other solutions
| Own backend / oracle | Optimistic oracle | MPC-TLS (TLSNotary, DiStefano) | zkTLS proxy | TEE with your login | bkTLS | |
|---|---|---|---|---|---|---|
| Who can fake data | the operator | a colluding majority | nobody (crypto) | depends on cipher assumptions | the TEE vendor | the TEE vendor |
| Who sees your X login | the operator | each reporter | nobody | nobody | the enclave | nobody: stays on your machine |
| IP that X sees | datacenter | reporters’ | user’s | proxy’s | datacenter | provider’s own |
| TLS version | any | any | 1.2 (TLSNotary) / 1.3 (DiStefano) | 1.2/1.3 | any | 1.3, Chrome-shaped |
| Cost per check | API fees | many reports + dispute delay | 28 MB to 220 MiB, 2+ GB RAM, seconds | light | one TEE job | one TEE job, ~0.5 s, KBs |
| One check is final | trust needed | no, wait for disputes | yes | yes | yes | yes |
| Runs as an OutLayer job | n/a | n/a | no | n/a | yes | yes |
| Needs a server someone runs | yes | yes | notary server | proxy | enclave host | no (OutLayer job) |
Log scale: each gridline is 1,000× more. bkTLS is about four orders of magnitude lighter than MPC-TLS.
| Nobody can fake data | Your X login stays private | Not a datacenter IP | No server anyone runs | One check is final | Runs as an OutLayer job | |
|---|---|---|---|---|---|---|
| Own backend / oracle | still there | still there | still there | still there | still there | still there |
| Optimistic oracle | partly | still there | removed | still there | still there | still there |
| MPC-TLS (TLSNotary, DiStefano) | removed | removed | removed | still there | removed | still there |
| zkTLS proxy | partly | removed | still there | still there | removed | still there |
| TEE with your login | partly | still there | still there | still there | removed | removed |
| bkTLS | partly | removed | removed | removed | removed | removed |
removed partly (you still trust a TEE vendor, a majority or a cipher) still there
11. Where bkTLS can run: NEAR, any TEE, or standalone
bkTLS has three layers: a notary that needs a TEE, providers that need nothing special, and a consumer that verifies signed claims. Only the first is tied to a platform.
11.1 Inside NEAR (what we built)
flowchart LR U[User] --> C[GM core contract] C --> P[providers contract<br/>registry, routing, payments] P -->|OutLayer job| N[bkTLS notary wasm<br/>Intel TDX] N <-->|TLS bytes| D[Provider node] D <--> X[x.com] N -->|signed claim| P P --> C
- The contract starts the job, so nobody else can trigger fake checks.
- The notary build is proposed and activated on chain behind a timelock; its wasm hash is pinned, and its root secret is an OutLayer protected secret bound to that hash. A new build means new keys.
- The claim comes back in the job’s callback and is checked against
get_notary_keys. - Payments to providers happen in the same callback.
- It costs one OutLayer job per check, and NEAR’s open “tick” methods replace a cron (anyone can ring the “GM bell” and earn a small tip).
This is the strongest form, because the chain decides when the notary runs and which build it is.
11.2 Inside any TEE (design, not built yet)
Nothing in the notary is NEAR-specific. It’s a wasm32-wasip2 binary that reads a task on stdin and prints a signed claim on stdout. It could run on:
- Phala or other TDX/SGX clouds, with the attestation report checked by a contract on any chain,
- AWS Nitro or GCP Confidential Space, with the enclave’s attestation verified by the consumer,
- another chain’s TEE co-processor, the same way OutLayer serves NEAR.
What you need: remote attestation that binds the signing key to the notary’s code hash, a way for the notary to make outbound HTTPS calls to providers, and roughly 256 MB and a few seconds per job.
But one important thing gets lost: OutLayer lets a smart contract manage the TEE. On NEAR, the contract decides when the notary runs, which wasm hash is allowed, and which secrets that exact build can read. There’s no operator in between. On a bare TEE cloud, somebody still deploys, updates and pays for the server, so you trust the enclave and whoever runs it. That’s what makes the NEAR version much stronger and more trustworthy.
11.3 Standalone, no blockchain (design, not built yet)
Take the chain away entirely and bkTLS becomes a verifiable web-fetch service:
flowchart LR App[Any app or AI agent] -->|task| N[bkTLS notary<br/>in a TEE] N <-->|TLS bytes| D[User's own browser / node] D <--> S[Any HTTPS site] N -->|signed claim + attestation| App App -->|verify sig + code hash| OK[trusted result]
- The consumer verifies the TEE attestation once, caches the notary’s public key, then checks each claim’s signature.
- The “provider” can be the user’s own machine: their browser session supplies the cookie, and the app learns a fact (“this account has 10k followers”, “this order exists”) without ever seeing the login.
- No token, no gas, no oracle network.
12. Use cases beyond GM
bkTLS works for any HTTPS source, not only X. The set of supported requests (ops) lives in the notary (relay/crates/notary/src/ops.rs), and adding one is a matter of a path template, a credential profile and an output schema. Some ideas:
| Use case | Source | Why bkTLS fits |
|---|---|---|
| Tweet-to-earn, quests, social airdrops | X, Farcaster web, YouTube | Proof of posts and likes without one API key |
| Proof of account ownership or followers | Any social profile | User’s own session, cookie never shared |
| Creator and community rewards | Twitch, GitHub, Discord web | Read contributions, stars, roles |
| Reputation and anti-sybil | Account age, activity | Signals from logged-in pages |
| Proof of purchase or subscription | Shop or SaaS account page | Private data proved without sharing the login |
| Off-chain data for DeFi | Any public API or web page | Cheap, one-request finality |
| Verifiable AI agents | Any site an agent reads | The agent’s “I read this” becomes a signed fact |
| Decentralized scraping market | Anyone’s IP and accounts | Paid, verifiable data jobs with no central scraper |
13. Measurements and tests
13.1 Numbers
| Approach | Traffic per check | Time | Memory | Fits an OutLayer job |
|---|---|---|---|---|
| TLSNotary (Oct 27 spike) | ~28 MB upload | 3 to 12 s (20 to 100 Mbit/s) | not measured | no (needs a notary server) |
| DiStefano (Nov 9 spike) | 220 MiB preprocessing, ~257 MiB total | ~17 s + ~2 s online | ~2.4 GB per side | no |
| First TEE relay (Nov 9) | 490 B up, 7.4 KB down | 0.9 s, 3 relay calls | 1.46 MB wasm | yes |
| Split-key relay (Nov 9) | same | same | same | yes, cookie hidden from TEE |
| bkTLS (gm-relay/3) | few KB (+ OT for cookie bytes) | ~0.5 s, 3 to 7 calls | 256 MB limit set | yes |
The Nov 9 split-key test against publish.x.com: TLS 1.3 AES-256-GCM, 5 of 5 response records authenticated, 200 OK, same body hash as the plain relay. That was the moment bkTLS existed.
13.2 Tests
About 1,800 automated tests in the repo: roughly 650 Rust tests in the bkTLS relay, 620 in the contracts, rule crates and OutLayer modules, and 560 TypeScript tests across the web app, relayer and tunnel. The ones specific to bkTLS:
| Test file | What it proves |
|---|---|
relay/tests/e2e/tests/scenarios.rs |
Full path: real notary wasm under wasmtime, SDK provider, mock X with test certs, providers contract on a local NEAR sandbox, claim recorded on chain |
attacks.rs, attacks_chain.rs |
Tampered TLS bytes, swapped or smuggled requests, forged JSON: each must be rejected |
attacks_record_b.rs |
CRLF in a slot, out-of-class byte, changed fixed byte, extra header, wrong OT index |
leak_detector.rs |
Fails if the X cookie appears anywhere in notary or tunnel traffic, including hex, base64 and keystream-masked forms, with a positive control |
tls_profiles.rs |
Chrome ClientHello shape, plus an optional live check against public fingerprint echo services |
h2.rs, wasm_native.rs, sdks.rs, desktop_tunnel.rs |
HTTP/2, wasm vs native parity, all four SDKs, notary → tunnel → desktop app → mock X |
crates/proto/tests/tag.rs |
Property tests: the jointly computed tag equals a direct AES-GCM seal for every profile, h1/h2, both key sizes |
Every merge request went through independent review rounds until a round found nothing of medium severity or above. The relay alone took an audit plus a review loop, and the request-template change took four rounds.
14. Hackathon timeline
gantt title GM Coin on NEAR: from empty repo to bkTLS dateFormat YYYY-MM-DD axisFormat %b %d section Research NEAR vs old stack, OutLayer, costs :2026-10-19, 8d Tokenomics, cross-chain, X ban research :2026-11-01, 4d section Core Token, core, OutLayer modules, relayer :milestone, 2026-10-27, 0d Web app :2026-10-28, 2d Figma redesign, move to GitLab :2026-11-05, 3d Trustless sign-in design :2026-11-08, 1d section bkTLS TLSNotary spike :milestone, 2026-10-27, 0d DiStefano spike + split-key proof :crit, 2026-11-09, 1d Relay, sidecar, SDKs, HTTP/2 :crit, 2026-11-10, 1d Audit and review loops :2026-11-11, 3d Chrome profile :2026-11-13, 1d gm-relay/3 templates, desktop app, tunnel :crit, 2026-11-14, 1d
| Date (2026) | What happened |
|---|---|
| Oct 19 to 26 | Hackathon announced. Research: NEAR vs our old stack, OutLayer, ticks without a cron, cost per user. |
| Oct 27 | Empty repo. In one day: GM token (NEP-141), core contract with X linking through OutLayer, scoring and emission crates, OutLayer x-verify/x-scan modules, gasless relayer, sandbox and testnet tests, CI. Same day: TLSNotary spike, three verified proofs against X. |
| Oct 28 to 29 | Web app. Research on permissionless providers and optimistic quorums. |
| Nov 1 to 4 | Tokenomics review, Intents vs Chain Signatures, research on X’s ban of reward-for-posting apps. |
| Nov 5 to 7 | Web app rebuilt on the GM Figma design. GitHub auto-suspended our account on Nov 7, so everything moved to GitLab with full history. |
| Nov 8 | Trustless sign-in designed: no login server. |
| Nov 9 | DiStefano built and measured: too heavy. A plain TLS 1.3 relay in wasm worked on the first try (0.9 s). Then the split-key variant worked on X: the TEE does the handshake, the provider writes its own secret request. bkTLS is born. |
| Nov 10 | The relay built for real: OutLayer notary, provider sidecar, SDKs in Rust/Node/Python/Go, derive-checker, providers contract, HTTP/2. |
| Nov 11 | Security audit of sign-in, mail relay and relayer; all findings fixed. |
| Nov 12 | GitLab CI (free minutes ran out the same day), scan retries, mainnet cost model. |
| Nov 13 | Review loops on the relay until clean (53 commits of fixes). Chrome TLS profile. |
| Nov 14 | Final push, 184 commits: gm-relay/3 (enclave-sealed request templates, 1-of-N OT), GM Provider desktop app for macOS and Linux with tunnel, CLI and official-X-API nodes, X OAuth through OutLayer, Chain Signatures minting on Solana and Base, testnet app, demo videos, prior-art review, the bkTLS name. That evening OutLayer testnet jobs queued for ~100 s or failed, which kept us from a final live end-to-end run. |
Commits on the main branch of the GM repo. Nov 14 alone has more commits than the rest of the month together.
15. Try it yourself
As a user (testnet)
- Open hackathon.smgm.xyz and sign in with X (or a NEAR wallet, passkey, or by posting a link code).
- Post a tweet with
gm,#gmor$gm. - Press Check now. You’ll see which provider served it, then the GM minted. Tweets shows each scored post with the notary claim behind it.
As a data provider
- Desktop app: download GM Provider from the app’s Providers page, log in to X in its window (or start without login, 10 checks/hour), set a price, press Start my node. The live log shows every request, and that your cookie crossed the tunnel as 0 bytes.
- CLI with an X API key:
tar xzf gm-provider-cli-*.tar.gz && cd gm-provider-cli
printf %s 'TOKEN' > ~/.gm-x-api-key && chmod 600 ~/.gm-x-api-key
./gm-provider start --api-key-file ~/.gm-x-api-key --payout you.testnet
- Your own node: implement one
build(task)function with the SDK in Rust, Node, Python or Go;serve()does the rest. Seerelay/provider-kit/GUIDE.md.
As a developer
git clone https://gitlab.com/neverknower/gm.git && cd gm
relay/scripts/test-all.sh # every bkTLS suite, PASS/FAIL per suite
cd relay
cargo build --release -p gm-sidecar
cargo test -p gm-relay-e2e --test scenarios -- --nocapture # full check, claim on chain
cargo test -p gm-relay-e2e --test leak_detector -- --nocapture # cookie never leaks
cargo test -p gm-relay-e2e --test attacks -- --nocapture # every tampering attempt fails
You need Rust 1.97 with wasm32-wasip2, clang with the wasm backend, and wasmtime 25+. Everything runs offline with a mock X and a local NEAR sandbox.
To add a new data source, add an op (host, path template, params, output schema) in relay/crates/notary/src/ops.rs and the matching schema in relay/crates/derive-check, pick a credential profile, and register it in the providers contract with set_op_transport.
16. Honest limits
bkTLS is not magic, and I’d rather say so here than in the comments.
- You trust the TEE. Integrity and the cookie’s privacy both rest on Intel TDX (via OutLayer) and on the notary build whose hash is pinned on chain. TLSNotary’s critique, “TEEs move trust to the chip vendor”, applies to us as much as anyone. It’s not zero-knowledge, and there are no ZK proofs.
- A compromised enclave is bad for providers. It holds both keys, so a broken notary could in principle send other requests as a provider’s X account. Providers are protected by the attested build, not by cryptography alone.
- The provider picks the X account. Mutes, blocks and protected follows change what a logged-in search returns. That’s omission, never forgery. Mitigations: prefer account-free endpoints for scoring, pin one X user per provider, and re-check a random 5% of list results through a second provider.
- Liveness depends on someone being online. No providers, no checks. That’s why providers are paid, and why anyone can become one in minutes.
- OutLayer availability. On the deadline evening, OutLayer testnet jobs queued for ~100 s or failed. We documented it with transaction links. A decentralized notary still depends on its TEE platform being up.
- Testnet only. All contracts and payments run on NEAR testnet, and USDC is a mock token.
17. Prior art and credits
We are not the first to use a TEE as a TLS notary, and not the first to hide a user’s cookie from it. The idea is ten years old:
| Project | Year | What it does | Difference from bkTLS |
|---|---|---|---|
| Town Crier | 2016 | SGX enclave runs TLS | Credentials go into the enclave; enclave’s IP |
| DECO | 2019 to 20 | 3-party handshake (2PC) | No TEE; heavier |
| TLSNotary | 2013+ | MPC-TLS | No TEE; TLS 1.2 |
| Reclaim TEE | 2025 | Two TEEs, split AES-GCM, Tamarin proofs | Closest: same goal, two enclaves instead of one + OT |
| Primus, Opacity, Pluto, Clique, Peer | 2024 to 26 | TEE modes in zkTLS products | Notary’s IP talks to the website |
What I couldn’t find anywhere is this exact combination: one TEE that does the TLS 1.3 handshake, holds both keys and seals the request itself, while the provider fills only a templated secret record through keystream plus oblivious transfer, sends it from its own IP with a Chrome-shaped ClientHello, and the result is verified by a NEAR contract in about half a second, with an open paid provider market on top. To our knowledge it’s the first TEE TLS notary of this kind running on NEAR.
Built on rustls, impit’s rustls fork, ring, curve25519-dalek, near-sdk and OutLayer. Thanks to the NEAR and OutLayer teams, and to everyone who published the work above.
18. What’s next
- Mainnet. Contracts, notary build and provider network on NEAR mainnet.
- Account preflight and redundancy. Check that a provider’s account has no mutes or blocks on the same TLS connection, and compare a sample of results across providers.
- More sources. Logged-in X search, then other platforms, through new ops and profiles.
- bkTLS as a library. Split the notary, sidecar and SDKs out so other projects can run their own ops on NEAR or any TEE.
GM Coin started as a joke about saying good morning. It ended up as a small proof that you can read Web2 data into a contract with no backend, no oracle company, no single API key and no single IP. Nobody, including me, can fake it or switch it off.
Wasn’t that the point of crypto in the first place?
gm. ☀️
GM Coin: smgm.xyz · App: hackathon.smgm.xyz · Code: gitlab.com/neverknower/gm (Apache-2.0) · Spec: relay/SPEC.md