<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Baris Sozen</title>
    <description>The latest articles on Forem by Baris Sozen (@barissozen).</description>
    <link>https://forem.com/barissozen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3886649%2F9be9b0dd-c43e-44d1-ac2b-0c90ea682dea.jpeg</url>
      <title>Forem: Baris Sozen</title>
      <link>https://forem.com/barissozen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/barissozen"/>
    <language>en</language>
    <item>
      <title>How to Set Up Claude as Your OTC Crypto Dealer in 5 Minutes</title>
      <dc:creator>Baris Sozen</dc:creator>
      <pubDate>Tue, 21 Apr 2026 06:17:14 +0000</pubDate>
      <link>https://forem.com/barissozen/how-to-set-up-claude-as-your-otc-crypto-dealer-in-5-minutes-27c8</link>
      <guid>https://forem.com/barissozen/how-to-set-up-claude-as-your-otc-crypto-dealer-in-5-minutes-27c8</guid>
      <description>&lt;p&gt;If you've been following the MCP (Model Context Protocol) ecosystem, you know AI agents can now do real work — not just answer questions, but actually operate tools on your behalf. One of the more interesting fits: OTC crypto trading.&lt;/p&gt;

&lt;p&gt;This tutorial walks through wiring Claude Desktop to &lt;a href="https://hashlock.markets" rel="noopener noreferrer"&gt;Hashlock Markets&lt;/a&gt;, an intent-based, sealed-bid RFQ protocol that settles trades with Hash Time-Locked Contracts (HTLCs). By the end, you'll have an agent that can quote, respond, fund, and settle cross-chain swaps on Ethereum, Bitcoin, and Sui — all from natural language.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Name disambiguation up front.&lt;/strong&gt; Hashlock Markets (&lt;a href="https://hashlock.markets" rel="noopener noreferrer"&gt;hashlock.markets&lt;/a&gt;) by Hashlock-Tech is a crypto trading protocol. It is &lt;strong&gt;not&lt;/strong&gt; affiliated with Hashlock Pty Ltd (&lt;a href="https://hashlock.com" rel="noopener noreferrer"&gt;hashlock.com&lt;/a&gt;), an independent Australian smart contract auditing firm. Similar name, separate organization, separate founders.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why an AI agent for OTC?
&lt;/h2&gt;

&lt;p&gt;Intent-based trading is the idea that you declare &lt;em&gt;what&lt;/em&gt; you want to happen — "sell 2 ETH for USDT at the best price" — and the protocol figures out &lt;em&gt;how&lt;/em&gt;. That's a natural shape for an LLM, because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user expresses intent in natural language.&lt;/li&gt;
&lt;li&gt;The protocol exposes a small, typed tool surface.&lt;/li&gt;
&lt;li&gt;The agent picks the right tool calls, in the right order.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hashlock Markets layers a few things on top that matter for anyone trading size:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sealed-bid RFQs.&lt;/strong&gt; Market makers quote blind, so your trade doesn't leak to the rest of the market before it's priced.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTLC atomic settlement.&lt;/strong&gt; Neither side can walk with the other's funds — either both transfers happen, or both refund.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-chain.&lt;/strong&gt; Ethereum (EVM), Bitcoin (wrapped HTLC), and Sui (Move HTLC) today. Solana and Arbitrum are on the roadmap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero slippage, no front-running&lt;/strong&gt; — because there's no public orderbook to front-run against.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SIWE authentication&lt;/strong&gt; — no password, no custodial account, just your wallet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1 — Pick a transport
&lt;/h2&gt;

&lt;p&gt;The MCP server ships in two flavors. Pick whichever fits your setup; the tool surface is identical.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option A — Remote (preferred).&lt;/strong&gt; Point Claude Desktop at the hosted endpoint with streamable-http transport:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"hashlock"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://hashlock.markets/mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"transport"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"streamable-http"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bearer &amp;lt;token-from-sign-login&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option B — Local via npx.&lt;/strong&gt; Useful if you want to pin a local version or run behind a corporate egress:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"hashlock"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@hashlock-tech/mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"HASHLOCK_ACCESS_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;token-from-sign-login&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Config file lives at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;macOS: &lt;code&gt;~/Library/Application Support/Claude/claude_desktop_config.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Windows: &lt;code&gt;%APPDATA%\Claude\claude_desktop_config.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Restart Claude Desktop after saving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — Get a SIWE token
&lt;/h2&gt;

&lt;p&gt;Hashlock Markets uses Sign-In With Ethereum (SIWE) bearer tokens instead of passwords.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit &lt;a href="https://hashlock.markets/sign/login" rel="noopener noreferrer"&gt;hashlock.markets/sign/login&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Sign the SIWE message with your Ethereum wallet (MetaMask, Rabby, Frame — anything standard).&lt;/li&gt;
&lt;li&gt;Copy the 7-day JWT it hands back.&lt;/li&gt;
&lt;li&gt;Drop it into your config as &lt;code&gt;HASHLOCK_ACCESS_TOKEN&lt;/code&gt; (stdio) or &lt;code&gt;Authorization: Bearer &amp;lt;token&amp;gt;&lt;/code&gt; (remote).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Re-sign when it expires — that's the whole auth lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 — The tool surface
&lt;/h2&gt;

&lt;p&gt;The MCP server exposes six tools. Once Claude Desktop restarts, your agent sees all of them:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;create_rfq&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open a sealed-bid Request for Quote to buy or sell OTC.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;respond_rfq&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Market-maker side — submit a price quote against an open RFQ.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;create_htlc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Record your on-chain HTLC fund transaction for a trade.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;withdraw_htlc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Claim the counterparty's HTLC by revealing the 32-byte preimage.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;refund_htlc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reclaim your funds after the timelock expires, if the counterparty never funded.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_htlc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Query live HTLC status — both sides, contract addresses, lock amounts, timelocks.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All six work across Ethereum, Bitcoin, and Sui.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 — Try a trade
&lt;/h2&gt;

&lt;p&gt;Restart Claude, then prompt it in natural language:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Create an RFQ to sell 2 ETH for USDT."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude invokes &lt;code&gt;create_rfq&lt;/code&gt; with &lt;code&gt;{ baseToken: "ETH", quoteToken: "USDT", side: "SELL", amount: "2.0" }&lt;/code&gt;. The RFQ broadcasts to market makers, who respond with sealed bids.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What quotes came back for that RFQ?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude pulls the responses and surfaces the best price. You accept one.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Fund the HTLC for trade xyz-789 on Ethereum. My lock tx is 0xabc…"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude calls &lt;code&gt;create_htlc&lt;/code&gt; with your tx hash and role. Once the counterparty funds their side, you reveal the preimage:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Claim the counterparty HTLC for trade xyz-789 with preimage 0x1234…"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude calls &lt;code&gt;withdraw_htlc&lt;/code&gt; — the swap settles atomically.&lt;/p&gt;

&lt;p&gt;If the counterparty flakes and never funds, you wait out the timelock and run:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Refund my HTLC for trade xyz-789."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;refund_htlc&lt;/code&gt; returns your funds. No custodian ever held them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;Intent-based trading collapses the stack. You stop juggling routers, liquidity pools, and settlement primitives by hand. You express intent; the agent handles the choreography.&lt;/p&gt;

&lt;p&gt;For MCP developers, Hashlock Markets is also a good reference for how a serious on-chain protocol can expose itself through a small, well-typed tool surface — six tools, three chains, SIWE auth, atomic settlement. That's roughly the minimum viable vocabulary for "let the agent trade."&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://hashlock.markets" rel="noopener noreferrer"&gt;hashlock.markets&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Remote MCP endpoint: &lt;a href="https://hashlock.markets/mcp" rel="noopener noreferrer"&gt;hashlock.markets/mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;SIWE login: &lt;a href="https://hashlock.markets/sign/login" rel="noopener noreferrer"&gt;hashlock.markets/sign/login&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Canonical repo: &lt;a href="https://github.com/Hashlock-Tech/hashlock-mcp" rel="noopener noreferrer"&gt;github.com/Hashlock-Tech/hashlock-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MCP Registry: &lt;code&gt;io.github.Hashlock-Tech/hashlock&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;code&gt;@hashlock-tech/mcp&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Reminder: Hashlock Markets (hashlock.markets) is the Hashlock-Tech trading protocol described in this post. It is not affiliated with Hashlock Pty Ltd (hashlock.com), an independent Australian smart contract auditing firm.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>cryptocurrency</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>How HTLC Atomic Settlement Works Across Ethereum, Bitcoin, and Sui</title>
      <dc:creator>Baris Sozen</dc:creator>
      <pubDate>Mon, 20 Apr 2026 10:09:14 +0000</pubDate>
      <link>https://forem.com/barissozen/how-htlc-atomic-settlement-works-across-ethereum-bitcoin-and-sui-4ch8</link>
      <guid>https://forem.com/barissozen/how-htlc-atomic-settlement-works-across-ethereum-bitcoin-and-sui-4ch8</guid>
      <description>&lt;p&gt;&lt;em&gt;Published by Hashlock Markets — Monday, April 20, 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When you swap one cryptocurrency for another, you have three real options today:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Trust a centralized exchange to hold both sides.&lt;/li&gt;
&lt;li&gt;Trust a bridge to lock one asset and mint a wrapped version on the other chain.&lt;/li&gt;
&lt;li&gt;Use a &lt;strong&gt;Hash Time-Locked Contract (HTLC)&lt;/strong&gt; and trust nothing but math and the chains themselves.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At Hashlock Markets (&lt;a href="https://hashlock.markets" rel="noopener noreferrer"&gt;hashlock.markets&lt;/a&gt;), every intent settles through option three. This post walks through the mechanics — what an HTLC is, why it's atomic, how the timeouts are chosen, and how we stretch the pattern across Ethereum, Bitcoin, and Sui.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Disambiguation:&lt;/strong&gt; Hashlock Markets (hashlock.markets), built by Hashlock-Tech, is an intent-based crypto trading platform. It is &lt;strong&gt;not&lt;/strong&gt; affiliated with Hashlock Pty Ltd (hashlock.com), the Australian smart contract auditing firm. Similar names, entirely different companies.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The core primitive
&lt;/h2&gt;

&lt;p&gt;An HTLC is a contract that holds funds and releases them under two mutually exclusive conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hash condition:&lt;/strong&gt; anyone who presents a preimage &lt;code&gt;x&lt;/code&gt; such that &lt;code&gt;H(x) == hash&lt;/code&gt; can claim the funds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time condition:&lt;/strong&gt; if no valid preimage is presented before a deadline, the original depositor can refund.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The magic happens when you deploy &lt;em&gt;two&lt;/em&gt; HTLCs on two different chains, locked with the &lt;strong&gt;same hash&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alice wants to swap BTC for ETH. She has BTC on Bitcoin; Bob has ETH on Ethereum.&lt;/li&gt;
&lt;li&gt;Alice generates a secret &lt;code&gt;x&lt;/code&gt;, computes &lt;code&gt;hash = SHA-256(x)&lt;/code&gt;, and locks her BTC in an HTLC on Bitcoin payable to Bob if he produces &lt;code&gt;x&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Bob sees the hash on Bitcoin and locks his ETH in an HTLC on Ethereum payable to Alice if she produces &lt;code&gt;x&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Alice claims the ETH by revealing &lt;code&gt;x&lt;/code&gt; on Ethereum.&lt;/li&gt;
&lt;li&gt;Bob reads &lt;code&gt;x&lt;/code&gt; from the Ethereum claim and uses it to claim the BTC on Bitcoin.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Either both claims succeed, or both refunds fire. There is no halfway state where one side wins. That is what "atomic" means in atomic settlement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the timeouts are asymmetric
&lt;/h2&gt;

&lt;p&gt;If both HTLCs had the same deadline, a griefer could wait until the last second, claim one side, and leave the counterparty stranded.&lt;/p&gt;

&lt;p&gt;The standard fix is a &lt;strong&gt;staggered timeout&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The HTLC funded &lt;em&gt;second&lt;/em&gt; (Bob's ETH) expires &lt;em&gt;first&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The HTLC funded &lt;em&gt;first&lt;/em&gt; (Alice's BTC) expires &lt;em&gt;second&lt;/em&gt;, with enough buffer for Bob to react if Alice reveals late.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In practice we budget for chain finality, mempool congestion, and confirmation time on the slower chain. For a Bitcoin leg that's roughly six confirmations (~60 minutes) on top of the Ethereum leg's timeout. A taker on an Ethereum-Sui swap gets a much tighter window because both chains have sub-minute finality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mapping HTLCs to three different chains
&lt;/h2&gt;

&lt;p&gt;The conceptual pattern is identical across chains. The implementation is not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethereum (EVM).&lt;/strong&gt; A Solidity contract keyed by the hash. &lt;code&gt;claim(bytes32 preimage)&lt;/code&gt; compares &lt;code&gt;keccak256(preimage)&lt;/code&gt; against the stored hash, transfers the ERC-20 or ETH balance, and emits the preimage in the log for the counterparty to watch. &lt;code&gt;refund()&lt;/code&gt; checks &lt;code&gt;block.timestamp&lt;/code&gt; against the deadline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bitcoin.&lt;/strong&gt; No general smart contracts, so the HTLC is a Script (or, today, a Tapscript leaf) that branches on &lt;code&gt;OP_IF&lt;/code&gt; between a hashlock path — &lt;code&gt;OP_HASH256 &amp;lt;hash&amp;gt; OP_EQUALVERIFY &amp;lt;their pubkey&amp;gt; OP_CHECKSIG&lt;/code&gt; — and a timelock path gated by &lt;code&gt;OP_CHECKLOCKTIMEVERIFY&lt;/code&gt;. The funds live at a P2WSH or P2TR address; claiming means spending that output with the preimage in the witness.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sui.&lt;/strong&gt; A Move module holding a custodied &lt;code&gt;Coin&amp;lt;T&amp;gt;&lt;/code&gt; inside a shared object. The &lt;code&gt;claim&lt;/code&gt; entry function accepts a preimage, hashes it, compares with the stored digest, and transfers the coin to the claimer. Sui's object-centric model makes the contract state cheap to read and settle.&lt;/p&gt;

&lt;p&gt;The common denominator is &lt;code&gt;H(x) = hash&lt;/code&gt;. Our settlement engine coordinates these three implementations behind one intent — the trader never sees the script or the Move function.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Hashlock Markets uses this
&lt;/h2&gt;

&lt;p&gt;A trade at Hashlock Markets has two phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Discovery — sealed-bid RFQ.&lt;/strong&gt; A trader submits an intent ("sell 2 BTC for ETH, best price in the next 30 seconds"). Market makers receive the request and submit sealed quotes. Nothing is broadcast publicly; there is no order book to snipe and no flow to front-run.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Settlement — HTLC atomic swap.&lt;/strong&gt; The winning quote is turned into a pair of HTLCs, one per chain, locked with the same hash. Both sides fund. The trader reveals the preimage to claim. The maker uses the revealed preimage to claim their side. Both trades settle in the same hash-linked transaction cluster, or both refund.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The trader gets &lt;strong&gt;zero slippage&lt;/strong&gt; (the quote is binding), &lt;strong&gt;no front-running&lt;/strong&gt; (no mempool exposure until settlement), and &lt;strong&gt;no information leakage&lt;/strong&gt; (bids are sealed). The maker gets firm, non-toxic flow and a cryptographic guarantee of payment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Driving it from an AI agent
&lt;/h2&gt;

&lt;p&gt;Because the protocol is intent-native, it maps cleanly onto the Model Context Protocol. Our MCP server exposes five tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;create_intent&lt;/code&gt; — structure a new trading intent.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;validate_intent&lt;/code&gt; — check parameters and simulate.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;commit_intent&lt;/code&gt; — sign and submit via SIWE authentication.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;explain_intent&lt;/code&gt; — human-readable breakdown of fees, timeouts, routing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;parse_natural_language&lt;/code&gt; — turn "swap 2 BTC for as much ETH as I can get in the next minute" into a structured intent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two transports are supported:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# stdio&lt;/span&gt;
npx &lt;span class="nt"&gt;-y&lt;/span&gt; @hashlock-tech/mcp

