Back to projects

web3 / 2026

Ageis — On-Chain Agricultural Traceability & Provenance

Full-stack agricultural traceability and marketplace platform combining custom Solana Anchor PDAs, dual Expo mobile apps, and idempotent NFC-to-NFT hardware binding to verify produce provenance.

Role Solo engineer — system architecture, mobile apps, Anchor program, hardware bridge, DevOps·Timeline 2026 · 3 months·Status Shipped
Farmer app / Register, verify, and manage every harvest

Farmer app / Register, verify, and manage every harvest

Marketplace / Discover, purchase, and trace your produce

Marketplace / Discover, purchase, and trace your produce

Anchor PDAs per order

2 (ProductTrace & DeliveryTrace)

Actor mobile clients

2 (Farmer & Buyer in React Native/Expo)

Custody lifecycle

4 verified stages (Initialized → Delivered)

Data architecture

PostgreSQL (Prisma) + Solana + Pinata IPFS

01 / Solving the Physical-to-Digital Oracle Problem

Solving the Physical-to-Digital Oracle Problem

A blockchain ledger is only as trustworthy as the data committed to it. In agricultural supply chains, writing metadata to an NFT is meaningless if an unauthorized actor can mislabel origins or substitute produce during transit. Ageis addresses this physical-to-digital integrity gap through a multi-factor verification chain. At harvest, produce batches are registered with geographic origin data, timestamps, and farmer credentials. Each batch is packed into tamper-evident containers anchored with cryptographically unique NFC tags. By enforcing cryptographic hardware binding at every physical handoff, Ageis makes unauthorized substitution physically destructive and cryptographically detectable.

  • Bridges physical produce crates to verifiable on-chain records using cryptographic NFC tags
  • Eliminates the oracle problem through multi-factor provenance: farmer identity, timestamps, and hardware binding
  • Tamper-evident packaging ensures physical tags cannot be transferred between crates without detection
  • Encodes harvest windows and regional seasonality rules for 100+ Indian crop varieties

02 / Decoupled Architecture: Web2 Commerce & Web3 Provenance

Decoupled Architecture: Web2 Commerce & Web3 Provenance

A fundamental architectural decision in Ageis is strictly separating high-frequency commerce from immutable provenance attestations. Forcing standard marketplace operations—such as browsing catalogs, searching products, updating cart items, or tracking local orders—through on-chain transactions introduces intolerable latency, unpredictable gas costs, and poor user experience. Ageis executes all transactional commerce workflows against a serverless PostgreSQL database via Prisma, achieving sub-millisecond query responses. Solana smart contracts are reserved exclusively for verifiable milestones: NFT minting, tamper-evident NFC binding, and immutable delivery state transitions.

  • High-throughput commercial transactions run on PostgreSQL at sub-millisecond latencies
  • Solana Anchor programs are reserved for immutable provenance attestations and custody milestones
  • 11 Prisma relational models link farmers, orders, physical NFC chips, and on-chain NFT mint addresses
  • Serverless PostgreSQL architecture on Neon delivers elastic scaling with zero connection exhaustion

03 / Custom Anchor PDAs & Immutable Delivery State Machine

Custom Anchor PDAs & Immutable Delivery State Machine

On-chain state is governed by a custom Solana Anchor program deployed on the network (4fRvr5yrDNTqnSXv8yFb9CSj3MwnYuade8UUmgb8cg3H). Each agricultural order generates two deterministic Program Derived Addresses (PDAs). The ProductTrace PDA—derived from the order identifier—anchors the produce NFT mint address, farmer public key, validated batch name, and decentralized IPFS metadata URI. The DeliveryTrace PDA acts as an immutable state machine, recording the mounted NFC chip identifier, the three supply chain participants (farmer, logistics courier, buyer), and a strictly forward-moving four-stage custody lifecycle (0: Initialized → 1: PickedUp → 2: InTransit → 3: Delivered). State transitions are cryptographically signed at each checkpoint, creating an auditable chain of custody.

  • ProductTrace PDA binds produce NFT mint, farmer identity, and IPFS metadata URI immutably
  • DeliveryTrace PDA enforces a strict, irreversible four-state custody lifecycle
  • Deterministic PDA seed derivation normalizes order identifiers to respect Solana's 32-byte seed limit
  • Anchor client derivation wraps atomic multi-account queries, resolving complete provenance chains in a single call

04 / Frictionless Hardware Bridge: NFC Resolution Without Crypto Barriers

Frictionless Hardware Bridge: NFC Resolution Without Crypto Barriers

For supply chain technology to succeed in agricultural markets, field operations must require zero specialized blockchain knowledge. Ageis implements an idempotent hardware bridge connecting physical NFC chips to digital state. During packaging, a farmer taps an NFC tag to bind it to an order through an idempotent upsert, allowing effortless tag replacement if hardware is damaged. On the consumer side, scanning an NFC tag requires no crypto wallet, browser extension, or token balance: the scan performs a lightweight API lookup that resolves the chip's unique identifier through the relational index directly to its linked Solana provenance record and Metaplex metadata.

  • Idempotent NFC tag mounting allows damaged physical chips to be replaced during packaging without state corruption
  • Consumer scanning resolves complete origin and transit history with zero crypto wallet requirements
  • Pre-flight constraint validation sanitizes Metaplex string boundaries before submitting on-chain instructions
  • Decentralized produce media stored on Pinata IPFS guarantees tamper-proof imagery and batch records

