Skip to content

fluturecode/edge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

68 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


Edge

The Trust Primitive for Autonomous Agents

EdgePass gives agents your rules, not your keys.


Built on Sui Walrus Storage npm version npm downloads Tests License Sui Overflow


Live Demo โ†’ ย ยทย  npm โ†’ ย ยทย  Contract โ†’ ย ยทย  Docs โ†’



The best infrastructure is invisible.



The Problem

Every developer building an autonomous agent hits the same wall:

Option Approach Problem
A Give the agent full wallet access Catastrophic risk โ€” unlimited exposure
B Human approves every transaction Defeats the purpose of automation
C Build custom policy logic per app 6โ€“8 weeks of infrastructure before any business logic

There is no Option D. No standard primitive for saying:

"This agent can spend up to $300, at these merchants, auto-approve under $50, ask me before anything over $100, and shut down in 48 hours โ€” without ever touching my keys."

Edge is Option D.


What Edge Does

Edge is programmable trust infrastructure. Users define boundaries once. Agents execute freely within them. Unsafe actions escalate automatically.

The atomic unit is the EdgePass โ€” a Sui Move object encoding a complete trust policy:

budget: $300  ยท  auto-approve: < $50  ยท  escalate: > $100  ยท  merchants: [...]  ยท  expiry: 48h

Without Edge, every developer builds the same infrastructure from scratch:

โŒ Policy engine        who can the agent pay? how much?
โŒ Escalation system    when does the human get notified?
โŒ Audit trail          what did the agent do? prove it.
โŒ Budget tracker       how much is left?
โŒ Expiry system        when does authority end?
โŒ Revocation           how do I stop it immediately?
โŒ On-chain state       where does the policy live?

With Edge:

pnpm add @edge-protocol/sdk
const pass = await sdk.create(EdgePass.fromTemplate('festival', { owner }), signer);
const outcome = await sdk.execute(pass, { merchant, amount }, signer);
// โœ… policy enforced  ยท  ๐Ÿ—‚ audit logged  ยท  โœ“ done

10 lines of code. 8 weeks of infrastructure. Gone.


๐Ÿค– Live AI Agent Demo

The real proof: Claude autonomously manages festival purchases within an EdgePass.

๐Ÿง  Claude:        "Shuttle from parking โ€” $18.50 at Shuttle Express"
โš™๏ธ  PolicyEngine:  โœ… auto-approved ยท under $50 threshold ยท trusted merchant
โ›“  Sui:           execute_transaction ยท Success ยท checkpoint #348722271

๐Ÿง  Claude:        "Drinks for the group โ€” $32 at Hydra Bar"
โš™๏ธ  PolicyEngine:  โœ… auto-approved ยท within policy limits
โ›“  Sui:           execute_transaction ยท Success

๐Ÿง  Claude:        "VIP artist meet & greet โ€” $149"
โš™๏ธ  PolicyEngine:  โš ๏ธ  escalated ยท exceeds $100 threshold
๐Ÿ‘ค User:          approves via modal (Face ID in production)
โ›“  Sui:           execute_transaction ยท Success

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
3 transactions executed autonomously
$54.50 spent ยท $245.50 remaining
0 wallet popups ยท every action verified on Suiscan
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Every decision cryptographically verified on-chain. Every receipt immutably stored on Walrus.


๐Ÿ“ฆ SDK Quickstart

npm install @edge-protocol/sdk
# or
pnpm add @edge-protocol/sdk
# or
yarn add @edge-protocol/sdk

Create a trust boundary

import { EdgePass, MIST_PER_SUI } from '@edge-protocol/sdk';

const sdk = new EdgePass({ network: 'mainnet', enokiApiKey: 'YOUR_KEY' });

// From a template โ€” sensible defaults for common use cases
const pass = await sdk.create(
  EdgePass.fromTemplate('festival', {
    approvedMerchants: ['Shuttle Express', 'Hydra Bar', 'Stage Access VIP'],
    owner: userAddress,
  }),
  signer
);

// Or from scratch โ€” full control
const pass = await sdk.create({
  budget:            300n * MIST_PER_SUI,
  autoThreshold:      50n * MIST_PER_SUI,
  escalateThreshold: 100n * MIST_PER_SUI,
  approvedMerchants: ['Shuttle Express', 'Hydra Bar'],
  expiryMs:          48 * 60 * 60 * 1000,
  owner:             userAddress,
}, signer);

Execute autonomously

const outcome = await sdk.execute(pass, {
  merchant: 'Shuttle Express',
  amount:   18_500_000_000n, // 18.5 SUI in MIST
}, signer);

switch (outcome.status) {
  case 'approved':
    console.log('executed:', outcome.digest);
    // audit log written to Walrus automatically
    break;
  case 'escalated':
    await notifyUser(outcome.reason);
    break;
  case 'blocked':
    console.log('policy rejected:', outcome.reason);
    break;
}

Preview before executing

// Zero network calls โ€” pure TypeScript, sub-millisecond
const preview = sdk.validate(pass, { merchant, amount });
// { allowed: boolean, requiresEscalation: boolean, reason: string }

Revoke instantly

