Skip to content
BORWI

BORWI

Blockchain Operated Real World Interactions

Created on 27th April 2025

BORWI

BORWI

Blockchain Operated Real World Interactions

The problem BORWI solves

Borwi addresses the challenge of connecting blockchain actions to the physical world in a decentralized, secure, and automated way — without relying on centralized servers.

Most existing solutions that bridge physical devices with digital systems depend on centralized infrastructure (e.g., web servers, private databases, or proprietary platforms). This introduces vulnerabilities, higher costs, and risks of censorship or system failure.

Borwi improves on these models by allowing physical devices (like an ESP32) to react directly to blockchain events, offering:

Decentralization – no need for private infrastructure or trusted intermediaries.

Transparency – all interactions are publicly and immutably recorded on the blockchain.

Reliability – the system works as long as there's blockchain connectivity, reducing single points of failure.

Security – logic is validated by blockchain events, not by private or opaque servers.

Proof of Concept: Blockchain-Powered Vending Machine
The first implementation of Borwi is a fully autonomous vending machine, powered by a smart contract deployed on the Base sepolia.

Users simply scan a QR code on the device’s screen and send the exact payment from their crypto wallet. The contract emits an on-chain event, which is instantly detected by the ESP32 via WebSocket — triggering the physical release of the selected product.

This demo showcases how real-world automation can be controlled 100% by smart contracts, with no servers, apps, or intermediaries involved.

Challenges I ran into

Developing Borwi revealed several technical and conceptual challenges. Here are the most notable ones — and how they were overcome:

Real-time Blockchain Event Listening on ESP32
Most Web3 tools are designed for full operating systems. Getting an ESP32 microcontroller to reliably connect to a WebSocket RPC endpoint, handle JSON-RPC messages, and remain connected over time required careful tuning of connection logic, buffers, and watchdog handling.

Solution: Switched to lightweight WebSockets with manual JSON parsing and minimal reconnect logic to ensure resilience and stability on constrained hardware.

Reliable QR Generation for MetaMask
Many QR libraries failed to produce valid ethereum: URIs that MetaMask would recognize. Even small rendering issues (like contrast, quiet zones, or alignment) would break the scan.

Solution: Migrated to the QRcode_ST7735 library, which produces scannable, high-contrast codes directly on the TFT screen with correct sizing and spacing.

On-Chain Logic Without UI
In Borwi, all logic (product selection, pricing, payment verification) is handled entirely on-chain — which meant any inconsistency in payment value would break the logic.

Solution: Encoded each product’s price as the only selector, using the receive() fallback in Solidity. The ESP32 builds dynamic QR codes that include this exact amount in the ethereum: URI.

Servo Timing and Hardware Safety
Physically dispensing a product reliably with a low-cost 360º servo required precise timing. Mistiming could lead to missed dispenses or motor overheating.

Solution: Tuned PWM control on the ESP32 and added feedback in the UI to confirm successful operation.

Tracks Applied (1)

Consumer

Technologies used

Cheer Project

Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.

Discussion

Builders also viewed

See more projects on Devfolio