HashLock OTC

by Hashlock-Tech

353 downloads
Not rated
GitHub

About

Institutional-grade OTC crypto trading with HTLC atomic settlement on Ethereum, Bitcoin, and Sui. Counterparty-risk-free for AI agents — trades settle atomically via on-chain hash time-locked contracts. Six tools cover the full trade lifecycle: create_trade (RFQ), accept_quote, c

Details

Author
Hashlock-Tech
Downloads
353
Categories
Other, Finance

- Multi-chain HTLC settlement (Ethereum, Bitcoin P2WSH, Sui Move)
- RFQ quote routing to institutional market makers
- Blind auction mode hides counterparty identity
- Cross-chain atomic swaps (ETH ↔ BTC, EVM ↔ Sui)
- Anonymous compliance caps ($1k/trade, $5k/24h) with KYC tier upgrades
- Six tools covering the full trade lifecycle

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name HashLock OTC
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure the MCP client with npx command and a HASHLOCK_ACCESS_TOKEN environment variable. Alternatively, use the remote HTTP endpoint (https://mcp.hashlock.markets/mcp) with Authorization: Bearer <token>. Get a token by signing in with an Ethereum wallet at https://hashlock.markets/mcp/auth. Six tools are available: create_trade, accept_quote, confirm_my_lock, confirm_my_claim, refund_my_lock, and get_trade_status.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "hashlock otc": {
            "hashlock": {
                "command": "npx",
                "args": [
                    "-y",
                    "@hashlock-tech/mcp"
                ],
                "env": {
                    "HASHLOCK_ACCESS_TOKEN": "<7-day SIWE bearer token from https://hashlock.markets/sign/login>"
                }
            }
        }
    }
}

McpServers

{
    "hashlock": {
        "command": "npx",
        "args": [
            "-y",
            "@hashlock-tech/mcp"
        ],
        "env": {
            "HASHLOCK_ACCESS_TOKEN": "<7-day SIWE bearer token from https://hashlock.markets/sign/login>"
        }
    }
}

Hashlock Markets— the settlement layer for the agent economy, as MCP tools. Non-custodial cross-chain OTC: sealed RFQ + price negotiation +HTLC atomic settlement— both legs settle or both refund; no bridge, no custodian, no counterparty risk. BTC ↔ EVM / TRON.

⚠️Testnets only for now(Ethereum Sepolia · TRON Nile · Bitcoin signet). Mainnet comes after the security-hardening gate — do not send real funds.

The canonicalModel Context Protocolserver forHashlock Markets. It gives AI agents (Claude, Cursor, Windsurf, any MCP client) the full OTC trading loop:
- Browsethe asset registry and the public RFQ board
- Posta public RFQ or a private fixed-price order (shareable link)
- Respondto requests with a price;negotiate(counter / accept / decline) in the deal thread
- Agree— both parties accept → an HTLC swap is created
- Track settlement— who funded, timelocks, tx hashes — and manage receive/refund addresses

Settlementsigning(funding and claiming the HTLCs) stays with your own wallet — the server never holds keys or funds. The swapsecret is generated locallyon your machine and only itssha256hashlock is sent; retrieve it withget_deal_secretwhen it's time to claim.

