Skip to content

Commit

Permalink
CA DMV Hackathon Blog Post (#1831)
Browse files Browse the repository at this point in the history
* CA DMV Hackathon Blog Post

* rephrase

* updates

* later date
  • Loading branch information
angiejones authored Oct 15, 2024
1 parent cff2a2c commit 12b8749
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions site/blog/2024-10-15-ca-dmv-mdl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
slug: ca-dmv-mdl
title: "Our California DMV Hackathon Win: Privacy-Preserving Age Verification"
description: "Learn about our winning prototype for instant age verification within Square's Point of Sale system."
authors:
name: Angie Jones
tags: [Verifiable Credentials, Decentralized Web Nodes, Decentralized Identity, Web5, tbDEX, Hackathon]
---

<head>
<meta property="og:title" content="Our California DMV Hackathon Win: Privacy-Preserving Age Verification" />
<meta property="og:type" content="website" />
<meta property="og:url" content='https://developer.tbd.website/blog/kcc-hackathon' />
<meta name="og:description" content="Learn about our winning prototype for instant age verification within Square's Point of Sale system." />
<meta property="og:image" content="https://developer.tbd.website/assets/images/blog-ca-dmv-mdl-3f980361c940d2382af955056a74af1b.png" />

<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:domain" content="developer.tbd.website" />
<meta name="twitter:site" content="@tbdevs" />
<meta name="twitter:title" content="Our California DMV Hackathon Win: Privacy-Preserving Age Verification" />
<meta property="twitter:url" content='https://developer.tbd.website/blog/kcc-hackathon' />
<meta name="twitter:description" content="Learn about our winning prototype for instant age verification within Square's Point of Sale system." />
<meta name="twitter:image" content="https://developer.tbd.website/assets/images/blog-ca-dmv-mdl-3f980361c940d2382af955056a74af1b.png" />

<link rel="apple-touch-icon" href="https://developer.tbd.website/img/tbd-fav-icon-main.png" />
</head>


![](/img/blog-ca-dmv-mdl.png)


At the recent [California DMV Hackathon](https://www.dmv.ca.gov/portal/news-and-media/news-releases/dmv-recognizes-companies-for-outstanding-mdl-use-cases-at-first-community-hackathon/), the Block team, represented by members from Square and TBD, won the **Best Privacy & Security Design** award for building a prototype of an instant age verification system. This solution utilizes mobile drivers’ licenses (mDLs) to provide secure, privacy-centric transactions for age-restricted purchases with Square’s Point of Sale (POS) system.

In this post, we’ll explore the core technical components behind our solution, which centered on using TruAge technology to enable seamless, secure age verification.

<!--truncate-->

## How TruAge QR Code Verification Works
At the heart of our prototype is the ability to scan and verify a [TruAge Age Token QR code](https://www.dmv.ca.gov/portal/ca-dmv-wallet/truage/). These QR codes contain a [verifiable credential (VC)](https://developer.tbd.website/docs/web5/verifiable-credentials/what-are-vcs) that confirms a person’s legal age without exposing unnecessary personal information. Here’s a breakdown of how we approached verifying these credentials in our solution.

1. **Decoding the QR Code Payload**

The first step in the verification process was reading the QR code provided by the customer. TruAge QR codes follow a standard format which encodes the [verifiable presentation (VP)](https://developer.tbd.website/docs/glossary/#verifiable-presentation) in a compact [CBOR](https://cbor.io/) format.

Our team implemented a scanner using our open source [web5-swift](https://github.com/TBD54566975/web5-swift/tree/truage-credentials) SDK that reads the QR code and decodes the CBOR-encoded payload. This CBOR format is efficient, allowing the verifiable presentation to be transmitted and processed quickly, minimizing any delays at the point of sale.

2. **Converting CBOR to JSON**

Once we decoded the CBOR data, the next step was to parse it into a JSON-based verifiable presentation using the [W3C Verifiable Credentials (VC) Data Model v1.1](https://www.w3.org/TR/vc-data-model/). This model is critical to ensuring interoperability across different platforms and services, as it standardizes how credentials are represented and exchanged in a decentralized manner.

3. **Validating the Issuer’s DID**

After converting the data into a verifiable format, we needed to validate the digital signature on the credential. We retrieved the issuer’s [Decentralized Identifier (DID)](https://developer.tbd.website/docs/web5/decentralized-identifiers/what-are-dids) from the TruAge server, which provided us access to a sandbox environment containing their list of authorized DIDs.

Using DIDs, we were able to validate the cryptographic signature to ensure that the credential was issued by a trusted TruAge provider. This validation step is critical for ensuring that the credential has not been tampered with and is issued by a legitimate authority.

4. **Credential Content Verification**

Once the issuer’s signature was validated, the next step was to check the contents of the verifiable credential itself. In this case, we looked for proof that the individual was over 21 and verified that the credential had not expired.

This lightweight verification process ensures that businesses can quickly and easily confirm a customer’s legal age, while protecting their privacy by not exposing sensitive information like birthdates or addresses.

## Building the Integration: Web5 and TruAge Libraries
To bring this solution to life, we used a few key technologies:

* **iOS**: Our team developed the iOS implementation using the web5-swift library, which allowed us to efficiently handle the scanning, decoding, and parsing of the TruAge QR codes on Apple devices. You can explore the code here: [web5-swift TruAge Credentials](https://github.com/TBD54566975/web5-swift/tree/truage-credentials).

* **Android**: For Android, we modified the TruAge library provided by Digital Bazaar to make it compatible with our solution. This involved adapting the library for seamless integration with our QR code parsing and validation logic. The code for this can be found here: [TruAge Java VC Verifier](https://github.com/tbdeng/truage-java-vc-verifier).

## Privacy and Security at the Forefront
Our approach ensures that personal information is protected at every stage of the transaction. By focusing solely on verifying the specific data point needed (in this case, whether someone is over 21), we avoid collecting or storing any unnecessary information. This is a win for both businesses and consumers, as it minimizes risk while maintaining a smooth user experience.

By integrating this technology into [Square’s Retail POS system](https://squareup.com/us/en/point-of-sale/retail), we not only enhanced security but also brought innovative, privacy-preserving solutions to small businesses that need to comply with age verification laws. This prototype has the potential to extend to many other use cases, from secure employee onboarding to identity verification for suppliers and customers.

## What’s Next?
Participating in the California DMV Hackathon is just the beginning of our efforts to drive adoption of mobile drivers’ licenses and secure age verification solutions. Our work continues in collaboration with the California DMV and other industry partners as part of the [NIST consortium](https://www.nccoe.nist.gov/news-insights/nccoe-announces-collaborators-mobile-drivers-license-mdl-project-use-case-1), aimed at standardizing and scaling mDLs across the United States.

Join us on October 23 for a live [Show & Tell](https://cal.et/c/t7jszrie) of the prototype!

Binary file added site/static/img/blog-ca-dmv-mdl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 12b8749

Please sign in to comment.