Skip to content

jacob-tucker/cdr-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CDR Tutorial & Skill

Tiny TypeScript scripts that exercise Story Confidential Data Rails (CDR) on the Aeneid testnet.

Four end-to-end examples:

Script What it does
src/01-encrypt-text.ts Encrypt + decrypt a short text secret (owner-only).
src/02-encrypt-file.ts Encrypt + decrypt a file via IPFS (owner-only).
src/03-license-gated.ts Encrypt content gated by a Story license token.
src/04-encrypt-file-supabase.ts Same as 02, but the ciphertext lives in Supabase Storage.

Agent skill

This repo also ships a cdr agent skill that teaches Claude Code (and any agent compatible with the open agent skills format) how to develop against @piplabs/cdr-sdk.

Install it into your project:

npx skills add jacob-tucker/cdr-skill --skill cdr

Prerequisites

  • Node.js 22+ (the file example uses Helia which needs 22+)
  • A funded Aeneid testnet wallet

Setup

@piplabs/cdr-sdk is published on npm, so a plain install is all it takes:

cp .env.example .env
# fill in WALLET_PRIVATE_KEY (and IP_ID / LICENSE_TERMS_ID for the license demo)

pnpm install

(npm install or yarn work too — this repo just ships a pnpm lockfile.)

Run

pnpm text          # 01-encrypt-text.ts
pnpm file          # 02-encrypt-file.ts
pnpm license       # 03-license-gated.ts
pnpm file:supabase # 04-encrypt-file-supabase.ts

The Supabase example needs SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, and SUPABASE_BUCKET set in .env — create a private Storage bucket in your Supabase project first.

Each script logs every transaction hash and the decrypted output.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors