GhostShift is a Casper-native evidence-and-negotiation buying desk for agents. You open a temporary company with a capped treasury, pin a market evidence snapshot, let specialist agents source the browser, telemetry, auth, and knowledge stack under a signed mandate, and dissolve the desk with a permanent ledger trail.
- Frontend:
https://ghostshift.pages.dev - Worker API:
https://ghostshift-api-live.dpratik3005.workers.dev
- Open
https://ghostshift.pages.dev. - Click
Refresh Evidenceto mint a current market snapshot. - Click
Open Deskto pin that snapshot. - Click
Run Negotiationto generate lane-by-lane offers for browser, telemetry, auth, and knowledge vendors. - Once the desk reaches review, click
Seal on Casper. - Open the newest
Receipt raillinks and verify the Casper explorer receipts.
Reference proof:
- Contract hash:
hash-6f770642967df494b3304840279f145d6dc95511dc53dd3e96a0ff0381517989 - Contract install deploy:
https://testnet.cspr.live/deploy/162fce749a0f84b209b25192ca4cf7f984eef35bb2751e8984950bb683d31c11 - Sample live receipt 1:
https://testnet.cspr.live/deploy/69c13bda94b47bb368db4f4268e2da3ee715b8dfe30e3095822946d5f7879f75 - Sample live receipt 2:
https://testnet.cspr.live/deploy/ced39d0e0568d1d6652878b9a48cc9daf9124473d047f524676c25bda883c086
Leadopens a mission, defines the treasury plus mandate, and pins the evidence snapshot.Scoutrefreshes public vendor evidence and short-lists vendors lane-by-lane for the launch stack.Buyernegotiates down to mandate-safe trial terms, then pays for trial runs inside the signed caps.Verifieraccepts or rejects vendor outputs.Bookkeeperwrites spend receipts and the closing event to the ledger adapter.
The current demo mission is a launch-day sourcing run across browser automation, telemetry, auth, and knowledge vendors with a visible negotiation arena and source citations.
apps/server- HTTP API, mission engine, vendor market, ledger adapter, MCP serverapps/web- public evidence-and-negotiation deskpackages/shared- shared mission, vendor, spend, and receipt typescontracts/ghostshift-ledger- minimal Casper receipt contract scaffold
pnpm install
pnpm dev:server
pnpm dev:webThen open http://localhost:4173.
- Copy
apps/server/.dev.vars.exampletoapps/server/.dev.varsif you want local Worker secrets or non-default values. - Apply the local D1 schema:
pnpm cf:d1:migrate:local- Start the Worker API:
pnpm dev:worker- In a second shell, point the web app at the Worker instead of the Node server:
$env:VITE_API_BASE_URL='http://127.0.0.1:8787'
pnpm dev:webThe Worker path has been verified locally with D1-backed mission create, run, approve, and receipt writes.
Run the MCP server over stdio:
pnpm dev:mcpAvailable tools:
refresh_market_evidenceinspect_vendor_evidencelaunch_companyrun_negotiation_roundlist_candidate_vendorsbuy_trial_serviceverify_trial_deliveryclose_companysource_launch_stack
pnpm test
pnpm build
pnpm casper:build-contract
pnpm submission:checkGhostShift is explicit about ledger mode:
mockis the default and generates deterministic receipt hashes for local demo/testing.casperactivates only when RPC, signer key material, and a deployed contract hash are all present.
Set these in .env for live-mode experiments:
GHOSTSHIFT_LEDGER_MODE=casper
GHOSTSHIFT_RPC_URL=https://node.testnet.casper.network/rpc
GHOSTSHIFT_CHAIN_NAME=casper-test
GHOSTSHIFT_SECRET_KEY_PATH=contracts/ghostshift-ledger/keys/secret_key.pem
GHOSTSHIFT_LEDGER_CONTRACT_HASH=hash-...
GHOSTSHIFT_LEDGER_PAYMENT_MOTES=3000000000
Useful helpers:
pnpm casper:keygenwrites an ignored Ed25519 keypair tocontracts/ghostshift-ledger/keys/.pnpm casper:deploy-contractinstalls the Wasm contract and prints the resultingGHOSTSHIFT_LEDGER_CONTRACT_HASH=...line once the deploy lands.pnpm cf:d1:migrate:liveapplies the remote D1 schema for theliveWorker environment.pnpm deploy:worker:livepublishes theliveWorker once Wrangler auth, the private key secret, and real D1 IDs are configured.pnpm submission:checkproves the public Worker is live in Casper mode and can complete a single-lane mission with real explorer links.
- The default template is
agent-app-launch. - The desk sources four required lanes:
browser,telemetry,auth, andknowledge. - Every mission pins an
evidenceSnapshotIdso the desk can prove which market facts it used. - The sourcing run records
negotiationRoundsand per-lane negotiated offers before trial payment. - Agents can trial vendors and spend within the mandate, but final stack approval still pauses for an explicit sign-off.
GET /api/missions/:id/reportreturns a structured stack report with per-lane recommendations, blockers, spend totals, and receipts.GET /api/evidence/latest,POST /api/evidence/refresh, andGET /api/missions/:id/negotiationexpose the evidence pack and negotiation arena directly.
The contract now builds on this Windows host. The repo is pinned to the same newer Casper contract stack that compiled successfully here:
casper-contract = 5.1.1casper-types = 6.0.1nightly-2024-07-31-x86_64-pc-windows-gnu
Install the wasm target for that toolchain once:
rustup target add wasm32-unknown-unknown --toolchain nightly-2024-07-31-x86_64-pc-windows-gnuBuild it with:
pnpm casper:build-contract