05 / Custodial Key Architecture & Production-Grade Infrastructure

Custodial Key Architecture & Production-Grade Infrastructure

To support non-crypto native farmers and consumers while maintaining cryptographic integrity, Ageis manages Solana keypairs through an architecturally isolated custodial key architecture. Sensitive wallet credentials (FarmerKeys and UserKeys) are encrypted at rest with dedicated salt and initialization vector (IV) metadata and stored in isolated database schemas separate from core user identity tables. The backend API is containerized using multi-stage Docker builds optimized for Alpine runtimes, deployed behind an NGINX reverse proxy with automated Let's Encrypt TLS renewal, and managed via PM2 for zero-downtime process lifecycle control.

  • Architecturally isolated custodial key vaults store encrypted private keys with unique salt/IV parameters
  • Decoupling key storage from identity tables eliminates single-point credential compromise risks
  • Multi-stage Docker builds generate hardened, minimal-footprint production Alpine runtime containers
  • NGINX reverse proxy manages SSL termination, HTTP-to-HTTPS enforcement, and security headers

06 / Architecture

System design decisions.

The architecture strictly decouples relational marketplace throughput from cryptographic provenance commitments. Product browsing, ordering, and inventory updates execute against PostgreSQL via Prisma at sub-millisecond latencies. Solana Anchor programs act strictly as an immutable attestation and state machine layer: orders trigger ProductTrace and DeliveryTrace PDA derivation using stripped UUID seeds to respect Solana's 32-byte seed limit. Metaplex metadata accounts bind IPFS media URIs and farmer public keys directly on-chain. The physical-to-digital link is anchored via idempotent OrderNFC records in PostgreSQL and on-chain UID records in DeliveryTrace, enabling instant NFC verification without requiring buyer wallets or gas fees.

07 / Challenges

The hard parts.

Enforcing Solana 32-byte PDA seed constraints with UUID order identifiers

Standard UUID strings with hyphens span 36 bytes, exceeding Solana's hard limit of 32 bytes per PDA seed. Deriving addresses with unstripped UUIDs triggers immediate runtime panics in Solana SDKs. The derivation pipeline normalizes order identifiers by stripping hyphen formatting into a deterministic 32-byte hexadecimal representation, allowing UUIDs to serve directly as unique seeds for both ProductTrace and DeliveryTrace PDAs without collision.

Pre-flight validation for Metaplex on-chain string constraints

Metaplex on-chain programs enforce strict string boundaries: 32 bytes for asset names and 200 bytes for metadata URIs. Submitting non-compliant strings results in failed transactions with cryptic error codes after incurring network round-trips. Ageis enforces pre-flight validation at the API boundary, truncating display names cleanly and rejecting oversized URIs prior to transaction construction to guarantee on-chain execution determinism.

Idempotent NFC tag mounting and physical-digital state consistency

Physical NFC tags can be mis-scanned or damaged during produce packing. Simple insert operations risk primary key collisions or orphaned physical records. Ageis implements an idempotent upsert pattern for NFC tag mounting keyed to the order ID, enabling farmers to re-tap or replace tags seamlessly during boxing without corrupting historical order state or breaking on-chain delivery traces.

08 / Takeaways

What the build taught me.

  • Decoupling commercial marketplace traffic from blockchain attestations via relational caching allows instant verification under poor field connectivity without waiting on block confirmations.
  • Enforcing strict data boundary validation at the application client layer before invoking cross-program invocations (CPIs) eliminates costly on-chain reverts and saves developer debugging cycles.
  • Isolating cryptographic signing keys in dedicated database tables with separate encryption salt/IV metadata prevents credential leaks during application-level data exposure.
  • Utilizing Anchor PDAs as lightweight state machines provides a tamper-proof chain of custody without incurring the operational overhead of heavy smart contract architectures.

09 / Stack

Tools chosen for the job.

TypeScript
React Native
Expo
NativeWind
Node.js
Express.js
PostgreSQL
Prisma
Neon
Solana
Solana Web3.js
SPL Token
Anchor
Metaplex
NFC
Pinata
Docker
NGINX
PM2
Farmer app / Verified identity and trust score

Farmer app / Verified identity and trust score

Farmer app / Register a new harvest

Farmer app / Register a new harvest

Farmer app / Upload harvest evidence

Farmer app / Upload harvest evidence

Farmer app / Produce history and verification

Farmer app / Produce history and verification

Marketplace / Discover fresh produce

Marketplace / Discover fresh produce

Marketplace / Browse verified products

Marketplace / Browse verified products

Marketplace / Blockchain-secured checkout

Marketplace / Blockchain-secured checkout

Marketplace / Track farm-to-door delivery

Marketplace / Track farm-to-door delivery

Marketplace / Buyer profile and saved farms

Marketplace / Buyer profile and saved farms