Repository navigation
v0.7.0-alpha.1
Pre-releaseThe first alpha of 0.7 is a security and privacy release. A node's address no longer goes on the
air in announces, firmware updates over the companion link are signed, and the protocol is
hardened against replays, forged acknowledgements and lost sessions. It follows a review of the
protocol and of the firmware's cryptography, made with Claude, an AI model: every primitive was
checked against its official test vectors and against OpenSSL, and each finding was fixed or is
listed below as still open.
It is an alpha. The protocol is a draft and will change. That review was not made by an
independent cryptographer, and nobody outside the project has reviewed the design. Do not rely on
it for anything that matters.
Not compatible with 0.6
A board on this release cannot exchange messages with a board on 0.6.0-alpha.1 or earlier, and
cannot reach a contact by its old routing id. Update every board you talk with. Every session is
started again by first contact, once, after the update: a session's saved form changed, and so did
every destination tag. Contacts, groups, messages, settings and paired phones are kept.
What changed
- Your address stays off the air. Announces used to carry a node's address in clear so that
neighbours could check their signatures. They now carry a key blinded from it, as Tor's onion
services do, and are signed with that key; the routing id is made from it. A contact who knows
your address can still compute your routing id. Nobody else can recover the address from what
they hear. With presence cards off, no frame carries it. - Signed updates. Every file in this release is signed, its Ed25519 signature listed in the
release'sSIGNATURES, by the release key09800d79c2c3d0cab7f1710a18cd50d6f0e39c57d9cfe395b371195d4942f88d. An ESP32 board
checks an update's signature before a byte of the image is sent, and refuses an unsigned one
(companion version 13,ERROR11). The apps and ternmesh.org check signatures before sending
or writing any image. Over USB a board still takes anything. - Pairing a board without a passkey screen works only within three minutes of turning it on
or pressing its button (RESET on boards without one). Once a phone is paired, pairing another
needs someone at the board. Boards that show a passkey on their screen are unchanged. - Erase this node. A client can now erase everything a board holds, its identity among them,
and restart it with a new address (companion version 13,WIPE). - Acknowledgements. A board acknowledges a repeated message only if it matches the one
accepted, at most four times and for ten minutes, so a listener can no longer make it reveal who
sent a message. Relays no longer learn link power from acknowledgements they cannot check. - Sessions. A session that has lost too many messages starts first contact again by itself
instead of failing for good, and every session is renewed after seven days. Each epoch of a
session has its own tag key, so a captured board cannot label frames recorded earlier. - First contact. A board answers at most four first contacts in ten minutes, and an
unauthenticated request can no longer cut off one it is answering. - Groups. A group message's sender is shown as claimed, not proved, on the screen and in the
apps: anyone with the join code can write as any member. A writer heard only once is forgotten
before an established one, a group's windows are saved as each message is accepted so that
nothing is accepted twice after a power cut, and a group's random nonces come from a checked
source. - Floods start at a random hop count, so the count no longer points at the board that sent
them. - Cryptography. Signature checks refuse small-order keys themselves, rather than relying on
every caller, and are about two and a half times faster. A failed random draw no longer yields a
passkey from uninitialised memory on nRF52840 boards, and ESP32 boards no longer report
randomness when no source is running.
The companion protocol is now version 14. A client of version 12 or older still connects, but
cannot update an ESP32 board or erase one, and shows routing ids the board no longer uses.
What was tested, and what was not
CI built every image of this release for every board and region and ran the firmware test suite
under the address and undefined-behaviour sanitizers, with the specification's vectors for every
change above. The simulator, running the firmware's own routing code on 1000 nodes, delivered the
same as before the change to blinded keys, and within its seed spread for the other changes. The
signing step was run against the specification's test key in CI, and against the release key in
this release.
This release was not run on a physical board before it was published. In particular, the
pairing window has not been tried on hardware. If an nRF52840 board's bootloader clears the
register that says why the board started, the window would open on every start, not only after
power-on or the button.
Updating
An ESP32 board on 0.2.0-alpha.1 or later takes this release over the link once ternmesh.org lists
it. A board on 0.6.0-alpha.1 does not check signatures yet, so any client can update it; from this
release on, it will take only signed images.
tools/companion.py --port <port> update tern-heltec-v3-<region>-0.7.0-alpha.1-app.binAn nRF52840 board with the OTAFIX bootloader is updated over Bluetooth as before:
tools/companion.py --port <port> update tern-heltec-t114-<region>-0.7.0-alpha.1.zipOtherwise put it in its bootloader and copy the matching .uf2, as for 0.6.0-alpha.1. For a new
node, write the full image at 0x0 on an ESP32 board, or copy the .uf2 on an nRF52840 board.
Never power a board with nothing on the antenna connector. SHA256SUMS has the SHA-256 of every
file, and tools/release_key.py verify checks their signatures.
What to know
- An nRF52840 board's bootloader is not signed. While it waits for an update, anyone in range
can send it firmware. A bootloader that checks signatures is planned. - Who talks to whom is not hidden. A listener cannot learn your address, but sees which
routing ids exchange messages, and one near your board can tell when it sends. Routing ids that
change are specified but off: today's boards do not have room in their tables to route while
they change. - Saved keys and messages are not encrypted. Anyone holding the board can read them, a group's
secret among them. Flash storage also keeps superseded copies of session keys until it reuses
the page, so old keys can be read from a captured board. Erase removes everything. - A join code is a group's secret. Anyone who has it can read the group and write as any
member. Replacing a group's secret is specified; boards do not follow a replacement yet. - A card is public. Its name and your address go to every board within two hops, unsealed.
- The rules are yours to keep. The regions follow each country's rules as written, but
nothing here is certified, and whoever operates a radio answers for it. - The classic ESP32 boards are short of memory. The Heltec V2 and V2.1, LilyGo T-Beam, and T3
V1.6.1 have under 800 bytes of static RAM to spare in this build.