I got to prototype a great backup feature for smart contract wallets at ETHGlobal Lisbon 2026, it's called Carte Bleue and the idea is simple: you already have a credit card that you don't easily lose, it has a secure element chip and can sign data with it.

It wasn't obvious to figure out how you could actually sign a message as these cards are obviously made for payments and don't expect a non point-of-sale device to send them requests.

Bank cards are already recovery devices

While cryptocurrency tooling and UX got a lot better, I find myself coming back to the same conclusion: account recovery is close to the last thing we need to build for mainstream adoption. Everyone assumes you can always get your bank account back, and until crypto can say the same, custodial solutions will always be the default.

When I wrote that post I laid out the three ways you can prove you're the same person as before:

  • you know something — passwords, your favorite teacher
  • you own something — passports, biometrics, hardware keys
  • people know you — vouch systems, social recovery

The "you know something" category doesn't interested me, because it requires remembering things you set up long before you'll ever need them. The "you own something" category is much better, but every example has friction like scanning documents or buying a hardware key that you shouldn't lose it.

Then at ETHGlobal Lisbon I built something that made me rethink that framing, because we already have a very good recovery device in our pockets: a bank card, which already has the signing primitives we want.

What a bank card actually is

The chip inside is a great piece of tech. It's a tiny computer with its own silicon, its own firmware, and its own private key that never leaves the chip (aka a secure element).

Every time you tap to pay, the terminal sends the card a random challenge (alongside payment data like the amount and currency) and the card signs it with that private key. The terminal verifies the signature with the card's public key, and that's how the bank network knows it's the card they issued. Other signatures happen between the bank and the terminal but we're not interested in those for our purpose here.

That's the same as a hardware wallet. Except it's an RSA key instead of secp256k1, and a very opinionated protocol on top, but a hardware wallet nonetheless. It's two main functions are GENERATE AC and INTERNAL AUTHENTICATE.

The command to send is INTERNAL AUTHENTICATE (00 88). Send a challenge to get a signature back:

00 88 00 00 04 <4-byte challenge>
=> 77 81B4 9F4B 81B0 <176-byte RSA signature>

Two important details makes this usable for us:

  • The INTERNAL AUTHENTICATE command take a raw 4-byte challenge directly, unlike the more standard EMV GENERATE AC command that would have wrapped the challenge in a more rigid payload that takes a transaction amount, currency code, internal nonce (ATC) and would have forced us to handle that format.
  • INTERNAL AUTHENTICATE doesn't increment the ATC (the card's transaction counter/nonce). Unlike GENERATE AC, you can call it as many times as you want without updating card state. It's important because the bank also keeps track of it and will notice a nonce increasing without a payment attached to it (which could lead to your bank account getting frozen).

After getting a first signature, the next steps are straighforward:

If the card can sign, and we can extract its public key, we can verify card signatures onchain. Which means the card can authorize a wallet ownership change.

Reading the public key

Signing is the easy half. The harder one is getting the card's public key, because you cannot just read it off directly. It's encrypted inside a three-level certificate chain:

  1. The CB Root CA public key is public and known (we hardcoded it; there are a handful of keys, indexed by a value on the card).
  2. The issuer certificate (tag 90) is encrypted with that CA key. You decrypt it to get the issuer's public key.
  3. The ICC certificate (tag 9F46) is encrypted with the issuer's key. You decrypt that to get the card's actual public key, plus its exponent (tag 9F47) and a remainder (tag 9F48).

So the card-reading code is like a mini PKI walk: pow(cert, e, n) at each layer, verify the embedded SHA-1 hash, and assemble the modulus.

It's a nice bonus for anyone building identity products: every payment card sits under an already well-maintained public-key infrastructure.

Putting verification on-chain

Similar to what I wrote in this post about passkeys: the verification is doable onchain, but the details are painful.

First, the obvious tool, OpenZeppelin's RSA library, doesn't work, because it requires 2048-bit keys and our card uses 1408-bit. It's the choice issuers make for offline DDA. So we use the EVM modexp precompile directly to compute recovered = signature^exponent mod modulus. It costs about 2,581 gas.

A full EMV verification would also check the hash of the challenge embedded in the recovered block. We can't, because CB uses a proprietary DDOL and the hash computation is non-standard. So the contract checks the structure of the recovered block instead:

