r/androiddev • • 20d ago

I built an open-source Android app where the phone acts as a P2P blockchain node

Hi r/androiddev!

I've been working on a technical experiment called Trigger. The goal was to see if a regular Android smartphone could act as a full node for a P2P network, without relying on central servers.

Tech Stack:

· Networking: Iroh (direct P2P connections) + mDNS for local discovery. · Blockchain: Custom lightweight implementation with SHA-256 and ECDSA signatures. · Security: StrongBox / Keystore integration for key storage. · Language: Java (Android SDK).

What it does:

· The phone stores and validates blocks locally. · Mining is based on a Proof-of-Authority mechanism, protected by SIM-card verification (to prevent emulator farms). · There is a built-in P2P messenger (SQLite + WebSockets) and a simple marketplace for peer-to-peer data exchange.

The project is fully open-source (MIT License).

💻 GitHub: https://github.com/trigerjl/Trigger- 📱 APK: https://github.com/trigerjl/Trigger-/releases

I'm looking for feedback on the architecture, especially regarding battery optimization and P2P connection stability. Any Pull Requests or issues are welcome!

0 Upvotes

5 comments sorted by

2

u/Muchy_Tangerine 19d ago

Android doze mode will kill persistent peer connections fast

1

u/Different-Adagio-993 16d ago

we ping every 15 sec in our app to keep connections alive on wifi, helped a lot