Claim label
Each device gets one sticker. The QR code and the NFC tag carry the same claim URL. A scan or a tap opens the claim form with the device id and the claim code filled in. The user still picks the tenant and presses Claim. Nothing is claimed on load.
URL format
https://<app host>/devices/claim?device_id=thesada-<12 hex>&code=<8 digits>
Example: https://thesada.app/devices/claim?device_id=thesada-0123456789ab&code=12345678
| Part | Rule |
|---|---|
device_id |
thesada- plus 12 lowercase hex digits |
code |
exactly 8 digits |
| App host | the --app-url the unit was provisioned with, default https://thesada.app |
The form drops a value that does not have this shape instead of echoing it, so a mistyped tag fills nothing rather than something wrong.
Once the app release that carries it ships, a logged-out scan keeps both values through the login redirect. The login page gets the claim path as a vetted rt return target, and an off-site target is refused.
Source of the URL
scripts/flash-provision.sh writes the link at flash time, next to the claim code, in the per-device artifact directory (build/provision/<device id>/ by default, mode 0600):
| File | Content |
|---|---|
claim.txt |
device id, claim code, app URL, claim link |
claim-link.txt |
the claim link alone, one line |
claim.png |
the link as a QR code, when the qrcode module is installed |
The firmware never changes the claim code, so a printed label stays valid. Re-running flash-provision with --force seeds a new one and the label must be reprinted. A device that is claimed again, such as a bench unit, gets a fresh label the same way.
The link carries the claim code. Treat the label like the unit: whoever holds it can claim the device, and that is the intended proof of possession.
QR code
Print the link from claim-link.txt as a QR code with error correction level M. At that level the link fits a version 5 symbol or smaller. A version 5 symbol is 45 modules wide with its quiet zone, so a 1.5 mm module (68 mm) fits a 76 x 51 mm label.
qrencode -l M -o claim.png < claim-link.txt
Any label printer works. The label needs the QR code, the 12 hex digits after thesada- and the claim code as text, and the device id printed under the QR code so the unit can be matched by eye.
NFC tag
| Item | Value |
|---|---|
| Tag | NTAG213 (144 bytes) or NTAG215 (504 bytes) |
| Record | one NDEF URI record, the claim link as its payload |
| Size | about 80 bytes, so NTAG213 is enough |
| Lock | leave unlocked until the tag is verified, then set it read-only |
To write it:
- Open an NFC writer app on a phone (NFC Tools, or the phone’s own tag writer).
- Choose add a record, then URL or URI, and paste the contents of
claim-link.txt. - Write it to the tag.
- Tap the tag with a second phone. The claim form must open with both fields filled.
- Lock the tag if it should not be rewritten.
Put the tag under the QR code on the same sticker so one label serves both.
Out of scope
| Not done | Why |
|---|---|
| Auto-claim on scan | claiming needs a signed-in user choosing a tenant |
| Wi-Fi or other secrets in the tag | the tag carries the claim link only |
| Changes to the claim rate limit or token rules | unchanged, see Provisioning |