UltraWideLock v0.4.0
Open-source lock firmware · UWB · NFC · Matter

Walk up.
It unlocks.

A smart lock that measures your phone’s distance by time of flight and opens only when you are really at the door. iPhone or Apple Watch, on approach or on tap. Verified on the lock, with no cloud in the loop.

A ranging round live drag the phone · or use the slider
A double-sided two-way ranging round A lock on the left and a phone on a distance scale, with the three ranging messages below: poll from the lock, response from the phone, and final from the lock. The measured distance, its tick count and the unlock decision are given as text beneath the diagram. 0 1 2 3 m unlock bound · 1.00 m lock phone 0.82 m poll response final
measured 0.82m ticks 154 time of flight 2.73ns unlock

A relay can add delay and nothing else, so arming one pushes the measurement away from the door. Every reading here is computed from the firmware’s own constants. How it is measured

4.692 mmper ranging tick
9,608host checks, no hardware
0cloud dependencies
Get started

Clone to a passing suite in one minute.

A C compiler and python3 are the whole requirement. No board, no toolchain, and nothing phones home.

shellno hardware
git clone https://github.com/ultrawidelock/ultrawidelock.git
cd ultrawidelock
make check                  # 18 suites, 9,608 checks
shellDWM3001CDK
make dfu-key                # once per clone   · image-signing key
make bootstrap              # once per machine · NCS v3.3.0
make build                  # -> build/cdk-matter
make flash                  # over the on-board J-Link
make monitor                # console, over RTT
Why it is different

Distance is measured, not trusted.

Signal strength can be faked from across the street. Time of flight cannot: light takes 3.34 ns per metre, and nothing makes it arrive early.

  • Time of flight, not signal strength

    A DS-TWR round under a scrambled timestamp sequence puts the phone on a ruler with 4.7 mm ticks. A relay can only add delay, which moves the phone further from the door.

  • Verified on the lock

    The credential is checked on the device itself. No app in the loop, no account, no cloud round trip, and therefore no remote verifier to compromise.

  • The phone already in your pocket

    An iPhone or Apple Watch opens it on approach over UWB or on tap over NFC, and the lock reports its state to Apple Home over Matter.

How a door opens

Learned from the air.
Written by hand.

Five steps in the order they happen, each one studied as it crossed the air and reimplemented in portable C: the credential exchange, the key ladder, STS, DS-TWR, and a Matter node without CHIP. The notes are public.

  1. 01BLE The phone finds the lock’s credential service.
  2. 02Authenticate AUTH0, AUTH1 and EXCHANGE, and both ends hold the ranging key.
  3. 03Range The key ladder seeds an STS session, then one DS-TWR round.
  4. 04Gate A trusted range inside 1.00 m moves the bolt.
  5. 05Home Lock state into Apple Home over Thread or Wi-Fi.
On real hardware

Three chip families. One portable core.

Eight iPhone screens recorded against the lock: Home Key setup, Approach Direction, provisioning, an NFC tap, and lock-state notifications Eight iPhone screens recorded against the lock: Home Key setup, Approach Direction, provisioning, an NFC tap, and lock-state notifications
Home Key setup, Approach Direction, provisioning, an NFC tap and live lock state. Recorded on the bench, not mocked up.
  • DWM3001CDK nRF52833 + DW3110

    The reference board. Radio, MCU and a J-Link on one part, nothing to wire. Matter over Thread. Also builds without Zephyr.

  • nRF5340 DK DWM3000EVB + NFC12A1

    UWB and NFC on the same lock, so a tap works when a walk-up does not. Matter over Thread.

  • ESP32-S3 / C5 / C6 DWM3000EVB

    Matter over Wi-Fi, and the tier the web flasher installs with no toolchain at all.

  • Every target, every number, and the memory budget on the smallest part.Read the specification
Open source

ISC licensed,
all the way down.

No CLA. Every number on this page is checked against the code that produces it, and the build fails when they drift.

Repository defaults are bench defaults. Keys and identities in the tree are for development. Do not secure valuables with it.