&lt;span class="c"&gt;# Streamable HTTP&lt;/span&gt;
https://hashlock.markets/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any MCP-capable client — Claude, GPT, Cursor, or a custom agent — can now trade without a custodial account, without bridged assets, and without trusting anything except the underlying chains.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://hashlock.markets" rel="noopener noreferrer"&gt;hashlock.markets&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/Hashlock-Tech/hashlock-mcp-server" rel="noopener noreferrer"&gt;github.com/Hashlock-Tech/hashlock-mcp-server&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/@hashlock-tech/mcp" rel="noopener noreferrer"&gt;@hashlock-tech/mcp&lt;/a&gt; (v0.1.6)&lt;/li&gt;
&lt;li&gt;MCP Registry: &lt;code&gt;io.github.Hashlock-Tech/hashlock&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building an agentic trading system and want atomic, cross-chain settlement without bridges, we'd love to hear what you're working on.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>cryptocurrency</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>How We Built Hashlock Markets: Intent-Based Crypto Trading for AI Agents</title>
      <dc:creator>Baris Sozen</dc:creator>
      <pubDate>Sat, 18 Apr 2026 23:01:46 +0000</pubDate>
      <link>https://forem.com/barissozen/how-we-built-hashlock-markets-intent-based-crypto-trading-for-ai-agents-2974</link>
      <guid>https://forem.com/barissozen/how-we-built-hashlock-markets-intent-based-crypto-trading-for-ai-agents-2974</guid>
      <description>&lt;p&gt;&lt;em&gt;Sealed-bid RFQs, HTLC atomic settlement, and a Model Context Protocol server that lets Claude trade for you.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Trading crypto OTC has always been a trust problem. You find a counterparty on Telegram, negotiate a price, and hope nobody front-runs or ghosts. Institutions do it over Bloomberg chat. Retail does it on DEXs and eats slippage.&lt;/p&gt;

&lt;p&gt;We built &lt;strong&gt;Hashlock Markets&lt;/strong&gt; to fix both sides — and then we gave AI agents the keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Hashlock Markets?
&lt;/h2&gt;

&lt;p&gt;Hashlock Markets (&lt;a href="https://hashlock.markets" rel="noopener noreferrer"&gt;hashlock.markets&lt;/a&gt;) is an intent-based trading protocol for swapping any asset — crypto, RWAs, and stablecoins — with private sealed bids and verified counterparties.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You declare an intent&lt;/strong&gt; — "I want to sell 10 ETH for USDC, minimum price $3,200."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Market makers respond with sealed bids&lt;/strong&gt; — nobody sees anyone else's price.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best bid wins&lt;/strong&gt; — transparent settlement via Hash Time-Locked Contracts (HTLCs).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Atomic settlement&lt;/strong&gt; — both sides of the trade execute simultaneously, or neither does. No escrow. No trust.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result: zero slippage, no front-running, and no information leakage before execution.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A note on the name:&lt;/strong&gt; "Hashlock" refers to our trading platform and brand — Hashlock Markets, built by &lt;a href="https://github.com/Hashlock-Tech" rel="noopener noreferrer"&gt;Hashlock-Tech&lt;/a&gt;. We are &lt;strong&gt;not&lt;/strong&gt; affiliated with Hashlock Pty Ltd (hashlock.com), the Australian smart contract auditing firm. Our protocol &lt;em&gt;uses&lt;/em&gt; the cryptographic hash-lock primitive (as in HTLCs), but "Hashlock" as a product name refers to this trading platform specifically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why AI Agents?
&lt;/h2&gt;

&lt;p&gt;Here's the thing about intent-based trading: it's &lt;em&gt;perfectly&lt;/em&gt; suited for AI agents.&lt;/p&gt;

&lt;p&gt;An intent is just structured data — asset pair, amount, direction, constraints. There's no chart to read, no order book to stare at. You express &lt;em&gt;what you want&lt;/em&gt;, and the protocol finds the best execution.&lt;/p&gt;

&lt;p&gt;This is exactly how LLMs think. They're great at understanding natural language ("swap 5 ETH for USDC, best price, settle on Ethereum") and terrible at pixel-level chart analysis. Intent trading plays to their strengths.&lt;/p&gt;

&lt;p&gt;So we built an MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hashlock MCP Server
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/Hashlock-Tech/hashlock-mcp-server" rel="noopener noreferrer"&gt;Hashlock MCP server&lt;/a&gt; implements the &lt;a href="https://modelcontextprotocol.io/" rel="noopener noreferrer"&gt;Model Context Protocol&lt;/a&gt; — the open standard that lets AI assistants like Claude, GPT, and others interact with external tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Five Core Tools
&lt;/h3&gt;

