Skip to content

altergui/askhumans-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AskHumans Demo

An AI-organized voting demonstration using DAVINCI (privacy-preserving voting protocol) and Self.xyz (passport-based human verification with zero-knowledge proofs).

What This Demo Does

A single TypeScript script (src/selfxyz-demo.ts) that an AI agent can run autonomously to:

  1. Initialize a wallet on Celo Mainnet
  2. Build & deploy an OpenCitizenCensus smart contract — only real humans with valid passports from specified countries can join
  3. Bootstrap the on-chain census indexer (subgraph-style GraphQL endpoint)
  4. Create a DAVINCI voting process through the sequencer API
  5. Verify the process is live and ready to accept votes

The result: a live voting URL where verified humans can scan a QR code with the Self app, hold their passport to the phone's NFC reader, generate a ZK proof of humanity, and cast their vote.

Prerequisites

  • Node.js 18+
  • A Celo Mainnet wallet with ~2 CELO for gas
  • PRIVATE_KEY environment variable set (see .env.example)

Setup

npm install

Copy .env.example to .env and fill in your private key.

Running the Demo

npm run demo

What Happens

Step Action Output
1 Initialize wallet on Celo Address + balance
2 Load OpenCitizenCensus artifact Contract bytecode + ABI
3 Build census configuration Scope seed, countries, age requirements
4 Deploy census contract Contract address on Celo
5 Bootstrap on-chain indexer GraphQL census URI
6 Wait for indexer readiness Confirmed indexed
7 Create DAVINCI process Process ID + transaction hash
8 Wait for process indexing Ready to accept votes

Configuration

Variable Required Description
PRIVATE_KEY Yes Celo wallet private key (must have CELO)

Hardcoded in the script:

Security Model

  • 1 human = 1 vote — nullifier prevents duplicate voting
  • Zero-knowledge — passport data never leaves the phone
  • Country gating — only specified passport nationalities can join
  • Self-sovereign — user controls their own identity proof

Architecture

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  AI Agent   │────▶│  DavinciSDK │────▶│  Sequencer  │
│  (Node.js)  │     │  (library)  │     │   (API)     │
└─────────────┘     └─────────────┘     └──────┬──────┘
       │                                        │
       │         ┌─────────────┐               │
       └────────▶│   Self.xyz  │◀──────────────┘
                 │   ZK Proof  │
                 └─────────────┘
                        │
                 ┌──────┴──────┐
                 │  Passport   │
                 │   NFC       │
                 └─────────────┘

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors