The journey of a tap
Every tap follows the same path. The resolver step is optional: tags can point straight at your own server instead.
1. The tag writes a fresh link
Knura uses NXP's NTAG 424 DNA chips and their Secure Dynamic Messaging feature. Every time a phone reads the tag, the chip builds a new link with two values in it:
e=the tag's ID and its read counter, encrypted with AES-128. The counter goes up by one on every tap.c=a MAC (a short signature) over that tap, made with a key that never leaves the chip.
https://your-server/tap?e=EF963FF7828658A599F3041510671E88&c=94EED9EE65337086
Tags are set up with knurctl and a USB NFC reader. It gives each tag its own keys, writes the link template and reads the tag back to check it. Anyone can read the link, but only Knura's key can rewrite it or change the tag's settings.
2. knurd verifies it
knurd is the verification daemon. When a link arrives it:
- Decrypts
e=to get the tag's ID and counter. - Works out that tag's own key from your master key and checks the MAC. A forged or edited link fails here.
- Compares the counter with the last one it accepted for that tag. If it isn't higher, the link was used before and is refused.
Counters are saved to disk, so a restart doesn't reopen old links. A browser gets a small "Tap verified" or "Link already used" page; other clients get JSON.
| Status | HTTP | Meaning |
|---|---|---|
| ok | 200 | Genuine tag and a new counter. The action runs. |
| replay | 409 | The link was opened before. Nothing runs. |
| rejected | 403 | Bad signature or unknown tag: a forged or edited link. |
| malformed | 400 | Not a tap link at all. |
3. knurgN runs the action
knurgN is the actions engine. knurd hands it only taps that came back ok, so forged and replayed taps can never start anything. knurgN looks up the rule for the tag's verified ID: nothing in the link can choose or change what runs.
It then delivers a signed event to the tag's connector, in the background:
- Network errors and busy answers are retried after 1, 2, 4… seconds.
- An action that hasn't gone through 30 seconds after the tap is dropped, so lights don't switch on a minute late.
- Every action is logged as delivered, refused or expired.
See Connectors for where events can go.
Optional: tap.knura.io
A tag's link is written onto the chip, so it has to keep working if your server moves. With the resolver, tags carry https://tap.knura.io/<owner>?e=…&c=… instead of your own address, and the resolver sends each tap on to the server you registered.
Moving knurd to a new computer then means registering the new address once, not rewriting every tag. The resolver only forwards: it holds no tag keys and knurd still checks every tap. More on the Security page.