Skip to main content
Glama
W3 Ledger MCP Server

W3 Ledger MCP Server

by baskcart

W3Ledger MCP Server

A self-verifying ledger for AI agents — every transaction is cryptographically signed and chain-linked.

W3Ledger (Rolledge) is an MCP (Model Context Protocol) server that gives AI agents the ability to check token balances, create and claim gift cards, create and claim sponsor cards, and process dual-signed purchases — all secured by cryptographic signatures.

Every write operation requires dual signatures (sender + receiver/distribution). The server-side Lambda functions verify all signatures and enforce chain continuity. The MCP server is a thin HTTP client — it cannot bypass security.


⚡ Quick Start

No installation required — just configure your AI client:

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "w3ledger": {
      "command": "npx",
      "args": ["-y", "w3ledger-mcp-server"]
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "w3ledger": {
      "command": "npx",
      "args": ["-y", "w3ledger-mcp-server"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "w3ledger": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "w3ledger-mcp-server"]
    }
  }
}

Prerequisites

  • Node.js 18+

  • No external database or cloud credentials required — the server connects to the W3Ledger API


Related MCP server: AgentAudit MCP

🛠️ Tools (6 total)

🟢 Read (Safe)

Tool

Description

check_balance

Check DAH, DAHYM, DAHLOR, and W3SH token balances for a public key. Includes loyalty tier (Seed → Joist) with cashback rates.

🟡 Write (Requires Dual Signatures)

Tool

Description

create_gift_card

Create a gift card by debiting the customer's DAH balance. Requires customer signature + distribution co-signature.

claim_gift_card

Claim an ISSUED gift card and credit the claimer's DAH balance.

create_sponsor_card

Create a location-based sponsor card with GPS coordinates. Requires dual signatures.

claim_sponsor_card

Claim an ISSUED sponsor card near the sponsor's location.

purchase_product

Purchase a product by debiting sender and crediting receiver (merchant). Requires sender + receiver dual signatures.

❌ Excluded (Intentionally)

Tool

Reason

fund_account

Uses server-side distribution keys. Too dangerous for MCP — could credit arbitrary accounts.


🔐 Security Model

W3Ledger implements a self-verifying chain — every transaction is cryptographically linked to the previous one:

┌──────────────────────────────────────────────────────────┐
│  AI Agent (Claude / Cursor / VS Code)                    │
│  "Purchase a VR session for 35 DAH"                      │
└──────────────────┬───────────────────────────────────────┘
                   │ MCP Protocol (stdio)
┌──────────────────▼───────────────────────────────────────┐
│  W3Ledger MCP Server (thin HTTP client)                  │
│  • Forwards tool calls to API Gateway                    │
│  • Does NOT verify signatures (server does)              │
│  • Does NOT access database directly                     │
│  • Equivalent security to curl                           │
└──────────────────┬───────────────────────────────────────┘
                   │ HTTPS
┌──────────────────▼───────────────────────────────────────┐
│  API Gateway → Lambda Functions (server-side)            │
│                                                          │
│  ✅ Validates both signatures (sender + receiver)        │
│  ✅ Verifies chain continuity (prev_balance linkage)     │
│  ✅ Verifies previous transaction's signature            │
│  ✅ Checks balance sufficiency                           │
│  ✅ Enforces timestamp window (5 min)                    │
│  ✅ Atomic DynamoDB transactWrite (all-or-nothing)       │
└──────────────────────────────────────────────────────────┘

Supported Signature Schemes

Scheme

Use Case

EVM (secp256k1)

Ethereum/MetaMask wallets (personal_sign)

Ed25519 (Curve25519)

Solana, Cardano, Stellar, NEAR, Algorand, Aptos, Cosmos, TON wallets

ML-DSA-65

Post-quantum signatures (NIST standard)

SLH-DSA

Stateless hash-based post-quantum signatures


⚙️ Configuration

Environment Variables

Variable

Required

Default

Description

ROLLEDGE_API_URL

No

W3Ledger API

Base URL for the Rolledge API Gateway

ROLLEDGE_API_KEY

No

—

Optional API key for authenticated access

MCP_LOG_LEVEL

No

info

Logging level: debug, info, warn, error

Verify Installation

List all available tools:

npx w3ledger-mcp-server --list-tools

💡 Example Conversation

You:    "Check my balance"
Claude: [calls check_balance with your public key]
        "Your DAH balance is 1,250.00
         W3SH: 520 (Kindling tier — 10% cashback)
         DAHLOR: 0  |  DAHYM: 0"

You:    "Send a 100 DAH gift card to my friend for coffee"
Claude: [calls create_gift_card — requires your signature]
        "Please sign this transaction with your wallet..."
        [after dual signing]
        "Gift card GC-x8k2 created! Value: 100 DAH
         Your new balance: 1,150.00 DAH"

You:    "Buy a VR session for 35 DAH"
Claude: [calls purchase_product — requires sender + receiver signatures]
        "Transaction confirmed! Order #VR-2026-001
         Spent: 35 DAH  |  New balance: 1,115.00 DAH
         🏅 Cashback: 3.50 W3SH earned (Kindling tier, 10%)"

🏆 W3SH Loyalty Tiers

Purchases automatically earn W3SH cashback based on your tier:

Tier

W3SH Required

Cashback Rate

🌱 Seed

0

0%

🌿 Twig

100

5%

🔥 Kindling

500

10%

🪵 Log

2,000

15%

🏗️ Joist

10,000

20%



📄 License

MIT — see LICENSE

Available Tools

6 tools
check_balanceA

Check the token balances (DAH, DAHYM, DAHLOR, W3SH) for a public key. Returns total balance, per-token breakdown, maturity info, merchant breakdown, and W3SH loyalty tier (Seed/Twig/Kindling/Log/Joist) with cashback rate and progress.

Inputs: player_publickey (required).

claim_gift_cardA

Claim a gift card and credit the claimer's DAH balance. Only cards with status ISSUED can be claimed.

Inputs: player_publickey (required), cardInfo (required).

claim_sponsor_cardA

Claim a sponsor card and credit the claimer's DAH balance. Only cards with status ISSUED can be claimed.

Inputs: player_publickey (required), cardInfo (required).

create_gift_cardA

Create a gift card by debiting the customer's DAH balance. Requires dual signatures (customer + distribution). The card value is escrowed until the recipient claims it.

Inputs: customer_public_key (required), customer_partyKey (required), cardInfo (required), signature (required), +2 more.

create_sponsor_cardA

Create a location-based sponsor card by debiting the sponsor's DAH balance. Requires dual signatures. The card can be claimed by users near the sponsor location.

Inputs: sponsor_public_key (required), cardInfo (required), sponsor_location (required), signature (required), +2 more.

purchase_productA

Purchase a product by debiting the sender's DAH balance and crediting the receiver (merchant). Requires dual signatures.

Inputs: sender_public_key (required), receiver_public_key (required), orderDetails (required), sender_signature (required), +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: check_balance for viewing balances, claim_gift_card and claim_sponsor_card for claiming different card types, create_gift_card and create_sponsor_card for creating different card types, and purchase_product for product transactions. The descriptions specify unique actions and contexts, making misselection unlikely.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., check_balance, claim_gift_card, create_sponsor_card) with clear, descriptive terms. There are no deviations in style or convention, making the set predictable and easy to understand.

    Tool Count5/5

    With 6 tools, the server is well-scoped for its ledger and token management domain. Each tool serves a specific, necessary function (balance checking, card creation/claiming, and product purchases), and none feel redundant or missing, fitting typical tool counts for such a purpose.

    Completeness4/5

    The tool set covers core operations for token balances, gift/sponsor card lifecycle, and product purchases, with clear CRUD-like actions (create/claim for cards, check for balances, purchase for transactions). A minor gap exists in lacking update or delete operations for cards or balances, but agents can likely work around this given the escrow and dual-signature constraints described.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers