π’ Firmware β’ πΎ Protobuf β’ π» Host β’ π Chrome β’ π± Android
This repository contains the official Protocol Buffer (.proto) schema for the TurtlPass project and a reproducible build script to generate language bindings for C++, Python, JavaScript and Kotlin. It enables host applications to communicate with TurtlPass hardware over USB using a consistent, cross-platform data format.
turtlpass-protobuf/
βββ proto/
β βββ turtlpass.proto # Core protobuf definition
β βββ turtlpass.options # Nanopb / protobuf options
βββ build_turtlpass_proto.sh # Script to generate all bindings
βββ PROTOCOL.md
βββ README.md
βββ LICENSE
You must have all of the following tools installed and available in your system PATH:
| Tool | Purpose | Install Command |
|---|---|---|
| protoc | Protocol Buffers compiler | brew install protobuf |
| python3 | For running the Nanopb generator | brew install python |
| nanopb_generator.py | Generates C/Nanopb source files | pip install nanopb |
| protobufjs / pbjs | JS protobuf generation | npm install --save-dev protobufjs protobufjs-cli |
| esbuild | JS bundling for browser | npm install --save-dev esbuild |
| gradle | Kotlin protobuf generation | brew install gradle |
From the repository root:
./build_turtlpass_proto.shThe script will:
-
Validate dependencies
-
Generate protobuf bindings for:
- C++ / Nanopb
- Python
- JavaScript
- Kotlin
-
Create output directories automatically:
/out/cpp /out/python /out/js /out/kotlin
After running the build script, youβll see a structure like this:
cpp/
βββ turtlpass.pb.c
βββ turtlpass.pb.h
python/
βββ __init__.py
βββ turtlpass_pb2.py
js/
βββ turtlpass_pb.js
kotlin/
βββ turtlpass/
βββ CommandKt.kt
βββ DeviceInfoKt.kt
βββ GeneratePasswordParamsKt.kt
βββ InitializeSeedParamsKt.kt
βββ ResponseKt.kt
βββ TurtlpassKt.proto.kt
- Transport: USB serial (CDC)
- Serialization: Protocol Buffers (proto3)
- Pattern: Command / Response
Key Commands:
GET_DEVICE_INFO: Fetch device version and seed stateINITIALIZE_SEED: Store a seed for password derivationGENERATE_PASSWORD: Generate password using stored seedFACTORY_RESET: Reset device to default state
Message Highlights:
Command/Responsepair for communication- Fixed-size buffers for reliable MCU parsing
DeviceInfoincludes firmware and MCU identifiers
For full details, see the complete protocol specification.
This repository is intentionally minimal. It exists solely to:
- Define the canonical
.protoschema for TurtlPass. - Provide a single reproducible script to generate bindings for all supported languages.
Check your PATH and ensure that all required executables can be run directly from the terminal.
You can also verify your Protobuf installation:
protoc --versionIf it runs successfully, protoc itself is correctly installed.
This repository is licensed under the MIT License.