This is the implementation reference for the Lit-specific parts of SplitHub.
In this repo, "Lit" means Vincent.
SplitHub uses Vincent as:
- a backend-controlled Smart Wallet
- a policy-gated onchain execution layer
- the wallet that holds Aave positions
- the just-in-time top-up source for chip payments
SplitHub does not currently use:
- Vincent MCP
- Vincent App SDK / Connect
- OpenClaw
- Lit Actions
- per-user Vincent wallets
The current code path is Vincent REST only.
Actors:
Privy wallet: user-facing walletchip wallet: actual tap signer / direct payer in chip-pay flowsVincent Smart Wallet: shared execution wallet for the demo
Current rule set:
- idle Vincent balance should be deployed into Aave
- chip payments should be funded only when needed
- user tap amount is capped by
users.tap_limit_usd
Put these in packages/nextjs/.env.local:
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
NEXT_PUBLIC_PRIVY_APP_ID=...
VINCENT_API_KEY=ssk_...
VINCENT_API_BASE=https://heyvincent.ai
OPENAI_API_KEY=sk_...Notes:
VINCENT_API_KEYis server-side onlyOPENAI_API_KEYis used by the DeFi planner- there are no Lit/Vincent SDK package credentials in the current repo because the repo uses REST, not the App SDK
Core client:
Execution:
- packages/nextjs/services/vincentExecutionService.ts
- packages/nextjs/services/vincentWalletService.ts
- packages/nextjs/services/jitPaymentService.ts
- packages/nextjs/services/paymentReadinessService.ts
- packages/nextjs/services/agentPlannerService.ts
Routes:
- packages/nextjs/app/api/vincent/secret/route.ts
- packages/nextjs/app/api/vincent/wallets/route.ts
- packages/nextjs/app/api/vincent/plan/route.ts
- packages/nextjs/app/api/vincent/open-position/route.ts
- packages/nextjs/app/api/vincent/prepare-payment/route.ts
- packages/nextjs/app/api/vincent/readiness/route.ts
UI:
- packages/nextjs/app/defi/page.tsx
- packages/nextjs/app/agents-pay/page.tsx
- packages/nextjs/app/settle/page.tsx
The current client in vincent.ts uses:
GET /api/skills/evm-wallet/addressGET /api/skills/evm-wallet/balancesPOST /api/skills/evm-wallet/send-transactionPOST /api/skills/evm-wallet/transfer
Meaning:
- SplitHub resolves the Vincent smart account
- reads wallet inventory from Vincent
- encodes Aave calldata locally with
viem - asks Vincent to sign and submit the actual transaction
Page: packages/nextjs/app/defi/page.tsx
Flow:
- Read Privy balance, Vincent liquid balance, and Vincent Aave position
- Build a planner snapshot
- Ask OpenAI for a deployment plan
- Validate the plan server-side
- If funding is required, return a client-side funding step
- Execute Aave supply via Vincent
Planner:
- model:
gpt-5.4-mini - schema validated with
zod - planner file: packages/nextjs/services/agentPlannerService.ts
Important:
- OpenAI is the planner
- Vincent is the executor
- Lit is not the LLM layer here
Page: packages/nextjs/app/agents-pay/page.tsx
Current payment model:
- the user sets a
tap_limit_usd - on payment attempt, SplitHub checks the paying wallet balance
- if needed, Vincent withdraws the exact shortfall from Aave
- Vincent transfers that shortfall to the wallet that will actually pay
Current JIT route:
Current JIT service:
Tap limit storage:
users.tap_limit_usd- migration: packages/nextjs/supabase/migrations/005_add_tap_limit_to_users.sql
These are true in the current implementation:
- the hackathon build uses one shared Vincent Smart Wallet
- Vincent keys are backend-only
- the repo is not yet a per-user Vincent architecture
- direct chip payment and contract-based payment flows both still exist in the repo
- the cleanest Agents Pay direction is direct chip payment, not Privy-in-the-middle settlement
- Vincent can return
executed,denied, orpending_approval - the current implementation assumes the configured Vincent wallet can execute without human approval for the demo
- Vincent execution is non-custodial from the app’s perspective, but the
ssk_...key is still a high-value backend credential - do not expose
VINCENT_API_KEYto the browser
These are the recommended next steps after the hackathon:
- Separate Agents Pay fully from the older
SplitHubPaymentscontract flow. - Make chip-pay the canonical final sender for Agents Pay.
- Batch Vincent-side steps where possible:
- Aave withdraw
- Vincent transfer to chip
- Add gas strategy for direct chip payment:
- chip ETH buffer, or
- JIT gas top-up
- Move from one shared Vincent wallet to per-user Vincent wallets if the product matures.
- If per-user Vincent wallets become necessary, re-evaluate Vincent App SDK / Connect instead of staying on the shared REST secret model.
- Keep Lit/Vincent logic server-side
- Keep planner validation deterministic even if the planner uses an LLM
- Treat Vincent as execution infrastructure, not as the source of business truth
- Use SplitHub DB state to decide who can be paid and how much
- Prefer direct chip payment for Agents Pay
- Keep judge/demo flows simple and explicit in the UI