Skip to content

Latest commit

Β 

History

85 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lock-In Responsible

Decentralized goal accountability with AI-powered verification and IP ownership

Commit your goals to the blockchain. Get verified by AI. Own your productivity methodologies as IP.

ICP Camp Network Origin SDK License


What Is This?

Lock-In Responsible helps you achieve your goals through cryptographic commitment, AI verification, IP ownership, and economic incentives.

🌟 Featured at WAIB Summit AI x Web3 Hackathon - CAMP Network Track

The Problem

  • 88% of people fail their New Year's resolutions
  • To-do apps don't work because there's no consequence for failure
  • You can delete tasks, reset apps, and pretend failures never happened
  • Nobody owns or earns from their successful productivity methodologies

The Solution

Blockchain-immutable goals + AI verification + IP ownership = Real accountability + Creator economy

  1. Create a goal β†’ Stored on ICP blockchain (can't delete)
  2. Complete it β†’ Submit text proof
  3. Get verified β†’ AI + community consensus validates your proof
  4. Earn rewards β†’ Receive 10 tokens if approved
  5. Register as IP β†’ Your successful goal becomes sellable IP on Camp Network via Origin SDK
  6. Earn royalties β†’ Others license your methodology, you earn passive income

πŸš€ Quick Start (5 minutes)

Prerequisites

Step 1: Install DFX (if not installed)

# Install the ICP SDK
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

# Verify installation
dfx --version

Step 2: Start Local ICP Network

# Start the local replica (blockchain node)
dfx start --clean --background

# This will run on http://localhost:4943
# Keep this running in the background

Step 3: Deploy the Canister

# Deploy the smart contract to local network
dfx deploy lock_in_backend

# You'll see output like:
# Deployed canisters.
# URLs:
#   Backend canister via Candid interface:
#     lock_in_backend: http://127.0.0.1:4943/?canisterId=XXXXX

Step 4: Update Frontend Configuration

# Get your canister ID
dfx canister id lock_in_backend

# Copy the output (e.g., rrkah-fqaaa-aaaaa-aaaaq-cai)

# Update frontend/.env with your canister ID
cd frontend
echo "VITE_ICP_CANISTER_ID=$(dfx canister id lock_in_backend)" > .env
echo "VITE_ICP_NETWORK=development" >> .env
echo 'VITE_APP_NAME="Lock-In Responsible"' >> .env

Step 5: Install Frontend Dependencies

# Still in frontend/
npm install

Step 6: Run the Frontend

npm run dev

# Frontend will be available at http://localhost:5173

Step 7: Login & Test

  1. Open http://localhost:5173
  2. Click "Login with Internet Identity"
  3. A popup will open for local Internet Identity
  4. Click "Create Internet Identity"
  5. Follow the prompts (you can skip adding recovery methods for local testing)
  6. You'll be redirected back and logged in!
  7. Try creating a goal and submitting proof

πŸ“– Full Development Setup

Project Structure

lock-in-responsible/
β”œβ”€β”€ canister/           # ICP smart contract (Motoko)
β”‚   └── main.mo        # Goals, voting, consensus, tokens
β”œβ”€β”€ frontend/          # React + TypeScript web app
β”‚   β”œβ”€β”€ src/pages/    # Goals, Voting, Dashboard, History
β”‚   β”œβ”€β”€ src/lib/      # ICP integration & utilities
β”‚   └── src/store/    # State management (Zustand)
β”œβ”€β”€ validator-node/    # Optional: AI validator daemon
└── dfx.json          # ICP configuration

Running Everything

# Terminal 1: Start ICP local network
dfx start --clean

# Terminal 2: Deploy canister & run frontend
dfx deploy lock_in_backend
cd frontend && npm install && npm run dev

# Optional: Run an AI validator node
cd validator-node && npm install && npm start

Note: The validator node is optional. Users with completed goals can vote on proofs directly through the web interface!

Useful Commands

# Check if dfx is running
dfx ping

# View deployed canisters
dfx canister id lock_in_backend

# Stop the local network
dfx stop

# View canister logs
dfx canister logs lock_in_backend

# Redeploy after code changes
dfx deploy lock_in_backend

# Reset everything (CAREFUL: deletes all data)
dfx start --clean --background
dfx deploy

πŸ”§ Troubleshooting

"Login not working"

Problem: DFX not running or canister not deployed

Solution:

# 1. Check if dfx is running
dfx ping

# 2. If not, start it
dfx start --background

# 3. Deploy the canister
dfx deploy lock_in_backend

# 4. Update frontend/.env with canister ID
echo "VITE_ICP_CANISTER_ID=$(dfx canister id lock_in_backend)" > frontend/.env
echo "VITE_ICP_NETWORK=development" >> frontend/.env

# 5. Restart frontend
cd frontend && npm run dev

"Cannot connect to canister"

Problem: Wrong canister ID in .env

Solution:

# Get the correct ID
dfx canister id lock_in_backend

# Update frontend/.env manually
# VITE_ICP_CANISTER_ID=<your-canister-id>

"Internet Identity popup doesn't open"

Problem: Browser blocking popups

Solution: Allow popups for localhost:5173 in your browser settings

"Module not found" errors

Problem: Dependencies not installed

Solution:

cd frontend
rm -rf node_modules package-lock.json
npm install

🎯 How It Works

Community-Based Verification Flow

1. User creates goal
   ↓
2. Goal stored on ICP blockchain (immutable)
   ↓
3. User completes goal and submits text proof
   ↓
4. ICP canister checks for eligible voters
   β”‚
   β”œβ”€ NO VOTERS? β†’ Auto-approve (bootstrapping)
   β”‚                β”œβ”€ Award 10 tokens immediately
   β”‚                └─ Goal marked complete
   β”‚
   └─ VOTERS EXIST? β†’ Create verification request
                      ↓
5. System selects 5 random voters (users with completed goals)
   ↓
6. Voters review proof in Voting page
   ↓
7. Each voter submits: Approve πŸ‘ or Reject πŸ‘Ž
   ↓
8. Consensus: 3/5 votes needed for approval
   ↓
9. Rewards distributed:
   β”œβ”€ Correct voters: +1 reputation, split verification fee
   β”œβ”€ Wrong voters: -1 reputation
   └─ Goal creator: 10 tokens (if approved)

Key Innovation: Bootstrapping Mechanism

First-time users get auto-approved when no voters exist yet. Once users complete goals, they become eligible voters, creating an organic validator pool!

See ARCHITECTURE.md for detailed system design.


πŸ’‘ Technology Stack

Component Technology
Smart Contract Motoko (ICP)
IP Layer Camp Network Origin SDK ⭐
Frontend React 18 + TypeScript + Vite
UI Framework Tailwind CSS + shadcn/ui (Radix UI)
State Management Zustand + TanStack React Query
Routing React Router v6
AI Verification OpenAI/Anthropic/Ollama
Auth Internet Identity (Passwordless)
Storage ICP stable memory
Deployment Vercel (Frontend) + ICP Network (Backend)

πŸ†• Camp Network Integration

Origin SDK enables:

  • IP Registration: Goal templates registered as on-chain intellectual property
  • Creator Royalties: Earn tokens when others license your methodologies
  • IP Marketplace: Browse and purchase proven productivity frameworks
  • Remix & Derive: Fork successful goals and create your own variants

This makes Lock-In the first platform where productivity methodologies are ownable, tradeable IP assets.


πŸ“ Use Cases

  • Writing: "Write 1000 words today"
  • Coding: "Commit code for 30 minutes"
  • Learning: "Study for 2 hours"
  • Fitness: "Work out for 45 minutes"
  • Productivity: "Complete project milestone"

🌐 Deploying to Production

Prerequisites

Step 1: Deploy Backend to IC Mainnet

# Deploy canister to ICP mainnet
dfx deploy --network ic lock_in_backend

# Get your mainnet canister ID
dfx canister id lock_in_backend --network ic

Step 2: Deploy Frontend to Vercel

cd frontend

# Create production .env
echo "VITE_ICP_CANISTER_ID=<your-mainnet-canister-id>" > .env
echo "VITE_ICP_NETWORK=production" >> .env
echo 'VITE_APP_NAME="Lock-In Responsible"' >> .env

# Install Vercel CLI (if not installed)
npm i -g vercel

# Deploy to Vercel
vercel deploy --prod

Important: Vercel Configuration

The project includes frontend/vercel.json for proper SPA routing:

  • Fixes 404 errors on page refresh
  • Enables direct URL access to all routes
  • Already configured - no changes needed!

Post-Deployment

  1. Test Internet Identity login on production
  2. Create a test goal and verify the flow
  3. Monitor canister cycles: dfx canister status lock_in_backend --network ic

πŸ’° Economics

For Users

  • Create goal: Free (minimal ICP cycles)
  • Verification fee: 0.50 tokens per proof
  • Completion reward: 10 tokens (20x return!)
  • Become a voter: Complete 1+ goals
  • Streak bonus: Compete on global leaderboard

For Community Voters

  • No stake required: Any user with completed goals can vote
  • Earnings: Split verification fee among correct voters
  • Example: 4 correct voters β†’ 0.125 tokens each
  • Reputation system:
    • Correct vote: +1 reputation
    • Wrong vote: -1 reputation
  • Rewards: Higher reputation = more voting opportunities

Token Flow Example

User submits proof β†’ 0.50 token fee
5 voters selected β†’ Each votes
Consensus: 4 approve, 1 reject
Majority = Approved βœ…
β†’ Goal creator: +10 tokens
β†’ 4 correct voters: +0.125 tokens each
β†’ 1 wrong voter: -1 reputation

πŸ“š Documentation


🀝 Why This Works

Psychological Principles

  1. Commitment Device: Public goals you can't delete or hide
  2. Loss Aversion: Verification fees create skin in the game
  3. Immediate Rewards: 10 tokens earned instantly upon approval
  4. Social Proof: Global leaderboard & community feed
  5. Gamification: Streaks, reputation, and token rewards

Technical Innovation

  1. Community-Driven Verification: Democratic voting by peers
  2. Bootstrapping Mechanism: Auto-approval for first users solves cold-start problem
  3. Economic Incentives: Voters earn tokens for accurate verdicts
  4. Reputation System: Track record of voting accuracy on-chain
  5. Transparent: All goals, proofs, and votes stored on blockchain
  6. Scalable: More users = larger voter pool = better security
  7. No Gatekeeping: Any user who completes a goal can vote

πŸ“„ License

MIT License


πŸ™ Built With

  • Blockchain: Internet Computer Protocol (DFINITY)
  • Frontend: React 18, TypeScript, Vite, Tailwind CSS
  • UI Components: shadcn/ui (Radix UI primitives)
  • State Management: Zustand, TanStack React Query
  • Auth: Internet Identity
  • AI (Optional): OpenAI, Anthropic, Ollama
  • Deployment: Vercel + ICP Network

πŸ†• Recent Updates

βœ… Camp Network Origin SDK Integration (LATEST)

  • IP-registered goal templates - Own your productivity methodologies
  • Creator royalties - Earn tokens when others license your goals
  • IP marketplace - Buy/sell proven goal frameworks
  • Origin SDK badges - Visual indicators for IP-registered content
  • WAIB Summit Hackathon submission - CAMP Network Track

βœ… AI-Powered Verification

  • Advanced AI analysis of proof submissions
  • Combined with community voting for consensus
  • Prevents gaming and ensures legitimacy

βœ… Community-Based Voting

  • Any user with completed goals can vote on proofs
  • Democratic peer verification system
  • Reputation tracking for voting accuracy

βœ… Auto-Approval Bootstrapping

  • First-time users get auto-approved when no voters exist
  • Solves chicken-and-egg problem for new platforms
  • Automatic transition to community voting as user base grows

Stop procrastinating. Start achieving. Lock in your commitment today. 🎯

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages