Get the powerful template to approach system design for FREE on newsletter sign-up:
This post outlines how AirTag works. You will find references at the bottom of this page if you want to go deeper.
Share this post & I'll send you some rewards for the referrals.
Note: This post is based on my research and may differ from real-world implementation.
Once upon a time, there was a sports journalist named Maria.
She had to travel often by flight for work.
But one day she lost her luggage during a flight, and couldn’t track it.
So she was sad and upset.
She hears about a tracking device, called Apple AirTag, from a coworker.
And bought it immediately, she was dazzled by its simplicity in tracking luggage.
This Post Summary - Bluesky
I wrote a summary of this post (save it for later):
And I’d love to connect if you’re also on Bluesky:
An AirTag contains a low-power CPU and a tiny amount of memory.
A tracking device must send its accurate location data at regular intervals.
Yet finding location data using GPS, WiFI, or cellular networks consumes power. Besides it’s expensive to maintain a tracking device with GPS functionality.
So smart engineers at Apple used simple ideas to solve this hard problem.
Onward.
How Do AirTags Work
An AirTag doesn’t use GPS, WiFi, or a cellular network for communication; instead, it uses Bluetooth Low Energy (BLE).
Imagine BLE as a low-power wireless technology for communication.
Here’s how AirTag works:
1. Setting up AirTag
They generate a public-private key pair, using elliptic curve cryptography, when a user adds an AirTag.
The key pair is shared between AirTag and the user account. The AirTag sends location data after encrypting it using the public key. While the user account decrypts the received location data using the private key.
Think of the public key as an email address; anyone can send messages to it. While the private key is similar to the password of an inbox; only the user with the password can read emails.
And authenticity of an email can be verified by checking the sender’s email address: digital signature.
Ready for the best part?
2. Broadcasting AirTag’s Location
They send the AirTag’s location, which is near its owner’s iPhone, using Bluetooth, or Ultra Wideband for precision and efficiency.
Think of Ultra Wideband as a wireless technology for high-speed, and short-range communication.
Yet Bluetooth and Ultra Wideband communication won’t work if the owner’s iPhone is far from the AirTag. So they rely on someone else's iPhone which is nearby.
Here’s how it works:
The AirTag broadcasts its public key every 2 seconds over BLE.
Someone else’s iPhone, which is nearby, receives the broadcast signal.
The iPhone encrypts its location data and timestamp using the received public key.
The iPhone uploads the encrypted data to the Apple server over HTTP.
Put simply, AirTag doesn’t send location data; instead, only the public key. The iPhone then includes its location data and encrypts it.
3. Finding AirTag’s Location
The owner can find AirTag’s location using their iPhone app.
Here’s how it works:
The owner authenticates on the Apple server.
The owner requests location data for a specific public key.
The owner decrypts the received location data using their private key.
The iPhone then displays AirTag’s recent location on a map.
An iPhone is necessary to relay location data, so an AirTag won’t work if there aren’t any iPhones nearby.
Put simply, the precision and effectiveness of an AirTag depends on the number of iPhones in its proximity.
While there are around 1.46 billion iPhone users in the world.
👋 PS - Do you want to level up at work?
I’m launching system design deep dives in February 2025.
But it’ll be available only to paid subscribers of this newsletter.
My mission is to help you go from 0 to 1 in system design by spending less than an hour each month. Yet paid subscription fees will be higher than current pledge fees. So pledge now to get access to it at a very low price.
“This newsletter is an amazing resource for learning system design.” Alex
Subscribe to get simplified case studies delivered straight to your inbox:
Want to advertise in this newsletter? 📰
If your company wants to reach a 100K+ tech audience, you may want to advertise with me.
Neo’s Recommendations 🫡
Product for Engineers: Get actionable tips to improve your product skills.
Refactoring: Get advice on writing good software.
Thank you for supporting this newsletter.
You are now 117,001+ readers strong, very close to 118k. Let’s try to get 118k readers by 17 January. Consider sharing this post with your friends and get rewards.
Y’all are the best.
References
Block diagrams created with Eraser
This is quite cool. I was wondering how this would work in a small village where I live where there are limited iPhones nearby, but you answered this nicely. Super informative, Kim! 👏
I think this really shows what kind of products you can build at a big company. Without the iPhone being extended enough, this product wouldn’t have been born.