# Cerberus Tags

By [jeffy yu](https://paragraph.com/@lljeffy) · 2023-09-04

---

**The World We Live In**
------------------------

Imagine a city struck by a devastating earthquake. Amidst the rubble and chaos, families are torn apart, not by the disaster itself, but by the uncertainty of not knowing if their loved ones are safe. In another part of the world, political unrest pushes a nation into turmoil. As the internet is censored and communication lines are cut, people are left in the dark, wondering about the safety of their friends and family. These scenarios, though distinct, share a common thread - the agonizing pain of not knowing.

Recent history is replete with examples that underscore the urgency of a reliable proof-of-life system. The devastating 2010 Haiti earthquake left over 230,000 people dead, and in the immediate aftermath, thousands were unaccounted for, leading to a chaotic search for loved ones. Similarly, the Syrian civil war has displaced millions, with families torn apart, not knowing if their relatives are dead or alive. In disasters like these that occur around the world everyday, the search for the missing is always a race against time.

In our hyper-connected age, it's ironic that when disaster strikes, our sophisticated communication systems often crumble, leaving us more isolated than ever.

Current systems, be it government databases or NGO-operated tracking solutions, are vulnerable. They rely heavily on physical infrastructure and often suffer from bureaucratic red tape. In conflict zones, centralized databases can be attacked, either to manipulate data or to cut off access entirely.

Databases become inaccessible due to power outages or server damages. Paper records, if they exist, can be destroyed or lost. The bureaucracy, already overwhelmed, struggles to provide timely information. This is not just an inefficiency; it's a disaster waiting to happen.

This is where the concept of decentralized identity comes into play. Unlike centralized systems, where a single entity has control over all data, decentralized identity systems distribute the data across multiple nodes, ensuring that no single point of failure exists. This means that even if a natural disaster destroys local infrastructure, the proof-of-life data remains accessible from anywhere in the world.

**Cerberus Tags**
-----------------

**Cerberus Tags** (Greek Cerberus + Dog Tags) aims to solve this issue by providing a framework that can be adapted and deployed at any scale by anyone, whether it be a family looking to account for all its members, or a military organization looking to track thousands of troops.

The design is a decentralized proof-of-life system which uses a blockchain to create secure, digital identities for each user. User interactions, including registrations, regular check-ins, and death confirmations, are facilitated by smart contracts and recorded in the immutable ledger. The system harnesses the power of QR codes, PINs, and asymmetric cryptography to ensure user security and two-factor authentication.

![/>](https://storage.googleapis.com/papyrus_images/38e8ded3cf38d5e60ef1e7a8c98f2e1725c5545b6796aa1dfa62a95c55428527.png)

/>

**System Design**
-----------------

### **The Life Ledger**

In the core of a Cerberus Tags system lies a decentralized ledger or blockchain that records transactions across multiple computers, ensuring that the data is transparent, immutable, and secure.

Ethereum, a leading blockchain platform, introduces the concept of smart contracts, which are self-executing contracts with the terms of the agreement directly written into code. Though our proposed system is blockchain-agnostic, Ethereum emerges as a top choice due to its mature ecosystem, robust security, and widespread adoption.

Moreover, Ethereum's Layer 2 (L2) solutions can be leveraged to strike a balance between cost, speed, reliability, and decentralization. These L2s operate on top of the Ethereum mainnet and can process transactions faster and at a lower cost, making them ideal for systems that require frequent interactions, like our proof-of-life framework.

### **Users**

In the system, users are crucial participants who carry out regular check-ins that confirm their presence in the system. They are required to check-in within a specified timeframe or else they will be automatically marked as “missing” or “inactive”, and pre-programmed action may take place, like in a dead man’s switch.

Assuming deployment on Ethereum, the primary tool enabling user interactions with the system is the user's Ethereum wallet, a digital application that authorizes transactions on the blockchain.

Every user wallet is fortified by a unique pair of cryptographic keys: a public key, which is disclosed publicly and used to receive transactions, and a private key, guarded secretly, used to sign transactions and prove ownership - essentially acting like a digital signature. This mechanism, called asymmetric cryptography, ensures high-level security. It makes it impossible for anyone to forge transactions without the private key, even if they know the public key.

In the context of this system, both these keys play vital roles. The public key helps produce the user's unique Ethereum address which is recorded into the system during the registration phase. Any activities performed by the user, such as check-ins or duress signals, are tracked against this address.

The private key is responsible for the initiation of these activities. Every time a user decides to check-in or register a duress signal, they use this private key to sign the transaction. The system then verifies the authenticity of this digital signature before acknowledging the activity. Since the private key is only known to the user, this mechanism ensures that only genuine activities are acknowledged, thereby reducing the risk of fraud.

However, to bring an extra layer of protection, this system combines the use of private keys with a Personal Identification Number (PIN). Hence, besides signing the transaction with the private key, the user also has to enter their unique PIN at the time of check-in, similar to a two-factor authentication system. With this, even if a malicious party somehow gets access to a user's private key, they will not be able to falsely check-in without knowing the right PIN.

Moreover, we have integrated QR codes to increase usability and security. Rather than manually handling the private key, users can make use of scannable QR codes encrypted with their private keys. This not only speeds up the process of checking-in but also minimizes the risk of exposing raw private keys.

### **Smart Contract**

The smart contract for our system would have several critical functions:

*   **Registration**: When a user first joins the system, they interact with the registration function. Here, they either provide a chosen PIN or let the smart contract generate one for them. This PIN, along with their Ethereum address (derived from their public key), is stored. The PIN acts as an additional layer of security, ensuring that even if someone has access to the user's private key, they cannot falsely check-in without the PIN.
    
*   **Check-in**: At regular intervals, users are required to interact with the check-in function. They sign a transaction using their private key and provide their PIN. The smart contract verifies the authenticity of the request and logs the check-in time against the user's address.
    
*   **Death Verification**: In the unfortunate event of a user's death, the death verification function can be invoked. For civilian setups, multiple peers can confirm the death, while in official setups, only authorized personnel can do so. The smart contract logs the verification against the user's address and the addresses of the verifiers.
    
*   **Duress Signals**: If a user is under duress, they can use a secondary PIN to signal the system discreetly. On the surface, it appears as a regular check-in, but the system flags it, alerting the necessary parties.
    

### **QR Code Integration**

The integration of QR codes into the system serves a dual purpose: enhancing user experience and bolstering security. By abstracting the private key within a scannable QR code, the system reduces the risks associated with manual key entry and potential exposure. It is also much faster than typing an entire private key every check in. Furthermore, the QR code is designed to work in tandem with the user's PIN. Scanning the QR code alone isn't sufficient; the user must also input their PIN to authenticate, ensuring a two-factor authentication mechanism.

### **Death Verification Protocols**

The process of verifying a user's death is sensitive and demands a robust security protocol. In civilian contexts, the system requires multiple peers (e.g., 3 or 5) to collaboratively confirm a death, reducing the likelihood of false or malicious reports. For more official setups, the system mandates that only authorized personnel, such as coroners or military doctors, can confirm a death. Their digital signatures, unique to each individual, are used to verify their authority, ensuring that death verifications are both secure and credible.

### **Check-in Frequencies**

The frequency of check-ins can be tailored to the specific needs and contexts of deployments:

*   **Shorter Frequencies**: In high-risk zones, such as active conflict areas or regions recently hit by natural disasters, shorter check-in frequencies (e.g., every 24 hours) might be necessary. This ensures rapid response and allows for timely interventions if someone fails to check in.
    
*   **Longer Frequencies**: In more stable civilian contexts or during the recovery phase post-disaster, longer check-in frequencies (e.g., every 72 hours or once a week) might be more appropriate. This reduces the burden on users while still providing a reliable proof-of-life mechanism.
    

### Offline Capabilities

*   **Mesh Networks:** Decentralized, peer-to-peer networks where individual devices, or nodes, communicate directly with each other. Unlike traditional networks that rely on a central router, mesh networks dynamically self-organize and self-configure, allowing devices to join or leave the network seamlessly. In the context of our system, this means that users can check in or verify deaths even without direct internet access. As long as one device within this mesh network has internet connectivity, perhaps through a satellite link in remote or war-torn areas, it can act as a beacon, relaying information for all other devices in the network. This approach is reminiscent of systems like Tile or Airtags, where the collective power of the network ensures functionality even when individual devices lack direct connectivity.
    
*   **Batching:** Given the potential volume of check-ins and verifications, especially in large-scale disaster scenarios, batching becomes an essential feature. Batching allows multiple actions to be grouped together and processed as a single transaction, optimizing both cost and speed. Here are a few proposed batching methods:
    
    *   **Time-based Batching**: All actions within a specific time frame, say every hour or every day, are grouped together and processed as one. This is beneficial for consistent intervals but might introduce slight delays.
        
    *   **Threshold-based Batching**: Actions are batched together until they reach a certain number, after which they're processed. This ensures quicker processing but might vary in batch sizes.
        
    *   **Priority-based Batching**: Critical actions, like death verifications, are processed immediately, while regular check-ins are batched. This ensures urgent actions aren't delayed but might complicate the batching logic.
        
        Each method has its merits, and the choice would depend on the specific scenario and user requirements.
        
*   **SMS Integration:** In many regions, while internet connectivity might be sporadic, cellular networks remain operational, allowing for SMS communication. The system can be leveraged to allow users to check in or verify deaths via SMS. Users can send a specifically formatted SMS containing their private key and other essential information to a dedicated number associated with the system. This SMS is then received by a service set up in tandem with our system, which processes the information and interacts with the smart contract on the user's behalf. This ensures that even in areas with only basic cellular connectivity, users remain connected to the system.
    

**A Basic Smart Contract**
--------------------------

    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    
    contract ProofOfLife {
    
        // Struct to represent each user
        struct User {
            bytes32 pinHash; // Hashed version of the user's PIN for security
            uint256 lastCheckIn; // Timestamp of the last check-in
            bool isUnderDuress; // Flag to indicate duress
            bool isVerifiedDead; // Flag to indicate death verification
            bool isRegistered; // Flag to indicate if the user is registered
        }
    
        // Mapping of user's Ethereum address to their data
        mapping(address => User) public users;
    
        // Event to log user registrations
        event UserRegistered(address indexed userAddress);
    
        // Event to log user deregistrations
        event UserDeregistered(address indexed userAddress);
    
        // Event to log check-ins
        event CheckedIn(address indexed userAddress);
    
        // Event to log duress signals
        event UnderDuress(address indexed userAddress);
    
        // Event to log death verifications
        event VerifiedDead(address indexed userAddress, address indexed verifierAddress);
    
        // Modifier to check if the user is registered
        modifier isUserRegistered {
            require(users[msg.sender].isRegistered, "User is not registered");
            _;
        }
    
        // Register a new user or update an existing user's PIN
        function registerOrUpdate(bytes32 _pinHash) external {
            users[msg.sender] = User(_pinHash, 0, false, false, true);
            emit UserRegistered(msg.sender);
        }
    
        // Deregister a user
        function deregister() external isUserRegistered {
            delete users[msg.sender];
            emit UserDeregistered(msg.sender);
        }
    
        // Check-in function
        function checkIn(string memory _pin) external isUserRegistered {
            require(keccak256(abi.encodePacked(_pin)) == users[msg.sender].pinHash, "Invalid PIN");
            users[msg.sender].lastCheckIn = block.timestamp;
            users[msg.sender].isUnderDuress = false; // Reset duress flag on a valid check-in
            emit CheckedIn(msg.sender);
        }
    
        // Duress signal function
        function signalDuress(string memory _duressPin) external isUserRegistered {
            require(keccak256(abi.encodePacked(_duressPin)) == users[msg.sender].pinHash, "Invalid PIN");
            users[msg.sender].isUnderDuress = true;
            emit UnderDuress(msg.sender);
        }
    
        // Death verification function
        function verifyDeath(address _userAddress) external isUserRegistered {
            require(msg.sender != _userAddress, "Cannot verify own death");
            users[_userAddress].isVerifiedDead = true;
            emit VerifiedDead(_userAddress, msg.sender);
        }
    
        // Function to check the status of a user
        function getUserStatus(address _userAddress) external view returns (uint256, bool, bool, bool) {
            return (
                users[_userAddress].lastCheckIn,
                users[_userAddress].isUnderDuress,
                users[_userAddress].isVerifiedDead,
                users[_userAddress].isRegistered
            );
        }
    }
    

**Adversary Countermeasures**
-----------------------------

The proposed system is not without vulnerabilities. Understanding these vulnerabilities and devising countermeasures is essential for the system's integrity and the safety of its users.

### **Visibility Issues**

1.  **Public Ledger Exposure**: Since Ethereum operates on a public ledger, all transactions, including check-ins and death verifications, are visible. This transparency, while ensuring accountability, can inadvertently leak information.
    
    *   **Military Intelligence Concerns**: Adversaries could monitor the smart contract to gauge troop strength, movements, or even morale. For instance, a sudden spike in death verifications from a particular unit might indicate a recent engagement.
        
    *   **Civilian Context**: In non-military scenarios, monitoring the contract could give insights into the movement or status of groups of people, potentially aiding in targeting or other malicious activities.
        
    
    **Solutions**:
    
    *   **Private Transactions**: Implementing zero-knowledge proofs or other privacy-preserving technologies can allow for transactions that don't reveal specifics but still maintain the integrity of the system.
        
    *   **Deploy on Private Chains**: For highly sensitive operations, a private or consortium Ethereum chain could be used. This restricts access and visibility to authorized entities.
        

### **Attack Issues**

1.  **User Coercion**: An adversary could force users to check in under duress, giving a false sense of security to those monitoring.
    
    **Solutions**:
    
    *   **Duress PIN**: As previously discussed, a secondary PIN can be used to discreetly signal duress.
        
    *   **Randomized Check-ins**: Randomizing check-in times makes it harder for adversaries to predict and force check-ins.
        
2.  **Sybil Attacks**: Malicious entities could flood the system with fake registrations, making it hard to discern genuine users.
    
    **Solutions**:
    
    *   **Proof of Humanity**: Integrate mechanisms where users have to prove they are real, such as video verifications or vouching from existing trusted users.
        
    *   **Staking**: Require users to lock up a certain amount of cryptocurrency as a stake when registering. Malicious actors would be disincentivized due to the financial cost.
        
3.  **Physical Threats to Users**: Possession of a tag could make users targets, especially in hostile areas.
    
    **Solutions**:
    
    *   **Disguise the Tag**: Design the tag to look like everyday objects, such as jewelry or accessories. May be easier to print the actual private key as small plaintext to avoid a QR code that may draw attention.
        
    *   **Digital Alternatives**: Instead of physical tags, use secure mobile apps or other digital tools that don't draw attention.
        
    *   **Disposability:** Design the key generation such that QR codes and private keys can be easily invalidated and replaced if needed.
        
4.  **Relay Attacks on Mesh Networks**: An adversary could intercept and alter messages in a mesh network.
    
    **Solutions**:
    
    *   **End-to-End Encryption**: Ensure that messages within the mesh network are encrypted from the sender to the receiver, making interception useless.
        
    *   **Trust Scores**: Devices in the network can have trust scores based on their behavior. Devices that act maliciously are isolated.
        
5.  **SMS Interception**: SMS messages, especially in conflict zones, can be intercepted.
    
    **Solutions**:
    
    *   **Encrypted SMS**: Use encryption protocols for SMS, ensuring that even if intercepted, the content remains secure.
        
    *   **One-Time Pads**: For ultra-sensitive operations, use one-time pads or keys to encrypt messages, ensuring near-impenetrable security.
        

Decentralized, Not Disconnected
-------------------------------

In the intricate dance of human progress, we often find ourselves revisiting age-old challenges, armed with new tools and insights. Disasters, both natural and man-made, have perennially tested our resilience, prompting us to innovate and adapt. The [Headcount](https://headcount.io/) app, with its ability to swiftly account for everyone within 5 minutes during emergencies, epitomizes this spirit of innovation. It's a testament to how we harness modern technology, like mobile apps, to address timeless challenges. Yet, as with all innovations, there's always room for evolution.

Enter the realm of decentralized proof-of-life, a fusion of the immutable ledger of blockchain with the immediacy of smart contracts, all underpinned by the security of cryptographic principles. It promises flexibility in deployment, ensuring that whether you're a soldier on the frontlines, a resident in a hurricane-prone area, or a member of a close-knit community, you have a tool to signal your safety.

The vision is clear: an open-source, easily deployable framework, where with a few clicks and a dash of gas, anyone, anywhere, can set up their safety net.

Imagine a world where communities, be it a family, a church, or a workplace, preemptively prepare for uncertainties. When disaster strikes, instead of chaos, there's a system in place, ready to be activated, ensuring that no one is left unaccounted for.

In the end, this isn't just about technology; it's about humanity. It's about our undying spirit to protect, connect, and above all, persevere. And as we move forward, with tools like this decentralized framework in our arsenal, we do so with the hope and determination to build a safer, more connected world for all.

---

*Originally published on [jeffy yu](https://paragraph.com/@lljeffy/cerberus-tags)*