if (recovered[0] != 0x6A) return false;      // header
if (fmt != 0x05 && fmt != 0x06) return false; // DDA / CDA format
if (recovered[nic-1] != 0xBC) return false;    // trailer

Because the recovered data is a valid RSA signature, this structural check is enough to prove the card signed it: the odds of random data passing all three checks are around 1 in 16 million. Combined with one-time-use challenges (replay protection), it's sound for this prototype.

Why this is interesting for recovery specifically

Let me compare the failure modes, because that's where this whole class of problem lives:

Recovery factor What you need to hold Failure mode
Seed phrase a piece of paper / your memory you lose it, you forget it, someone finds it
Passkey a cloud account + a device you lose the cloud account, you lose the funds; you switch ecosystems and you're stuck (or the relying party goes down)
Bank card a physical card you lose the card, and the bank gives you a new one with a new key

The bank card is the only one where the failure mode is recoverable by an institution you already trust.

The downside is that a new card gives you a new certificate, which means updating the recovery key. You'd need to avoid losing both the smart wallet and the card at the same time.

A caveat: in our flow, possession of the card is the security. We don't require a PIN. A production version would want more, maybe a PIN and of course a timelock on the guardian contract. But as a factor, a card is stronger than it looks, because it's something you carry, that you notice when it's missing, and that an attacker has to obtain (assuming they even know it unlocks a smart wallet).

What the weekend looked like

I've written about how I run hackathons (before, during, after), and this one followed the script almost exactly:

  • Feasibility check first: the first question was "can we get this card to sign something?" I sent INTERNAL AUTHENTICATE, it worked, then we I verified we could get the public key.
  • Demo-driven development: My "right" implementation was an ERC-7579 validator for Kernel accounts (a smart-account implementation). But it didn't fit the time I had, so I revised the ambition down, and shipped a 38-line SimpleWallet plus a guardian contract. The Kernel validator still lives in the repo as a legacy artifact. It didn't matter for the demo because the goal of it is to show that the concept works.
  • One sponsor, minimally: I deployed on Base to have easy access to the ENS Basename records, and that was the whole integration. It was an addition to a demo, not the demo.

The thing that actually recovered a real wallet on Base mainnet was small:

contract SimpleWallet {
    address public owner;
    address public immutable guardian;
    function changeOwner(address newOwner) external onlyGuardian { owner = newOwner; }
    function execute(address to, uint256 value, bytes calldata data) external payable onlyOwner { ... }
}

Wallet calls CardGuardian.registerKey(modulus, exponent). Anyone, permissionlessly, can later call recover(), the guardian verifies the card signature via modexp, and calls changeOwner(). And it's useful with a single user, which is the test I like to apply to hackathon projects.

A fun detour: recovery keys as DNS records

With the core demo done I had time to add one cool feature: instead of storing the card's modulus/exponent in the guardian contract, store it in Basename text records (cartebleue.rsa.modulus, cartebleue.rsa.exponent). The guardian resolves the current records at recovery time and verifies against whatever key they contain.

Which means: change the DNS record, change the recovery key. It's a lovely illustration of the flexibility smart accounts give you. Of course it needs to be understood that whoever controls the Basename controls the recovery authority in this demo, but a production app could change how the records manager is set.

What I'd want next

This was a 36-hour prototype with a specific card from a specific issuer. To go from demo to product you'd want:

  • More cards: We only did CB cards with DDA. Supporting other issuers means adding their CA keys, their AID, their DDOL format.
  • A PIN factor: so stealing a card isn't enough (although I'm not a fan of the "you know something" category).
  • Re-registration on card replacement: so changing card doesn't strand the wallet.
  • A real integration: with Kernel or Safe recovery modules, which the flow is compatible with.

But even as a weekend project, it made the point I care about: the "you own something" category is bigger than we think. Passkeys are the synced, cloud-dependent version of "you own something." A bank card is the opposite version: physical, institution-issued, replaceable, and it's already sitting in our pockets.

I still believe passkeys are the right primary signer, but I still believe they're wrong as the sole recovery mechanism. The recovery factor should have uncorrelated failure modes from your signing. A card fails in a completely different way (and recoverably) than passkeys or seed phrases.

If you're building wallet recovery and this is interesting to you, I'm @yssf_io.