await sdk.revoke(pass, signer);
// all future execute() calls return 'blocked'

๐Ÿ“‹ Templates

Pre-configured trust boundaries for the most common use cases:

Template Budget Auto โ‰ค Escalate โ‰ฅ Max/tx Expiry
festival 300 SUI 50 SUI 100 SUI 200 SUI 48h
gaming 50 SUI 2 SUI 10 SUI 10 SUI 4h
subscription 200 SUI 20 SUI 50 SUI 50 SUI 30d
defi 10,000 SUI 500 SUI 1,000 SUI 2,000 SUI 7d
enterprise 50,000 SUI 1,000 SUI 5,000 SUI 10,000 SUI 30d

Every template is a starting point โ€” override any field:

const pass = await sdk.create(
  EdgePass.fromTemplate('defi', {
    budget: 25_000n * MIST_PER_SUI,
    approvedMerchants: ['DeepBook', 'Cetus', 'Turbos'],
    owner: userAddress,
  }),
  signer
);

โš™๏ธ How It Works

User creates EdgePass (once)
         โ”‚
         โ–ผ
Agent calls sdk.execute() โ€” many times, autonomously
         โ”‚
         โ”œโ”€โ–ถ ๐Ÿ” PolicyEngine.validate()
         โ”‚         Pure TypeScript ยท no network ยท <1ms
         โ”‚         โ”œโ”€ active? expired? merchant in allowlist?
         โ”‚         โ”œโ”€ amount within budget? below maxPerTx?
         โ”‚         โ”œโ”€ amount > escalateThreshold? โ†’ โš ๏ธ  escalate
         โ”‚         โ””โ”€ amount โ‰ค autoThreshold?     โ†’ โœ… auto-approve
         โ”‚
         โ”œโ”€โ–ถ โšก ExecutionEngine โ€” PTB (atomic)
         โ”‚         validate โ†’ execute โ†’ update spent โ†’ emit event
         โ”‚         if any step fails โ†’ everything reverts ยท no partial state
         โ”‚
         โ””โ”€โ–ถ ๐Ÿ—‚ Walrus โ€” immutable audit receipt
                   cryptographically committed ยท decentralized ยท permanent

๐Ÿ”ท Why This Is Only Possible on Sui

Five primitives. All native to Sui. None exist anywhere else.

๐Ÿ” zkLogin
   Invisible wallet from Google login. No seed phrase, no MetaMask.
   On Ethereum: weeks of account abstraction infrastructure.
   On Sui: one API call.

โ›ฝ Sponsored Transactions
   Users never pay gas. Protocol-level primitive.
   On Ethereum: deploy and maintain a Paymaster contract.
   On Sui: one API key.

๐Ÿงฑ Programmable Transaction Blocks
   Policy check + execution + state update + audit event โ€” one atomic block.
   If any step fails, everything reverts. No race conditions. No partial state.
   Native to Sui. Doesn't exist anywhere else.

๐Ÿ“ฆ Object Model
   EdgePass is a first-class owned object in the user's wallet.
   An agent executes against it without ever taking ownership.
   Trust enforced at the protocol level, not application code.
   On Ethereum: a contract mapping the developer can modify.
   On Sui: an object only the owner can touch.

๐Ÿ—‚ Walrus
   Every execution writes an immutable audit receipt to decentralized storage.
   Built by the same team as Sui. Byzantine fault-tolerant. Erasure-coded.
   Not IPFS. Not S3. Native.

You could build a worse version of Edge on Ethereum in months. On Sui it took 48 hours โ€” because every primitive was already there.


๐ŸŒ Use Cases

The same three lines work across every vertical:

Vertical Template The agent does
๐ŸŽช Consumer / Festival festival Purchases at approved vendors, escalates big spends
๐ŸŽฎ Gaming gaming In-game micro-purchases within session budget
๐Ÿ“ฆ Subscriptions subscription Recurring payments to approved services
๐Ÿ“ˆ DeFi / Trading defi Trades on approved DEXes within risk parameters
๐Ÿข Enterprise / Payroll enterprise Vendor payments with compliance audit trail
๐Ÿค– AI Agent Platforms any Any LLM making autonomous spending decisions
๐Ÿฆ Institutional enterprise Fireblocks custody + Edge policy = complete stack

โ›“ Move Contract

๐Ÿ“ Network:    Sui Testnet (Mainnet pending)
๐Ÿ“ฆ Package:    0x9f4065009494aa5acd92a5c72a6c22ce80939b2bddae3b34345459bc98d2501d
๐Ÿ”‘ Deployer:   0xe759eaf1a47566836f825b96a8d12e55b858df1be7d86b032f449638a93489c9
๐Ÿงพ Tx Digest:  64fovgDj7P5DX9mNDTEEmEwVU2cxxJhQvnZq2eos1s84

View on Sui Explorer โ†’


๐Ÿงช Testing

cd packages/sdk && pnpm test
โœ“ auto-approves transactions under threshold
โœ“ escalates transactions above threshold
โœ“ blocks merchants not in approved list
โœ“ blocks when remaining budget is exceeded
โœ“ blocks when EdgePass has expired
โœ“ blocks when EdgePass is inactive

Test Suites: 1 passed
Tests:       6 passed, 6 total โœ…

๐Ÿš€ Local Development

# Clone and install
git clone https://github.com/fluturecode/edge.git
cd edge && pnpm install

# Set environment variables
cp apps/web/.env.example apps/web/.env.local
# Add: NEXT_PUBLIC_ENOKI_API_KEY, NEXT_PUBLIC_GOOGLE_CLIENT_ID, ANTHROPIC_API_KEY

# Run the demo app
cd apps/web && pnpm dev
# โ†’ http://localhost:3000

# Run SDK tests
cd packages/sdk && pnpm test

# Build SDK
cd packages/sdk && pnpm build

๐Ÿ“ Repository Structure

edge/
โ”œโ”€โ”€ ๐Ÿ“ฑ apps/web/                     Next.js 15 demo app
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx                 Login โ€” terminal typewriter, zkLogin
โ”‚   โ”‚   โ”œโ”€โ”€ auth/callback/           zkLogin callback, Enoki address derivation
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/               Main dashboard, EdgePass card
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/create/        EdgePass creation + PTB preview + terminal log
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/activity/      Festival Mode simulation + Walrus audit
โ”‚   โ”‚   โ””โ”€โ”€ dashboard/agent/         ๐Ÿค– AI agent demo โ€” Claude + EdgePass
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ signer.ts                zkLogin signer, gas coin resolution
โ”‚   โ”‚   โ”œโ”€โ”€ zklogin.ts               ZK proof generation via Enoki
โ”‚   โ”‚   โ”œโ”€โ”€ walrus.ts                Walrus HTTP API (write/read blobs)
โ”‚   โ”‚   โ””โ”€โ”€ seal.ts                  Seal policy encryption
โ”‚   โ””โ”€โ”€ app/api/
โ”‚       โ”œโ”€โ”€ sign/route.ts            Transaction signing + Sui execution
โ”‚       โ”œโ”€โ”€ zkp/route.ts             ZK proof generation via Enoki
โ”‚       โ””โ”€โ”€ agent/route.ts           Claude API for autonomous decisions
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ฆ packages/sdk/                 @edge-protocol/sdk
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ core/
โ”‚       โ”‚   โ”œโ”€โ”€ EdgePass.ts          Main API + fromTemplate()
โ”‚       โ”‚   โ”œโ”€โ”€ PolicyEngine.ts      Validation logic (pure TS, 6/6 tests)
โ”‚       โ”‚   โ””โ”€โ”€ ExecutionEngine.ts   PTB builder + chain execution
โ”‚       โ””โ”€โ”€ utils/
โ”‚           โ”œโ”€โ”€ types.ts             All TypeScript types
โ”‚           โ””โ”€โ”€ constants.ts         Templates + Package IDs + MIST_PER_SUI
โ”‚
โ””โ”€โ”€ ๐Ÿ“œ contracts/navis/
    โ””โ”€โ”€ sources/edge_pass.move       โœ… Deployed to Sui testnet

๐Ÿ—บ Roadmap

Phase 1 โ€” Foundation โœ… shipped

  • zkLogin onboarding โ€” invisible wallet from Google
  • EdgePass creation โ€” real Move object on-chain
  • PolicyEngine โ€” 6/6 tests, pure TypeScript
  • Festival Mode simulation โ€” all 5 transaction types
  • ๐Ÿค– AI agent demo โ€” Claude making real autonomous decisions
  • ๐Ÿ—‚ Walrus audit logs โ€” live blobs on testnet
  • ๐Ÿ”’ Seal policy encryption
  • Move contract โ€” deployed to Sui testnet
  • SDK on npm โ€” @edge-protocol/sdk@0.1.2
  • CI/CD โ€” GitHub Actions contract deployment

Phase 2 โ€” Trust Layer ๐Ÿ”จ in progress

  • Agent reputation system โ€” on-chain scoring across sessions
  • Composable delegation โ€” org hierarchy trust trees
  • Multi-token support โ€” USDC, USDT, any Sui coin
  • Events โ€” on('approved'), on('escalated'), on('blocked')
  • Mainnet deployment

Phase 3 โ€” Protocol ๐Ÿ“‹ coming

  • Cross-agent coordination โ€” multi-agent quorum execution
  • Intent-based policies โ€” natural language โ†’ on-chain rules
  • Edge Protocol DAO โ€” community governance
  • Cross-chain EdgePasses

๐Ÿ’ก The Analogy

Before Stripe, every developer built their own payment processing. After Stripe, you call stripe.charge().

Edge is stripe.charge() for autonomous agent trust.


๐Ÿ“Š Why It Matters

The agentic economy is already here:

  • 140M+ autonomous agent payments completed in 9 months
  • $43M+ in agent-managed transaction volume
  • Growing exponentially as AI adoption accelerates

Every one of those agents needs a trust boundary. Today, every team builds their own. With Edge, every team ships in a day.



The best infrastructure is invisible.


Built with โ™ฅ by @fluturecode for Sui Overflow 2026 โ€” Agentic Web track.


pnpm add @edge-protocol/sdk


GitHub npm Sui

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors