EasyTLV: A Lightweight TLV Serialization Library

EasyTLV is a TLV (Tag-Length-Value) serialization library I built while developing smartcard drivers for the GridPlus hardware wallet. TLV is a simple binary encoding format where each data element is represented as a tag identifying the type, a length field indicating the size, and the actual value bytes. Why Am I Working With TLV? TLV is an older binary serialization format that does not see much use in new applications today. In fact, with modern binary serialization schemes like Protobuf or CBOR, which offer much better tradeoffs for most applications, it’s a wonder people still use TLV. ...

November 10, 2020 · 6 min

Reflecting on my time at GridPlus

I recently left GridPlus after 3 years, where I served as tech lead building hardware cryptocurrency wallets that now secure assets for some of the world’s largest crypto custodians. I wanted to take a moment to reflect on what was truly an exceptional journey. The full Gridplus product suite. The Technical Deep End Working at GridPlus meant diving headfirst into some of the most challenging and rewarding technical problems I’ve encountered. My days were filled with hardware hacking, electronics prototyping, and porting cryptography libraries to embedded firmware. I developed Java applets for chip-and-pin cards, designed anti-tamper circuitry capable of detecting intrusion and destroying sensitive keys, and helped build the first secure display featuring a dedicated embedded GPU entirely enclosed within the device’s anti-tamper zone. This work spanned embedded graphics driver development, distributed networking, and extensive blockchain wallet development at both firmware and application levels. ...

January 14, 2020 · 3 min

MicroCLI: A Lightweight CLI Framework for Bare Metal Systems

When working on embedded systems, I typically rely on some form of serial interface for debugging the firmware and perhaps issuing some control commands. In my years doing embedded systems development, I haven’t come across any great frameworks for building a more fully-featured command interface. I’m talking specifically about bare metal projects, perhaps even without a standard library available. Of course, if your device can run linux, you have loads of great options for hosting a shell and building a CLI… but there’s a gap for lower level systems. I built MicroCLI to address this gap by providing a reusable command-line interpreter framework specifically designed for resource-constrained embedded systems. ...

December 1, 2019 · 3 min

The Typestate Pattern: Where the Rust Type System Shines

If you’ve been writing Rust for a while, you’ve probably encountered a peculiar but elegant pattern: structs that consume themselves to become different structs, encoding a state machine directly into the type system. This is the typestate pattern, and it’s one of those patterns that makes Rust special. What Is the Typestate Pattern? The typestate pattern encodes the states of a state machine as distinct types. Instead of tracking state with an enum field or boolean flags, each state becomes its own type, and transitions consume the old state to produce the new one. ...

August 13, 2018 · 4 min

Reflecting on my time at Knocki (Haptic Inc.)

Knocki was my first startup, where I served as CTO and led development of a device that transforms any surface into a smart controller. Mount it to your bedside table and tap twice to control your lights, or knock a secret pattern to arm your security system—think of it as The Clapper reimagined for modern smart homes. Knocki device mounting to a wall. The Technical Challenge Building Knocki presented fascinating engineering challenges. The initial assumption—that you could simply attach an accelerometer to an MCU and call it done—proved woefully inadequate. Everyday surfaces experience constant background vibrations: fridge compressor motors, HVAC systems, footsteps, doors slamming, and countless other sources of noise that make distinguishing intentional gestures from environmental interference remarkably difficult. ...

January 4, 2018 · 2 min

Building an ADC on a Keychain

A few times recently, I’ve found myself wanting a memorable business card to give out. Being an electrical engineer, I figured I’d have some fun and build a cool fidget circuit onto a PCB small enough to hand out at meetings. I decided to build a little ADC (analog-to-digital converter) demo from scratch, because who doesn’t like an ADC fidget toy? The Idea The idea was to included a dummy analog input ‘signal’, a scratch-built ADC, and an LED output to show a digital readout of the analog voltage. This should be small enough to fit on a card, without being so small that people can’t inspect and play with the components themselves. Most importantly, it should be fun to fidget with, and ideally a conversation starter. ...

April 26, 2016 · 4 min