Skip to main content


keyanchor

Link your current SSH key to a post-quantum successor, so people can verify which key you chose if your old key is ever compromised.
Quantum computers will be able to forge today's SSH keys; a Bitcoin timestamp proves your choice came first.

Install · Start · GitHub Action · How it works · Spec · Security

CI License: Apache-2.0 Python 3.9+ No Python package dependencies Homebrew: brew install JustaRsearchGuy/tap/ka

keyanchor makes your current SSH key (Ed25519, the one GitHub knows) sign a statement naming a hybrid post-quantum key (ML-DSA-44 + Ed25519), and timestamps that statement in Bitcoin through OpenTimestamps. When a quantum computer eventually derives your Ed25519 private key, the forger can sign anything — except a statement that is older than yours. Verifiers trust the earliest anchored binding, and from then on only your post-quantum key.

You anchor 'K hands over to P' in Bitcoin block 978,942. Years later a forger who derived K anchors 'K hands over to F' in a much later block. A verifier asks which binding of K is earliest: yours, so it trusts P and ignores F.

  • No Python package dependencies. Standard library only (Python 3.9+; macOS's built-in python3 is enough). It needs git and OpenSSH ≥ 10.6, see Install.
  • No home-made crypto. Every signature is OpenSSH SSHSIG made and checked by your system ssh-keygen.
  • No SHA-1 trust. Git trees are re-hashed file by file with SHA-256; git's SHA-1 ids are never what is signed.
  • No accounts, no server, no fees. Public OpenTimestamps calendars pay the Bitcoin fee for everyone.

Install

brew install JustaRsearchGuy/tap/keyanchor      # or the short name: JustaRsearchGuy/tap/ka
brew install openssh && brew unlink openssh    # OpenSSH 10.6, next to the system one

keyanchor needs OpenSSH ≥ 10.6, the first release with final post-quantum keys. macOS still ships 10.5; the second line installs 10.6 without replacing your system ssh (and its Keychain options), and keyanchor finds it by itself. On Linux, use your distribution's OpenSSH once it reaches 10.6.

Without Homebrew: pipx install keyanchor (PyPI, with signed provenance), or run bin/keyanchor from a checkout. Python ≥ 3.9 and git, nothing else.

Tab completion comes with Homebrew. Otherwise, for commands and flags:

keyanchor completions fish | tee ~/.config/fish/completions/{keyanchor,ka}.fish >/dev/null   # fish
echo 'eval "$(keyanchor completions zsh)"' >> ~/.zshrc     # zsh (after compinit)
echo 'eval "$(keyanchor completions bash)"' >> ~/.bashrc   # bash

Uninstall: brew uninstall keyanchor (or pipx uninstall keyanchor). keyanchor never deletes your keys: your post-quantum key in ~/.ssh, its backup in your password manager and the .keyanchor/ proofs in your repositories stay. Delete them yourself only if you are sure; a published binding cannot be recalled from Bitcoin, so revoke the key first (keyanchor → Revoke) if you stop using it.

Start

keyanchor      # or the short name: ka

The first time, it walks you through everything: your GitHub username, a new post-quantum key, the backup, the Bitcoin timestamp. Afterwards the same command opens a menu: check your status, sign a release, make a release bundle, back up, replace or revoke your key. Arrow keys or numbers; q quits.

Use without the menu

Every step is also a plain command, for scripts and CI. In the repository you publish:

# 1. Once: bind your current key to a new post-quantum key (prompts for the new key's passphrase).
#    keyanchor finds the key GitHub knows as you: in your ssh-agent, 1Password or ~/.ssh.
keyanchor init --github <you> --gen-pq ~/.ssh/id_mldsa44_ed25519
git add .keyanchor && git commit -S -m "keyanchor: bind post-quantum key"

# 2. A few hours later: fetch the Bitcoin proof. Rerun until nothing is pending.
keyanchor upgrade && git commit -am "keyanchor: bitcoin proofs"

# 3. Every release: vouch for the exact content with your post-quantum key.
keyanchor countersign --pq ~/.ssh/id_mldsa44_ed25519 --ref v1.0 --file dist/app.tar.gz

Anyone, any time later:

keyanchor verify                                    # the whole chain
keyanchor verify --ref v1.0 --file app.tar.gz       # is this exact content vouched for?

Terminal: keyanchor init and countersign sign and timestamp; verify shows the genuine app.tar.gz waiting for Bitcoin and the tampered evil.tar.gz refuted

A real run, minutes after stamping: the genuine file waits for Bitcoin (◷), the tampered copy is refuted (✘). A few hours later keyanchor upgrade turns ◷ into ✔. Regenerate with bash scripts/demo.sh.

Keys appear as the same SHA256: fingerprints that ssh-keygen -l and GitHub's key settings show, so you can compare them by eye. Colours appear in a terminal; NO_COLOR turns them off. --format json gives scripts the same rows; --details adds the per-statement technical report.

Exit Meaning
0 verified
1 refuted — a signature, proof or rule failed, or nothing covers the content you asked about
2 unverifiable — offline, explorer unreachable, or an undecidable tie
3 pending — waiting for Bitcoin; run keyanchor upgrade

Rotating or retiring keys: keyanchor rotate --old-pq A --new-pq B hands authority to a new post-quantum key (both sign). keyanchor revoke --pq A ends A's authority from the revocation's anchor block. keyanchor stamp retries statements that never reached a calendar. --dir points at a store elsewhere.

Back up your post-quantum key. Rotation and revocation need it to sign; a lost key cannot hand over authority, and after Q-Day your classical key no longer can either.

Always run upgrade. A fresh proof is only a calendar's promise. Until upgrade stores the Bitcoin path, the proof dies if the calendars do.

Use with your password manager

keyanchor signs through whichever SSH agent holds your key. It checks password-manager agents first, because they ask you to approve every signature, then the IdentityAgent your ~/.ssh/config sets for github.com, then SSH_AUTH_SOCK, then key files in ~/.ssh. How you approve is up to your manager: Touch ID, Apple Watch, or typing your master password all work the same.

Where your GitHub key lives Recognised automatically
1Password (Settings → Developer → Use the SSH agent) ✅
Bitwarden, Strongbox, Proton Pass (turn on their SSH agent) ✅
Secretive (Secure Enclave keys) ✅
KeePassXC and any other agent ✅ via SSH_AUTH_SOCK or IdentityAgent
YubiKey or other FIDO2 key (ssh-keygen -t ed25519-sk, add it on GitHub) ✅ keyanchor asks you to touch it
  1. Import your existing GitHub key into the manager (1Password: New Item → SSH Key → Add Private Key → Import a Key File; in file dialogs Cmd+Shift+. shows ~/.ssh), or create a new key there and add it on GitHub as both an Authentication and a Signing key.
  2. Run keyanchor init --github <you> …. It reports found your GitHub key … in <manager> and the manager asks you to approve. If the key only signs without asking, keyanchor says so.

Back up the post-quantum key with keyanchor backup: it saves the file to 1Password when its CLI (op) is installed, and otherwise walks you through saving it by hand in any password manager. Store the passphrase in the same item.

Want an approval prompt for the post-quantum key too? Load it into an OpenSSH ≥ 10.6 ssh-agent with ssh-add -c and pass the public half (--pq ~/.ssh/id_mldsa44_ed25519.pub). The agent then asks its SSH_ASKPASS helper before every signature; a declined prompt makes keyanchor stop with nothing written. Third-party helpers can turn that prompt into Touch ID; review one before trusting it with your key.

Ship the proof with your releases

People who download only app.tar.gz from a release page have no .keyanchor/ folder. Attach the whole proof as one small file:

keyanchor countersign --pq ~/.ssh/id_mldsa44_ed25519 --ref v1.0 --file dist/app.tar.gz
keyanchor upgrade                          # once Bitcoin confirmed
keyanchor bundle && gh release upload v1.0 keyanchor-bundle.json

Anyone with the download, no clone needed:

keyanchor verify --bundle keyanchor-bundle.json --file app.tar.gz

The bundle is untrusted input like any download: it only carries the statements, signatures and Bitcoin proofs, and verify judges them exactly as it judges a repository's .keyanchor/ folder.

Show it on GitHub

Add the action to your repository and every push gets a ✅/❌ check with a summary table on the run page:

# .github/workflows/keyanchor.yml
name: keyanchor
on: [push]
jobs:
  verify:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v7
      - uses: JustaRsearchGuy/keyanchor@v0.1.0
        # with:
        #   refs: HEAD               # also require this commit's tree to be countersigned
        #   files: dist/app.tar.gz   # or these release files

Then show the badge in your README:

[![keyanchor](https://github.com/OWNER/REPO/actions/workflows/keyanchor.yml/badge.svg)](https://github.com/OWNER/REPO/actions/workflows/keyanchor.yml)

Pending proofs (the first hours after stamping) pass with a warning; set fail-on-pending: true to make them fail. The action builds a post-quantum ssh-keygen from the pinned, checksum-verified OpenSSH release (about a minute) because runner images do not ship one yet.

How it works

.keyanchor/statements/ holds content-addressed statements: canonical JSON named by its SHA-256, one .sig file per required signature, one .ots OpenTimestamps proof. Commit it with your code; it is public by design.

Statement Signed by Says
binding classical key and PQ key this classical key's holder chose this PQ key
rotation current PQ key and new PQ key authority moves to the new key
revocation the revoked PQ key this key's authority ends here
countersign the in-force PQ key these SHA-256 digests of git trees and files are mine

Verification follows ERC-8373's anchored key-chain model, adapted to SSH keys, and orders everything by Bitcoin block height — never by self-declared dates, never by block header times (those can go backwards):

  1. Per classical key, the binding with the earliest anchor wins. Two in the same block: undecidable.
  2. A rotation counts only if anchored after its predecessor and before that predecessor's revocation.
  3. A countersignature counts only if its signer was in force at the countersignature's anchor block.
  4. A binding that embeds a GitHub key snapshot must contain its classical key.

Byte-level format and the full algorithm: docs/SPEC.md.

What it proves — and what it doesn't

  • Proves: by Bitcoin block h, the holder of classical key K declared post-quantum key P (both signed), and the key in force vouched for exactly these SHA-256 digests.
  • Identity: --github embeds your published key list in the signed, anchored statement, so the claim survives later key changes and GitHub itself. It is a snapshot you took; a signed commit or a --claim dns=… record you publish corroborates it.
  • Anchors: Bitcoin attestations are hash paths into block Merkle roots. Shor's algorithm does not apply to hashes; Grover leaves ~128-bit security.
  • Not proven: that a person, not just a key, is who GitHub says; that your key was not stolen before you bound it. And it only protects you with verifiers that enforce these rules — that is why the spec is open and the tool is free.

Trust and network

What Who Note
Stamping the 4 public OpenTimestamps calendars ≥ 2 must answer; the hash you send is blinded with a random nonce
Upgrading only *.calendar.opentimestamps.org, *.calendar.eternitywall.com, *.calendar.catallaxy.com a failing calendar is skipped, not fatal
Block headers one Esplora API (--explorer, default blockstream.info) a lying explorer can mislead you; for high stakes point --explorer at your own node (http://localhost allowed)
GitHub keys api.github.com / github.com only with --github or --live-github

Nothing else leaves your machine: no telemetry, no keyanchor server. And no cryptocurrency: keyanchor needs no coins, no wallet and no fees. It sends only a hash, the public calendars pay for the Bitcoin transaction, and verify reads public block headers.

Known quirk: macOS's system Python (LibreSSL) cannot complete TLS with a.pool.opentimestamps.org; the other calendars cover it, so you only see a warning.

Release provenance. PyPI releases are built and uploaded by .github/workflows/release.yml through Trusted Publishing: no upload token exists, and every file carries a Sigstore-signed attestation naming this repository and workflow (PyPI shows it as "Provenance" on the release page).

Roadmap

What is done, what comes next, and what is deliberately not planned: docs/ROADMAP.md.

Contributing

Bug reports, spec reviews and second implementations are very welcome — see CONTRIBUTING.md. Security issues: SECURITY.md, please not as public issues.

License

Copyright 2026 JustaRsearchGuy. Licensed under Apache-2.0; see NOTICE.

Metadata

Release files for keyanchor 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keyanchor 0.1.0
File Size Uploaded Provenance Actions
keyanchor-0.1.0.tar.gz 71.8 kB With provenance Details for keyanchor-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for keyanchor 0.1.0
File Interpreter ABI Platform Actions
keyanchor-0.1.0-py3-none-any.whl Python 3 none any Details for keyanchor-0.1.0-py3-none-any.whl

Total release size: 131.8 kB

Release files / keyanchor-0.1.0.tar.gz

Download URL keyanchor-0.1.0.tar.gz
Size 71.8 kB
Tags Source
SHA-256 checksum
How to use checksums
854bd9e20befc9988dd9d47275f1ee6302658f47100b2de0c3af49642e58be3c
BLAKE2b-256 checksum
How to use checksums
7621834d1d6f0151ff5c1b3d48b9c77b29da85d29335a48939b67ec213a7280e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

Release files / keyanchor-0.1.0-py3-none-any.whl

Download URL keyanchor-0.1.0-py3-none-any.whl
Size 60.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67afebca244c9226930bd38325160ba4341ecb935c8adcedcf7795f7f634c992
BLAKE2b-256 checksum
How to use checksums
a585ee2f1979121e6c5765676374f6f98893785e712a6bdd8e8da70e0ad666aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

Security for keyanchor 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for keyanchor-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page