- Local (stdio)— the npm package below. You run it on your machine withyour own keys; it can settleautonomously(SIWE login + on-chain signing withHASHLOCK_*_KEY). Full trust in yourself.
- Remote (hosted, Streamable HTTP)— a public URL (https://dev.hashlock.markets/mcp) anyone can add from Claude / ChatGPT / any MCP client; one-click OAuth, no install. Multi-tenant, so it is strictlynon-custodial: settlement returnsunsignedtransactions you sign with your own wallet, and the server never holds keys or your swap preimage. See
Remote (hosted)below.

Local stdio vianpx(Claude Desktop / Cursor / WindsurfmcpServersconfig):

{ "mcpServers": { "hashlock": { "command": "npx", "args": ["-y", "@hashlock-tech/mcp"], "env": { "HASHLOCK_EVM_KEY": "0x<agent EVM key (TESTNET!)>", "HASHLOCK_TRON_KEY": "<agent TRON key, 64-hex (optional)>", "HASHLOCK_BTC_KEY": "<agent BTC WIF, signet (optional)>" } } } }

The agent owns its key(s); the server does the login itself (nonce → sign → JWT, refreshed on expiry). The first configured key (EVM → TRON → BTC) mints the session; each key also signs settlement on its chain.

With none set, read-only tools (list_assets,list_open_rfqs,get_rfq) still work. Use dedicatedtestnetkeys.

Other env:HASHLOCK_API_URL(defaulthttps://dev.hashlock.markets/api),HASHLOCK_APP_URL(share links; default derived),HASHLOCK_EVM_RPC(default a public Sepolia RPC),HASHLOCK_TRON_HOST(default Nile),HASHLOCK_SECRETS_PATH(default~/.hashlock/mcp-secrets.json, mode 0600).

The same server also runs as aremote MCP over Streamable HTTPso anyone can connect by URL — no install. This is the multi-tenant,non-custodialsurface: browse, RFQ, negotiate, and getunsignedfund/claim/refund transactions you sign with your own wallet (there is no autonomous key-in-env signing and no server-side secret storage here — you supply your ownhashlockand keep your own preimage).

The grant then appears underDevelopersas an ordinary API key and can be revoked there at any time. Clients that do not speak OAuth can still send a key they created themselves asAuthorization: Bearer hk_….

Standard OAuth 2.1, so any compliant MCP client drives it unattended:

Codes are single-use and expire in 60 seconds; redirect URIs are allowlisted, with loopback permitted per RFC 8252. The issued token IS the API key, so a grant is revocable from the same list as every other key.

docker build -t hashlock-mcp-http . docker run -p 8080:8080 -e HASHLOCK_V1_URL=https://api-dev.hashlock.markets/v1 hashlock-mcp-http # or, from source: pnpm build && HASHLOCK_V1_URL=https://api-dev.hashlock.markets/v1 PORT=8080 pnpm start:http

Env:HASHLOCK_V1_URL(developer-API base, defaulthttps://api.hashlock.markets/v1) ·PORT(default8080). Put it behind your reverse proxy at/mcp;GET /healthis a liveness probe.

Amounts arehuman decimal strings("0.5"); prices are thetotalquote-asset amount, not per-unit. Errors return a structured envelope{ error: { code, is_retryable, recovery_hint } }agents can branch on.

With a key set for each chain a swap touches, an agent can run end to end with no human:create_rfq/respond_to_rfqnegotiate(accept) →set_settlement_address(both chains) →fund_legclaim_leg. Funding/claiming is signed locally with the agent's keys; the swap secret is generated + stored locally and only its hashlock leaves the machine. Use dedicated testnet keys.

Both parties lock funds in HTLCs bound to the samesha256(secret)hashlock — BTC as a P2WSH script, EVM/TRON as contracts. The initiator funds thelong-timelockleg first (asymmetric timelocks, so nobody gets a free option). Claiming one leg reveals the secret on-chain, which unlocks the other leg. Either both legs settle, or both refund after their timelocks. The recipient of each leg is fixed at funding time — revealing the secret cannot redirect funds.

pnpm install pnpm run build # tsup → dist/ pnpm run lint # tsc --noEmit pnpm test # vitest

On-chain automated trading strategies (DEX) for AI agents. Create limit orders, range orders, recurring buy-low-sell-high strategies, and concentrated liquidity positions across Ethereum, Sei, Celo, TAC, and COTI. Unlike traditional AMMs and liquidity pools, Carbon lets you set asymmetric price ranges - your buy and sell orders are independent, not mirrored. Backtest any strategy against historical prices before going on-chain, explore market liquidity, find discount entry points, and swap tokens against Carbon DeFi's maker liquidity. 25 tools. Returns unsigned transactions — agents never hold funds or private keys. Zero gas on fills.

Trade on prediction markets from Claude Code. Browse markets, check odds, build and execute trades on-chain.

MCP server for Uniswap — swap routing, pool data, and liquidity queries across all supported chains.

Automate token swaps on the Uniswap DEX across multiple blockchains.

Interact with the Solana blockchain using the Solana Agent Kit.

An MCP server for the Tinyman protocol on the Algorand blockchain, offering tools for swaps, liquidity provision, and pool management.

Blockchain data across 100+ chains: token prices, NFTs, transfers, simulation, traces, Solana DAS

Perform bulk BNB and BEP20 token transfers on the BNB Smart Chain (BSC).

MCP server for local transaction signing across EVM, UTXO, Tron, and XRP blockchains — no API calls required

Pool data, swap rates, and liquidity info on Curve Finance.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.