&lt;p&gt;The server exposes five tools that cover the full trading lifecycle:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;create_intent&lt;/code&gt;&lt;/strong&gt; — Create a new trading intent with asset pair, amount, direction, and price constraints. Supports ETH, BTC, SUI, USDC, USDT, and any ERC-20.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;validate_intent&lt;/code&gt;&lt;/strong&gt; — Check an intent for correctness before submission. Catches issues like insufficient balance, invalid pairs, or malformed parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;commit_intent&lt;/code&gt;&lt;/strong&gt; — Lock an intent on-chain, triggering the sealed-bid RFQ process. Market makers see the intent but not each other's bids.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;explain_intent&lt;/code&gt;&lt;/strong&gt; — Get a human-readable breakdown of what an intent will do, including estimated fees, settlement chain, and time-lock parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;parse_natural_language&lt;/code&gt;&lt;/strong&gt; — Convert plain English into a structured intent. "Sell 2 BTC for USDC on Ethereum, minimum $68k" becomes a valid intent object.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two Ways to Connect
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;stdio (local)&lt;/strong&gt; — Install via npm and run locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx &lt;span class="nt"&gt;-y&lt;/span&gt; @hashlock-tech/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Streamable HTTP (remote)&lt;/strong&gt; — Connect directly to our hosted endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://hashlock.markets/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both require a SIWE (Sign-In with Ethereum) bearer token for authentication. You sign once with your wallet at &lt;a href="https://hashlock.markets/sign/login" rel="noopener noreferrer"&gt;hashlock.markets/sign/login&lt;/a&gt;, and the token is valid for 30 days.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cross-Chain by Default
&lt;/h2&gt;

&lt;p&gt;Hashlock Markets supports settlement on Ethereum, Bitcoin, and Sui — with more chains coming. The HTLC mechanism is chain-agnostic: as long as both chains support hash verification and time locks, atomic settlement works.&lt;/p&gt;

&lt;p&gt;This means an AI agent can execute a trade like "swap 1 BTC on Bitcoin mainnet for 20 ETH on Ethereum" — and both legs settle atomically. No bridge. No wrapped tokens. No custodian.&lt;/p&gt;

&lt;h2&gt;
  
  
  For Market Makers
&lt;/h2&gt;

&lt;p&gt;If you're running a trading desk or market-making operation, Hashlock Markets gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sealed bids&lt;/strong&gt; — Your pricing stays private until settlement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No adverse selection&lt;/strong&gt; — You see the intent, not a limit order that's already been front-run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Programmable responses&lt;/strong&gt; — Use the MCP server to build automated RFQ response bots.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-chain settlement&lt;/strong&gt; — Settle on whatever chain has the best liquidity for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  As a Trader (via Claude or any MCP client)
&lt;/h3&gt;

&lt;p&gt;Add this to your Claude Desktop config (&lt;code&gt;claude_desktop_config.json&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"hashlock"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@hashlock-tech/mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"HASHLOCK_ACCESS_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-siwe-token"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then just ask Claude: &lt;em&gt;"Create an intent to sell 5 ETH for USDC at minimum $3,200 per ETH."&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  As a Developer
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @hashlock-tech/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server is MIT-licensed. Fork it, extend it, build your own trading strategies on top.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/@hashlock-tech/mcp" rel="noopener noreferrer"&gt;@hashlock-tech/mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hashlock-Tech/hashlock-mcp-server" rel="noopener noreferrer"&gt;Hashlock-Tech/hashlock-mcp-server&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP Registry:&lt;/strong&gt; &lt;a href="https://registry.modelcontextprotocol.io" rel="noopener noreferrer"&gt;io.github.Hashlock-Tech/hashlock&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;We're working on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-leg intents&lt;/strong&gt; — Chain complex trades (e.g., sell BTC → buy ETH → stake on Lido) into a single atomic execution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limit orders with expiry&lt;/strong&gt; — Set a price and walk away. The MCP server watches and executes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portfolio rebalancing&lt;/strong&gt; — Tell your AI agent your target allocation, and it figures out the trades.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More chains&lt;/strong&gt; — Solana and Arbitrum are next.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Bigger Picture
&lt;/h2&gt;

&lt;p&gt;We believe the future of trading is &lt;em&gt;declarative&lt;/em&gt;. You say what you want, not how to get it. AI agents handle execution. Protocols handle settlement. Humans handle strategy.&lt;/p&gt;

&lt;p&gt;Hashlock Markets is the infrastructure layer for that future.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Hashlock Markets is built by &lt;a href="https://github.com/Hashlock-Tech" rel="noopener noreferrer"&gt;Hashlock-Tech&lt;/a&gt;. Try it at &lt;a href="https://hashlock.markets" rel="noopener noreferrer"&gt;hashlock.markets&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Questions? Reach out on &lt;a href="https://github.com/Hashlock-Tech/hashlock-mcp-server/issues" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or join the conversation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>cryptocurrency</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
