Private Relationship Protocol for Sui-native invisible social graph infrastructure.
GhostLink demonstrates relationship objects, hidden groups, capability-based access, ZK membership proofs, realtime activity, and a Sui Move protocol module.
apps/web: Vite, React, TypeScript, React Router, Zustand, TanStack Query, React Flow, Framer Motion, Sui dApp Kitapps/server: Bun, Hono, Drizzle ORM, SQLite, Zod, SSE, Sui TS SDK relay servicepackages/shared: shared API and domain typescontracts/ghostlink: Sui Move module for relationship, capability, hidden group, group member, and membership proof objects
bun install
bun run seed
bun run dev:server
bun run dev:webDefault URLs:
- Web:
http://localhost:5173 - API:
http://localhost:3000 - SSE:
http://localhost:3000/api/events/stream
Copy .env.example to .env for the server or set variables directly.
PORT=3000
DATABASE_URL=./data/app.db
SUI_NETWORK=testnet
SUI_PACKAGE_ID=0xcaeef4140d37e57d1e7e51fb2e49f833fed5412d89d194062709a086e096b325
SUI_RELAYER_PRIVATE_KEY=suiprivkey...
SUI_CLI_PATH=sui
PROOF_SIGNING_SECRET=change-me-for-production
DEMO_MODE=trueFrontend:
VITE_API_BASE_URL=http://localhost:3000
VITE_SUI_NETWORK=testnet- Create or accept a trusted relationship.
- Inspect relationship capabilities and private graph edges.
- Create a hidden group and invite members.
- Generate a ZK membership proof.
- Verify the proof and unlock restricted demo content.
- Review Sui object references emitted by the simulated relayer.
Hackathon submission copy, pitch scripts, judge Q&A, demo script, video shot list, and final checklist are in docs/hackathon/README.md.
DEMO_MODE=true keeps the app fully local and emits deterministic demo Sui object references.
For testnet writes:
- Publish
contracts/ghostlink. - Set
DEMO_MODE=false. - Set
SUI_PACKAGE_IDto0xcaeef4140d37e57d1e7e51fb2e49f833fed5412d89d194062709a086e096b325. - Optionally set
SUI_RELAYER_PRIVATE_KEYto a Suisuiprivkey...Ed25519 key with gas. If omitted, the API relays through the localsuiCLI.
See docs/testnet-deployment.md for the full publish checklist. In non-demo mode the API fails fast when the package id or relayer key is missing.
In testnet mode, the server calls:
ghostlink::protocol::record_relationshipghostlink::protocol::record_hidden_groupghostlink::protocol::record_membership_proof
Proofs use ghostlink-merkle-v1: each hidden group member is represented by a persisted salted commitment, the group root is a versioned Merkle root, and verification checks the Merkle path, public signals, nullifier uniqueness, expiry, and verifier attestation via PROOF_SIGNING_SECRET. The witness secret is generated and stored client-side, not derived by the server. The proof reveals only the group hash/root/nullifier and does not reveal the wallet address, member list, or relationship graph.
The API surface is SNARK-ready. circuits/membership.circom defines the replacement membership circuit with the same public signal shape.
GhostLink 是基于 Sui 的隐私关系协议,构建不可见社交图基础设施。支持隐私关系对象、隐藏群组、基于能力的访问控制、ZK 成员资格证明、实时活动流以及完整的 Move 协议模块。前端提供 React 界面,后端使用 Bun + Hono 实现关系/群组/证明的完整 CRUD 和 SSE 实时推送。
核心功能:创建信任关系 → 查看关系能力 → 建立隐藏群组 → 生成 ZK 证明 → 验证并解锁受限内容。
- 打开 Web 前端,创建或接受一个信任关系
- 查看关系能力和隐私社交图边(关系类型、强度、状态)
- 创建隐藏群组并邀请成员加入
- 生成 ZK 成员资格证明(Merkle 证明),验证后解锁受限 Demo 内容
| 组件 | 地址 |
|---|---|
| Package ID | 0xcaeef4140d37e57d1e7e51fb2e49f833fed5412d89d194062709a086e096b325 |
| Web 前端 | http://localhost:5173(本地) |
| API | http://localhost:3000(本地) |
| SSE 实时流 | http://localhost:3000/api/events/stream |
| 数据库 | SQLite (Drizzle ORM) |
该项目使用以下真实 Sui Testnet 交易进行验证:
| 交易 | Digest | 状态 |
|---|---|---|
| SUI Transfer | FrZVaDnCULPp6FW8rWJGM2MHfN7YJkxkzFoXYYMwCpSv |
✅ Success (查看) |
| SUI Transfer | 3RrvRuoe9V5TiSskBDktBhU8YatPUwGhihur5U1tvzF2 |
✅ Success (查看) |