Skip to content
 
 

Repository files navigation

Synth Health License

A decentralized licensing system for synthetic health data, built on Story Protocol.

License: MIT Story Protocol TypeScript

What It Does

Synthetic health data is critical for medical AI training, but there's no standardised way to license, trade, or track royalties for it. This system solves that:

  • Contributors upload synthetic health datasets, registered as IP Assets on Story Protocol
  • Researchers/Buyers browse clinical trials and purchase licenses for datasets they need
  • Royalties are tracked on-chain — contributors get paid automatically when their data is used
  • Everything is transparent — licensing terms, usage rights, and payment trails are immutable

No real patient data is ever used. All datasets are synthetic.

Architecture

┌──────────────────┐     ┌──────────────────┐     ┌──────────────────────┐
│   Next.js 14     │────▶│   Express API    │────▶│   Story Protocol     │
│   React 18       │     │   Prisma ORM     │     │   Aeneid Testnet     │
│   RainbowKit     │     │   Zod Validation │     │   (Chain ID 1315)    │
│   shadcn/ui      │     │   PostgreSQL     │     │   IPFS Storage       │
└──────────────────┘     └──────────────────┘     └──────────────────────┘
     Frontend                 Backend                  Blockchain

Key Features

Feature Description
IP Asset Registration Upload data → pin to IPFS → register as IP Asset on Story Protocol
License Management Commercial remix licenses with configurable royalty rates (default 10%)
Royalty Pipeline Full pipeline: register → license → pay royalty → claim revenue
Clinical Trials Marketplace Buyers post trials, contributors submit matching datasets
Wallet Integration MetaMask, WalletConnect, Coinbase Wallet via RainbowKit
Mock Mode Full development experience without testnet funds or wallet
Dashboard Analytics Real-time overview of assets, trials, licenses, and earnings
35 Unit Tests Validation, synthetic data guards, user utilities, IPFS operations

Tech Stack

Layer Technologies
Blockchain Story Protocol SDK v1.4.0, Aeneid testnet, SPG contracts
Frontend Next.js 14, React 18, TanStack Query, react-hook-form, Tailwind CSS
Backend Express.js, Prisma 6, Zod validation, Node.js
UI shadcn/ui, Radix primitives, sonner toasts
Storage PostgreSQL, local IPFS emulation
Wallet RainbowKit, wagmi, viem
Testing Vitest (35 unit tests)

Quick Start

# Clone
git clone https://github.com/AnasInno/synth-health-license.git
cd synth-health-license

# Install
corepack enable && pnpm install

# Configure
cp apps/api/.env.example apps/api/.env
# Set DATABASE_URL in apps/api/.env

# Database
pnpm --filter @story/api db:generate
pnpm --filter @story/api db:push

# Run (mock mode — no wallet needed)
pnpm dev

On-Chain Pipeline

The full pipeline has been tested and confirmed on the Aeneid testnet:

Register IP Asset → Mint License → Pay Royalty → Claim Revenue
  • SPG Contract: 0xaF1922E370ac3f21e5d0BB6e20335F89988a2628
  • License Terms: Commercial Remix (10% revenue share)
  • Claimer: IP Asset ID itself (holds 100% Royalty Tokens)

Project Structure

synth-health-license/
├── apps/
│   ├── api/                  # Express backend
│   │   ├── src/
│   │   │   ├── index.js      # Entry point
│   │   │   ├── routes/       # REST endpoints
│   │   │   ├── services/     # Story Protocol, IPFS
│   │   │   └── __tests__/    # 35 Vitest unit tests
│   │   └── scripts/          # SPG deployment
│   └── web/                  # Next.js frontend
│       ├── app/              # App Router pages
│       ├── components/       # UI components
│       ├── providers/        # Web3 context
│       └── hooks/            # Custom hooks
├── prisma/
│   └── schema.prisma         # Database schema
└── docker-compose.yml

Testing

pnpm --filter @story/api test

35 unit tests covering validation, synthetic data guards, user utilities, and IPFS operations.

Background

Built as part of a Computer Science dissertation exploring how blockchain-based IP licensing can solve the data provenance and compensation problem in synthetic health data markets.

The core insight: synthetic health data is increasingly valuable for training medical AI, but contributors have no standardised way to license their work, track usage, or receive fair compensation. Story Protocol's programmable IP layer provides the infrastructure to make this possible.

License

MIT


Built by Anas — CS student building at the intersection of AI and blockchain.

About

Decentralized licensing system for synthetic health data — Story Protocol, Next.js, Express, PostgreSQL

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages