Skip to content

About

Patent transfers take months, cost billions, and are opaque. PatentSync tokenizes them, making them instant, verifiable, and secure. All powered by the XRP Ledger.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

PatentSync

Patent transfers take months, cost billions, and are opaque. PatentSync tokenizes them, making them instant, verifiable, and secure. All powered by the XRP Ledger.

The Problem

Modern-day patent systems are broken. They:

  1. Take months to transfer - Manual data entry over thousands of patents takes time
  2. Bleed billions in opportunity costs - Crucial IP transfers from M&A take too long to innovate on
  3. Opaque - Nobody knows the behind the scenes, least of all IP holders

We fix this by:

  1. Patent tokenization - Sources files hosted on IPFS, transfers via tokens
  2. Instant transfers - Using XRPL's native escrow alternative
  3. Public record of transfers - No more opacity, transaction histories and current holders are transparent

Tech Stack

Layer Technology
Blockchain XRP Ledger (Testnet)
Backend Python 3.13, FastAPI, xrpl-py 4.4+
Frontend Next.js 16, React 19, TypeScript, Tailwind CSS 4
File Storage IPFS via Pinata
Auth Xumm SDK (QR-based signing) + backend fallback

How It Works

Architecture

Tokenization

  1. User uploads a patent PDF through the frontend (or via POST /api/patents/tokenize)
  2. The PDF is uploaded to IPFS through Pinata, returning a content-addressed CID
  3. A metadata JSON file (title, inventor, filing date, SHA-256 hash, IPFS URLs) is also pinned to IPFS
  4. An NFTokenMint transaction is submitted to the XRP Ledger with the IPFS metadata URI
  5. The resulting NFToken ID and transaction details are recorded locally and returned

Transfer (Escrow)

  1. The patent owner creates a sell offer (POST /api/offers/sell) — this commits the NFT on-ledger, acting as escrow
  2. The offer can optionally be restricted to a specific buyer wallet address
  3. The buyer accepts the offer (POST /api/offers/accept) — the NFT atomically transfers to their wallet
  4. The transfer is recorded in transfer_history.json and is verifiable on-chain
  5. Either party can cancel the offer before acceptance (DELETE /api/offers/{offer_id})

Ownership History

  1. GET /api/nfts/{nftoken_id}/history returns the full chain of custody
  2. Queries the XRP Ledger (AccountTx) for all NFTokenAcceptOffer transactions involving the NFT
  3. Merges on-chain data with the local transfer log, deduplicates by transaction hash, and sorts chronologically
  4. Returns the issuer, current owner, and every transfer event with timestamps and wallet addresses

Setup

Prerequisites

  • Python 3.13+ — python.org
  • uv — Python package manager — pip install uv or docs.astral.sh/uv
  • Node.js 18+ — nodejs.org
  • npm (comes with Node.js)
  • An XRPL Testnet wallet seed — generate one with python scripts/generate_wallet.py
  • A Pinata account with an API JWT — pinata.cloud (free tier works)
  • (Optional) A Xumm developer API key for wallet QR signing — apps.xumm.dev

Backend

cd xrpl-patent-backend

# Install dependencies
uv sync

# Create your environment file
cp .env.example .env.local

# Edit .env.local and fill in:
#   XRPL_WALLET_SEED=sYourTestnetSeedHere
#   PINATA_JWT=eyYourPinataJWTHere
#   XRPL_TESTNET_URL=https://testnet.xrpl-labs.com    (optional, this is the default)
#   XRPL_BASE_URL=http://localhost:8001                (optional, this is the default)

# Start the API server
uv run uvicorn server:app --reload --port 8001

The API will be available at http://localhost:8001. Verify with:

curl http://localhost:8001/api/health

Frontend

cd xrpl-patent-frontend

# Install dependencies
npm install

# (Optional) Create .env.local for Xumm wallet integration:
#   NEXT_PUBLIC_XUMM_API_KEY=your-key
#   NEXT_PUBLIC_XUMM_API_SECRET=your-secret

# Start the dev server
npm run dev

The frontend will be available at http://localhost:3000.

Generating a Testnet Wallet

If you don't have a wallet seed yet:

cd xrpl-patent-backend
uv run python scripts/generate_wallet.py

This creates a new wallet, funds it via the XRPL Testnet faucet, and prints the seed. Copy it into your .env.local.

API Endpoints

Method Endpoint Description
GET /api/health Health check
GET /api/wallet Current wallet address
POST /api/wallet/generate Generate & fund a new testnet wallet
GET /api/patents List all tokenized patents
GET /api/patents/{id} Single patent detail
POST /api/patents/tokenize Upload PDF → IPFS → mint NFT
GET /api/nfts/{address} List NFTs for a wallet
POST /api/offers/sell Create a sell offer (escrow)
GET /api/offers/{nftoken_id} Query active offers for an NFT
POST /api/offers/accept Accept a sell offer (transfer)
DELETE /api/offers/{offer_id} Cancel an offer
GET /api/nfts/{nftoken_id}/history NFT ownership history
GET /api/transfers List all transfer records

About

Patent transfers take months, cost billions, and are opaque. PatentSync tokenizes them, making them instant, verifiable, and secure. All powered by the XRP Ledger.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages