<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>HeimLabs</title>
        <link>https://paragraph.com/@heimlabs</link>
        <description>undefined</description>
        <lastBuildDate>Fri, 24 Jul 2026 00:28:52 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>HeimLabs</title>
            <url>https://storage.googleapis.com/papyrus_images/7f1f46d983e8ec1b27b3c430c3d174031e2f6627b1acb6066294b61a745eda1a.jpg</url>
            <link>https://paragraph.com/@heimlabs</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Farcaster got acquired… and the timing is kinda perfect]]></title>
            <link>https://paragraph.com/@heimlabs/farcaster-got-acquired-and-the-timing-is-kinda-perfect</link>
            <guid>mPGLIsjrZqPx8ast6qzc</guid>
            <pubDate>Thu, 22 Jan 2026 17:08:28 GMT</pubDate>
            <description><![CDATA[But if you’ve been watching closely, it felt like Farcaster was heading into its next phase. Not because Farcaster wasn’t building. Not because the idea was bad. It’s just that crypto social is HARD, and Farcaster reached that point where the vision and the reality start fighting each other. And now Neynar is taking over.The crazy part is… Farcaster started super pure.Dan left Coinbase with this one strong thought: “Why does my entire online identity depend on one app’s mood?” One algorithm t...]]></description>
            <content:encoded><![CDATA[<p>But if you’ve been watching closely, it felt like Farcaster was heading into its next phase.</p><p>Not because Farcaster wasn’t building. Not because the idea was bad.</p><p>It’s just that <strong>crypto social is HARD</strong>, and Farcaster reached that point where the vision and the reality start fighting each other.</p><p>And now <strong>Neynar</strong> is taking over.</p><h2 id="h-the-crazy-part-is-farcaster-started-super-pure" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The crazy part is… Farcaster started super pure.</strong></h2><p>Dan left Coinbase with this one strong thought: “Why does my entire online identity depend on one app’s mood?”</p><p>One algorithm tweak, one random ban, one policy change… and boom, you’re done.</p><p>So the whole Farcaster pitch was basically:</p><ul><li><p>you own your identity</p></li><li><p>you own your followers</p></li><li><p>apps can change, but you don’t disappear</p></li></ul><p>And honestly, that idea still slaps.</p><p>He teams up with Varun, they build it on Ethereum (later Optimism), and it feels like: “Okay… this might actually be the future of social.”</p><h2 id="h-2022-23-farcaster-was-crazy" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>2022 - 23 Farcaster was crazy.</strong></h2><p>Not big. Not loud. But clean.</p><p>They raised $30M in seed funding with a16z, and Warpcast became the main app; the community was small but solid.</p><p>You’d open the app, and it didn’t feel like a warzone.</p><p>No constant spam. No bots screaming “gm” under every post. No engagement farming Olympics.</p><p>It was just builders, founders, nerds, and actual conversations. 2023 was more of that. Slow growth, but the vibe stayed good.</p><h2 id="h-then-2024-happened-and-thats-where-the-pressure-entered-the-chat" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Then 2024 happened… and that’s where the pressure entered the chat.</strong></h2><p>$150M Series A led by Paradigm. $1B valuation.</p><p>And once you hit that number, you’re not allowed to be “a cool niche app” anymore.</p><p>Now everyone expects you to become the next global social network overnight. Which is insane, because social networks aren’t built like that.</p><p>They’re not like DeFi protocols where you ship and liquidity comes.</p><p>Social is messy. People are messy.</p><p>But to be fair, Farcaster did drop something genuinely exciting that year: <strong>Frames. (Later called Mini Apps.) </strong>That was the moment where even haters were like: “Okay, wait… this is different.”</p><p>Because suddenly, you weren’t just posting content, you could <em>do stuff</em> inside the post.</p><p>Mint. Trade. Claim. Sign. Whatever.</p><p>It felt like the beginning of a whole new internet.</p><h2 id="h-and-then-2025-was-basically-this-is-why-we-cant-have-nice-things" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>And then 2025 was basically: “this is why we can’t have nice things.”</strong></h2><p>This is where it started going downhill.</p><p>&gt; DAUs dropped like ~40%. </p><p>&gt; Revenue dropped like ~85%.</p><p>&gt; Spam increased. Bots increased. </p><p>&gt; Frames started getting abused.</p><p>And then the social politics started:</p><p>Power badges drama. Channel name confiscations. Endless arguing.</p><p>It started feeling like Farcaster was slowly turning into the same thing it was trying to escape.</p><p>Not fully, but enough that you could feel it. And honestly… this is normal. Any open system that gets attention eventually gets farmed.</p><p>It’s like gravity.</p><h2 id="h-clanker-was-the-one-w-that-actually-mattered" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Clanker was the one “W” that actually mattered.</strong></h2><p><strong>Clanker was the moment that make it interesting. </strong>In October 2025, Farcaster acquired Clanker basically a social trading protocol that let people trade straight from the feed, in a super native way.</p><p>And it wasn’t just “cool tech.” It was <em>working</em>.</p><p>Clanker reportedly generated <strong>$50M+ in fees</strong>, which is not “nice traction” that’s real usage with real money behind it.</p><p>That move made me think: <strong>maybe Farcaster doesn’t win by becoming the next Twitter. </strong>Maybe it wins by becoming the place where onchain apps get distribution <em>through social</em>.</p><p>Because Clanker wasn’t just content. It was economic behavior happening socially and that’s where Farcaster is naturally strong.</p><h2 id="h-but-even-then-the-big-picture-didnt-change" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>But even then… the big picture didn’t change.</strong></h2><p>Growth slowed. Costs stayed high. And expectations were still insane because of the $1B narrative.</p><p>And this is the part people don’t say out loud:</p><p>Farcaster didn’t have a “product problem.” It had an <strong>expectation problem.</strong></p><p>Everyone wanted it to become Twitter.</p><p>But Farcaster was never built like Twitter.</p><p>It’s built like infrastructure.</p><h2 id="h-then-boom-january-21-2026" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Then boom: January 21, 2026.</strong></h2><p>Neynar acquires Farcaster.</p><p>Valuation isn’t publicly confirmed, but it’s rumored to be close to $1B.</p><p>Dan and Varun step back from day to day operations.</p><p>And the announcement is basically: “Nothing changes immediately. App works. Clanker works. But Neynar is taking over the contracts, repos, dev calls, everything.”</p><p>Which tells you this isn’t a shutdown. This is a handoff.</p><p>Like “you drive now.”</p><h2 id="h-and-honestly-neynar-taking-over-makes-sense" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>And honestly? Neynar taking over makes sense.</strong></h2><p>Because Neynar isn’t some random buyer.</p><p>They’ve been in the Farcaster ecosystem from day one.</p><p>They were one of the earliest clients, and their infra literally powers a huge part of the developer ecosystem already.</p><p>So it’s not like Farcaster got sold to a stranger.</p><p>It got handed to the team that was already holding the plumbing.</p><h2 id="h-my-take-farcaster-was-always-infrastructure-pretending-to-be-a-social-app" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>My take: Farcaster was always infrastructure pretending to be a social app.</strong></h2><p>This is the real thing.</p><p>Farcaster tried to be two things at the same time:</p><ol><li><p>a consumer social app (Warpcast as the destination)</p></li><li><p>a protocol (the layer apps build on)</p></li></ol><p>And the market judged it like it was #1.</p><p>But all the actual wins came from #2.</p><p>Frames. Mini apps. Clanker. Onchain actions. Developer ecosystem.</p><p>That’s infrastructure behavior.</p><p>Not “we’re competing with Instagram” behavior.</p><p>So this acquisition feels like Farcaster finally admitting: “Yeah… we’re not going to brute force mainstream social.”</p><p>“We’re going to become the base layer.”</p><h2 id="h-so-what-happens-now" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>So what happens now?</strong></h2><p>The question isn’t “can Farcaster survive?”</p><p>It’s: <strong>Can Neynar make Farcaster feel good again, without ruining what makes it open?</strong></p><p>Because if they execute properly, Farcaster becomes:</p><ul><li><p>the default social graph for crypto</p></li><li><p>the place where mini apps actually thrive</p></li><li><p>the layer where social + transactions become normal</p></li><li><p>the onchain distribution engine</p></li></ul><p>And that’s a huge win.</p><p>Not flashy like “we beat X.” But way more real.</p><h2 id="h-summary" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Summary</strong></h2><p>Farcaster didn’t die. It just stopped pretending.</p><p>Now it gets to become what it always was underneath: <strong>infrastructure with a social feed on top.</strong></p><p>Let’s see if Neynar can turn that into actual market fit.</p><h3 id="h-heimlabs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Heimlabs :</strong></h3><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATY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5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener noreferrer nofollow" class="dont-break-out graf markup--anchor markup--anchor-readOnly" href="https://x.com/heimlabs"><strong><u>Twitter</u></strong></a>, <a target="_blank" rel="noopener noreferrer nofollow" class="dont-break-out graf markup--anchor markup--anchor-readOnly" href="https://www.linkedin.com/company/heimlabs"><strong><u>LinkedIn</u></strong></a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>neynar</category>
            <category>farcaster</category>
            <category>blockchain</category>
            <category>web3</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/4fa093d1ac3420e9bb7b3ecb51cb886d5ffbc3de45bd0078c1f6374ecbe722c3.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[InfoFi is DEAD or not?]]></title>
            <link>https://paragraph.com/@heimlabs/infofi-is-dead-or-not</link>
            <guid>uf5rUl0snPWV8HeUBVsR</guid>
            <pubDate>Tue, 20 Jan 2026 16:44:17 GMT</pubDate>
            <description><![CDATA[For a while, InfoFi (Information Finance) felt like the next obvious chapter in crypto. But InfoFi isn’t dead, it’s evolving (and that’s a good thing) The idea was simple and powerful: If information moves markets, then people who generate high-quality information should be rewarded. Not just influencers with reach but researchers, analysts, builders, and early signal-spotters who consistently add real value. And honestly, that vision still makes sense. But what’s changed is this: the first w...]]></description>
            <content:encoded><![CDATA[<p>For a while, <strong>InfoFi (Information Finance)</strong> felt like the next obvious chapter in crypto.</p><p>But InfoFi isn’t dead, it’s evolving (and that’s a good thing)</p><p>The idea was simple and powerful: If information moves markets, then <strong>people who generate high-quality information should be rewarded</strong>. Not just influencers with reach but researchers, analysts, builders, and early signal-spotters who consistently add real value.</p><p>And honestly, that vision still makes sense.</p><p>But what’s changed is this: the first wave of InfoFi wasn’t the final form. A lot of it was experimental, messy, and sometimes misunderstood. So instead of saying “InfoFi is dead,” the more accurate take is:</p><p><strong>InfoFi is growing up. </strong>The hype phase is fading, and the useful parts are starting to stay.</p><p><strong>What InfoFi was trying to solve</strong></p><p>Crypto runs on information:</p><ul><li><p>Narratives move liquidity</p></li><li><p>Research influences conviction</p></li><li><p>Signals decide entries and exits</p></li><li><p>Community sentiment drives momentum</p></li><li><p>Timing matters more than most people admit</p></li></ul><p>Yet most of the value created by information has traditionally been captured by:</p><ul><li><p>Platforms (social media)</p></li><li><p>Insiders (private groups)</p></li><li><p>Exchanges (flow)</p></li><li><p>Loud accounts (distribution)</p></li></ul><p>InfoFi aimed to rebalance that.</p><p>The goal wasn’t “financialize tweets.” It was to create a world where: <strong>Good information becomes a real economic layer.</strong></p><p><strong>Why the first wave struggled</strong></p><p>InfoFi faced a few natural challenges, not because it was a bad idea, but because the space is hard.</p><p><strong>1) Quality is difficult to measure </strong>Information isn’t like a token with a clear price. A research post can stay valuable for weeks or become outdated within hours. Sometimes it’s “right” but too early, and sometimes it’s “wrong” but sparks a useful insight.</p><p>So building a fair system that rewards <em>quality</em> (not just popularity) is genuinely complex.</p><p><strong>2) Incentives shape behavior </strong>Whenever rewards exist, people adapt. That’s not always bad, it’s just reality.</p><p>If a platform rewards:</p><ul><li><p>speed → you’ll get faster posting</p></li><li><p>engagement → you’ll get more viral</p></li><li><p>confidence → you’ll get stronger opinions</p></li></ul><p>That doesn’t mean InfoFi can’t work. It just means <strong>the incentive design matters more than the branding.</strong></p><p><strong>3) “Alpha” has a sharing problem </strong>Some information loses value the moment it becomes public. That’s not manipulation, it’s just how markets work.</p><p>So the best InfoFi systems should support <em>flexible distribution</em> from public posts to gated access so creators can share insights responsibly without assuming every edge must be broadcast instantly.</p><p>This keeps your point without making InfoFi sound like “private groups 2.0</p><p><strong>What InfoFi got right</strong></p><p>Even with the early bumps, InfoFi introduced some important shifts:</p><p><strong>Creators started thinking like operators </strong>Instead of “posting for clout,” more people began building:</p><ul><li><p>Research brands</p></li><li><p>Signal products</p></li><li><p>Gated communities</p></li><li><p>Dashboards</p></li><li><p>Onchain analytics services</p></li></ul><p><strong>Markets started valuing signal density </strong>People are tired of noise. The demand for “less talk, more signal” is real, and InfoFi helped push that forward.</p><p><strong>Crypto began experimenting with reputation as an asset </strong>Not perfect yet, but important. Over time, credibility will become measurable through:</p><ul><li><p>Historical accuracy</p></li><li><p>Transparent track records</p></li><li><p>Onchain activity</p></li><li><p>Verifiable credentials</p></li></ul><p>That’s a big step for the space.</p><p><strong>What InfoFi is becoming (the next phase)</strong></p><p>Instead of “InfoFi is dead,” it’s better to say: <strong>InfoFi is moving from hype → infrastructure.</strong></p><p>Here’s what the next version looks like:</p><p><strong>1) Proof-based information </strong>The future isn’t “trust me.” It’s “verify this.”</p><p>Info tied to:</p><ul><li><p>Onchain data</p></li><li><p>Reproducible analysis</p></li><li><p>Backtesting</p></li><li><p>Open methodology</p></li></ul><p>wins long term.</p><p><strong>2) Public-first, with premium layers</strong></p><p>Not everything needs to be fully public <em>immediately</em> but InfoFi wins when the public layer gets smarter.</p><p>The strongest systems will combine:</p><ul><li><p>open research that improves public signal quality</p></li><li><p>optional premium access for deeper or time-sensitive insights</p></li><li><p>credibility that compounds through transparency over time</p></li></ul><p>The goal isn’t to hide information. It’s to reward real work while keeping public markets healthier.</p><p><strong>3) Outcome linked incentives </strong>Instead of rewarding posts, systems will reward results:</p><ul><li><p>prediction accuracy over time</p></li><li><p>performance of a strategy</p></li><li><p>usefulness measured through outcomes</p></li><li><p>verifiable contributions</p></li></ul><p>That’s how you avoid “engagement farming.”</p><p><strong>4) AI-native signal generation </strong>Humans won’t just sell opinions. They’ll sell <strong>systems</strong>: agents that scan, filter, and execute based on rules.</p><p>So the value shifts from: “Who posted first?” to “Who built the best engine?”</p><p><strong>The real conclusion : </strong>InfoFi isn’t disappearing.</p><p>It’s just leaving the “everything is a narrative” phase and entering the “signal + verification” phase.</p><p>The first wave proved something important: <strong>People want better information markets.</strong></p><p>The next wave will make them more sustainable by improving:</p><ul><li><p>incentive design</p></li><li><p>reputation systems</p></li><li><p>distribution models</p></li><li><p>and verification primitives</p></li></ul><p>So no, InfoFi isn’t dead. <strong>It’s becoming real.</strong></p><h3 id="h-heimlabs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Heimlabs :</strong></h3><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATYMJAzwU9BnohmElgcLDzgRVipZSwWpVeb1BvyKZ3FLqGSr2v5Dn7OuK/JYfRAt/xkrwj2YYej2Vf9aKLAiyCpZX8C6DAwgd6BmjM+kZfbnzh3LoKtn5+Xo2azOOBEQfH1MpYSCJa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AABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out bi kd" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out bi kd" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>infofi</category>
            <category>blockchain</category>
            <category>web3</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/ccf21a869690c2592b4c8c9d818a9da8a046da650107416db6d941c2a7904286.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[TEE : The only place your computer can’t spy on you]]></title>
            <link>https://paragraph.com/@heimlabs/tee-the-only-place-your-computer-cant-spy-on-you</link>
            <guid>31Qbmd8LoFPNJdvXKZ3Y</guid>
            <pubDate>Mon, 19 Jan 2026 14:35:38 GMT</pubDate>
            <description><![CDATA[Your computer can see everything you do… except what runs inside a TEE. Most of us assume “secure computing” means strong passwords, encrypted disks, and locked-down cloud servers. But in reality, the biggest weakness isn’t always the app you’re using, it’s the layer underneath it. Operating systems get compromised. Admin accounts get abused. Cloud workloads get inspected. Logs get copied. Memory gets scraped. So the real question becomes: What happens when the system you’re running on can’t ...]]></description>
            <content:encoded><![CDATA[<p>Your computer can see everything you do… except what runs inside a TEE.</p><p>Most of us assume “secure computing” means strong passwords, encrypted disks, and locked-down cloud servers. But in reality, the biggest weakness isn’t always the app you’re using, it’s the layer underneath it. Operating systems get compromised. Admin accounts get abused. Cloud workloads get inspected. Logs get copied. Memory gets scraped.</p><p>So the real question becomes: <strong>What happens when the system you’re running on can’t be trusted?</strong></p><p>That’s the exact gap a <strong>Trusted Execution Environment (TEE)</strong> is designed to close.</p><h2 id="h-what-is-a-trusted-execution-environment-tee" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What is a Trusted Execution Environment (TEE)?</strong></h2><p>A <strong>Trusted Execution Environment</strong> is a secure, isolated zone inside modern CPUs from <strong>Intel, AMD, and ARM</strong> where sensitive code and data can run in a protected “bubble,” even if the rest of the machine is compromised.</p><p>Think of it as a private room inside your processor.</p><p>Even if malware gains full control of the operating system, even if someone gets root access, even if the cloud host is malicious, the TEE is built to ensure the execution inside is hidden and tamper resistant.</p><p>This is what makes TEEs different from traditional security tools.</p><p>Encryption protects data at rest (on disk) and in transit (over the network). But TEEs protect data <strong>in use</strong>, while it’s actively being processed, the moment when most attacks succeed.</p><h2 id="h-why-tees-matter-the-in-use-privacy-problem" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why TEEs matter: the “in use” privacy problem</strong></h2><p>Here’s the uncomfortable truth about normal computing:</p><p>To compute the data, the system has to <strong>decrypt it</strong>.</p><p>And once it’s decrypted in memory, anyone with enough access (or the right exploit) can potentially read it. That includes:</p><ul><li><p>Compromised OS or kernel-level malware</p></li><li><p>Malicious or careless administrators</p></li><li><p>Hypervisor attacks in shared cloud environments</p></li><li><p>Debug tools, memory dumps, and logging pipelines</p></li><li><p>Insider threats at infrastructure providers</p></li></ul><p>This is why privacy in cloud computing often depends on trust: trust the provider, trust the admins, trust the machine.</p><p>TEEs flip that model.</p><p>They make privacy <strong>enforceable by hardware</strong>, not dependent on good behavior.</p><h2 id="h-what-happens-inside-a-tee" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What happens inside a TEE?</strong></h2><p>Inside a Trusted Execution Environment:</p><p><strong>1) Data decrypts only while being used<br></strong> Your sensitive inputs are decrypted only inside the secure boundary. Outside the TEE, they remain encrypted.</p><p><strong>2) Code executes in a hardware-locked bubble<br></strong> The CPU enforces isolation so the workload can run without interference from the OS or other processes.</p><p><strong>3) Everything re-encrypts before leaving<br></strong> When results move out of the TEE, they can be encrypted again so the rest of the system only sees protected outputs.</p><p><strong>4) Even root access can’t peek inside<br></strong> This is the key point: TEEs are designed so even the highest-privilege software on the machine cannot inspect what’s happening inside the enclave.</p><p>That means a compromised operating system doesn’t automatically mean compromised secrets.</p><h2 id="h-the-real-superpower-remote-attestation" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The real superpower: Remote Attestation</strong></h2><p>One of the most important features TEEs enable is <strong>remote attestation</strong>.</p><p>Attestation allows a TEE to prove to an external party:</p><ul><li><p>What code is running inside?</p></li><li><p>that it hasn’t been altered or tampered with</p></li><li><p>that it’s executing inside a real, hardware backed secure enclave</p></li></ul><p>So instead of trusting a cloud server, you can verify it cryptographically.</p><p>This brings you closer to trust-minimized compute not perfectly trustless, but significantly stronger than traditional models.</p><h2 id="h-what-tees-unlock-in-the-real-world" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What TEEs unlock in the real world</strong></h2><p>TEEs aren’t theoretical. They’re already being used to power some of the most important privacy-first systems today.</p><h3 id="h-1-private-ai-and-confidential-inference" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>1) Private AI and confidential inference</strong></h3><p>AI is hungry for data, and that data is often sensitive: medical records, financial histories, internal business documents, private chats.</p><p>TEEs allow models to run inference on sensitive inputs while keeping the data hidden from the host machine. That means:</p><ul><li><p>Prompts are protected from host access</p></li><li><p>Companies can process confidential datasets</p></li><li><p>AI workloads can run without exposing raw inputs</p></li></ul><p>This is a major step toward <strong>privacy-preserving AI</strong> without needing to fully redesign ML infrastructure.</p><h3 id="h-2-secure-agents-and-autonomous-workflows" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>2) Secure agents and autonomous workflows</strong></h3><p>AI agents are becoming more powerful and more dangerous if compromised.</p><p>Agents handle:</p><ul><li><p>API keys</p></li><li><p>signing credentials</p></li><li><p>user permissions</p></li><li><p>private decision-making logic</p></li><li><p>transaction execution</p></li></ul><p>Running agent logic inside a TEE helps ensure the agent’s secrets and actions can’t be hijacked by a compromised environment.</p><p>This matters for onchain agents, DeFi automation, trading systems, and enterprise copilots.</p><h3 id="h-3-confidential-transactions-and-protected-signing" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>3) Confidential transactions and protected signing</strong></h3><p>Crypto security often comes down to one thing: <strong>key safety</strong>.</p><p>TEEs can isolate signing operations, so private keys never leak into the broader system. This supports:</p><ul><li><p>secure transaction signing</p></li><li><p>confidential execution for certain onchain operations</p></li><li><p>reduced risk of key exfiltration</p></li></ul><p>It’s not a replacement for hardware wallets in every case, but it’s a powerful option for scalable systems that require automation.</p><h3 id="h-4-privacy-first-cloud-computing" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>4) Privacy-first cloud computing</strong></h3><p>Most cloud computing is built on trust: trust the cloud provider, trust the region, trust the administrators.</p><p>TEEs make it possible to run workloads where even the cloud provider can’t easily inspect the contents.</p><p>That’s huge for:</p><ul><li><p>regulated industries</p></li><li><p>sensitive enterprise workloads</p></li><li><p>data collaboration across organizations</p></li><li><p>confidential analytics</p></li></ul><h2 id="h-tees-vs-just-trust-us-security" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>TEEs vs “just trust us” security</strong></h2><p>A lot of security products rely on policies, permissions, and access control. Those are useful, but they’re still enforced by software.</p><p>TEEs change the enforcement layer.</p><p>They don’t just say “admins shouldn’t access this.”<br>They say: <strong>even if they try, the hardware won’t allow it.</strong></p><p>That’s why TEEs represent a shift from trust-based security to <strong>hardware-enforced privacy</strong>.</p><h2 id="h-where-you-can-deploy-tees-today" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Where you can deploy TEEs today</strong></h2><p>TEEs are already available across major infrastructure providers and confidential compute ecosystems.</p><p>You can deploy TEE-backed workloads today using:</p><ul><li><p><strong>AWS</strong></p></li><li><p><strong>Google Cloud</strong></p></li><li><p><strong>Microsoft Azure</strong></p></li><li><p><strong>Phala Network</strong></p></li><li><p><strong>EigenCloud</strong></p></li><li><p><strong>Super Protocol</strong></p></li></ul><p>This makes it easier than ever to start building private-by-default applications without waiting for “future cryptography” to mature.</p><h2 id="h-the-bottom-line" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The bottom line</strong></h2><p>A Trusted Execution Environment is one of the most practical privacy breakthroughs in modern computing.</p><p>It creates a secure zone inside the CPU where sensitive code and data can run, protected even if the operating system is compromised, even if root access is abused, even if the infrastructure host is untrusted.</p><p>In a world where AI is everywhere, agents are executing actions autonomously, and cloud computing runs critical systems, TEEs give us something we’ve been missing for a long time: <strong>real privacy for computation enforced by hardware, not trust.</strong></p><h3 id="h-heimlabs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Heimlabs :</strong></h3><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATYMJAzwU9Bnohm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zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out bi kd" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out bi kd" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>tee</category>
            <category>blockchain</category>
            <category>web3</category>
            <category>privacy</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/152ebb9df4bcd48245a10e23cec5d21000114374157e0deb758debba59df41a9.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[A2A: When AI Agents Learn to Communicate and Transact]]></title>
            <link>https://paragraph.com/@heimlabs/a2a-when-ai-agents-learn-to-communicate-and-transact</link>
            <guid>Zp4RovKkj6BO9Zh4c3wq</guid>
            <pubDate>Thu, 15 Jan 2026 13:38:10 GMT</pubDate>
            <description><![CDATA[AI agents are getting smarter at an incredible pace. They can reason, plan, summarize, simulate, and even write code. But despite all this intelligence, most agents today still operate alone. They exist inside isolated applications, unable to easily communicate with other agents, discover external services, or exchange value on their own. This limitation isn’t about intelligence, it's about infrastructure. For AI agents to become truly autonomous, they need two things: a common way to talk to...]]></description>
            <content:encoded><![CDATA[<p>AI agents are getting smarter at an incredible pace. They can reason, plan, summarize, simulate, and even write code. But despite all this intelligence, most agents today still operate alone. They exist inside isolated applications, unable to easily communicate with other agents, discover external services, or exchange value on their own.</p><p>This limitation isn’t about intelligence, it's about infrastructure.</p><p>For AI agents to become truly autonomous, they need two things: a common way to talk to each other, and a native way to pay for services when value is exchanged. That’s where A2A and x402 come in.</p><h2 id="h-the-structural-problem-with-todays-ai-systems" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The Structural Problem with Today’s AI Systems</strong></h2><p>Most AI agents are built to serve a single application or user. Even when multiple agents exist, they are typically connected through custom integrations or centralized platforms. If one agent wants data or computation from another, developers must hardcode the interaction, manage authentication, and handle payments off-chain.</p><p>This approach doesn’t scale. It prevents agents from dynamically discovering services, negotiating access, or acting independently in real time. In practice, agents remain sophisticated tools rather than autonomous actors.</p><p>What’s missing is a shared, open standard, something equivalent to what HTTP did for the web.</p><h2 id="h-a2a-a-communication-layer-for-agents" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>A2A: A Communication Layer for Agents</strong></h2><p>A2A, or Agent-to-Agent communication, introduces that missing layer. It defines a common way for agents to discover one another, send requests, and exchange structured responses, regardless of who built them or where they run.</p><p>In an A2A world, an agent doesn’t need to know in advance which other agent provides a service. It can simply ask. One agent might request weather data, another might ask for analytics, and a third might seek specialized computation. Each interaction follows a shared protocol, making agent collaboration as natural as application-to-application communication on the internet.</p><p>But communication alone doesn’t create autonomy. If every paid interaction still requires human approval or centralized billing, agents remain dependent on external systems.</p><h2 id="h-why-autonomous-agents-need-native-payments" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why Autonomous Agents Need Native Payments</strong></h2><p>Real services have real costs. Computation, data access, and intelligence aren’t free. For agents to operate independently, they need a way to handle payments programmatically, without breaking the flow of execution.</p><p>This is where x402 Protocol becomes critical.</p><p>Instead of treating payment as an exception or failure, x402 reframes it as part of the protocol itself. When an agent requests a service that isn’t free, the responding agent doesn’t reject the request. Instead, it returns a structured “402 Payment Required” response containing everything needed to complete the transaction.</p><p>That response includes the price, the settlement method, and the on-chain details required for payment. The requesting agent can then evaluate whether the service is worth the cost, sign a transaction, and settle it autonomously. Once payment is complete, the service is delivered all without human intervention.</p><h2 id="h-a-shift-in-how-we-think-about-automation" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>A Shift in How We Think About Automation</strong></h2><p>Together, A2A and x402 represent more than technical upgrades. They introduce a new way of thinking about automation itself.</p><p>A2A x402 to allow them to communicate in an open, interoperable environment. x402 to allow them to transact and assign economic value to services. When combined, they turn agents into participants in an economy rather than passive executors of instructions.</p><p>This moves us away from rigid, preconfigured workflows and toward dynamic systems where agents can discover services, compare costs, and make decisions in real time.</p><h2 id="h-from-isolated-agents-to-machine-economies" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>From Isolated Agents to Machine Economies</strong></h2><p>Once agents can both communicate and pay, entirely new structures become possible. Networks of agents can form markets for data, computation, and intelligence. Specialized agents can monetize their capabilities directly. Demand and supply can emerge organically between machines, governed by protocols instead of platforms.</p><p>This is what a true machine-to-machine economy looks like: autonomous, programmable, and open. There’s no central coordinator deciding who can participate. Any agent that follows the standards can join, offer services, and get paid.</p><h2 id="h-why-this-matters-now" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why This Matters Now</strong></h2><p>As AI becomes more capable, the risk isn’t that agents will be too powerful, it’s that they’ll remain trapped inside centralized systems. Without open communication and native payment rails, we’ll simply recreate today’s platforms with smarter automation on top.</p><p>A2A and x402 point toward a different future. One where intelligence is composable, services are discoverable, and value flows directly between machines. Just as the internet unlocked global information exchange, these protocols lay the groundwork for autonomous economic coordination between AI systems.</p><p>When agents can finally talk and pay intelligence stops being isolated. It becomes economic. And that’s the foundation for the next era of AI.</p><h3 id="h-resources-and-links" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Resources &amp;&nbsp;Links</h3><h4 id="h-heimlabs" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Heimlabs&nbsp;:</h4><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;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y7zNp1/7yBOdF++ETy3NGDo/u6UmuWtaX63zmZer+2crMzq9Nl6VgUHsu1xQXgUUmiSvHK57d/0r7x8/rqM/GdaMfLKPkGOjCABvp+SR66ndr7V3/PjX2J6373HuPMhrsAHEwzQC8Fm0rgMcgKtZRXL/Ub0v1aKl8jypdynSQwBNjFfDaDDM9W1IZKh6KhY0uCqQ114/FNX3Tv/LNz60972n5O7ka9HTfPj6Dr3yAX026cWXffL8LBTIFFznOmcx0yrmMq4NhkXAcBtAD0ONDUjByZqFinjOjl0cfDx2PP/rCl6Upn00Tz4tOp3TeOD6KGyOXG6IVtLRe3No+5s2J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>blockchain</category>
            <category>agents</category>
            <category>web3</category>
            <category>x402</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/a20b2ef66bb6227981a803eb7967fecc377d7e939ab3e436b163a914167ec4dc.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Zero Knowledge Proofs: Proving Truth Without Revealing Data]]></title>
            <link>https://paragraph.com/@heimlabs/zero-knowledge-proofs-proving-truth-without-revealing-data</link>
            <guid>Au7hXKNuYKnL2B7M2PqW</guid>
            <pubDate>Fri, 09 Jan 2026 11:46:18 GMT</pubDate>
            <description><![CDATA[Why Verification Leaks More Than It ShouldMost digital systems verify things by asking for data. To prove your age, you reveal your date of birth. To prove your identity, you upload documents. To prove a transaction is valid, you expose balances, inputs, and execution details. This model works, but it comes with a structural flaw: verification is tightly coupled with disclosure. Data is collected even when it is not strictly necessary, stored longer than intended, and often reused or correlat...]]></description>
            <content:encoded><![CDATA[<h2 id="h-why-verification-leaks-more-than-it-should" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why Verification Leaks More Than It Should</strong></h2><p>Most digital systems verify things by asking for data.</p><p>To prove your age, you reveal your date of birth.<br> To prove your identity, you upload documents.<br> To prove a transaction is valid, you expose balances, inputs, and execution details.</p><p>This model works, but it comes with a structural flaw: <strong>verification is tightly coupled with disclosure</strong>. Data is collected even when it is not strictly necessary, stored longer than intended, and often reused or correlated in ways users never agreed to.</p><p>On public blockchains, this problem becomes even more visible. Transparency enables trustless verification, but it also makes privacy difficult to preserve as applications grow more complex.</p><p>Zero-knowledge proofs exist because this trade-off is not fundamental.</p><h2 id="h-what-is-a-zero-knowledge-proof" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What Is a Zero-Knowledge Proof?</strong></h2><p>A <strong>zero-knowledge proof (ZKP)</strong> is a cryptographic protocol that allows one party, called the prover, to convince another party, called the verifier, that a statement is true <strong>without revealing any information beyond the truth of that statement</strong>.</p><p>The verifier does not learn the data, the inputs, or the method used to reach the result. They learn only that the claim is valid.</p><p>This concept was formalized in the mid-1980s by cryptographers Shafi Goldwasser, Silvio Micali, and Charles Rackoff. For many years, it remained mostly theoretical. Advances in cryptography and computing have since made it practical for real-world systems.</p><h2 id="h-how-zero-knowledge-proofs-work" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>How Zero-Knowledge Proofs Work</strong></h2><p>At a high level, zero-knowledge proofs rely on the idea that some challenges can only be answered correctly by someone who truly knows the secret information.</p><p>If the prover is guessing, they might succeed once by chance. But as the verifier repeats randomized challenges, the probability of cheating successfully becomes vanishingly small. After enough repetitions, the verifier becomes confident that the prover has real knowledge without ever seeing the secret itself.</p><p>In real systems, this logic is implemented using cryptographic circuits. A circuit takes private inputs, applies a series of constraints, and produces an output. A zero-knowledge proof demonstrates that the prover knows inputs that satisfy all constraints, without revealing the inputs themselves.</p><h2 id="h-the-guarantees-that-define-zero-knowledge" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The Guarantees That Define Zero-Knowledge</strong></h2><p>Every zero-knowledge proof satisfies three formal properties.</p><p>If the statement is true, an honest prover can always convince an honest verifier. If the statement is false, no dishonest prover can reliably convince the verifier. And if the statement is true, the verifier learns nothing beyond that fact.</p><p>These guarantees are mathematical. They do not depend on trust, incentives, or institutional control.</p><h2 id="h-interactive-and-non-interactive-proofs" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Interactive and Non-Interactive Proofs</strong></h2><p>Early zero-knowledge protocols were interactive, requiring multiple rounds of communication between the prover and verifier. While sound, this approach does not scale well in distributed environments.</p><p>Modern systems rely on <strong>non-interactive zero-knowledge proofs</strong>, where the prover generates a single proof that can be verified by anyone. This is essential for blockchains and decentralized systems, where proofs must be reusable and independently verifiable.</p><h2 id="h-major-families-of-zero-knowledge-proof-systems" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Major Families of Zero-Knowledge Proof Systems</strong></h2><p>Different ZKP constructions optimize for different trade-offs.</p><ul><li><p><strong>zk-SNARKs</strong> produce very small proofs that are fast to verify, making them efficient for on-chain verification. Their main trade-off is the need for a trusted setup phase.</p></li><li><p><strong>zk-STARKs</strong> remove the need for a trusted setup and rely on hash-based cryptography. They offer stronger transparency and better assumptions against future quantum attacks, but produce larger proofs.</p></li><li><p><strong>PLONK-style systems</strong> introduce universal setups that can be reused across many programs, improving flexibility and developer experience.</p></li></ul><p><strong>Bulletproofs</strong> are non-interactive proofs that require no trusted setup and are commonly used for confidential transactions.</p><p>Each system represents a different balance between efficiency, transparency, and security.</p><h2 id="h-why-zero-knowledge-proofs-matter-for-blockchains" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why Zero-Knowledge Proofs Matter for Blockchains</strong></h2><p>Public blockchains are transparent by design. Every transaction, balance, and state transition is visible.</p><p>This transparency enables trustless verification, but it also introduces privacy. Execution paths become public, user behavior becomes linkable, and every node must re-execute every computation.</p><p>Zero-knowledge proofs offer a different model. Instead of publishing execution, systems publish proofs of correctness. Instead of replaying computation, verifiers check succinct cryptographic evidence. Instead of exposing data, users reveal only the facts that matter.</p><p>This is why zero-knowledge proofs are foundational to private transactions, scalable layer-2 systems, verifiable off-chain computation, and decentralized identity.</p><h2 id="h-recent-advances-in-zero-knowledge-proofs" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Recent Advances in Zero-Knowledge Proofs</strong></h2><p>Zero-knowledge proofs are no longer a niche technique. Recent progress has significantly expanded their scope.</p><p>Recursive proofs allow proofs to verify other proofs, enabling large-scale aggregation. Zero-knowledge virtual machines make it possible to run general programs inside proof systems without designing custom circuits for each application. Ongoing research focuses on reducing prover costs, improving performance, and strengthening long-term security assumptions.</p><p>What was once theoretical is now becoming core infrastructure.</p><h2 id="h-from-disclosure-to-verification" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>From Disclosure to Verification</strong></h2><p>Zero-knowledge proofs change how systems establish trust.</p><p>Instead of asking, “Can you show me the data?”<br>They ask, “Can you prove this is true?”</p><p>That shift from disclosure to verification is one of the most important ideas in modern cryptography. As digital systems continue to scale, zero-knowledge proofs offer a way to preserve correctness, trust, and privacy at the same time.</p><h2 id="h-resources-and-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources &amp; Links</strong></h2><h3 id="h-heimlabs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Heimlabs :</strong></h3><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATYMJAzwU9BnohmElgcLDzgRVipZSwWpVeb1BvyKZ3FLqGSr2v5Dn7OuK/JYfRAt/xkrwj2YYej2Vf9aKLAiyCpZX8C6DAwgd6BmjM+kZfbnzh3LoKtn5+Xo2azOOBEQfH1MpYSCJaoVWuY3TPFVh6KwNvr2+6NnoBjU2gw8nfW2omm5dcjTw2EmudOHsWWfRtFD96F0CBRQBGDx3O1pXoMqpsdJ2XqfRZFwfzaueoSwSQJQQnD1gMWyAW1SrFq6sjF7sHUajore74zZFxFGv9PtGGBl9EuxJo85pr3Vs+3bzhfLapjeD9BwCgDBev6usZfm3wVP8LRw8kTvT1HB3af3IwMXxudKIi0ADgEvLCUlGNXt0Srhg9dAbFulBf1+2hXjRxBY1/hD6+gPoPoh39aP/e2/NcA66s7SpJ/RQAB7MUbFXFax26IDMz4KZDuaaFQe/KgHupVRM0z3qizFfvczbxwY8BKyOXGjWtOfS2UGB468ZfXz+GXkqhr35EY8PfTV5ByVdRfOcf746g1cvGC+y7zNp1/7yBOdF++ETy3NGDo/u6UmuWtaX63zmZer+2crMzq9Nl6VgUHsu1xQXgUUmiSvHK57d/0r7x8/rqM/GdaMfLKPkGOjCABvp+SR66ndr7V3/PjX2J6373HuPMhrsAHEwzQC8Fm0rgMcgKtZRXL/Ub0v1aKl8jypdynSQwBNjFfDaDDM9W1IZKh6KhY0uCqQ114/FNX3Tv/LNz60972n5O7ka9HTfPj6Dr3yAX026cWXffL8LBTIFFznOmcx0yrmMq4NhkXAcBtAD0ONDUjByZqFinjOjl0cfDx2PP/rCl6Upn00Tz4tOp3TeOD6KGyOXG6IVtLRe3No+5s2J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah oy" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah oy" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>zkproofs</category>
            <category>zkps</category>
            <category>blockchain</category>
            <category>web3</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/95e4d6970cc9e2c0947a2397756c4b507df82051ce5743b1c3b66646b4063a16.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Why transparency alone isn’t enough for modern blockchains]]></title>
            <link>https://paragraph.com/@heimlabs/why-transparency-alone-isnt-enough-for-modern-blockchains-1</link>
            <guid>Jd6xRXacpoYuiXE6aYef</guid>
            <pubDate>Thu, 08 Jan 2026 17:23:39 GMT</pubDate>
            <description><![CDATA[Blockchain was built to be transparent and that strength needs a complement If you’re new to blockchain, one of the first things you’ll hear is that everything is transparent. Transactions are public. Balances are visible. Contract interactions can be inspected by anyone. This transparency is not a flaw, it’s the reason blockchains work in the first place. It makes systems auditable, reduces blind trust, and allows independent verification instead of relying on intermediaries. However, as blo...]]></description>
            <content:encoded><![CDATA[<p><strong>Blockchain was built to be transparent and that strength needs a complement</strong></p><p>If you’re new to blockchain, one of the first things you’ll hear is that everything is transparent. Transactions are public. Balances are visible. Contract interactions can be inspected by anyone.</p><p>This transparency is not a flaw, it’s the reason blockchains work in the first place. It makes systems auditable, reduces blind trust, and allows independent verification instead of relying on intermediaries.</p><p>However, as blockchains move from simple value transfers to more complex applications, transparency alone starts to show its limits. Not because transparency is wrong but because it isn’t sufficient for every kind of computation.</p><h2 id="h-what-transparent-by-design-actually-means" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What “Transparent by Design” Actually Means</strong></h2><p>On most public blockchains today, the ledger is globally shared. Every transaction, state update, and contract execution is written to a public record.</p><p>While users interact through addresses rather than names, real-world usage patterns often make those addresses linkable over time. Transaction histories can be analyzed, behaviors inferred, and relationships reconstructed even without explicit identity data.</p><p>More importantly, smart contracts don’t just store outcomes; they expose execution paths. The logic, inputs, and state transitions required to reach a result are visible because they must be validated by the network.</p><p>This is an intentional design choice and a powerful one. But it also means developers need to be deliberate about <em>what</em> logic belongs on a fully transparent execution layer.</p><h2 id="h-why-just-encrypt-it-doesnt-fully-solve-the-problem" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why “Just Encrypt It” Doesn’t Fully Solve the Problem</strong></h2><p>A common first instinct is to encrypt sensitive data before writing it to the chain. But encryption alone doesn’t solve the core issue.</p><p>Blockchains don’t just store data. They execute logic. And data used in this execution process are made public. Inputs, outputs, and state transitions often reveal more than intended, even if raw values are hidden.</p><p>What most applications need is not secrecy for secrecy’s sake. They need <strong>verifiability without disclosure</strong>. They need to prove that something happened correctly without showing everything that happened.</p><p>This is where the idea of a privacy layer becomes unavoidable.</p><h2 id="h-privacy-as-a-complement-not-a-replacement" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Privacy as a Complement, Not a Replacement</strong></h2><p>As blockchain adoption expands into areas like finance, identity, and enterprise workflows, privacy requirements become more nuanced.</p><p>In many cases:</p><ul><li><p>Regulators need auditability</p></li><li><p>Users need confidentiality</p></li><li><p>Businesses need assurances without exposing proprietary logic</p></li></ul><p>This isn’t about hiding information from everyone, it’s about <strong>selective visibility</strong>. Transparency where it’s required, privacy where it’s justified.</p><p>That’s why privacy is no longer treated as an optional add-on. It’s increasingly viewed as a complementary layer that enables broader classes of applications without compromising the core principles of blockchains.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/472a070bc480c8ae1d9cac57abba925ac95aac779c4e82348581b40e81b7fb2b.png" alt="" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAgCAIAAABywqTfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAHrUlEQVR4nD2VXUxaCRbH7+6+zdu+TWay+zK7yWQzyc7spA/tZrcP3Wm3H3FaO9pPqwV1vFbEi1U+/EIUQUABuYqKChT0IqgogiNQlIIXrtzxFm4FgSJYqVRssfZjpjPWaTZ2d+fk93BykpOc/HKSP/A892r/zduD/YOf3uz/+MPPP735+e3+wcF73u4fvHz++nnu1a/s7rzIbe/t/7g/PDjSrxhccvuAB8FYSwOvV9Zv0E3OWZxtXAENhIR8cWtTu0KmDK6EHz/aTqeevOew2YzHw+QarFBhKB5aWQVwLAjRGOfOXjj1rzO0ipqKsqrTp85983VhORUEy2h+L57b3sts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0Sp/fLYySs3brEbu46fyM87XwwxWjlN0iIqdPT4mSvXKs/n3+iBxw79Y+gqhq6SRGIFi5DEOoHHA77VFSwSDibDweQKFlkNrQfxGLYUWg0dTojlKI5FQkQiRKyv4PH/AJTv4BF/0wt6AAAAAElFTkSuQmCC" nextheight="1590" nextwidth="1059" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-how-modern-blockchains-approach-privacy" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>How Modern Blockchains Approach Privacy</strong></h2><p>Instead of trying to hide everything, modern privacy-focused systems separate two concerns.</p><p>The first is public verification. The network still needs to be able to verify that rules were followed and that state transitions are valid.</p><p>The second is private execution. The actual data and logic that led to those transitions don’t need to be exposed to everyone.</p><p>This separation is what technologies like zero-knowledge proofs enable. They allow a system to say, “this computation was done correctly,” without revealing the inputs, intermediate steps, or full history behind it.</p><p>From a developer’s point of view, you can think of this as moving sensitive logic off the public surface, while still anchoring trust and settlement on a shared chain.</p><h2 id="h-enter-miden" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Enter Miden</strong></h2><p>One concrete example of this approach is Miden.</p><p><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah oy" href="https://x.com/@0xMiden"><u>@0xMiden</u></a> is a privacy chain that executes programs on a user’s device and then posts compact cryptographic proofs onchain. Instead of exposing every state change, it proves that the correct rules were applied.</p><p>What makes Miden particularly interesting is that it doesn’t treat privacy as an afterthought. Privacy is part of how execution works, not something bolted on at the edges.</p><h2 id="h-thinking-differently-about-transactions" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Thinking Differently About Transactions</strong></h2><p>Most blockchains move assets by directly updating account balances. If Alice sends tokens to Bob, Alice’s balance goes down, and Bob’s balance goes up. That change is visible to the entire network.</p><p>Miden uses a different mental model based on notes.</p><p>A note is best thought of as a sealed envelope. Alice creates a note that contains assets and specifies who is allowed to open it. The note itself can be posted publicly, but only the intended recipient can consume it.</p><p>When Bob consumes the note, the assets move into his vault, and the note is invalidated. The important part is that Alice’s transaction and Bob’s transaction are not directly linked in a way that reveals a clear transfer graph.</p><p>This two-step process improves privacy and scalability at the same time. Transfers can happen in parallel, and observers can’t trivially reconstruct who paid whom.</p><h2 id="h-why-this-matters-for-developers" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why This Matters for Developers</strong></h2><p>If you’re coming from traditional backend development, this model should feel familiar in spirit.</p><p>When a payment API confirms that a transaction succeeded, it doesn’t expose the internal database writes, fraud checks, or reconciliation steps. It returns a verifiable outcome, not the internal machinery.</p><p>Privacy-focused rollups apply a similar principle. The chain verifies correctness, but doesn’t need to see every internal detail that led to that result.</p><p>This doesn’t make blockchain “simple” or “familiar” ; privacy preserving execution is still an evolving and complex area. But it offers a clearer mental model for building applications that respect real-world constraints.</p><h2 id="h-building-something-simple-privately" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Building Something Simple, Privately</strong></h2><p>A good way to understand this model is by building a small stateful application, like a counter.</p><p>The counter’s value updates privately, but the network can still verify that increments happened correctly. You don’t need to reveal the full history of interactions. You just prove that the rules were followed.</p><p>Once you grasp this pattern, extending it becomes natural. User-specific state, role-based access, and complex workflows all fit into the same mental model.</p><p>At that point, Privacy in Blockchain is still a strange world, it’s not battle tested yet.</p><h2 id="h-where-this-all-leads" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Where This All Leads</strong></h2><p>Privacy-preserving execution environments unlock entire categories of applications that struggle on transparent chains alone.</p><p>Confidential DeFi systems where balances and positions aren’t public. Identity systems where credentials are proven without being exposed. Enterprise workflows where internal logic stays internal, but outcomes are verifiable. Games where fairness can be proven without revealing the hidden state.</p><p>In all of these cases, privacy is not about obscuring behavior or avoiding accountability. It is about enabling <strong>verifiable interactions while preserving contextual confidentiality</strong> a requirement that many real-world systems already operate under.</p><h2 id="h-the-bigger-picture" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The Bigger Picture</strong></h2><p>Blockchain transparency addressed the problem of trust between unknown parties. Privacy addresses a different, equally important dimension: <strong>control over information disclosure during verification</strong>.</p><p>Architectures like Miden demonstrate that verifiability and confidentiality are not mutually exclusive. With the right execution model, systems can preserve public correctness guarantees while minimizing unnecessary data exposure.</p><p>For developers exploring blockchain today, this shift is fundamental. The future isn’t simply about placing more logic on-chain it’s about making deliberate choices around <em>what must be public, what can remain private,</em> and enforcing that boundary through cryptography rather than policy.</p><p>Seen this way, privacy doesn’t replace existing blockchain infrastructure or diminish its sophistication. It extends it allowing already powerful systems to support a broader range of applications under real-world constraints.</p><h2 id="h-resources-and-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources &amp; Links</strong></h2><h3 id="h-heimlabs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Heimlabs :</strong></h3><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAA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6373HuPMhrsAHEwzQC8Fm0rgMcgKtZRXL/Ub0v1aKl8jypdynSQwBNjFfDaDDM9W1IZKh6KhY0uCqQ114/FNX3Tv/LNz60972n5O7ka9HTfPj6Dr3yAX026cWXffL8LBTIFFznOmcx0yrmMq4NhkXAcBtAD0ONDUjByZqFinjOjl0cfDx2PP/rCl6Upn00Tz4tOp3TeOD6KGyOXG6IVtLRe3No+5s2J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><h3 id="h-miden" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Miden :</strong></h3><div data-type="embedly" src="https://miden.xyz/" data="{&quot;provider_url&quot;:&quot;https://miden.xyz&quot;,&quot;description&quot;:&quot;Practical privacy for the future of finance.&quot;,&quot;title&quot;:&quot;Miden&quot;,&quot;thumbnail_width&quot;:3000,&quot;url&quot;:&quot;https://miden.xyz/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/104f0884e99770673c47adaffcc86c52f2ed4eeb53218bc28ab55a137e024262.webp&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Miden&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1500,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAACXBIWXMAAAPoAAAD6AG1e1JrAAAAxklEQVR4nGP4hgrevX0HR3Du8+fP0UTgXDwAooYBv6JvMHXfyAWELfj27dvz589pa8E7WvvgHa0tIBJgdQdRFlw6eYRYS8iwYEppsgkDw8b50xgwgLW1NVYfIHuFgWD4TgFbsH3xbLi5nJycDAwMwsLCnJycyKZjTdAgHxC04/61i/gVILsdzTSQDyhJJN9gpuPK4dSx4B1qQYJuAZFuxA/wxQExOr+RqwzFB7hCEy6Ox6WY4hA2NA7wl8DIFmA1FBf69u0bACFriVmNe7auAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:3000,&quot;height&quot;:1500,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/104f0884e99770673c47adaffcc86c52f2ed4eeb53218bc28ab55a137e024262.webp&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/104f0884e99770673c47adaffcc86c52f2ed4eeb53218bc28ab55a137e024262.webp"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://miden.xyz/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Miden</h2><p>Practical privacy for the future of finance.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://miden.xyz</span></div><img src="https://storage.googleapis.com/papyrus_images/104f0884e99770673c47adaffcc86c52f2ed4eeb53218bc28ab55a137e024262.webp"></div></a></div></div><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah oy" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah oy" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p><p><a target="_blank" rel="noopener follow" class="dont-break-out qs ak ao aq" href="https://medium.com/tag/privacy?source=post_page-----dd7bd25c4216---------------------------------------"><br></a></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>blockchain</category>
            <category>privacy</category>
            <category>web3</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/1a746657c1382ca95c8a4ac37ca28614fe62a03ebfd64e6d5e8336eaba2d5de3.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Prediction Markets as Truth Seeking Systems]]></title>
            <link>https://paragraph.com/@heimlabs/prediction-markets-as-truth-seeking-systems</link>
            <guid>YNmxuezH8bFclKZJwNs1</guid>
            <pubDate>Mon, 05 Jan 2026 13:32:01 GMT</pubDate>
            <description><![CDATA[Everyone Has OpinionsPrediction Markets Ask One Simple Question: Do you believe it enough to pay for it?Spend a few minutes online and you’ll see endless certainty. People confidently predict elections, markets, launches, prices, and world events that haven’t happened yet. Most of these claims are emotional, loud, and completely free to make. That’s exactly why they’re often wrong. Prediction markets exist to change this dynamic by introducing something missing from online discourse: cost. On...]]></description>
            <content:encoded><![CDATA[<h2 id="h-everyone-has-opinions" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Everyone Has&nbsp;Opinions</h2><h2 id="h-prediction-markets-ask-one-simple-question-do-you-believe-it-enough-to-pay-for-it" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Prediction Markets Ask One Simple Question: </strong><em>Do you believe it enough to pay for it?</em></h2><p>Spend a few minutes online and you’ll see endless certainty. People confidently predict elections, markets, launches, prices, and world events that haven’t happened yet. Most of these claims are emotional, loud, and completely free to make.</p><p>That’s exactly why they’re often wrong.</p><p>Prediction markets exist to change this dynamic by introducing something missing from online discourse: <strong>cost</strong>.</p><p>Once confidence has a price, behavior changes.</p><h2 id="h-what-prediction-markets-actually-are" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What prediction markets actually&nbsp;are</h2><p>A prediction market lets people trade on the outcome of future events.</p><p>Instead of posting opinions, participants buy and sell shares tied to specific outcomes. If a market asks whether an event will happen, a “Yes” share might trade at $0.70. That price implies a 70% probability. If the event happens, the share pays out $1. If it doesn’t, it pays out nothing.</p><p>You’re not predicting prices or timing markets.<br>You’re pricing likelihood.</p><p>The market price becomes a real time signal of collective belief.</p><h2 id="h-why-people-mistake-them-for-gambling" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Why people mistake them for&nbsp;gambling</h2><p>Because money is involved, prediction markets often get dismissed as gambling. But the similarity ends at risk.</p><p>Gambling is driven by randomness and entertainment. Prediction markets are driven by information and incentives.</p><p>As <strong>Vitalik Buterin</strong> has said, prediction markets are <strong>social epistemic tools</strong>. They force beliefs to compete under real consequences. Luck dominates casinos. Accuracy dominates prediction markets.</p><p>- If you’re consistently wrong, you lose.<br>- If you’re consistently right, you compound.</p><h2 id="h-the-real-problem-prediction-markets-solve" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">The real problem prediction markets&nbsp;solve</h2><p>On social media, there is no penalty for being wrong. Anyone can push a confident narrative, collect engagement, and disappear when reality contradicts them.</p><p>Prediction markets flip that incentive structure.</p><p>- Strong beliefs must be backed<br>- Wrong beliefs lose money<br>- Right beliefs earn it</p><p>Over time, weak opinions get filtered out. Participants research more, exaggerate less, and update their views faster. The output isn’t certainty, it’s <strong>better probability estimates</strong>.</p><p>Something feeds and algorithms have never figured out how to do.</p><h2 id="h-this-isnt-niche-anymore" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>This isn’t niche anymore</strong></h2><p>Prediction markets have grown rapidly over the last year.</p><ul><li><p>Total value locked has climbed from tens of millions to hundreds of millions of dollars</p></li><li><p>Monthly trading volume now reaches into the tens of billions</p></li><li><p>Estimated total annual volume for 2025 is around <strong>$44B</strong></p></li></ul><p>This level of growth only happens when a product solves a real coordination problem.</p><h2 id="h-how-the-major-platforms-differ" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How the major platforms differ</h2><p>The core idea is the same, but each platform explores a different design space.</p><h2 id="h-polymarket" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Polymarket</h2><p>Polymarket is the most liquid and culturally relevant prediction market today. It focuses on a wide range of markets across politics, crypto, technology, and global events. Because it’s crypto native and permissionless, markets form quickly around emerging narratives. Its strength lies in fast price discovery and deep liquidity, making it a real-time signal for internet native events.</p><h2 id="h-kalshi" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Kalshi</h2><p>Kalshi operates under full U.S. regulatory approval, which changes the audience entirely. It enables institutions, hedge funds, and traditional traders to participate legally. Markets are more structured and conservative, but the credibility and regulatory clarity make Kalshi’s probabilities especially influential in policy, macro, and institutional contexts.</p><h2 id="h-limitless" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Limitless</h2><p>Limitless focuses on ultra short term markets that resolve in minutes or hours rather than weeks or months. This compresses feedback loops and rewards fast, accurate information processing. It’s less about long-term forecasting and more about real-time belief expression, making it closer to an information reflex than a forecasting instrument.</p><p>Each platform is experimenting with the same question:<br>&nbsp;<strong>How do we price truth more efficiently?</strong></p><h2 id="h-why-prediction-markets-matter-beyond-trading" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why prediction markets matter beyond trading</strong></h2><p>Prediction markets are increasingly used as an <strong>information layer</strong>.</p><p>Founders track them to gauge product launches. Traders use them to assess macro and political risk. Researchers and institutions reference them as live sentiment indicators.</p><p>When opinions become tradable and probabilities become public, belief stops being abstract. It becomes measurable.</p><h2 id="h-the-challenges-are-real-but-solvable" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">The challenges are real, but&nbsp;solvable</h2><p>Prediction markets still struggle with ambiguous questions, oracle design, and dispute resolution. Poorly worded markets can lead to confusion or manipulation.</p><p>These are design problems, not structural failures. As platforms mature, clearer standards, better governance, and improved resolution mechanisms continue to raise reliability.</p><h2 id="h-the-bigger-picture" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">The bigger&nbsp;picture</h2><p>Prediction markets don’t tell you what to think.</p><p>They show you what people actually believe and how much it costs them to believe it.</p><p>In a world flooded with free opinions, that signal matters.</p><p>Prediction markets aren’t gambling.<br>They’re what happens when belief finally has a price.</p><h2 id="h-resources-and-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources &amp; Links</strong></h2><h3 id="h-heimlabs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Heimlabs :</strong></h3><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCq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9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><h2 id="h-kalshi" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Kalshi : </h2><div data-type="embedly" src="https://kalshi.com/" data="{&quot;provider_url&quot;:&quot;https://kalshi.com&quot;,&quot;description&quot;:&quot;Kalshi is a regulated exchange &amp; prediction market where you can trade on the outcome of real-world events. Buy and sell Event Contracts.&quot;,&quot;title&quot;:&quot;Kalshi - Prediction Market for Trading the Future&quot;,&quot;mean_alpha&quot;:151.897222222,&quot;thumbnail_width&quot;:800,&quot;url&quot;:&quot;https://kalshi.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/a50e042701688ed8216f9a0c4a7105b2719d47f8e77fdeb2b3fdf74e863607e5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Kalshi&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:450,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAASCAIAAAC1qksFAAAACXBIWXMAAAs6AAALOgFkf1cNAAAEOElEQVR4nJ2Ta0ybZRTH/x/ml30xS4yazMRMt31YJnFZxsBuhXLphUJbCHRctw4yAgoNrVi0UCh9U+msRMb4MEGYkyGhMqdzYWE16lBMxIELDZcMBDYXlbJA7/e3j3lKWabRKL755c15znPO+Z/znrxA9Sv/i2QouVCmQpkCdQZUqVDx0MCHmoeKw6hIhDqdXtVygdpj/wbn75xcqNJo6epkFCXgVDKkh3D0eRRnCJpqUMKHPAGaTBqDOi5FucWjY90/ozxG+9UI8RoHNXnv9/UMD1kQe1rPmXseTHx0awQvPE070wgBFXfb1B1HfTqasnDi0OTEj/ZIYMG9Ond3nhAyeP9244K1/+YXVE2VigYh6FdT81CfFjf+Iw0CNGSiUvizbXZ+afGObXraZhu5MTL+za3Z+TnzBxeogFGGej6gSYc6Barj9K3JgJpLxepTYqo8iib9r9SnoVmCmuR9qtKpb8ctn1isVuva2prT4fT4vN5otEBRhp2AqQAaKsCDIQ/GIhjyoeLAKKeeFiktoRWhWUSPDel/JhOtUtRxFEbtgm1mcmpq3enwR8KEkBXH6nTw4d6DB7Af6Ciie4aKI77aOTj3Pc5Xl4/2lY/2Voz2VVo/VH11uXy0N66nFUDL3yITWiEMMigO91gGXOsbHq/XE/T7Q0ESJcFwyBONYOcO8J6DWY63BIAmZe8AU3HzovCzjvbbNxq/G676st80MbJ7oPWdiREYC9DAe6x6jGYRTPkoPTI+OUEIibAsiT3uoN/FBmeWF+kCziTBmE9boQlthTDkUkyFdHZDLpg8WqVVBp0Qegn0OdTQ8qETxD0GMV4VrSwvEUJYlo3GBGYf3v/Bdc8yep0KMJJYugDQ8fHuyT2DzP5BRnK9C92vo1eD/iZcajx65ewzAy2iz88fGDImDL2ddOUs9Nk0h8mjYjV5G36XLxx0+D2rPofd51z3uZws+2YbQwU6imgfOiGgF8OQjbYCtCvQfgrmIpgLYZLDXEp57zT1mE7AXIJuJRgp9Fn0VptZZm4MRSN37Ev3XPZAOBRmI8FQMEqIWCbDHqCrjM6tF4MOaxDTNL0QelGMrC1D9JhTBL2AXjEStBeiKqn3moUQutXNHUTYiNPj9kaju/e9iCNPofs07duQBTA5cYySGDEj7pTEnY8CmGwYpegswRnO12NjXq/X5XYTQkKhUCAQ2PB5pn9fwZNPQP4SnYCJxcMk2yb5aJejTmxffsASEgiEwmGWZdlwmF3zuYfHrHQBWhE6imHKpfHbFjAXwpiz641iQtgI62VZHyHRKCHesH9y+a6u+xwV6NxcpHRTIHc7yNBRCpMku0XTP7SoMk8JVGNXrb+EnYFZ228zTkd2bSWeBXoU9C/bTIE5f3t0KaDjnWy9gJf7kfgxOEMXry3/al+3/jT36frijsQEHNyFS1VUIBb/B/F/oVeAkmeKAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:800,&quot;height&quot;:450,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/a50e042701688ed8216f9a0c4a7105b2719d47f8e77fdeb2b3fdf74e863607e5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/a50e042701688ed8216f9a0c4a7105b2719d47f8e77fdeb2b3fdf74e863607e5.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://kalshi.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Kalshi - Prediction Market for Trading the Future</h2><p>Kalshi is a regulated exchange &amp; prediction market where you can trade on the outcome of real-world events. Buy and sell Event Contracts.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://kalshi.com</span></div><img src="https://storage.googleapis.com/papyrus_images/a50e042701688ed8216f9a0c4a7105b2719d47f8e77fdeb2b3fdf74e863607e5.png"></div></a></div></div><h2 id="h-polymarket" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Polymarket : </h2><div data-type="embedly" src="https://polymarket.com/" data="{&quot;provider_url&quot;:&quot;https://polymarket.com&quot;,&quot;description&quot;:&quot;Polymarket is the world's largest prediction market, allowing you to stay informed and profit from your knowledge by betting on future events across various topics.&quot;,&quot;title&quot;:&quot;Polymarket | The World's Largest Prediction Market&quot;,&quot;thumbnail_width&quot;:2400,&quot;url&quot;:&quot;https://polymarket.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/ac54786251c20fcd8db44cb2abf6beb48d2a7a565563594986d27309a21b0e2b.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Polymarket&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1260,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoA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vo5h2MTERE+Poa3tk46Om0ODgyzLms3mHr1B3/3t4A+DFEVxraK1j9LfpTuG6CY9FVdHfDlMf9pPn/yIPNtOXh+gP+unW/uorhE6r4UELRr5eVzf3WXo7e3p6bnRcWNkZIRlWYvFQpIkTdObrO/WDw0O3f7+9urqKic4UEVADteFnC8Q3Pfm49Hvclf2VxFQjkMuDgV8m+IbydiDRcvayuyscWFuft44R+AE+9hgtjBAOrraTdV3UQ3dVMstqrWP449vUS3fUTaVxKNV2VykZG4NfptcRixaIc3LhMmILy9YsGXLigk3s2trLIaxi4v01BQzM01jGHfKTVEKSnqfPNFMZjSRiQ1kJg+OF4iMJlJSR3C99s+6UnOCX8cXFknswapxFLs/MD86ZpqaNi8sWDB2aZmZmaHv32OGh5mf7jJGIzM9zZIkX0Wb9ZPIQwIPmzWjeKxdp6N7kxjLsgRFMSzDsAzF0BRD0wzD0jRLUdyRYR8xRbEM8zvNe0GOtbejewAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1260,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/ac54786251c20fcd8db44cb2abf6beb48d2a7a565563594986d27309a21b0e2b.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/ac54786251c20fcd8db44cb2abf6beb48d2a7a565563594986d27309a21b0e2b.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://polymarket.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Polymarket | The World's Largest Prediction Market</h2><p>Polymarket is the world's largest prediction market, allowing you to stay informed and profit from your knowledge by betting on future events across various topics.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://polymarket.com</span></div><img src="https://storage.googleapis.com/papyrus_images/ac54786251c20fcd8db44cb2abf6beb48d2a7a565563594986d27309a21b0e2b.png"></div></a></div></div><h2 id="h-limitless" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Limitless : </h2><div data-type="embedly" src="https://limitless.exchange/pro" data="{&quot;provider_url&quot;:&quot;https://limitless.exchange&quot;,&quot;description&quot;:&quot;Forecast the future on Limitless, financial prediction market&quot;,&quot;title&quot;:&quot;Limitless Exchange&quot;,&quot;mean_alpha&quot;:73.8484126984,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://limitless.exchange/pro&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/88b2dcd8ce099f78cc847404b91aac78a65ef3d1e37028d2bd80806764ffed1a.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Limitless&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEC0lEQVR4nNWQzW/bdBjHf03T1Hm1Hcfvcew4dmLn1alTO85LkyahWV7Wri/JxNbRsqlF09Zq9LAisZaJDe2AEJdKHDhBEQMuSFwYqrTbxF4QEtLYhQPS/oCJO0hDWVFEQfSAxAHpc/j9pOf5fvR8QT6YqYf1hZixkilt5Ctbpep2dfpao7J7onK9W7kxV745X3x70brRM673jN3+5PZi5spS9lJv4vIr5ctrzbX11sprnf767MLaQnttqXZ+qXBuUe+fUlotfqrG5KdAilTzbLIp6ouqsTJhrZulzVL59Urpar38RrO0c7L8Ztf8aHv1uy/2Prgy//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ot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/88b2dcd8ce099f78cc847404b91aac78a65ef3d1e37028d2bd80806764ffed1a.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/88b2dcd8ce099f78cc847404b91aac78a65ef3d1e37028d2bd80806764ffed1a.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://limitless.exchange/pro" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Limitless Exchange</h2><p>Forecast the future on Limitless, financial prediction market</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://limitless.exchange</span></div><img src="https://storage.googleapis.com/papyrus_images/88b2dcd8ce099f78cc847404b91aac78a65ef3d1e37028d2bd80806764ffed1a.png"></div></a></div></div><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah qa" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah qa" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>predictionmarket</category>
            <category>kalshi</category>
            <category>polymarket</category>
            <category>crypto</category>
            <category>web3</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/9f186ff473f44d376804a321067b221bcdc98afe800f5d1696dcae690f77fb01.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[How Stablecoins Became Global Payment Infrastructure]]></title>
            <link>https://paragraph.com/@heimlabs/how-stablecoins-became-global-payment-infrastructure-1</link>
            <guid>W4MPjGmzrvQdqk3Wb0Pk</guid>
            <pubDate>Wed, 17 Dec 2025 15:45:56 GMT</pubDate>
            <description><![CDATA[There was no speculative mania, no viral charts, no sudden “crypto is back” moment. Instead, the shift happened quietly, through infrastructure. According to a16z’s latest State of Crypto report, stablecoins processed $9 trillion in transaction volume in the last 12 months, a number that fundamentally changes how we should think about crypto’s real-world impact. For perspective, PayPal processed roughly $1.7 trillion in the same period, while Visa processed about $16 trillion. Stablecoins now...]]></description>
            <content:encoded><![CDATA[<p>There was no speculative mania, no viral charts, no sudden “crypto is back” moment. Instead, the shift happened quietly, through infrastructure. According to <strong>a16z’s latest State of Crypto report</strong>, stablecoins processed <strong>$9 trillion in transaction volume in the last 12 months</strong>, a number that fundamentally changes how we should think about crypto’s real-world impact.</p><p>For perspective, PayPal processed roughly <strong>$1.7 trillion</strong> in the same period, while Visa processed about <strong>$16 trillion</strong>. Stablecoins now sit directly between them. What was once dismissed as crypto’s most boring category has quietly become one of the largest payment networks on Earth.</p><p>This didn’t happen by accident.</p><h1 id="h-why-stablecoins-won-by-being-boring" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why Stablecoins Won by Being Boring</strong></h1><p>Stablecoins didn’t succeed because they were exciting. They succeeded because they were useful.</p><p>Stablecoins didn’t win hearts by being exciting. They won markets by being functional.</p><p>For decades, global money movement has relied on infrastructure built long before the internet became the backbone of commerce. International wires remain slow, expensive, and opaque. A typical transfer can cost around <strong>$40</strong>, take <strong>three to five business days</strong>, and pass through multiple intermediaries, each adding fees and friction.</p><p>Stablecoins replace this entire process with something radically simpler: a digital dollar that can be sent globally in seconds, at near-zero cost, without regard for banking hours or geography. Settlement happens in real time. Transparency is built in. Money becomes programmable.</p><p>This is not a feature upgrade it’s a structural shift. Just as cloud computing replaced on-prem servers and APIs replaced paperwork, stablecoins are replacing correspondent banking rails that were never designed for a global, always-on economy.</p><p>Infrastructure that works doesn’t need excitement. It just needs adoption.</p><h1 id="h-the-trading-narrative-is-breaking" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The Trading Narrative Is Breaking</strong></h1><p>For much of their early life, stablecoins were seen primarily as a tool for traders, a place to park value between volatile crypto assets. That framing made sense in the early days, but it no longer explains the data.</p><p>Recent metrics show stablecoin usage <strong>decoupling from crypto trading activity</strong>. Even during periods of lower speculation, stablecoin volumes continue to grow. This signals a fundamental shift in how and why these assets are being used.</p><p>Today, stablecoins are increasingly powering everyday economic activity. They are used for payments, remittances, payroll, merchant settlement, treasury management, and savings especially in regions facing inflation or capital controls. For many users, stablecoins are no longer “crypto.” They are simply the fastest, most reliable way to move and hold money.</p><p>This transition marks the moment when stablecoins move from a niche financial tool to essential infrastructure.</p><h1 id="h-institutions-are-adopting-without-the-noise" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Institutions are adopting without the noise</strong></h1><p>Perhaps the strongest signal of stablecoins’ durability is institutional behavior.</p><p>Major financial and commerce platforms are not experimenting publicly or chasing headlines. They are quietly integrating stablecoins into their core systems. Visa is rolling out stablecoin settlement, treating blockchains as an alternative backend for moving value. PayPal has described stablecoins as pivotal to the future of global commerce. Shopify is embedding stablecoin payments directly into checkout flows, allowing merchants to accept digital dollars alongside traditional payment methods.</p><p>These are not ideological endorsements of crypto. They are pragmatic decisions driven by cost efficiency, speed, and global reach. At scale, shaving seconds off settlement times and reducing fees by even small margins creates massive economic advantages.</p><p>When institutions adopt infrastructure quietly, it usually means they expect it to be permanent.</p><h1 id="h-the-geopolitical-shock-nobody-predicted" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The Geopolitical shock nobody predicted</strong></h1><p>One of the most under-discussed consequences of stablecoin growth is its geopolitical impact.</p><p>Because the vast majority of stablecoins are <strong>backed by U.S. dollars</strong>, issuers must hold equivalent reserves. Today, those reserves include <strong>more than $150 billion in U.S. Treasuries</strong>, placing the stablecoin industry ahead of multiple sovereign nations as holders of U.S. government debt.</p><p>In effect, stablecoins are exporting the dollar digitally, without relying on traditional banks, treaties, or diplomatic agreements. For users in emerging markets, stablecoins often provide greater stability than local currencies, easier access than offshore banking, and faster settlement than legacy FX systems.</p><p>This creates organic global demand for dollars not through policy enforcement, but through superior technology. Dollar dominance is being reinforced by infrastructure rather than regulation.</p><h1 id="h-why-this-isnt-just-another-crypto-cycle" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why this isn’t “Just another crypto cycle”</strong></h1><p>Skeptics often frame every crypto development as part of a repeating cycle. Stablecoins break that pattern.</p><p>They solve problems that exist regardless of market sentiment. Businesses need faster settlement. Merchants need lower fees. Individuals need stable value. The internet needs money that can move as easily as information.</p><p>These needs do not disappear during bear markets.</p><p>That’s why <strong>Citi projects the stablecoin market could reach $3.7 trillion by 2030</strong>. The growth curve resembles that of foundational technologies like cloud computing slow, unglamorous, and then suddenly indispensable.</p><p>Stablecoins are not a bet on price appreciation. They are a bet on efficiency.</p><h1 id="h-infrastructure-always-wins-quietly" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Infrastructure Always Wins Quietly</strong></h1><p>Most financial revolutions don’t announce themselves with hype. They unfold quietly, in the background, while attention is elsewhere.</p><p>Stablecoins didn’t overthrow banks or replace fiat currencies overnight. They simply outperformed legacy systems where it mattered most: speed, cost, transparency, and reach. Over time, those advantages compound.</p><p>That’s how infrastructure wins. Slowly. Quietly. Inevitably.</p><p>The stablecoin revolution isn’t coming.</p><p>It’s already here and it’s scaling.</p><h2 id="h-resources-and-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources &amp; Links</strong></h2><h3 id="h-heimlabs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Heimlabs :</strong></h3><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATYMJAzwU9BnohmElgcLDzgRVipZSwWpVeb1BvyKZ3FLqGSr2v5Dn7OuK/JYfRAt/xkrwj2YYej2Vf9aKLAiyCpZX8C6DAw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osIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><h3 id="h-coindesk-article" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>CoinDesk Article:</strong></h3><div data-type="embedly" src="https://www.coindesk.com/business/2025/09/25/stablecoin-market-could-reach-usd4-trillion-by-2030-citi-says-in-revised-forecast?source=post_page-----460332653ef3---------------------------------------" data="{&quot;provider_url&quot;:&quot;https://www.coindesk.com&quot;,&quot;description&quot;:&quot;Bank tokens may ultimately surpass stablecoins in transaction volume, report said.&quot;,&quot;title&quot;:&quot;Stablecoin Market Could Reach $4 Trillion by 2030, Citi Says in Revised Forecast&quot;,&quot;thumbnail_width&quot;:812,&quot;url&quot;:&quot;https://www.coindesk.com/business/2025/09/25/stablecoin-market-could-reach-usd4-trillion-by-2030-citi-says-in-revised-forecast&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/6f9ad1f61920d91f5fe39803f6e5358b2c8bbd448826f9dd3831d6d6f5b2dd45.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coindesk&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:540,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAVCAIAAACor3u9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAF5UlEQVR4nIWVC1BUZRTH/7v38X337t67D5bdBRWUl6ImOySChSmpIKloCUitCINGC8UMiopgD0CQFBUCdUE0HamM8ZWMUg7ZlDI12Ut7KE1UTmbZSxsaDabH19xd28hqmvnPN2funTm/8z/fN+eAiJSIhAgiEUSRF/wBEUQqkv8S+fOvyAsCxwfE67lALPKCXxABwulFgRAiEUKH8wIZJUL9+idpOGC4/gJYx0+zWJ1GnqMAAUSdjggCJRKlsnaKGm846Rbe/wPQwdByCeXdcNdbkxcHjZ5oNipGHSSAApTnKKESlTVpvFvb5c/yrwx/G4BOhiMMJxh6GI4xPDOExgtYsR8L19D4VKt9lIXjZJ85otdpSaksSbJEJepzEKh0eO1/BzQy7GDYxzQrzzEc9ZG6GXb9GNR6Ge2X0fQ+iraHp7hDIuOsRtWg98EAymnmRJGKIhEFIvLiLTD/kwHyGR5hWMnQ5rPSzlBzrXPi8u3pVWvydzUV7iqvOomTDG/52K0XUHnIkb0uNCHd7hyjigIFBL84ThBEUbszKvLiMEDCe0jqK+r46frgb6fO33jtMnPuZTmdv6KDzfqQ1V5gqLjQklEP70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rUQw30Cgqx0AiVKaSLMmKLCsGo2pUzIpqVlQNbLIEWaz2IJtdA48cFRYVETtpQkJywt3pd2cumZfvmZvvSV1auHjVY+7y6qzSynnLSmYsct8+Y06Ma4pjZITZbJeIisCECsi/arSJfxNs0MAGxaSoZtVkUU1WkznIbAm2WIMtQQ57yIiwyKjYuNsSpyWmZky/d0l6fvHCotULPGX3LCu5IyNbczB8W/mzGyRZppL/+7+wqaTIBtWomBRFVRSTYlQNRpNWh0E1KGbVFGS1h4aGh0WOGzNuAgKJAmtSIlSr+qbkwK+AbpK0BaspUFygVq3nVDIQKovkD2FE67/nk67UAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:812,&quot;height&quot;:540,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/6f9ad1f61920d91f5fe39803f6e5358b2c8bbd448826f9dd3831d6d6f5b2dd45.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/6f9ad1f61920d91f5fe39803f6e5358b2c8bbd448826f9dd3831d6d6f5b2dd45.jpg"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.coindesk.com/business/2025/09/25/stablecoin-market-could-reach-usd4-trillion-by-2030-citi-says-in-revised-forecast?source=post_page-----460332653ef3---------------------------------------" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Stablecoin Market Could Reach $4 Trillion by 2030, Citi Says in Revised Forecast</h2><p>Bank tokens may ultimately surpass stablecoins in transaction volume, report said.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.coindesk.com</span></div><img src="https://storage.googleapis.com/papyrus_images/6f9ad1f61920d91f5fe39803f6e5358b2c8bbd448826f9dd3831d6d6f5b2dd45.jpg"></div></a></div></div><br><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah qa" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah qa" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>stablecoins</category>
            <category>blockchain</category>
            <category>web3</category>
            <category>payments</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/9a886f5739c78be445b9695577b56c40d075fc5be87537dffaaa851a020ad6e3.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Tempo Testnet Is Live]]></title>
            <link>https://paragraph.com/@heimlabs/tempo-testnet-is-live</link>
            <guid>IbduznfTeAvlwnGE4vS9</guid>
            <pubDate>Thu, 11 Dec 2025 12:43:30 GMT</pubDate>
            <description><![CDATA[A blockchain purpose built for real financial workloadsFor the past decade, general-purpose blockchains have powered some of the most creative experiments in technology. DeFi, NFTs, on-chain gaming, identity, and autonomous agents all emerged because these chains were designed to be flexible programmable environments where anything is possible. But that flexibility comes with tradeoffs. When a chain supports every type of workload, payments often share blockspace with NFT drops, liquidations,...]]></description>
            <content:encoded><![CDATA[<h1 id="h-a-blockchain-purpose-built-for-real-financial-workloads" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>A blockchain purpose built for real financial workloads</strong></h1><p>For the past decade, general-purpose blockchains have powered some of the most creative experiments in technology. DeFi, NFTs, on-chain gaming, identity, and autonomous agents all emerged because these chains were designed to be flexible programmable environments where anything is possible.</p><p>But that flexibility comes with tradeoffs.</p><p>When a chain supports <em>every</em> type of workload, payments often share blockspace with NFT drops, liquidations, arbitrage bots, and high-frequency market activity. For most applications, that’s fine. For payments, especially those involving stablecoins or enterprise workflows, it can introduce unpredictability.</p><h2 id="h-tempo-takes-a-different-approach" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Tempo takes a different approach.</strong></h2><p>It begins with a simple question:</p><p><strong>What if a blockchain was purpose built for stablecoin payments from day one?<br></strong>What if finality, fees, metadata, and UX were architected not for general compute but specifically for moving digital dollars fast, reliably, and at global scale?</p><p>That question defines Tempo’s architecture. And today, its <strong>public testnet is officially live</strong>.</p><h1 id="h-why-tempo-exists-and-what-its-built-for" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why tempo exists and what it’s built for</strong></h1><p>Tempo is a specialized blockchain built entirely around payments.<br>&gt; Not a general-purpose compute engine.<br>&gt; Not a platform for NFT ecosystems.<br>&gt; Not another environment competing for multi-tenant blockspace.</p><p><strong>Tempo</strong> focuses on one thing: <strong>helping money move</strong>.</p><p>The chain is engineered for stability, determinism, and speed qualities that matter deeply to enterprises and consumer apps that rely on predictable financial behavior.</p><p>In less than three months, Tempo moved from announcement → implementation → live network. Builders can now test payment flows on infrastructure optimized for:</p><h2 id="h-instant-settlement-05s" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>• Instant settlement (~0.5s)</strong></h2><p>Finality that feels closer to real-time payments, not typical crypto confirmation windows.</p><h2 id="h-predictable-low-fees-dollar0001" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>• Predictable low fees (~$0.001)</strong></h2><p>Isolated payment lanes keep fees steady even during periods of global volatility.</p><h2 id="h-a-stablecoin-native-ux" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>• A stablecoin native UX</strong></h2><p>Gas, liquidity, and transaction metadata are all designed around USD-denominated stable assets.</p><p>This isn’t a small launch. Tempo reports early pilots with major enterprises including <strong>OpenAI, Visa, Deutsche Bank, DoorDash, Shopify, Nubank, Mastercard, Brex, Klarna, Ramp, UBS</strong>, and more.</p><h1 id="h-what-makes-tempo-different" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What makes tempo different</strong></h1><p>Medium readers love clarity, so let’s break down the mechanics.</p><h2 id="h-dedicated-payment-lanes" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>→ Dedicated payment lanes</strong></h2><p>Payment traffic gets its own execution environment. No competition with NFT mints or trading bots.<br>More predictable fees. More predictable latency.</p><h2 id="h-stablecoin-native-gas" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>→ Stablecoin native gas</strong></h2><p>Gas is paid directly in USD stablecoins.<br>No volatile governance token.<br>No messy accounting.</p><h2 id="h-built-in-stable-asset-dex" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>→ Built in stable asset DEX</strong></h2><p>Unified, protocol-level liquidity for USD stablecoins.<br>Validators and users can pay and receive fees in the stablecoin of their choice.</p><h2 id="h-structured-payment-metadata" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>→ Structured payment metadata</strong></h2><p>Native fields for invoices, vendor IDs, cost centers, payment references, reconciliation logic all built into the chain.</p><h2 id="h-fast-deterministic-finality-05s" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>→ Fast, deterministic finality (~0.5s)</strong></h2><p>A BFT consensus mechanism ensures immediate, irreversible settlement.</p><h2 id="h-modern-wallet-ux" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>→ Modern wallet UX</strong></h2><p>Tempo wallets support:</p><ul><li><p>gas sponsorship</p></li><li><p>scheduled payments</p></li><li><p>passkey authentication</p></li><li><p>batched transactions</p></li><li><p>automatic fee handling</p></li></ul><p>All at the protocol layer not through third-party middleware.</p><h1 id="h-what-builders-are-exploring-already" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What builders are exploring already</strong></h1><p>Early builders on the testnet are experimenting with : </p><p><strong>&gt; Cross-border remittances<br>&gt; Payroll and vendor payouts<br>&gt; Embedded finance rails<br>&gt; Microtransactions with fees below a cent<br>&gt; Agent-to-agent autonmous payments<br>&gt; Tokenized deposits and institutional settlement</strong></p><p>These use cases often require determinism, low fees, predictable blockspace, and structured metadata all areas where Tempo is specifically optimized.</p><h1 id="h-whats-next-for-tempo" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What’s next for tempo</strong></h1><p>Launching the testnet is only step one.</p><p>Over the next phases, Tempo will:</p><h2 id="h-onboard-more-enterprise-partners" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>• Onboard more enterprise partners</strong></h2><p>Expanding pilots across fintech, banks, commerce platforms, and agent-driven systems.</p><h2 id="h-grow-the-developer-ecosystem" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>• Grow the developer ecosystem</strong></h2><p>Releasing SDKs, APIs, wallet toolkits, and data interfaces.</p><h2 id="h-stress-test-throughput" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>• Stress-test throughput</strong></h2><p>To understand how payment lanes behave under sustained high-volume settlement loads.</p><h2 id="h-move-toward-validator-decentralization" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>• Move toward validator decentralization</strong></h2><p>Ensuring long-term resilience, transparency, and trust.</p><h1 id="h-fully-open-source-under-apache" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Fully open source under apache</strong></h1><p>The Tempo client is entirely open-source under an Apache license.<br>Anyone can:</p><ul><li><p>run a node</p></li><li><p>audit the implementation</p></li><li><p>fork the client</p></li><li><p>contribute improvements</p></li></ul><p>This fosters community-driven development and supports a pathway toward decentralized governance and infrastructure.</p><h1 id="h-the-bigger-picture" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The bigger picture</strong></h1><p>Tempo isn’t trying to replace general-purpose blockchains. Those ecosystems are thriving and essential for experimentation, apps, and compute-heavy use cases.</p><p>Tempo complements them.</p><p>As stablecoins become one of crypto’s most important real-world utilities, the infrastructure supporting them needs specialization. Payments are not just another transaction type; they’re a mission-critical function of global commerce. And they require consistency.</p><p>Tempo is designed for exactly that.</p><p>The testnet is live, open, and ready for builders who want to explore what’s possible when a blockchain focuses on one thing and does it exceptionally well.</p><h1 id="h-resources" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources</strong></h1><p><strong>Tempo Website :</strong></p><div data-type="embedly" src="https://tempo.xyz/" data="{&quot;provider_url&quot;:&quot;https://tempo.xyz&quot;,&quot;description&quot;:&quot;The blockchain for payments at scale. A neutral, permissionless blockchain optimized for payment processing, enabling efficient transactions with predictable low fees.&quot;,&quot;title&quot;:&quot;Tempo: the blockchain designed for payments&quot;,&quot;mean_alpha&quot;:211.776111111,&quot;author_name&quot;:&quot;Rachel, Veena, Matt, Veit, Devin, Nick&quot;,&quot;url&quot;:&quot;https://tempo.xyz/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/6057cba90a9e902f807ee8ee16b5bb1289efc9fb2111c86aec8b9732092fac04.png&quot;,&quot;thumbnail_width&quot;:2400,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Tempo&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1350,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAASCAIAAAC1qksFAAAACXBIWXMAABYlAAAWJQFJUiTwAAAD/klEQVR4nG2VzUr7WBjGs/E+XPiBOwt6DXoFbkQQXHkRrhSkoihSgiWhCQ0hIeHkkCAJCTGUkhRDaGmLYpHRhUWxhKaUhgali8Hzzj/Tkfktzi7P836Hiv8wJCRzjOZIkmQ6nfb7fU3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ubvJywSpqmgb9UAlgAxvebDaHw2F+Y+aLnksnSTIcDimWZc8J5XL55uYG1GVZhl2XJEkURagejBacGlEUEUJBEHx8fECJ5v8cuXocxz+nolgsyrJ8cnKCMaZpWtM0hmFyG1mW89ME6wo/HEmSGIapVqu2bb++vv6SBvU4jv8GcQr2Xbc5LH0AAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1350,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/6057cba90a9e902f807ee8ee16b5bb1289efc9fb2111c86aec8b9732092fac04.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/6057cba90a9e902f807ee8ee16b5bb1289efc9fb2111c86aec8b9732092fac04.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://tempo.xyz/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Tempo: the blockchain designed for payments</h2><p>The blockchain for payments at scale. A neutral, permissionless blockchain optimized for payment processing, enabling efficient transactions with predictable low fees.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://tempo.xyz</span></div><img src="https://storage.googleapis.com/papyrus_images/6057cba90a9e902f807ee8ee16b5bb1289efc9fb2111c86aec8b9732092fac04.png"></div></a></div></div><p><strong>Tempo doc :</strong></p><div data-type="embedly" src="https://docs.tempo.xyz/" data="{&quot;provider_url&quot;:&quot;https://docs.tempo.xyz&quot;,&quot;description&quot;:&quot;Documentation, integration guides, and protocol specifications&quot;,&quot;title&quot;:&quot;Tempo&quot;,&quot;thumbnail_width&quot;:2400,&quot;url&quot;:&quot;https://docs.tempo.xyz/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/77d8681e4296706d73b802c192df053c16a6e8fba75f6c781882006672ea99c5.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Tempo&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1260,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAD6UlEQVR4nI2UQWT7fBjH46WMl6mqSLQqUpWKmEhEVCuiIlEREZGKqoiqamlYjdVLdKfqYYcydtllt5nZYXbf7LJjD2OH2WG3moqqKi3Rw+vNT/v+38v+7+fwE8+P7zfP83ueB5r/D4IgmM1mm83m/f3dcZxqRK1Wazabx8fHvV6v3+8PBoPRaHR+fj6MGAwGw+HQ933oZ+lZxHK53G63X19fw+HQdV1d1w3DAB6NRqPZbLbbbc/z+v2+7/t/Rfi+3+l0zs7O/jUI/stsNguCYL1eb7fbj4+P0WhEURSKotVq1dihaZppmo7jNCOATbfbBWev16vX69BecT6fL5fL1Wq1iQjDcLFYPD8/e55HUVQymcRxnOO4SoQkSUDdNE3LsmzbdhzHjWg0Go7jtFotEIHCiNVq9f39/fn5OZlMnp6e7u7uxuOxrus4jiMIQhAERVE0TXMcJ4qiIAhihCAIpVJJURQ9QtM0wzB0XVdVVdM0y7JM04S63a5lWbIsF4tFhmEoisrn8xiGoSiayWTy+TxFUQzD0DS9P3meL5VKPM9zHFcqlURRVBRFluVyuVyKABFJkmRZhv6IODg4SCQSqVQqHYFhWC4iH0EQBEmSR0dHFEWRJAkiBEHQNM1HsCx7FMHuEARBkiRVVaFEIgHvAAYoioKPTCaD4ziGYZlMBsOwbDaL43gqlcrswHE8m83mcjlwlU6nwW02mwVVZVkWisViBxF/7ojH44mIeDwOwzCCIDAMx+PxZDKZSCTAeXh4CMMwwzAkScIwHIvFIOifYsAwzLKsYRinp6fX19evr69QcgdIJZlMwjAMhMA3EhkgCAL+jiCIXC7HMEyv17u8vBwMBqD9Ly4uHh4e3t7eptMpaO4wDNfrNQTyQlE0nU4jCALeAEVRJALDMIIggC7DMMViUVEU27bH4/HLy8tkMplOp8vlMgzD7Xa72WxWq9VisdiPURAEEBdB0zTLshRFgWrm83nyFwiCQBBE07RWq9Xtdh8fH1erFRiavdxeEYzUHqhSqRiGIUkSz/PlcllRlEKhwPM8RVG5XA68FUmSoCye593f3/869r/dY5DruvV6HQwe6OVCoUDTNKgJx3Gg+cAEsCw7Go3m8/lmswGb6vcGvu+fnJy4rquqqiiKQFQUxXK5LAgC8OM4jud5EKRp2jTN29vbIAjAOvk5D0jXdcuyKpWKKIpgNCqVim3bqqoqilIul8FWkGVZVVXLsnRdF0WxUCjU6/Wbm5vZbBaG4U8GnU5HEASWZdvtNsdxnufZtt1sNi3LqtVqtm1Xq1XTNME663Q6ruvatm2apizLhULBtu2rq6sfkvgbu//WQD8wwboAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1260,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/77d8681e4296706d73b802c192df053c16a6e8fba75f6c781882006672ea99c5.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/77d8681e4296706d73b802c192df053c16a6e8fba75f6c781882006672ea99c5.jpg"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.tempo.xyz/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Tempo</h2><p>Documentation, integration guides, and protocol specifications</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.tempo.xyz</span></div><img src="https://storage.googleapis.com/papyrus_images/77d8681e4296706d73b802c192df053c16a6e8fba75f6c781882006672ea99c5.jpg"></div></a></div></div><p>Heimlabs :</p><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUV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ubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p>Clap it up if this saved you time!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah qq" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah qq" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p><p><a target="_blank" rel="noopener follow" class="dont-break-out qt ak ao aq" href="https://medium.com/tag/blockchain?source=post_page-----a30cc43183eb---------------------------------------"><br></a></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>tempo</category>
            <category>blockchain</category>
            <category>payment</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/05ce0e7fcd251cad28890987e9896079fbc326eca02daf4acebd7454c4ce0eeb.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Snapchain: How Farcaster Rewired Social Media for a Decentralized Future]]></title>
            <link>https://paragraph.com/@heimlabs/snapchain-how-farcaster-rewired-social-media-for-a-decentralized-future</link>
            <guid>C5dic9wkfyetV54D9WCw</guid>
            <pubDate>Wed, 10 Dec 2025 11:01:16 GMT</pubDate>
            <description><![CDATA[“In tech, ‘good enough’ is never good enough for long.” For Farcaster, a decentralized social protocol “good enough” once meant a messy, but functional, system. But as the network grew, that fragile foundation started to crack under pressure. The answer? A bold re-architecture. That led to Snapchain, a blockchain-like data layer designed specifically for social systems.Farcaster + the “Deltagraph” (Pre-SnapChain) EraFarcaster was always conceived as a decentralized social protocol. The idea w...]]></description>
            <content:encoded><![CDATA[<p><strong><em>“In tech, ‘good enough’ is never good enough for long.”</em></strong></p><p>For Farcaster, a decentralized social protocol “good enough” once meant a messy, but functional, system. But as the network grew, that fragile foundation started to crack under pressure.</p><p>The answer? A bold re-architecture.</p><p>That led to <strong>Snapchain</strong>, a blockchain-like data layer designed specifically for social systems.</p><h1 id="h-farcaster-the-deltagraph-pre-snapchain-era" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Farcaster + the “Deltagraph” (Pre-SnapChain) Era</strong></h1><p>Farcaster was always conceived as a decentralized social protocol. The idea was to let users own their identity, own their social graph, and give developers a base on which to build social apps free from centralized gatekeepers. Identity and high security operations (like account creation) remain on-chain, but most user data posts, follows, likes, profile updates are stored off-chain.</p><p>To manage that off-chain data, Farcaster originally used a system called <strong>“Deltagraph”</strong>&nbsp;, a gossip or CRDT(<strong>Conflict Free Replicated Data Type</strong>) based network.&nbsp;</p><p>Under this system:</p><ul><li><p>Every user action (post, follow, like, profile update…) was treated as a CRDT operation.</p></li><li><p>When a user did something, their node immediately applied the change locally, then “gossiped” it out to peers.</p></li><li><p>There was no global coordinator, no strict ordering, just peer-to-peer gossip and eventual consistency.</p></li></ul><p>Early on, Farcaster reportedly served a modest user base; the network managed something like 100,000 users and ~500 transactions per second (TPS), with roughly 2 GB/day of state growth.</p><p>It worked but only up to a point.</p><h1 id="h-deltagraph-started-failing" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Deltagraph Started&nbsp;Failing</h1><p>As usage grew, more users, more apps built on top of Farcaster Deltagraph started to show significant weaknesses. The decentralized, gossip-based system began failing in ways that matter to real users.</p><p><strong>Here’s what went wrong:</strong></p><h2 id="h-1-lack-of-global-ordering-and-inability-to-guarantee-strong-consistency" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>1. Lack of global ordering and inability to guarantee strong consistency</strong></h2><p>Because CRDT operations are unordered and asynchronous, there was <strong>no canonical “source of truth.”</strong> If two nodes had differing data (e.g. due to message loss, network partitions, or delays), there was no reliable way to reconcile automatically. A node could only detect divergence by comparing <em>all</em> transactions with every other node, a task that becomes utterly unmanageable at scale.</p><p>As the number of nodes and messages ballooned, keeping everyone in sync became infeasible.</p><h2 id="h-2-sync-failures-rate-limit-divergence-and-state-bloat" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">2. Sync failures, rate limit divergence, and state&nbsp;bloat</h2><p>Nodes sometimes miss messages (gossip failures), meaning some users’ data became inconsistent or out-of-date. Because CRDT offers only <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://en.wikipedia.org/wiki/Eventual_consistency">eventual consistency</a>, there was no guarantee when (or if) nodes would catch up.</p><p>Moreover, and perhaps most troubling, the state size kept growing relentlessly. Every post, like, follow, profile change, all piled up. For active usage, that meant storage demands growing day by day.</p><p>Eventually, running a node became so resource-intensive (bandwidth, storage, compute) that only big players could realistically keep up. That starts undermining the decentralization promise.</p><blockquote><p>The result? Deltagraph, once “good enough,” was no longer good enough. Farcaster needed rethinking.</p></blockquote><p>Watch the video on snapchain&nbsp;:</p><div data-type="youtube" videoid="M9qGa4X58w8">
      <div class="youtube-player" data-id="M9qGa4X58w8" style="background-image: url('https://i.ytimg.com/vi/M9qGa4X58w8/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=M9qGa4X58w8">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><h1 id="h-a-new-chapter-snapchain" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">A New Chapter: Snapchain</h1><p>Rather than patching the problems, the Farcaster team went for a full pivot: they replaced gossip-based CRDT with a brand-new system, <strong>Snapchain</strong>.</p><p>Snapchain is not a generic blockchain. It’s a <strong>blockchain inspired, social optimized data layer</strong> built specifically to handle social media workloads (posts, likes, follows, profile updates) rather than financial transactions.</p><p>What changed, and why this architecture works better:</p><ul><li><p><strong>Ordered, block-based transaction processing:</strong> Instead of random gossip, user actions are grouped into blocks. Each block is signed, linked to the previous block, and includes a global “state root” (via a Merkle-trie over account states). This ordering provides a canonical source of truth. Syncing becomes trivial: if you miss a block, just fetch it no need to diff massive histories.</p></li><li><p><strong>Account-scoped transactions, non-Turing complete:</strong> Snapchain transactions are limited to social-native actions (post, like, follow, profile update, delete, etc.), each affecting only one account. No arbitrary smart contracts, no cross-account side effects. That simplifies validation and makes sharding by user account straightforward.</p></li><li><p><strong>Sharding &amp; pruning (garbage collection):</strong> Because each account’s history is isolated, the network can split accounts across multiple chains, improving scalability dramatically. Meanwhile, Snapchain supports pruning: old or reversed transactions (e.g. unlike deleted posts) can be removed after a certain time, preventing unbounded state growth.</p></li><li><p><strong>Storage-rent model instead of per-action fees:</strong> Rather than charging gas per post/like (which would discourage frequent use), Snapchain opts for a “storage rent” model: users pay a fixed annual fee for storage. Within limits (e.g. number of transactions or storage quota), they can act freely. When limits are exceeded, older transactions get pruned. For typical social use, this feels effectively “unlimited.”</p></li></ul><blockquote><p>The result: a social-data layer that remains decentralized, but massively more scalable, reliable, and manageable.</p></blockquote><h1 id="h-what-snapchain-delivers" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What Snapchain Delivers&nbsp;:</h1><h2 id="h-scalability-consistency-and-real-world-readiness" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Scalability, Consistency, and Real World Readiness</h2><p>With Snapchain live (mainnet launch in 2025), Farcaster unlocked capabilities that were previously difficult or impossible:</p><ul><li><p><strong>High throughput:</strong> Snapchain is designed to handle <strong>9,000–10,000+ transactions per second (TPS)</strong>, a level comparable to large centralized platforms and far beyond typical blockchains.</p></li><li><p><strong>Millions of daily users:</strong> The architecture supports large-scale usage. Estimates suggest a capacity for <strong>2 million daily active users</strong> on Farcaster apps.</p></li><li><p><strong>Strong consistency &amp; real-time sync across nodes:</strong> Because of block ordering and canonical state roots, nodes stay in sync reliably. No more “some nodes missing messages forever” missed blocks are detectable and fetchable.</p></li><li><p><strong>Decentralization + accessibility:</strong> With pruning and sharding, running a node becomes more feasible for a wider set of participants. The network stays decentralized but scalable, avoiding the “only big servers” trap.</p></li><li><p><strong>User-friendly experience:</strong> No gas fees per post or like, just a predictable storage rent. Users can behave like on traditional social media: post, like, follow, without worrying about per-action cost or blockchain latency.</p></li></ul><p>In short: Snapchain reclaims the promise of decentralized social media not just as a technical novelty, but as a serious, usable alternative to centralized platforms.</p><h1 id="h-the-tradeoffs-what-snapchain-gives-up-and-what-it-restricts" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">The Tradeoffs: What Snapchain Gives Up and What It Restricts</h1><p>No design is perfect. Snapchain makes deliberate tradeoffs to optimize for social use. Here’s what you should know.</p><ul><li><p><strong>Limited transaction expressiveness:</strong> Snapchain only supports a fixed set of “social primitives” (posts, likes, follows, profile updates, deletes). There’s no support for Turing-complete smart contracts, arbitrary logic, or complex multi-account transactions. This keeps things simple but less flexible compared to general blockchains.</p></li><li><p><strong>Ephemeral history (due to pruning):</strong> Because the system prunes old or reversed transactions, the full historical record may not be kept forever. For typical social media usage, that may be fine (old likes/unlikes are rarely revisited), but it means history isn’t guaranteed to be immutable or permanent.</p></li><li><p><strong>New complexity, new failure modes:</strong> Snapchain introduces block production, consensus, validators, and sharding, a step up from simple gossip. That adds complexity to the protocol, and potential points of failure (validator downtime, shard coordination, consensus bugs, version upgrades).</p></li><li><p><strong>Storage-rent model tradeoffs:</strong> The “rent + prune” model means that heavy or long-term users may need to pay more (buy extra storage units), and some data might get dropped if quotas are exceeded. Also, different transaction types (posts, likes, follows) have separate quotas, which may lead to wasted capacity for some users.</p></li></ul><p>In short: Snapchain sacrifices universality (no general smart contracts), permanence (pruning old data), and simplicity (added consensus/sharding complexity) but gains scalability, usability, and predictable performance for social use.</p><h1 id="h-conclusion" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h1><p>Snapchain shows that scaling decentralized social wasn’t just a performance problem, it was an architectural one. By replacing gossip with a purpose-built data layer, Farcaster proved the model can evolve without abandoning decentralization.</p><p>If Snapchain holds up under real adoption, it could pave the way for user owned social media at true Web2 scale. And that possibility alone makes this shift one of the most important experiments in Web3 right now.</p><h2 id="h-resources" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Resources&nbsp;:</h2><p><strong>Snapchain website&nbsp;</strong></p><br><div data-type="embedly" src="https://www.snapchain.dev/" data="{&quot;provider_url&quot;:&quot;https://www.snapchain.dev&quot;,&quot;description&quot;:&quot;Snap V1 is our first no-code solution that brings fast finality to the OP Stack. We help deploy, manage and scale this integration for your chain, so you can focus on building the best experience for your users.&quot;,&quot;title&quot;:&quot;Snapchain&quot;,&quot;mean_alpha&quot;:75.6404761905,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.snapchain.dev/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/d25c2db04c63cc5e656e3b784a473664906d843d0434653b6bad157a135a901f.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Snapchain&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAACVUlEQVR4nGPgE5DkE5TiE5SkOuIXkuITkGSghdF8SIjuFvALgRCtLOAXkuTmk+DigtrBLyQFCkeCAY2bi2IBv5AkF5ekpJK0hrksF48Ev5AUO5cIC5sAF6+YgLAMxDI0xCcoycYhJCAswycoKSAsw8Mvwc0nDlGMYQHYyYwM4l3HNNwTlBgYJLj5xbX1zGJiU/UMLRiYeNi5hHj4Jdi5RNg4hCCIhU1AREzW2c2PkZmXh1+ChU1AQUVbQ9uEgYmHk0cU3QJ+YSkmBvHKVWqH/jvIqEvLacqycAhU1bXWN3XIKmqkpOUmJGeZmttn55WZWtjnFVU6ufkGhsTEJWUuWrwqO7fE2NQmLbMwIiYlPCqxsLjKwzuYnUsE4g+QBYIiUqwskh5piiu/m5evU1360SypV5WJSVxRWTMjs3DqzPm5BWUFheVNLT2z5y1ev3GLt1/ovIXLW9p6lFV1axra4xPSOnomTZoye9XaTbPnL46ITKita4GEG8IHPHySStoyAmKSy9+azLmtz8kjxckl6ujqU1RSHZuQbmPvZmXjUlhSVVZR3z9pxoTJM13d/SJiUlLT89w9A3QMLLPzymrqW9MyCuMS03UMzD28g9AtEBSRYmQQ17GWm35dT0BMkhOckHj4QJHGwibAySPKySPKwibAwMRjZGarom4AjhURLl4xCMnEwgeOFSFWdkGIIJZI5uKSVNKVVtaTYWMD2QdPdvwwJCAsIyAsw8kjCk8qyFJwEi1xoyRTTl4JUAIVxpf2+YnIHPgyGnWzMd8AlEV81LeAxvUBAKNPw8N5CzWrAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/d25c2db04c63cc5e656e3b784a473664906d843d0434653b6bad157a135a901f.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/d25c2db04c63cc5e656e3b784a473664906d843d0434653b6bad157a135a901f.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.snapchain.dev/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Snapchain</h2><p>Snap V1 is our first no-code solution that brings fast finality to the OP Stack. We help deploy, manage and scale this integration for your chain, so you can focus on building the best experience for your users.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.snapchain.dev</span></div><img src="https://storage.googleapis.com/papyrus_images/d25c2db04c63cc5e656e3b784a473664906d843d0434653b6bad157a135a901f.png"></div></a></div></div><h4 id="h-farcaster" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Farcaster&nbsp;</h4><div data-type="embedly" src="https://farcaster.xyz/" data="{&quot;large&quot;:true,&quot;title&quot;:&quot;Farcaster: crypto wallet for Base, Monad, and Solana&quot;,&quot;description&quot;:&quot;Discover new people, projects and tokens on Farcaster, the decentralized crypto social network and wallet for Base, Solana, Monad, BSC and more.&quot;,&quot;url&quot;:&quot;https://farcaster.xyz/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/fa20a66e9497b20c5286cf3e8cda7172cbb1f5632660b28e2207b5e40be03783.png&quot;,&quot;provider_url&quot;:&quot;Farcaster&quot;}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/fa20a66e9497b20c5286cf3e8cda7172cbb1f5632660b28e2207b5e40be03783.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://farcaster.xyz/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Farcaster: crypto wallet for Base, Monad, and Solana</h2><p>Discover new people, projects and tokens on Farcaster, the decentralized crypto social network and wallet for Base, Solana, Monad, BSC and more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>Farcaster</span></div><img src="https://storage.googleapis.com/papyrus_images/fa20a66e9497b20c5286cf3e8cda7172cbb1f5632660b28e2207b5e40be03783.png"></div></a></div></div><h4 id="h-heimlabs" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Heimlabs</h4><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATYMJAzwU9BnohmElgcLDzgRVipZSwWpVeb1BvyKZ3FLqGSr2v5Dn7OuK/JYfRAt/xkrwj2YYej2Vf9aKLAiyCpZX8C6DAwgd6BmjM+kZfbnzh3LoKtn5+Xo2azOOBEQfH1MpYSCJaoVWuY3TPFVh6KwNvr2+6N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;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><h4 id="h-clap-it-up-if-this-saved-you-time" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Clap it up if this saved you time!</h4><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>blockchain</category>
            <category>snapchain</category>
            <category>farcaster</category>
            <category>web3</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/dabc2462ee3ad146c1f00d3abf754c0821c2bf994e2e909dcfc64ebb6cc93753.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[x402 Protocol: The Internet’s First Native Payment Layer]]></title>
            <link>https://paragraph.com/@heimlabs/x402-protocol-the-internets-first-native-payment-layer-1</link>
            <guid>wibJci89duPQhP2NGjqZ</guid>
            <pubDate>Wed, 26 Nov 2025 16:41:48 GMT</pubDate>
            <description><![CDATA[x402 Protocol: The Internet’s First Native Payment LayerFor more than three decades, the internet mastered one thing better than any invention in human history: moving information. It could stream videos, serve APIs, deliver messages, and host entire economies yet it never gained the ability to move money natively. When the original designers of the web defined HTTP status codes, they reserved one number for a future capability: 402 Payment Required. It wasn’t truly implemented in the Web2 er...]]></description>
            <content:encoded><![CDATA[<h1 id="h-x402-protocol-the-internets-first-native-payment-layer" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>x402 Protocol: The Internet’s First Native Payment Layer</strong></h1><p>For more than three decades, the internet mastered one thing better than any invention in human history: moving information. It could stream videos, serve APIs, deliver messages, and host entire economies yet it never gained the ability to move money natively.</p><p>When the original designers of the web defined HTTP status codes, they reserved one number for a future capability: <strong>402 Payment Required</strong>. It wasn’t truly implemented in the Web2 era mostly referenced in theory, occasionally speculated on, but never standardized or deployed at scale.</p><p>Until now.</p><p><strong>x402 brings that placeholder to life.</strong></p><p>It marks a fundamental shift in how the internet operates. It’s not a checkout system, not a Stripe clone, not a Web3 wrapper, and not a wallet prompt in disguise. It’s a <strong>protocol-level extension</strong>, embedding payments directly into the Web’s everyday request response cycle.</p><p>With x402, value moves over HTTP the same way data does instantly, natively, and verifiably.</p><h1 id="h-so-what-exactly-is-x402" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>So, What Exactly Is x402?</strong></h1><p>x402 is an open, machine-native payment protocol that embeds cryptographic payments directly inside normal HTTP requests. Instead of redirecting the user to a gateway or requiring API keys and subscriptions, a server can respond with <strong>402 Payment Required</strong> containing:</p><ul><li><p>The required asset</p></li><li><p>The amount</p></li><li><p>The chain</p></li><li><p>The recipient</p></li><li><p>The <strong>API/service metadata</strong> needed for the client to pay and prove authorization</p></li></ul><p>The client whether a browser, backend, agent, or IoT device, pays automatically by signing a transaction authorization, attaching it to the follow-up request, and receives the resource.</p><p>→ No pop-ups<br>→ No sign-ins<br>→ No “Connect Wallet.”</p><p>Just HTTP, upgraded with a value layer.</p><h1 id="h-why-x402-needed-to-exist" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why x402 Needed to Exist</strong></h1><p>The old web wasn’t built for:</p><ul><li><p>Microtransactions,</p></li><li><p>Autonomous AI agents,</p></li><li><p>Per-request billing,</p></li><li><p>Real-time machine commerce,</p></li><li><p>or on-demand digital services.</p></li></ul><p>Everything depended on centralized intermediaries, API keys, and subscription logic, all designed for human-triggered flows, not automated machine economies.</p><p>The new internet, filled with autonomous agents, decentralized compute, tokenized services, and programmable money, needs a universal economic interface.</p><p><strong>x402 is that interface.</strong></p><p>It lets software interact with services the way humans intuitively do:<br> <strong>access → authorize → receive</strong>, without manual steps or platform friction.</p><h1 id="h-how-x402-works-under-the-hood" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>How x402 Works Under the Hood</strong></h1><p>When a client requests a paid resource, the server replies with <strong>402 Payment Required</strong>, including a structured descriptor containing:</p><ul><li><p>The asset and amount</p></li><li><p>The chain</p></li><li><p>The recipient</p></li><li><p>API/service metadata</p></li><li><p>A unique payment session</p></li></ul><p>This payment session acts as a one-time handshake.</p><p>The client then constructs a cryptographically signed authorization preventing replay and proving intent. It attaches this proof to the follow-up request in a dedicated header.</p><p>The server verifies the payment session and signature.<br> <strong>In most deployments, the settlement and verification are handled by facilitators</strong>, not the server itself.</p><p>Once verified, the server returns the requested resource.</p><p><strong>The flow is simple :</strong></p><ol><li><p>Client requests something.</p></li><li><p>Server replies with a 402 response containing how to pay.</p></li><li><p>The client signs an authorization, intending to pay.</p></li><li><p>Client retries the request with the proof.</p></li><li><p>The facilitator verifies and settles the payment</p></li><li><p>The server returns the content.</p></li></ol><p>What once required checkouts, keys, dashboards, or subscriptions now fits inside one compact handshake between machines.</p><h1 id="h-why-onchain-settlement-matters" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Why Onchain Settlement Matters</strong></h1><p>x402 isn’t built for speculative crypto. It relies on stablecoins and fast L2 settlement because:</p><ul><li><p>Payments are final and irreversible</p></li><li><p>Settlement is transparent and auditable</p></li><li><p>Confirmation happens in milliseconds</p></li><li><p>Servers can release resources with confidence</p></li></ul><p>It solves the question: <strong>How do I know the payment went through?</strong></p><p>Not by trusting a platform but by relying on deterministic, cryptographic settlement.</p><h1 id="h-the-internet-economy-x402-unlocks" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The Internet Economy x402 Unlocks</strong></h1><p>Making payments a native part of HTTP unlocks entirely new design spaces:</p><p>APIs that charge per request instead of monthly subscriptions, media that charge per article without accounts or logins, compute markets that bill per second, agents that autonomously buy tools, data, or inference time, microservices that settle dependencies automatically, and streams priced by pixel, byte, or millisecond.</p><p>The web stops depending on centralized intermediaries. It becomes <strong>programmable, fluid, and value aware</strong>.</p><h1 id="h-x402-is-a-turning-point" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>x402 is a Turning Point</strong></h1><ul><li><p>It does not replace HTTP.</p></li><li><p>It does not replace wallets.</p></li><li><p>It does not replace blockchains.</p></li></ul><p>It <strong>extends</strong> the internet’s rulebook.</p><p>Just as cookies, compression, encryption, and caching became native primitives, x402 makes <strong>payments</strong> a primitive too a subtle shift with enormous consequences.</p><p>It changes how software interacts, how value flows, and how digital services monetize.</p><p>That’s why both non-technical readers and protocol engineers feel the “click” when they see it.</p><h1 id="h-the-vision-a-value-aware-internet" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>The Vision: A Value Aware Internet</strong></h1><p>Imagine an AI agent discovering a new API, interpreting its 402 descriptor, purchasing access instantly, and integrating it without human oversight.</p><p>Imagine a browser fetching premium content without accounts, passwords, or redirects, just <strong>request → authorize → continue</strong>.</p><p>Imagine infrastructure where economics aren’t bolted on, but built in.</p><p>The internet becomes not just a network of information, but a <strong>network of value</strong>.</p><p>x402 isn’t merely a protocol. It’s the long overdue upgrade the web always needed.</p><h1 id="h-real-world-use-cases-emerging-today" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Real World Use Cases Emerging&nbsp;Today</strong></h1><p>we’re already seeing the first wave of systems that depend on x402 style, machine native payments:</p><h4 id="h-1-agent-to-agent-payments" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">1. Agent to Agent&nbsp;Payments</h4><p>Autonomous agents are beginning to operate like tiny digital workers fetching data, running tasks, calling APIs, and chaining services together. With x402, these agents can now <em>pay each other</em> for what they consume, in real time, without user intervention.<br>&nbsp;A model paying another model for inference, an agent paying for storage, or an AI purchasing access to a dataset all become seamless.</p><h4 id="h-2-per-use-apis-without-subscriptions" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">2. Per-Use APIs Without Subscriptions</h4><p>APIs can finally charge per request. No keys, no dashboards, no plans. A simple “use → pay → continue” loop.</p><h4 id="h-3-on-demand-compute" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">3. On Demand&nbsp;Compute</h4><p>Compute nodes can bill by the second or millisecond perfect for inference time, job execution, rendering, or decentralized compute networks.</p><h4 id="h-4-iot-and-device-payments" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">4. IoT and Device&nbsp;Payments</h4><p>Devices such as sensors, smart meters, or edge hardware can settle tiny payments automatically as they interact with each other or cloud services.</p><h4 id="h-5-stream-based-pricing-models" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">5. Stream Based Pricing&nbsp;Models</h4><p>Anything consumed continuously bandwidth, pixels, audio, compute cycles can now be priced dynamically and settled instantly.</p><h1 id="h-conclusion" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Conclusion</strong></h1><p>x402 finally gives the internet what it has always lacked: a native way for value to move as easily as information. By embedding payments directly into HTTP, it removes the friction of gateways, accounts, and subscriptions, allowing humans, machines, and autonomous agents to access and pay for services in a single fluid interaction.</p><p>This simple shift unlocks a web where APIs bill per request, compute charges by the second, devices settle tiny debts automatically, and digital services become truly programmable. x402 doesn’t rebuild the internet, it completes it.</p><h1 id="h-resources-and-links" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Resources &amp; Links&nbsp;:</h1><p><strong>x402 :</strong></p><div data-type="embedly" src="http://www.x402.org" data="{&quot;provider_url&quot;:&quot;https://www.x402.org&quot;,&quot;description&quot;:&quot;An open standard for internet-native payments&quot;,&quot;title&quot;:&quot;x402.org&quot;,&quot;url&quot;:&quot;https://www.x402.org/&quot;,&quot;thumbnail_width&quot;:854,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;X402&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:480,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAASCAIAAAC1qksFAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFdUlEQVR4nF3VaUyTdxwH8N/zP56WQsvRcrWVq1DOUaAF2tKWPk+vpy23cnggoLgB25x4sDJdEEUXbwWdLi5zDo/MLTo3pzGR6Azqi2WLOl+YiDvM4jZ9MbMXZslMWJ4HRLfkmyd53vw/z+94ngcACgCKAEqA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vfN2F/91P7wPHmsevrzj3qHJ608CPGgv7G7vHDp+4ayJJw7ohPv2EeeAAgS4pRNOJtYBCQqSmqso3yy1MWRQyRPaFzl3v+etL04HfHhR+qDkxYN5+xR8YtPfvzF+4oX/tZYMvFgvk7TKHt3iXHFq26suH9nza+dzuYv9Oi6U1hvHocAEiyKmzNKU19+s6BlPY1qvl9yrZ+3ab9lRcvu7+/Y7/xXcGRs6rOzZDXCqoAICeABaCCJi7I4TZZF35sKIlkZL9VWDhoKR4y5w+X5g5mJrSrGb8aXFrq0xIfZG3fp+hayTjnQ64PzHXKFYP5J7/Iv3I18+jpuDe3MrZ2UFWLgwEbxHlhXl18WVdOyxZ+8PPytv2G8nU6Y4/OsFyd1BqvCitZLhrsSuRUE4+GeBIRn8R4Yfnjx+GbN21XJz23brU9fbp4erpuerr6z0epuw8ld749r30grfOd9O5Nuu6t6ctGstqHdTURlakD5G6AcgRWLK2WnHEoiFt8OaJ8KplXI/cmxwqpMYEk1gOJG3c2Pvix5Y+Hvt9+tU3dy79ytePu1KV/nik61qBMAYwNkF0HmWFIDYOKF1dW/FXYEKlmKIdINaZuynIzXyrxY0U5FSsmTsbFUj6Ocv8CNrtc/dbFLQgAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:854,&quot;height&quot;:480,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="http://www.x402.org" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>x402.org</h2><p>An open standard for internet-native payments</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.x402.org</span></div><img src="https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg"></div></a></div></div><p><strong>Heimlabs :</strong></p><div data-type="embedly" src="http://www.heimlabs.com" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlS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H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="http://www.heimlabs.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><br><p><strong>Share your x402 experiments, the internet’s new money layer is yours to shape.</strong></p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p><br>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>x402</category>
            <category>web3</category>
            <category>blockchain</category>
            <category>aiagents</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/65d1ace808163759fb26dedf6f877dca781959ee3a10ea428db1f3c94da33ff0.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[X402 + AnySpend: Chain-Agnostic, Token-Agnostic Payments for Autonomous Agents]]></title>
            <link>https://paragraph.com/@heimlabs/x402-anyspend-chain-agnostic-token-agnostic-payments-for-autonomous-agents</link>
            <guid>oNMaUZOyj7UJFfZ302w4</guid>
            <pubDate>Wed, 19 Nov 2025 14:17:30 GMT</pubDate>
            <description><![CDATA[IntroductionX402 introduced a simple idea: let agents pay for API access using the native semantics of the web, HTTP 402. No accounts, no custodians, no browser redirects. Just a request, a payment prompt, and a retry with a signed authorization. But X402 originally operated on a single chain and token, which restricted how widely agents could function. AnySpend removes those limits. It keeps the familiar X402 flow exactly as it is, while adding the ability to pay with any token on any chain....]]></description>
            <content:encoded><![CDATA[<h2 id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Introduction</strong></h2><p>X402 introduced a simple idea: let agents pay for API access using the native semantics of the web, HTTP 402. No accounts, no custodians, no browser redirects. Just a request, a payment prompt, and a retry with a signed authorization.</p><p>But X402 originally operated on a single chain and token, which restricted how widely agents could function.</p><p><strong>AnySpend removes those limits.</strong></p><p>It keeps the familiar X402 flow exactly as it is, while adding the ability to pay with <em>any token on any chain</em>. Under the hood, AnySpend performs swaps, bridging, and settlement, completely invisible to the buyer and seller.</p><p>With this upgrade, X402 becomes a universal, chain-agnostic payment layer for agents.</p><hr><h3 id="h-why-this-matters-for-autonomous-agents" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Why This Matters for Autonomous Agents</h3><p>Agents rarely hold the “correct” asset for every service.<br>One might have USDC on Base, another might earn fees in ETH on Optimism, while a service might settle in DAI on Ethereum.</p><p>Before AnySpend, these mismatches broke automation.<br>Now, they don’t matter.</p><ul><li><p>Agents pay with whatever they already have</p></li><li><p>Sellers receive exactly what they want</p></li><li><p>No one has to orchestrate routing or bridging logic</p></li></ul><p>This allows autonomous systems to operate fluidly across chains and economies.</p><h3 id="h-implementation" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Implementation</h3><p>Let’s walk through how to set up both server and client that charges users for API access using Anyspend X402.</p><p>We’ll be building a weather API that requires payment before access. Users can pay with any tokens to access the weather endpoint, but the server requires B3 tokens on the Base network.</p><p>(Watch the video here)</p><div data-type="youtube" videoid="wZB_RvNuQsM">
      <div class="youtube-player" data-id="wZB_RvNuQsM" style="background-image: url('https://i.ytimg.com/vi/wZB_RvNuQsM/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=wZB_RvNuQsM">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><h3 id="h-setting-up-the-express-server" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Setting Up the Express&nbsp;Server</h3><p>First, let’s start with a basic Express setup. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.</p><pre data-type="codeBlock" text="import express from &quot;express&quot;;
import { config } from &quot;dotenv&quot;;

config();

const app = express();
app.use(express.json());"><code><span class="hljs-keyword">import</span> <span class="hljs-title">express</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"express"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">config</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"dotenv"</span>;

config();

const app <span class="hljs-operator">=</span> express();
app.use(express.json());</code></pre><p>Here, we:</p><ul><li><p>Import Express and dotenv for environment variable management</p></li><li><p>Load environment variables from a&nbsp;.env file</p></li><li><p>Create an Express application instance</p></li><li><p>Configure Express to parse JSON request bodies</p></li></ul><p>To enable payment functionality, we need to install and import two key libraries from the Anyspend X402 ecosystem:</p><p><em>@b3dotfun/anyspend-x402-express</em> — Provides Express middleware for handling payments</p><p><em>@b3dotfun/anyspend-x402</em> — Core library with facilitator configuration utilities</p><p><em>@b3dotfun/anyspend-x402-fetch</em> — library that extends the standard fetch API with payment capabilities</p><pre data-type="codeBlock" text="import { paymentMiddleware } from &quot;@b3dotfun/anyspend-x402-express&quot;;
import {
 createFacilitatorConfig,
} from '@b3dotfun/anyspend-x402';
import { FacilitatorConfig } from &quot;@b3dotfun/anyspend-x402/types&quot;;"><code><span class="hljs-keyword">import</span> { paymentMiddleware } <span class="hljs-keyword">from</span> <span class="hljs-string">"@b3dotfun/anyspend-x402-express"</span>;
<span class="hljs-keyword">import</span> {
 createFacilitatorConfig,
} <span class="hljs-keyword">from</span> <span class="hljs-string">'@b3dotfun/anyspend-x402'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title class_">FacilitatorConfig</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">"@b3dotfun/anyspend-x402/types"</span>;</code></pre><p>The <em>paymentMiddleware</em> is what we’ll use to protect our API routes, while <em>createFacilitatorConfig</em> helps us set up the facilitator configuration that handles payment processing.</p><h3 id="h-setting-up-the-facilitator-url" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Setting Up the Facilitator URL</h3><p>The facilitator is a service that handles payment verification and processing. In our case, we’re using the mainnet facilitator:</p><pre data-type="codeBlock" text="const facilitatorUrl = &quot;https://mainnet.anyspend.com/x402&quot;;
const payTo = &quot;0x6aed5ca43987221f41ba4bb2ebe29a7f583a53ff&quot; as `0x${string}`"><code>const <span class="hljs-attr">facilitatorUrl</span> = <span class="hljs-string">"https://mainnet.anyspend.com/x402"</span><span class="hljs-comment">;</span>
const <span class="hljs-attr">payTo</span> = <span class="hljs-string">"0x6aed5ca43987221f41ba4bb2ebe29a7f583a53ff"</span> as `<span class="hljs-number">0</span>x<span class="hljs-variable">${string}</span>`</code></pre><p>This URL points to the production Anyspend facilitator service that will verify payments on the blockchain before allowing requests to proceed.</p><p>The <em>payTo</em> address is the cryptocurrency address where payments will be sent. This is your revenue address:</p><p>All payments for API access will be sent to this <em>payTo</em> address. Make sure this is an address you control!</p><h3 id="h-setting-up-the-facilitator-config" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Setting Up the Facilitator Config</h3><p>The facilitator configuration tells the payment system how to interact with the facilitator service:</p><pre data-type="codeBlock" text="const facilitatorConfig: FacilitatorConfig = { 
 …createFacilitatorConfig(), 
 url: facilitatorUrl 
};"><code>const facilitatorConfig: <span class="hljs-attr">FacilitatorConfig</span> = { 
 …createFacilitatorConfig(), 
 url: facilitatorUrl 
}<span class="hljs-comment">;</span></code></pre><p>We use createFacilitatorConfig() to get default configuration settings.This configuration will be passed to the payment middleware to handle payment verification.</p><h3 id="h-defining-the-payment-middleware" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Defining the Payment Middleware</h3><p>Now comes the exciting part, setting up the payment middleware. This middleware will intercept requests to protected routes and verify that payment has been made before allowing access:</p><pre data-type="codeBlock" text="app.use(
 paymentMiddleware(
 payTo,
 {
 // Cross-chain: Accept B3 on Base 
 &quot;GET /weather&quot;: {
 price: {
 amount: '1000000000000000', // 0.001 B3 tokens (18 decimals)
 asset: {
 address: '0xB3B32F9f8827D4634fE7d973Fa1034Ec9fdDB3B3',
 decimals: 18,
 eip712: {
 name: 'B3',
 version: '1',
 },
 },
 },
 network: &quot;base&quot;,
 config: {
 description: &quot;Premium weather content paid with B3 on base&quot;,
 },
 },
 },
 facilitatorConfig,
 ),
);"><code><span class="hljs-selector-tag">app</span><span class="hljs-selector-class">.use</span>(
 <span class="hljs-built_in">paymentMiddleware</span>(
 payTo,
 {
 <span class="hljs-comment">// Cross-chain: Accept B3 on Base </span>
 <span class="hljs-string">"GET /weather"</span>: {
 <span class="hljs-attribute">price</span>: {
 <span class="hljs-attribute">amount</span>: <span class="hljs-string">'1000000000000000'</span>, <span class="hljs-comment">// 0.001 B3 tokens (18 decimals)</span>
 <span class="hljs-attribute">asset</span>: {
 <span class="hljs-attribute">address</span>: <span class="hljs-string">'0xB3B32F9f8827D4634fE7d973Fa1034Ec9fdDB3B3'</span>,
 <span class="hljs-attribute">decimals</span>: <span class="hljs-number">18</span>,
 <span class="hljs-attribute">eip712</span>: {
 <span class="hljs-attribute">name</span>: <span class="hljs-string">'B3'</span>,
 <span class="hljs-attribute">version</span>: <span class="hljs-string">'1'</span>,
 },
 },
 },
 <span class="hljs-attribute">network</span>: <span class="hljs-string">"base"</span>,
 <span class="hljs-attribute">config</span>: {
 <span class="hljs-attribute">description</span>: <span class="hljs-string">"Premium weather content paid with B3 on base"</span>,
 },
 },
 },
 facilitatorConfig,
 ),
);</code></pre><p>Let’s break down what’s happening here:</p><ul><li><p><strong>payTo</strong>: The address that receives payments</p></li><li><p><strong>Route</strong> configuration: We’re protecting the GET /weather endpoint</p></li><li><p><strong>Price</strong>: Set to 1000000000000000 wei (0.001 B3 tokens, since B3 has 18 decimals)</p></li><li><p><strong>Asset</strong>: The B3 token contract address on Base network</p></li><li><p><strong>Network</strong>: “base” — we’re accepting payments on the Base network</p></li><li><p><strong>Description</strong>: A human-readable description of what the payment is for</p></li></ul><p>The middleware will automatically:</p><ol><li><p>Check if a valid payment proof is included in the request</p></li><li><p>Verify the payment with the facilitator</p></li><li><p>Allow the request to proceed if payment is valid</p></li><li><p>Reject the request if payment is missing or invalid</p></li></ol><h3 id="h-plugging-it-in-with-the-weather-api" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Plugging It In with the Weather&nbsp;API</h3><p>Finally, we define our actual weather endpoint. This is a simple endpoint that returns weather data:</p><pre data-type="codeBlock" text="app.get(&quot;/weather&quot;, (req, res) =&gt; {
 res.send({
 report: {
 weather: &quot;sunny&quot;,
 temperature: 70,
 },
 });
});"><code>app.get(<span class="hljs-string">"/weather"</span>, (req, res) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
 res.<span class="hljs-built_in">send</span>({
 report: {
 weather: <span class="hljs-string">"sunny"</span>,
 temperature: <span class="hljs-number">70</span>,
 },
 });
});</code></pre><p>Because we’ve applied the payment middleware earlier, this endpoint is now protected. Users must include a valid payment proof in their request headers to access this endpoint.</p><h3 id="h-starting-the-server" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Starting the&nbsp;Server</h3><p>We start the server on port 4021:</p><pre data-type="codeBlock" text="app.listen(4021, () =&gt; {
 console.log(`Multi-token server listening at http://localhost:${4021}`);
});"><code>app.listen(<span class="hljs-number">4021</span>, () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
 console.log(`Multi<span class="hljs-operator">-</span>token server listening at http:<span class="hljs-comment">//localhost:${4021}`);</span>
});</code></pre><h3 id="h-setting-up-the-client" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Setting up the&nbsp;client</h3><p>The client uses a wrapped fetch function that automatically handles payment processing, so you can make API calls just like you would with regular HTTP requests, but with built-in cryptocurrency payment support.</p><p>But first, we need to configure our environment variables. The client requires a private key for signing transactions and an optional API URL:</p><pre data-type="codeBlock" text="import { config } from &quot;dotenv&quot;;
config();
const privateKey = process.env.PRIVATE_KEY as Hex | string;
const apiUrl = process.env.API_URL || &quot;http://localhost:3001&quot;;
const MAX_PAYMENT_VALUE = BigInt(&quot;5000000000000000000&quot;); // 5 ethers max"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">config</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"dotenv"</span>;
config();
const privateKey <span class="hljs-operator">=</span> process.env.PRIVATE_KEY <span class="hljs-keyword">as</span> Hex <span class="hljs-operator">|</span> <span class="hljs-keyword">string</span>;
const apiUrl <span class="hljs-operator">=</span> process.env.API_URL <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">"http://localhost:3001"</span>;
const MAX_PAYMENT_VALUE <span class="hljs-operator">=</span> BigInt(<span class="hljs-string">"5000000000000000000"</span>); <span class="hljs-comment">// 5 ethers max</span></code></pre><p>Here’s what each variable does:</p><ul><li><p><strong>PRIVATE_KEY</strong>: Your Ethereum private key used to sign payment transactions. This should be kept secret and stored in a&nbsp;.env file.</p></li><li><p><strong>API_URL</strong>: The base URL of the API server. Defaults to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://localhost:3001">http://localhost:3001</a> if not provided.</p></li><li><p><strong>MAX_PAYMENT_VALUE</strong>: A safety limit for maximum payment amount (5 ETH in this case) to prevent accidental overpayments.</p></li></ul><h3 id="h-installing-and-importing-the-client-library" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Installing and Importing the Client&nbsp;Library</h3><p>The client uses <em>@b3dotfun/anyspend-x402-fetch</em>, a library that extends the standard fetch API with payment capabilities:</p><pre data-type="codeBlock" text="import {
 decodeXPaymentResponse,
 wrapFetchWithPayment,
 createSigner,
 type Hex,
} from &quot;@b3dotfun/anyspend-x402-fetch&quot;;"><code><span class="hljs-keyword">import</span> {
 decodeXPaymentResponse,
 wrapFetchWithPayment,
 createSigner,
 <span class="hljs-built_in">type</span> Hex,
} <span class="hljs-keyword">from</span> <span class="hljs-string">"@b3dotfun/anyspend-x402-fetch"</span>;</code></pre><p>Let’s break down these imports:</p><ul><li><p><strong>wrapFetchWithPayment</strong>: The main function that wraps the standard fetch to add automatic payment handling</p></li><li><p><strong>createSigner</strong>: Creates a cryptographic signer from a private key for signing payment transactions</p></li><li><p><strong>decodeXPaymentResponse</strong>: Decodes payment information from API response headers</p></li><li><p><strong>Hex</strong>: TypeScript type for hexadecimal strings (Ethereum addresses, transaction hashes, etc.)</p></li></ul><h3 id="h-creating-a-signer" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Creating a&nbsp;Signer</h3><p>Before we can make paid requests, we need to create a signer that will sign payment transactions on behalf of the user:</p><p>const network = “ethereum”<br>const signer = <strong>await</strong> createSigner(network, privateKey);</p><p>The signer:</p><ul><li><p>Takes a network identifier (in this case, “ethereum”)</p></li><li><p>Uses your private key to sign transactions</p></li><li><p>Enables the client to authorize payments automatically</p></li></ul><p>The signer is what allows the wrapped fetch function to create and sign payment transactions without requiring manual wallet interactions for each request.</p><h3 id="h-wrapping-fetch-with-payment" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Wrapping Fetch with&nbsp;Payment</h3><p>This is where the magic happens. We wrap the standard fetch function to add automatic payment processing:</p><pre data-type="codeBlock" text="const fetchWithPayment = wrapFetchWithPayment(
 fetch, 
 signer, 
 MAX_PAYMENT_VALUE, 
 undefined, 
 undefined, 
 {
 preferredNetwork: network,
 preferredToken: &quot;0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&quot; // $USDC token on ethereum
 }
);"><code><span class="hljs-keyword">const</span> fetchWithPayment = <span class="hljs-title function_">wrapFetchWithPayment</span>(
 fetch, 
 signer, 
 <span class="hljs-variable constant_">MAX_PAYMENT_VALUE</span>, 
 <span class="hljs-literal">undefined</span>, 
 <span class="hljs-literal">undefined</span>, 
 {
 <span class="hljs-attr">preferredNetwork</span>: network,
 <span class="hljs-attr">preferredToken</span>: <span class="hljs-string">"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"</span> <span class="hljs-comment">// $USDC token on ethereum</span>
 }
);</code></pre><p>Let’s understand each parameter:</p><ul><li><p><strong>fetch</strong>: The standard fetch function to wrap</p></li><li><p><strong>signer</strong>: The signer we created earlier for authorizing payments</p></li><li><p><strong>MAX_PAYMENT_VALUE</strong>: Maximum payment amount as a safety limit.</p></li></ul><p>Configuration object:</p><ul><li><p><strong>preferredNetwork</strong>: The blockchain network to use for payments (“ethereum” in this case)</p></li><li><p><strong>preferredToken</strong>: The token contract address to use for payments (USDC on Ethereum)</p></li></ul><h3 id="h-making-the-api-call" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Making the API&nbsp;Call</h3><p>With our payment-enabled fetch function, making a paid API call is as simple as a regular HTTP request:</p><p>const response = <strong>await</strong> fetchWithPayment(`${apiUrl}/weather`, {<br>&nbsp;method: “GET”,<br>});</p><p>The wrapped fetch handles all the payment complexity behind the scenes. If the API requires payment, it will:</p><ul><li><p>Check the payment requirements from the API</p></li><li><p>Create and sign a payment transaction</p></li><li><p>Include the signature in the request</p></li><li><p>Then retries the API call</p></li></ul><h3 id="h-handling-payment-responses" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Handling Payment Responses</h3><p>The API server includes payment information in response headers. We can extract and decode this information:</p><pre data-type="codeBlock" text="// Get payment response header
const paymentResponseHeader = response.headers.get(&quot;X-PAYMENT-RESPONSE&quot;);
if (paymentResponseHeader) {
 const paymentInfo = decodeXPaymentResponse(paymentResponseHeader);
 console.log(JSON.stringify(paymentInfo, null, 2));
}"><code><span class="hljs-comment">// Get payment response header</span>
const paymentResponseHeader <span class="hljs-operator">=</span> response.headers.get(<span class="hljs-string">"X-PAYMENT-RESPONSE"</span>);
<span class="hljs-keyword">if</span> (paymentResponseHeader) {
 const paymentInfo <span class="hljs-operator">=</span> decodeXPaymentResponse(paymentResponseHeader);
 console.log(JSON.stringify(paymentInfo, null, <span class="hljs-number">2</span>));
}</code></pre><p>The X-PAYMENT-RESPONSE header contains encoded payment details such as:</p><ul><li><p>Transaction hash</p></li><li><p>Payment amount</p></li><li><p>Token used</p></li><li><p>Network</p></li><li><p>Timestamp</p></li></ul><p>This is useful for tracking payments, displaying receipts, or debugging payment issues.</p><h3 id="h-handling-errors" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Handling Errors</h3><p>We include comprehensive error handling:</p><pre data-type="codeBlock" text="if (!response.ok) {
 const errorData = await response.json();
 console.error(&quot;❌ Request failed:&quot;);
 console.error(JSON.stringify(errorData, null, 2));
 return;
}"><code><span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>response.ok) {
 const errorData <span class="hljs-operator">=</span> await response.json();
 console.error(<span class="hljs-string">"❌ Request failed:"</span>);
 console.error(JSON.stringify(errorData, null, <span class="hljs-number">2</span>));
 <span class="hljs-keyword">return</span>;
}</code></pre><p>If the API call fails (due to payment issues, network problems, or API errors), we:</p><ul><li><p>Check if the response is not OK</p></li><li><p>Parse the error response</p></li><li><p>Display it in a readable format</p></li><li><p>Exit gracefully</p></li></ul><h3 id="h-processing-the-response-data" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Processing the Response&nbsp;Data</h3><p>Finally, we extract and display the actual API response:</p><pre data-type="codeBlock" text="// Get the response data
const data = await response.json();
console.log(JSON.stringify(data, null, 2));"><code><span class="hljs-comment">// Get the response data</span>
const data <span class="hljs-operator">=</span> await response.json();
console.log(JSON.stringify(data, null, <span class="hljs-number">2</span>));</code></pre><p>In our weather API example, this would display:</p><pre data-type="codeBlock" text="{
 &quot;report&quot;: {
 &quot;weather&quot;: &quot;sunny&quot;,
 &quot;temperature&quot;: 70
 }
}"><code><span class="hljs-punctuation">{</span>
 <span class="hljs-attr">"report"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
 <span class="hljs-attr">"weather"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"sunny"</span><span class="hljs-punctuation">,</span>
 <span class="hljs-attr">"temperature"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">70</span>
 <span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">}</span></code></pre><hr><h2 id="h-how-the-flow-works" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>How the Flow Works&nbsp;</strong></h2><p>The X402 flow stays exactly the same:</p><ol><li><p><strong>Client requests a resource</strong></p></li><li><p><strong>Server responds with 402 + payment details</strong></p></li><li><p><strong>Client retries with a signed payment authorization</strong></p></li><li><p><strong>Service grants access</strong></p></li></ol><p>The only difference now is <em>what the facilitator is capable of</em>.</p><p>Once the signed message arrives, <strong>AnySpend handles everything else</strong>:</p><ul><li><p>Validates the signature (EIP-2612 / EIP-3009 typed data)</p></li><li><p>Pulls the specified funds</p></li><li><p>Swaps the token if needed</p></li><li><p>Bridges to the seller’s chain, if needed</p></li><li><p>Settles in the seller’s preferred token</p></li></ul><p>To the client, nothing changes.<br>To the seller, everything becomes interoperable.</p><hr><h2 id="h-security-model" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Security Model</strong></h2><p>The security guarantees come from the signature standards themselves—not the facilitator.</p><ul><li><p><strong>Standard signature with </strong>EIP 2612 and EIP 3009, which offers <strong>replay protection</strong> via nonces</p></li><li><p><strong>Signature expiration</strong> via deadlines</p></li><li><p><strong>Signer verification</strong> via EIP-712 address recovery by the contract</p></li></ul><p><strong>A facilitator cannot forge or spoof signatures<br></strong>AnySpend only executes what the wallet owner explicitly authorizes.</p><hr><h2 id="h-developer-integration" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Developer Integration</strong></h2><p>AnySpend is designed so both sides can integrate easily:</p><h3 id="h-for-sellers" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>For Sellers</strong></h3><ul><li><p>Express middleware to monetize any endpoint with a 402 paywall</p></li><li><p>Settlement configuration (desired chain + token)</p></li><li><p>REST API for low-level control</p></li></ul><h3 id="h-for-buyersagents" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>For Buyers/Agents</strong></h3><ul><li><p>Client SDK for easy integration.</p></li><li><p>Preparing and signing typed-data payments is handled automatically.</p></li><li><p>Drop-in compatibility with existing X402 agent scripts</p></li></ul><p>The integration experience remains simple and consistent.</p><hr><h2 id="h-a-simple-mental-model" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>A Simple Mental Model</strong></h2><p><strong>You keep writing X402 the way you always have.<br> AnySpend makes it work everywhere.</strong></p><p>That’s the entire upgrade.</p><hr><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Conclusion</strong></h2><p>X402 keeps the simple flow, and AnySpend extends it across chains and assets. Agents pay with what they have, services settle how they prefer, and the whole loop stays automated.</p><hr><h2 id="h-resources" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Resources</h2><p><br><strong>AnySpend Website</strong></p><div data-type="embedly" src="https://anyspend.com" data="{&quot;provider_url&quot;:&quot;https://anyspend.com&quot;,&quot;description&quot;:&quot;AnySpend is a secure cross-chain crypto swapping platform that lets you seamlessly trade tokens across any blockchain network. Get the best rates, fast transactions, and easy token swaps between Base, Ethereum, Solana, and other major chains.&quot;,&quot;title&quot;:&quot;AnySpend - Swap &amp; trade crypto tokens from any chain&quot;,&quot;mean_alpha&quot;:212.283,&quot;thumbnail_width&quot;:500,&quot;url&quot;:&quot;https://anyspend.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/418bd99861ae08f4f39729ec11698bcf61acc5f86bba995e979d168dea83a598.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;AnySpend - Swap &amp; trade crypto tokens from any chain&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:500,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAACXBIWXMAAAsTAAALEwEAmpwYAAAH2UlEQVR4nJ2We1BT2R3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9eL6Bqm09muxWCxpapIpFAqlUqXVanU63UPsoVb7QKPRir8W6/VdzJ/GhoYGeE07OByEUDBMPBqe6Bj0QUxMDADEsFhXrlxVqrX3dR114lulpVdEIpFUKpXLW2RNTQ2Shuqqagx7ODbu0D5ob73XGqQv4YMHDwLAT9dv/Pn+g28f2A8FB7+f9G7C8hUWq20mgGAymXp7e00mU319w62GxnsqjUqjxTB9/4BRLpc3NNw2m80Wq9VoemYyPXv67LlSpWlrUwaDFCAvLw8A/niAt1v0j5QaCQiuwLKlCe+8Mzo6Su9ihCDoo4JBVVXXVFbXKtXtWOcj4/NBDNPv/TjnZvXNzoedo1br4NDwvwx9D/WPZLJv7ioUcwFbNmZ+nn8t9/il7acvLf3J6h/Fx1ssllkPmAuPSq+KGzViyT8xfVd3r9Vml0qlmZyMmps1j7u7DX39Twx97boOpVpbVy9tbmmZC8h9q1CUqrr0B9npI/XLE1bHL317LuDfg3Bl0VZjqA0AAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:500,&quot;height&quot;:500,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/418bd99861ae08f4f39729ec11698bcf61acc5f86bba995e979d168dea83a598.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/418bd99861ae08f4f39729ec11698bcf61acc5f86bba995e979d168dea83a598.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://anyspend.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>AnySpend - Swap &amp; trade crypto tokens from any chain</h2><p>AnySpend is a secure cross-chain crypto swapping platform that lets you seamlessly trade tokens across any blockchain network. Get the best rates, fast transactions, and easy token swaps between Base, Ethereum, Solana, and other major chains.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://anyspend.com</span></div><img src="https://storage.googleapis.com/papyrus_images/418bd99861ae08f4f39729ec11698bcf61acc5f86bba995e979d168dea83a598.png"></div></a></div></div><p><strong>HeimLabs</strong></p><div data-type="embedly" src="https://www.heimlabs.com" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpL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9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p>This is the foundation of open, intelligent, multi-chain autonomous commerce.</p><p>Share what you’re building with the CDP stack!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span><br></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>web3</category>
            <category>x402</category>
            <category>anyspend</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/b9f9bbf51cf525951ee5a8efa502b0473b503175e0f3667a50d53052f31c6d1a.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Build Secure Onchain Apps with Server Wallets V2 (Python Walkthrough)]]></title>
            <link>https://paragraph.com/@heimlabs/build-secure-onchain-apps-with-server-wallets-v2-python-walkthrough</link>
            <guid>t2CkHLe3tsmUv4imkVHN</guid>
            <pubDate>Tue, 04 Nov 2025 14:27:04 GMT</pubDate>
            <description><![CDATA[Today, let’s talk about a common pain point in the blockchain ecosystem. If you want your users to enjoy a web2-like experience in an onchain application, you have to hide all the complexities, such as managing wallets, enforcing compliance rules, and sometimes even sponsoring gas. Doing all this securely and at scale is tough. That’s where Server Wallets from Coinbase Developer Platform (CDP) come in. They let you create and manage wallets programmatically, send transactions, enf...]]></description>
            <content:encoded><![CDATA[<h2 id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Introduction</strong></h2><p>Today, let’s talk about a common pain point in the blockchain ecosystem.</p><p>If you want your users to enjoy a web2-like experience in an onchain application, you have to hide all the complexities, such as managing wallets, enforcing compliance rules, and sometimes even sponsoring gas. Doing all this securely and at scale is tough.</p><p>That’s where <strong>Server Wallets from Coinbase Developer Platform (CDP)</strong> come in.<br>They let you create and manage wallets programmatically, send transactions, enforce policies, and sponsor gas all through secure APIs. You can focus on your app logic while CDP handles the cryptography and infrastructure.</p><p>In our previous video, we covered how CDP secures private keys and how the wallet infrastructure works behind the scenes.<br>This time, we’re going hands-on with <strong>Python SDK</strong> (also available in TypeScript).</p><h2 id="h-what-youll-build" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What You’ll Build</strong></h2><p>By the end of this walkthrough, you’ll be able to:</p><ul><li><p><span data-name="gear" class="emoji" data-type="emoji">⚙</span> Set up the CDP SDK and securely manage environment variables</p></li><li><p><span data-name="key" class="emoji" data-type="emoji">🔑</span> Create new Ethereum accounts and import existing ones</p></li><li><p><span data-name="money_with_wings" class="emoji" data-type="emoji">💸</span> Send transactions and fetch balances</p></li><li><p><span data-name="jigsaw" class="emoji" data-type="emoji">🧩</span> Enforce policies with both failing and successful examples</p></li><li><p><span data-name="fuelpump" class="emoji" data-type="emoji">⛽</span> Enable gas sponsorship for seamless, gasless UX</p></li></ul><p>(Watch the Full Video here)</p><div data-type="youtube" videoid="FPu-GSorT4o">
      <div class="youtube-player" data-id="FPu-GSorT4o" style="background-image: url('https://i.ytimg.com/vi/FPu-GSorT4o/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=FPu-GSorT4o">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><h2 id="h-step-by-step-walkthrough" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Step-by-Step Walkthrough</strong></h2><h2 id="h-step-1-sdk-setup" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Step 1: SDK Setup</strong></h2><p>Create a <code>requirements.txt</code>file and add these inside it:</p><pre data-type="codeBlock" text="cdp-sdk&gt;=0.0.1
python-dotenv&gt;=1.0.0
web3&gt;=6.0.0
cryptography&gt;=41.0.0
eth-account&gt;=0.13.0"><code>cdp<span class="hljs-operator">-</span>sdk<span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span><span class="hljs-number">0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>
python<span class="hljs-operator">-</span>dotenv<span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span><span class="hljs-number">1.0</span><span class="hljs-number">.0</span>
web3<span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span><span class="hljs-number">6.0</span><span class="hljs-number">.0</span>
cryptography<span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span><span class="hljs-number">41.0</span><span class="hljs-number">.0</span>
eth<span class="hljs-operator">-</span>account<span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span><span class="hljs-number">0</span><span class="hljs-number">.13</span><span class="hljs-number">.0</span></code></pre><p>Then run this below command in your terminal:</p><pre data-type="codeBlock" text="pip install -r requirements.txt"><code>pip install <span class="hljs-operator">-</span>r requirements.txt</code></pre><p>Then we’ll create a reusable singleton instance of the CDP client inside <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://utils.py"><u>utils.py</u></a></p><pre data-type="codeBlock" text="# Singleton CDP client instance
_cdp_instance = None

async def get_cdp_client() -&gt; CdpClient:
 &quot;&quot;&quot;
 Get or create a singleton CDP client instance
 &quot;&quot;&quot;
 global _cdp_instance
 
 if _cdp_instance is None:
 # Verify environment variables
 api_key_id = os.getenv('CDP_API_KEY_ID')
 api_key_secret = os.getenv('CDP_API_KEY_SECRET')
 wallet_secret = os.getenv('CDP_WALLET_SECRET')
 
 if not all([api_key_id, api_key_secret, wallet_secret]):
 raise ValueError(&quot;Missing required environment variables. Please check your .env file.&quot;)
 
 _cdp_instance = CdpClient()
 
 return _cdp_instance"><code><span class="hljs-comment"># Singleton CDP client instance</span>
_cdp_instance = <span class="hljs-literal">None</span>

<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">get_cdp_client</span>() -&gt; CdpClient:
 <span class="hljs-string">"""
 Get or create a singleton CDP client instance
 """</span>
 <span class="hljs-keyword">global</span> _cdp_instance
 
 <span class="hljs-keyword">if</span> _cdp_instance <span class="hljs-keyword">is</span> <span class="hljs-literal">None</span>:
 <span class="hljs-comment"># Verify environment variables</span>
 api_key_id = os.getenv(<span class="hljs-string">'CDP_API_KEY_ID'</span>)
 api_key_secret = os.getenv(<span class="hljs-string">'CDP_API_KEY_SECRET'</span>)
 wallet_secret = os.getenv(<span class="hljs-string">'CDP_WALLET_SECRET'</span>)
 
 <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> <span class="hljs-built_in">all</span>([api_key_id, api_key_secret, wallet_secret]):
 <span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">"Missing required environment variables. Please check your .env file."</span>)
 
 _cdp_instance = CdpClient()
 
 <span class="hljs-keyword">return</span> _cdp_instance</code></pre><h2 id="h-step-2-create-and-import-accounts" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Step 2: Create and Import Accounts</strong></h2><p>Creating, fetching, or importing accounts is very straightforward with server wallets</p><p>You can create an account using</p><pre data-type="codeBlock" text="cdp = await get_cdp_client()
 
 # Create Alice — a new account
 timestamp = datetime.now().strftime(“%Y%m%d%H%M%S”)
 alice = await cdp.evm.create_or_get_account(name=f”demo-account-new-20251001002758&quot;)
 print(f”Alice: {alice.address}”)"><code>cdp <span class="hljs-operator">=</span> await get_cdp_client()
 
 # Create Alice — a <span class="hljs-keyword">new</span> account
 timestamp <span class="hljs-operator">=</span> datetime.now().strftime(“<span class="hljs-operator">%</span>Y<span class="hljs-operator">%</span>m<span class="hljs-operator">%</span>d<span class="hljs-operator">%</span>H<span class="hljs-operator">%</span>M<span class="hljs-operator">%</span>S”)
 alice <span class="hljs-operator">=</span> await cdp.evm.create_or_get_account(name<span class="hljs-operator">=</span>f”demo<span class="hljs-operator">-</span>account<span class="hljs-operator">-</span><span class="hljs-keyword">new</span><span class="hljs-number">-20251001002758</span><span class="hljs-string">")
 print(f”Alice: {alice.address}”)</span></code></pre><p>To import an account using an existing private key</p><pre data-type="codeBlock" text="# Import Bob — from private key
 bob_key = BOB_PRIVATE_KEY[2:] if BOB_PRIVATE_KEY.startswith(‘0x’) else BOB_PRIVATE_KEY
 
 # Calculate the expected address from the private key
 eth_account = Account.from_key(BOB_PRIVATE_KEY)
 expected_address = eth_account.address
 bob = await cdp.evm.import_account(
 private_key=bob_key,
 name=f”bob-{timestamp}”
 )
 print(f”Bob: {bob.address}”)"><code># Import Bob — <span class="hljs-keyword">from</span> <span class="hljs-keyword">private</span> key
 bob_key <span class="hljs-operator">=</span> BOB_PRIVATE_KEY[<span class="hljs-number">2</span>:] <span class="hljs-keyword">if</span> BOB_PRIVATE_KEY.startswith(‘0x’) <span class="hljs-keyword">else</span> BOB_PRIVATE_KEY
 
 # Calculate the expected <span class="hljs-keyword">address</span> <span class="hljs-keyword">from</span> the <span class="hljs-keyword">private</span> key
 eth_account <span class="hljs-operator">=</span> Account.from_key(BOB_PRIVATE_KEY)
 expected_address <span class="hljs-operator">=</span> eth_account.<span class="hljs-built_in">address</span>
 bob <span class="hljs-operator">=</span> await cdp.evm.import_account(
 private_key<span class="hljs-operator">=</span>bob_key,
 name<span class="hljs-operator">=</span>f”bob<span class="hljs-operator">-</span>{timestamp}”
 )
 print(f”Bob: {bob.<span class="hljs-built_in">address</span>}”)</code></pre><h2 id="h-step-3-send-a-transaction-and-fetch-balances" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Step 3: Send a Transaction &amp; Fetch Balances</strong></h2><p>You can use <code>evm.send_transaction</code>from the cdp client to initialise a transaction</p><pre data-type="codeBlock" text="tx_response = await cdp.evm.send_transaction(
 address=alice.address,
 transaction=TransactionRequestEIP1559(
 to=bob.address,
 value=w3.to_wei(amount_eth, “ether”),
 ),
 network=NETWORK,
 )"><code>tx_response <span class="hljs-operator">=</span> await cdp.evm.send_transaction(
 <span class="hljs-keyword">address</span><span class="hljs-operator">=</span>alice.<span class="hljs-built_in">address</span>,
 transaction<span class="hljs-operator">=</span>TransactionRequestEIP1559(
 to<span class="hljs-operator">=</span>bob.<span class="hljs-built_in">address</span>,
 value<span class="hljs-operator">=</span>w3.to_wei(amount_eth, “<span class="hljs-literal">ether</span>”),
 ),
 network<span class="hljs-operator">=</span>NETWORK,
 )</code></pre><p>And in the same way to fetch the balance of the user we use <code>list_token_balances</code>as below</p><pre data-type="codeBlock" text="balances = await cdp.evm.list_token_balances(
 address=address,
 network=NETWORK
 )"><code>balances <span class="hljs-operator">=</span> await cdp.evm.list_token_balances(
 <span class="hljs-keyword">address</span><span class="hljs-operator">=</span><span class="hljs-keyword">address</span>,
 network<span class="hljs-operator">=</span>NETWORK
 )</code></pre><p>This will provide the entire list of tokens the user is holding, and can be parsed as follow</p><pre data-type="codeBlock" text="if balances:
 balance_list = balances.balances if hasattr(balances, ‘balances’) else balances
 
 print(f”{address}:”)
 for balance in balance_list:
 symbol = balance.token.symbol if hasattr(balance, ‘token’) else ‘ETH’
 if hasattr(balance, ‘amount’) and hasattr(balance.amount, ‘amount’):
 amount = balance.amount.amount
 decimals = balance.amount.decimals if hasattr(balance.amount, ‘decimals’) else 18
 readable_amount = amount / (10 ** decimals)
 print(f” {symbol}: {readable_amount}”)
 
 return balances"><code><span class="hljs-keyword">if</span> balances:
 balance_list <span class="hljs-operator">=</span> balances.balances <span class="hljs-keyword">if</span> hasattr(balances, ‘balances’) <span class="hljs-keyword">else</span> balances
 
 print(f”{<span class="hljs-keyword">address</span>}:”)
 <span class="hljs-keyword">for</span> balance in balance_list:
 symbol <span class="hljs-operator">=</span> balance.token.symbol <span class="hljs-keyword">if</span> hasattr(balance, ‘token’) <span class="hljs-keyword">else</span> ‘ETH’
 <span class="hljs-keyword">if</span> hasattr(balance, ‘amount’) and hasattr(balance.amount, ‘amount’):
 amount <span class="hljs-operator">=</span> balance.amount.amount
 decimals <span class="hljs-operator">=</span> balance.amount.decimals <span class="hljs-keyword">if</span> hasattr(balance.amount, ‘decimals’) <span class="hljs-keyword">else</span> <span class="hljs-number">18</span>
 readable_amount <span class="hljs-operator">=</span> amount <span class="hljs-operator">/</span> (<span class="hljs-number">10</span> <span class="hljs-operator">*</span><span class="hljs-operator">*</span> decimals)
 print(f” {symbol}: {readable_amount}”)
 
 <span class="hljs-keyword">return</span> balances</code></pre><h2 id="h-step-4-enforce-policies" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Step 4: Enforce Policies</strong></h2><p>CDP Server Wallets allow you to attach policies that define allowed actions or spending limits.<br>For example, a policy might restrict transfers above a threshold or to certain addresses.</p><p>You can enable this from your <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah py" href="https://portal.cdp.coinbase.com/products/server-wallet/policies"><u>CDP dashboard</u></a> by editing an existing template or writing your own custom rules.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/13c1f93bc80c912965cb14c325c7d189eae7baa4c5e63df9d121d5699c9dd460.png" alt="" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAD6UlEQVR4nI1U7U/bRhi/TapUae02YK0oS2s4Lo7NJXEcm8PFMQuIjpckSP0/9ud0nzrxMlLY0rKp0tQP+7JvTK02RGFZmZjoOoRLnIQ4IXHiJHBTuJJRmLQ+ej5YZ/v53e/lDrx/pffS5esdH3ci5DOMUUUhHg/n8XBdXdcgRJOT0+2OxWYSibuJxN1YbObsYjQ6xnFQEPweDwchwljqR4IfS+9dvQ4AAJ/0CN2e/hvdPT4BM4CTj4IQomTyAaXUOSnXdU3TXF1dffr0mWmarus6jlMqlSg9TiYfCIKfEE2WVVlWFYVIIVWWB3u9+FKnB/T1wQ8/6uSFgJcfuMUhjkM8LwqCn+fFlZXvMpl9K2vRk2o2m45TqTpOs9lsr1BKk8llWVZ13dD1iKa1ejQanZq8E5uamBgfBxhLfdDrEzAOyFJIxQEJIZ8g+CFEc4tLe/vZ3T0rX6zki+WsXSw5rl2u5uzDQrlyWKnZpUrz+HjxFEDTIkOaPmKMdHR7AbgMwJVbMAB4XuR5H8f1hmU1ohuKQhDyiWLAc7NvfnHRtivp9I5lHeTt4p5lmblsJp/7y9wrlg8bjWa15lJK5xeWBnDIMEY1LUKIHp+eAP9WJyBEI0Rj1AjRGAAhmigGlpe/oZTuvtrPZwp2sVCulOnbxST6NpXCgTAbwiYMtWYOEzKs65GWRBwHIUSEaPopA4yDPT03mclZq7Cx9ufWix0rm6036qfdqDcartti8Cj1KBiUMZY0LcJ+l0JqxBhhlgBRDEDovQjg8XCzs3Nsp6b1+tff1je3fn++tbmW3lhLbzzfSq+lNzb/eEEpTaVWgkH5xGQjGJS7uq719vUrCmGqAD8OCIIoCKKmRdoAhjFKiMYA6m59e/tv08ya1n6pXGqLc0SPGINU6mHbZCaRopC27OBqF/qgA3Z/yodkzR8cwjiMkI8h3b//FaW0ULBf7+ULheLO7qvcQb7eqJ+L6VmAiw04KPb2Yy/vH8CyogxLIZUByLK6sPA186BwUK46tUy+FSHT2m+7/U4AoVBYFDFCXkHwt11iDGZnZ4t2+SBfKpVLOfvgXIQopa5b/38ARSEDYmAASxhL7ZgyBqnUQ+aB67rVWu0iwLtJdJJRCBHHwTMMPpNl9fHjHyilh4fVlqNvzT3K5fKO4yx+//O95E/3vpxTFHL79n9MfwOAkBchL8+3gkSIxjIXltX5haXtl5n1zZfZnF2rVdmtV6tVc7n8kyc/PvtlHQARAKDHvhgdaZ3hs3Pb57d1VSDk4zjIANg79jA2Nj6TSMTj8bOXNuup6fj0dDwa/Txi3BkbGydk+NzGwwoJBuXBQe0fL7PDFrAXPBUAAAAASUVORK5CYII=" nextheight="256" nextwidth="512" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Once a policy is created, try to test with a transaction and your transaction will fail with an API error if in case it violates the policy.</p><p>This can play a key role in compliance and operational safety.</p><h2 id="h-step-5-sponsor-gas" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Step 5: Sponsor Gas</strong></h2><ul><li><p>To deliver a true web2-like experience, CDP lets you sponsor gas fees for your users by abstracting all the complexities of managing a paymaster.</p></li><li><p>You can enable sponsorship through your CDP console under onchain tool &gt; paymaster or <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah py" href="https://portal.cdp.coinbase.com/products/paymaster"><u>click here</u></a></p></li><li><p>Once you enable it, you’ll get the Paymaster URL, which should be passed as a parameter for gasless txn in the code.</p></li></ul><p>Before we jump into the gasless txn, there’s an important to thing to note, that is gasless txn works only with smart accounts so it’s important to create one, and CDP let’s you do that with a single line of code using their <code>get_or_create_smart_account</code>function. But these smart accounts needs an owner account which is a EOA.</p><p>Here’s how we create smart accounts</p><pre data-type="codeBlock" text="async def _get_or_create_smart_account(cdp: Any, name: str, display_name: str) -&gt; Any:
 try:
 owner = await cdp.evm.get_or_create_account(name=name)
 account = await cdp.evm.get_or_create_smart_account(name=name, owner=owner)
 print(f”{display_name}: {account.address}”)
 return account
 except Exception as e:
 print(f”x Failed to create: {str(e)}”)
 raise

async def create_smart_accounts() -&gt; Tuple[Any, Any]:
 cdp = await get_cdp_client()
 alice = await _get_or_create_smart_account(cdp, “alice”, “Alice”)
 bob = await _get_or_create_smart_account(cdp, “bob”, “Bob”)
 return alice, bob"><code><span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">_get_or_create_smart_account</span>(<span class="hljs-params">cdp: <span class="hljs-type">Any</span>, name: <span class="hljs-built_in">str</span>, display_name: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-type">Any</span>:
 <span class="hljs-keyword">try</span>:
 owner = <span class="hljs-keyword">await</span> cdp.evm.get_or_create_account(name=name)
 account = <span class="hljs-keyword">await</span> cdp.evm.get_or_create_smart_account(name=name, owner=owner)
 <span class="hljs-built_in">print</span>(f”{display_name}: {account.address}”)
 <span class="hljs-keyword">return</span> account
 <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
 <span class="hljs-built_in">print</span>(f”x Failed to create: {<span class="hljs-built_in">str</span>(e)}”)
 <span class="hljs-keyword">raise</span>

<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">create_smart_accounts</span>() -&gt; <span class="hljs-type">Tuple</span>[<span class="hljs-type">Any</span>, <span class="hljs-type">Any</span>]:
 cdp = <span class="hljs-keyword">await</span> get_cdp_client()
 alice = <span class="hljs-keyword">await</span> _get_or_create_smart_account(cdp, “alice”, “Alice”)
 bob = <span class="hljs-keyword">await</span> _get_or_create_smart_account(cdp, “bob”, “Bob”)
 <span class="hljs-keyword">return</span> alice, bob</code></pre><p>This makes transactions feel instant and free from the user’s perspective, while you control limits via policy.</p><h2 id="h-step-6-bringing-them-all-together" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Step 6: </strong><code>Bringing </code><strong>them all together</strong></h2><p>You can call all these function in main function such as this</p><pre data-type="codeBlock" text="async def main():
 “””
 Main orchestration function
 “””
 try:
 # Create accounts
 alice, bob = await create_accounts()
 
 # Initial balances
 print(“\nInitial Balances:”)
 await fetch_balance(alice.address)
 await fetch_balance(bob.address)
 
 # Send transaction
 print(“\nSending Transaction:”)
 await send_tokens(alice, bob, amount_eth=0.001)
 
 # Final balances
 print(“\nFinal Balances:”)
 await fetch_balance(alice.address)
 await fetch_balance(bob.address)
 
 except Exception as e:
 print(f”Error: {str(e)}”)
 import traceback
 traceback.print_exc()
 
 finally:
 await close_cdp_client()"><code><span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">main</span>():
 “””
 Main orchestration function
 “””
 <span class="hljs-keyword">try</span>:
 <span class="hljs-comment"># Create accounts</span>
 alice, bob = <span class="hljs-keyword">await</span> create_accounts()
 
 <span class="hljs-comment"># Initial balances</span>
 <span class="hljs-built_in">print</span>(“\nInitial Balances:”)
 <span class="hljs-keyword">await</span> fetch_balance(alice.address)
 <span class="hljs-keyword">await</span> fetch_balance(bob.address)
 
 <span class="hljs-comment"># Send transaction</span>
 <span class="hljs-built_in">print</span>(“\nSending Transaction:”)
 <span class="hljs-keyword">await</span> send_tokens(alice, bob, amount_eth=<span class="hljs-number">0.001</span>)
 
 <span class="hljs-comment"># Final balances</span>
 <span class="hljs-built_in">print</span>(“\nFinal Balances:”)
 <span class="hljs-keyword">await</span> fetch_balance(alice.address)
 <span class="hljs-keyword">await</span> fetch_balance(bob.address)
 
 <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
 <span class="hljs-built_in">print</span>(f”Error: {<span class="hljs-built_in">str</span>(e)}”)
 <span class="hljs-keyword">import</span> traceback
 traceback.print_exc()
 
 <span class="hljs-keyword">finally</span>:
 <span class="hljs-keyword">await</span> close_cdp_client()</code></pre><h2 id="h-security-and-best-practices" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Security &amp; Best Practices</strong></h2><p>When working with Server Wallets, keep these best practices in mind:</p><ul><li><p><span data-name="lock" class="emoji" data-type="emoji">🔒</span> Always load secrets from environment variables — never hardcode keys</p></li><li><p><span data-name="repeat" class="emoji" data-type="emoji">🔁</span> Rotate wallet secrets regularly</p></li><li><p><span data-name="receipt" class="emoji" data-type="emoji">🧾</span> Redact API keys and private key material in logs</p></li><li><p><span data-name="bricks" class="emoji" data-type="emoji">🧱</span> Keep access scoped and audit permissions frequently</p></li></ul><h2 id="h-additional-features" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Additional Features</strong></h2><p>Beyond what we built today, <strong>Server Wallets V2</strong> also support:</p><ul><li><p><span data-name="brain" class="emoji" data-type="emoji">🧠</span> <strong>Smart accounts</strong> for account abstraction and batching</p></li><li><p><span data-name="arrows_counterclockwise" class="emoji" data-type="emoji">🔄</span> <strong>Token swaps</strong> for direct ERC-20 swaps</p></li><li><p><span data-name="toolbox" class="emoji" data-type="emoji">🧰</span> <strong>Spend permissions</strong> for granular, scoped access</p></li><li><p><span data-name="office" class="emoji" data-type="emoji">🏢</span> <strong>Managed mode</strong> for team-scale infrastructure</p></li></ul><p>These are optional but powerful tools as your app grows.</p><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Conclusion</strong></h2><p>You’ve just built and tested Server Wallets V2 with Python — from setup to transactions, policy enforcement, and gas sponsorship.<br>You now have a secure, programmable wallet infrastructure ready for production.</p><p>For deeper docs and SDK examples, visit the official Coinbase Developer Platform documentation.<br>And follow <strong>HeimLabs</strong> for more technical walkthroughs, tutorials, and hands-on guides for Web3 developers.</p><h2 id="h-resources" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources</strong></h2><p><strong>CDP Docs</strong></p><div data-type="embedly" src="https://docs.cdp.coinbase.com/" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;Explore our API &amp; SDK references, demos, and guides for building onchain apps.&quot;,&quot;title&quot;:&quot;Coinbase Developer Docs - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com/index&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFgUlEQVR4nGWUa0xaZxzG32WuSz8s6dqlH9yta4zZuqVdt262mVtv61Z7r13vo9rLvHS1Vm213pW1iooOKaKIgoqAPYh4QRAFpIhCQRRU0IB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Mqg66Td14t34YqDUQRA1FE2GDWNl9ZAxUUk5MyMFm5+MQM7BlUTCjqztlr99JyqdfvYEIuxv92Iyv4RHTI76kf7Tr91md7/YMuHY3Ef3kk8d3vwkHAcbD9EtgR/kMU5StUacBFwqcXCBtCcX6nivxOFcFDnnMsDumNgyPPRkzP+3TmJwpdu0wrUgzXsGU1jUpirZjMkuNoT4iQMovAS8I2ZxBFf1GlMfmtUbktYdmcC2mskDja/ltVgSjih2fxMPRYATiSD37JhbXq9b6YtT+ub2a3dECNQhpLUMHglVK5ODIn+WE5ppQTl0WOz6JGp5JismqvxJeg4klXkmjIVM8kMg/H1ARHVO4MI20592hDKA6cwILDGPDzQ7APDX7KBj9mA8/q6tTz2ZY2EadVXE6Fqh/zyYxWEo2LIdRl5FEzsfR0LPNmallSAXQxBht2twxNliQU8v9Acy6nsI7H1R64WfX9NXIgigjTjxXAkfehQXAm2J0GdiXDWnG5HS9XrI6l0Unb8NgssnmkarOgx9gsGYHa4IVD4ahLoKd5VGlmqSgRJ4jOaQ7PZCPx99wgb0OVbj5bDGdH6LvTwTf3wfZ7YFs8+DwONrAv+Pb+9Dyy2hRaePMIeozI061u7iexVXiGHEORZhBFCYX8yAdNl1NYJxMY+6Ko34bD5YBTRXAzCP3rJBgdGAu2/gm2RP8HMdkQRNH39DQAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Coinbase Developer Docs - Coinbase Developer Documentation</h2><p>Explore our API &amp; SDK references, demos, and guides for building onchain apps.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"></div></a></div></div><p><strong>Python SDK Reference</strong></p><div data-type="embedly" src="https://github.com/coinbase/cdp-sdk-python" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Contribute to coinbase/cdp-sdk-python development by creating an account on GitHub.&quot;,&quot;title&quot;:&quot;GitHub - coinbase/cdp-sdk-python&quot;,&quot;author_name&quot;:&quot;coinbase&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/coinbase/cdp-sdk-python&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/5fd7aea92cb67c41c310eb4176397a3d3c104f4ab9d8499d3fcaa873b1a5a40a.png&quot;,&quot;author_url&quot;:&quot;https://github.com/coinbase&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC+0lEQVR4nKVUbUhTURh+qf7UnzD6pxRlZBIl4cf6NCx/2G+ZpghaIijISgmiwEilouhDQ6IwEMlQLDVjGTo2pg4F3a7Oj2Y6dTo3da4Nd93duZ7dndi917npKKOXh8s579dz3vc95wLhheM44btdCCE+jvNtWLe4CeG80hdYC1tBA0GqrfFhc3HbrIGMDMJzi6uGGbuTRtgr8okEDC+rq6tOp9Nqta7Y7QghjLGgtNlsGGO9foSmaT4XRgh1KhRms5kQwq57CSG5FXKAK3CgEOLKANIgSiaw+gkQQjU1b+7df/CwsjIvv6Dkzl1pZnax7HZ6RlZefsGLqtfSrJz4xHN79kVEHo5ubGq+lJIaHRMLAEeOnejs6qLXPP6TxpcDSPtGLOrBOUlRA0CaB2GxAo7jpoxGnY4aGxsb1Or0+hGVSq3TUQqlUqVST05OfZXL39fVP39ZXSwrddF0R0dnVXVNXV19a1v7it0uVADXqkqrlRBRCBCXVvoJom4t2FybLeru7VWp1B8aGnNyb7ytre3p1Xxuaf1hMATm/wcRT3r5abKsKbWkGQ4Wvfo4ALtuLjvcIgHGOPp47O69+2NiT0suJCdIzkceOnry1JnKR0/4Fq/jIOE4H8YYIVbYBhMAJErL2t+1DAFkA1wVpiwSmEwmg2Fi3mwWgmma5nNxZAciXJhvGiOkPIOLj/3fhPLcCvnmkEMvb5g7/j8iEoR9Yv/EwXE+tO5leQiLEIKdxHN8fTv257ZUEKY5YZ804We2MfC/84lDnpiY1FHU7OxsgHxQq6Oo4da2LwsWCyHEaJymhkY6FQpCyOLSEkUND2q1YQslhEybLN+VfSKBB7FuhnHRa1PGGR2l14+Oj44bXPSaw+myWJc0/QP60XGHw+lmmHmztVvTb//l8CB22bYyoB0yW6zsOvYgNgDGw2Kv96dxTt7V42YYD2JDZiC0mZCQ/2KoJtjk2+IZvkWQlLEJyXU4yyMpAxLSNzSZmw6CSXTO9CM4PIAEqR/8+jfP0vgsVszTrQAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/5fd7aea92cb67c41c310eb4176397a3d3c104f4ab9d8499d3fcaa873b1a5a40a.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/5fd7aea92cb67c41c310eb4176397a3d3c104f4ab9d8499d3fcaa873b1a5a40a.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/coinbase/cdp-sdk-python" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - coinbase/cdp-sdk-python</h2><p>Contribute to coinbase/cdp-sdk-python development by creating an account on GitHub.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://storage.googleapis.com/papyrus_images/5fd7aea92cb67c41c310eb4176397a3d3c104f4ab9d8499d3fcaa873b1a5a40a.png"></div></a></div></div><p><strong>HeimLabs</strong></p><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&qu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g1cvGC+y7zNp1/7yBOdF++ETy3NGDo/u6UmuWtaX63zmZer+2crMzq9Nl6VgUHsu1xQXgUUmiSvHK57d/0r7x8/rqM/GdaMfLKPkGOjCABvp+SR66ndr7V3/PjX2J6373HuPMhrsAHEwzQC8Fm0rgMcgKtZRXL/Ub0v1aKl8jypdynSQwBNjFfDaDDM9W1IZKh6KhY0uCqQ114/FNX3Tv/LNz60972n5O7ka9HTfPj6Dr3yAX026cWXffL8LBTIFFznOmcx0yrmMq4NhkXAcBtAD0ONDUjByZqFinjOjl0cfDx2PP/rCl6Upn00Tz4tOp3TeOD6KGyOXG6IVtLRe3No+5s2J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p>Clap it up if this saved you time!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah py" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah py" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>web3</category>
            <category>server</category>
            <category>wallets</category>
            <category>cdp</category>
            <category>coinbase</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/4ad592a51c1b24de8b0bdaa02c2a9690dc1370b22010c997639b37e6faa52dcd.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Ship an x402-Powered API with Bazaar. From Discovery to Paid Response in One Script]]></title>
            <link>https://paragraph.com/@heimlabs/x402-bazaar</link>
            <guid>nIXNmnJodu6htlVOH4oP</guid>
            <pubDate>Mon, 27 Oct 2025 14:31:48 GMT</pubDate>
            <description><![CDATA[Tired of “sign up, add card, get API key” loops?

Bazaar + x402 flips the model — your AI agent can now discover, pay, and use APIs directly via HTTP 402 responses — no accounts, no subscriptions.

In this post, we walk you through building a full 402-powered API Bazaar:

🧭 List and discover services
💳 Handle pay-per-request APIs with x402
🔁 Automate payments and retries
🧪 Run the entire loop in one Node.js script

Build a pay-as-you-go Web3 API marketplace your agents can use autonomously.
]]></description>
            <content:encoded><![CDATA[<h2 id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Introduction</strong></h2><p>Most API marketplaces still assume a human is in the loop, create an account, add a card, mint keys, manage usage. That’s friction your <strong>AI agent</strong> can’t handle.</p><p><strong>Bazaar + x402</strong> flips that model. Your agent discovers services, <strong>gets an HTTP 402 (payment required) response with payment details</strong>, pays (typically <strong>USDC on Base</strong>), retries the same request with proof, and the API responds — <strong>no accounts, no subscriptions</strong>.</p><p>By the end of this post, you’ll have a runnable demo that shows the end-to-end loop: <strong>list → discover → 402 → pay → retry → use</strong>.</p><hr><h2 id="h-what-youll-build" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>What You’ll Build</strong></h2><ul><li><p><span data-name="compass" class="emoji" data-type="emoji">🧭</span> Publish a minimal <strong>Bazaar</strong>-style listing your agent can discover</p></li><li><p><span data-name="credit_card" class="emoji" data-type="emoji">💳</span> Simulate <strong>x402</strong> payment flow (HTTP 402 → facilitator settle → proof)</p></li><li><p><span data-name="repeat" class="emoji" data-type="emoji">🔁</span> Retry the same request with proof to get the <strong>paid</strong> response</p></li><li><p><span data-name="test_tube" class="emoji" data-type="emoji">🧪</span> Do it all in <strong>one Node.js script</strong> you can run locally</p></li></ul><p>(Watch the full video here)</p><div data-type="youtube" videoid="UiD6Ol8RHoA">
      <div class="youtube-player" data-id="UiD6Ol8RHoA" style="background-image: url('https://i.ytimg.com/vi/UiD6Ol8RHoA/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=UiD6Ol8RHoA">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><hr><h2 id="h-system-architecture" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>System Architecture</strong></h2><pre data-type="codeBlock" text="Agent (buyer) ──&gt; Bazaar catalog ──&gt; Service endpoint
    │                                   │
    │ (Request)                          │ If unpaid:
    │──────────────────────────────────&gt; │  returns HTTP 402 + payment details
    │                                    │
    │ --pay via Facilitator------------&gt; Facilitator (verifies/settles, returns proof)
    │                                    │
    │ (Retry + proof header)            │
    └──────────────────────────────────&gt; │ Returns the result"><code>Agent (buyer) ──<span class="hljs-operator">&gt;</span> Bazaar catalog ──<span class="hljs-operator">&gt;</span> Service endpoint
    │                                   │
    │ (Request)                          │ If unpaid:
    │──────────────────────────────────<span class="hljs-operator">&gt;</span> │  <span class="hljs-keyword">returns</span> HTTP <span class="hljs-number">402</span> <span class="hljs-operator">+</span> payment details
    │                                    │
    │ <span class="hljs-operator">-</span><span class="hljs-operator">-</span>pay via Facilitator<span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">&gt;</span> Facilitator (verifies<span class="hljs-operator">/</span>settles, <span class="hljs-keyword">returns</span> proof)
    │                                    │
    │ (Retry <span class="hljs-operator">+</span> proof header)            │
    └──────────────────────────────────<span class="hljs-operator">&gt;</span> │ Returns the result</code></pre><p><strong>Components (quick tour)</strong></p><ul><li><p><strong>Bazaar</strong>: Simple discovery layer returning listings with name, price, asset, network.</p></li><li><p><strong>Service</strong>: Your API endpoint that <em>requires pay-per-request</em>. If unpaid, it answers with <strong>HTTP 402</strong> and payment details.</p></li><li><p><strong>x402 Facilitator</strong>: Verifies/settles the client’s payment and issues a <strong>proof</strong> your service can trust.</p></li><li><p><strong>Agent</strong>: A tiny buyer script that discovers a service, calls it, handles 402, pays via facilitator, retries with proof, and prints the result.</p><hr></li></ul><h2 id="h-implementation-phase" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Implementation phase</strong></h2><p>The code will be split into two parts: <strong>Seller</strong> and <strong>Buyer</strong>.</p><h2 id="h-project-setup" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Project setup</strong></h2><pre data-type="codeBlock" text="mkdir x402-baazar
cd x402-baazar

npm init -y"><code>mkdir x402<span class="hljs-operator">-</span>baazar
cd x402<span class="hljs-operator">-</span>baazar

npm init <span class="hljs-operator">-</span>y</code></pre><h2 id="h-install-dependencies" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Install dependencies</strong></h2><pre data-type="codeBlock" text="npm i @coinbase/cdp-sdk @coinbase/x402 dotenv express viem x402-express x402-fetch"><code>npm i @coinbase<span class="hljs-operator">/</span>cdp<span class="hljs-operator">-</span>sdk @coinbase<span class="hljs-operator">/</span>x402 dotenv express viem x402<span class="hljs-operator">-</span>express x402<span class="hljs-operator">-</span>fetch</code></pre><p>We’ll start by building a simple <strong>Rock–Paper–Scissors</strong> endpoint. Then, we’ll integrate it with <strong>x402</strong> so each request is payable, and provide the necessary config to list the service in <strong>Baazar</strong>. Create a file called index.js</p><h2 id="h-setting-up-our-endpoint-with-express" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Setting up our endpoint with express</strong></h2><pre data-type="codeBlock" text="import express from “express”;

const moves = [&quot;rock&quot;, &quot;paper&quot;, &quot;scissors&quot;];
function getOutcome(player, server) {
 if (player === server) return &quot;draw&quot;;
 if (
 (player === &quot;rock&quot; &amp;&amp; server === &quot;scissors&quot;) ||
 (player === &quot;paper&quot; &amp;&amp; server === &quot;rock&quot;) ||
 (player === &quot;scissors&quot; &amp;&amp; server === &quot;paper&quot;)
 ) {
 return &quot;win&quot;;
 }
 return &quot;lose&quot;;
}

const app = express();
app.use(express.json());

app.post(&quot;/rps/play&quot;, (req, res) =&gt; {
 try {
 const { move } = req.body;
 if(!move || !moves.includes(move)){
 res.status(400).send({ error: &quot;Move must be rock, paper, or scissors&quot; });
 return;
 }

const serverMove = moves[Math.floor(Math.random() * moves.length)];
const outcome = getOutcome(move, serverMove);

app.listen(4021, () =&gt; {
 console.log(`Server listening at http://localhost:4021`);
})"><code><span class="hljs-keyword">import</span> <span class="hljs-title">express</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> “<span class="hljs-title">express</span>”;

const moves <span class="hljs-operator">=</span> [<span class="hljs-string">"rock"</span>, <span class="hljs-string">"paper"</span>, <span class="hljs-string">"scissors"</span>];
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getOutcome</span>(<span class="hljs-params">player, server</span>) </span>{
 <span class="hljs-keyword">if</span> (player <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> server) <span class="hljs-keyword">return</span> <span class="hljs-string">"draw"</span>;
 <span class="hljs-keyword">if</span> (
 (player <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">"rock"</span> <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> server <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">"scissors"</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span>
 (player <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">"paper"</span> <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> server <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">"rock"</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span>
 (player <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">"scissors"</span> <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> server <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">"paper"</span>)
 ) {
 <span class="hljs-keyword">return</span> <span class="hljs-string">"win"</span>;
 }
 <span class="hljs-keyword">return</span> <span class="hljs-string">"lose"</span>;
}

const app <span class="hljs-operator">=</span> express();
app.use(express.json());

app.post(<span class="hljs-string">"/rps/play"</span>, (req, res) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
 <span class="hljs-keyword">try</span> {
 const { move } <span class="hljs-operator">=</span> req.body;
 <span class="hljs-keyword">if</span>(<span class="hljs-operator">!</span>move <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-operator">!</span>moves.includes(move)){
 res.status(<span class="hljs-number">400</span>).<span class="hljs-built_in">send</span>({ <span class="hljs-function"><span class="hljs-keyword">error</span>: "<span class="hljs-title">Move</span> <span class="hljs-title">must</span> <span class="hljs-title">be</span> <span class="hljs-title">rock</span>, <span class="hljs-title">paper</span>, <span class="hljs-title">or</span> <span class="hljs-title">scissors</span>" })</span>;
 <span class="hljs-keyword">return</span>;
 }

const serverMove <span class="hljs-operator">=</span> moves[Math.floor(Math.random() <span class="hljs-operator">*</span> moves.<span class="hljs-built_in">length</span>)];
const outcome <span class="hljs-operator">=</span> getOutcome(move, serverMove);

app.listen(<span class="hljs-number">4021</span>, () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
 console.log(`Server listening at http:<span class="hljs-comment">//localhost:4021`);</span>
})</code></pre><p>Now to set up x402 and the configs required for Baazar for the above endpoint</p><pre data-type="codeBlock" text="// … exisiting imports
import { paymentMiddleware } from “x402-express”;
import { facilitator } from “@coinbase/x402”;

// after `app.use(express.json())`

app.use(
 paymentMiddleware(
 &quot;0xB1De43C2Ca1195258FEE160adAcB1820c3776B7D&quot;,
 {
 &quot;POST /rps/play&quot;: {
 price: &quot;$0.001&quot;, // USDC testnet price
 network: &quot;base&quot;,
 config: {
 name: &quot;Rock-Paper-Scissors&quot;,
 description: &quot;Pay to play a simple game of Rock-Paper-Scissors.&quot;,
 discoverable: true, // 
 inputSchema: {
 type: &quot;object&quot;,
 properties: {
 move: {
 type: &quot;string&quot;,
 enum: [&quot;rock&quot;, &quot;paper&quot;, &quot;scissors&quot;],
 description: &quot;Your move&quot;,
 },
 },
 required: [&quot;move&quot;],
 },
 outputSchema: {
 type: &quot;object&quot;,
 properties: {
 playerMove: { type: &quot;string&quot; },
 serverMove: { type: &quot;string&quot; },
 outcome: { type: &quot;string&quot; },
 },
 },
 },
 },
 },
 {
 facilitator
 }
 )
)

// before `app.post(&quot;/rps/play&quot;…`"><code><span class="hljs-comment">// … exisiting imports</span>
import { paymentMiddleware } <span class="hljs-keyword">from</span> “x402-express”;
import { facilitator } <span class="hljs-keyword">from</span> “@coinbase/x402”;

<span class="hljs-comment">// after `app.use(express.json())`</span>

app.<span class="hljs-keyword">use</span>(
 <span class="hljs-title function_ invoke__">paymentMiddleware</span>(
 <span class="hljs-string">"0xB1De43C2Ca1195258FEE160adAcB1820c3776B7D"</span>,
 {
 <span class="hljs-string">"POST /rps/play"</span>: {
 <span class="hljs-attr">price</span>: <span class="hljs-string">"<span class="hljs-subst">$0</span>.001"</span>, // USDC testnet price
 <span class="hljs-attr">network</span>: <span class="hljs-string">"base"</span>,
 <span class="hljs-attr">config</span>: {
 <span class="hljs-attr">name</span>: <span class="hljs-string">"Rock-Paper-Scissors"</span>,
 <span class="hljs-attr">description</span>: <span class="hljs-string">"Pay to play a simple game of Rock-Paper-Scissors."</span>,
 <span class="hljs-attr">discoverable</span>: <span class="hljs-literal">true</span>, // 
 <span class="hljs-attr">inputSchema</span>: {
 <span class="hljs-attr">type</span>: <span class="hljs-string">"object"</span>,
 <span class="hljs-attr">properties</span>: {
 <span class="hljs-attr">move</span>: {
 <span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span>,
 <span class="hljs-attr">enum</span>: [<span class="hljs-string">"rock"</span>, <span class="hljs-string">"paper"</span>, <span class="hljs-string">"scissors"</span>],
 <span class="hljs-attr">description</span>: <span class="hljs-string">"Your move"</span>,
 },
 },
 <span class="hljs-attr">required</span>: [<span class="hljs-string">"move"</span>],
 },
 <span class="hljs-attr">outputSchema</span>: {
 <span class="hljs-attr">type</span>: <span class="hljs-string">"object"</span>,
 <span class="hljs-attr">properties</span>: {
 <span class="hljs-attr">playerMove</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span> },
 <span class="hljs-attr">serverMove</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span> },
 <span class="hljs-attr">outcome</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span> },
 },
 },
 },
 },
 },
 {
 facilitator
 }
 )
)

<span class="hljs-comment">// before `app.post("/rps/play"…`</span></code></pre><ul><li><p>The paymentMiddleware integrates <strong>x402</strong> into this project as an Express middleware (learn more about Express middlewares <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah pw" href="https://expressjs.com/en/guide/using-middleware.html"><u>here</u></a>).</p></li><li><p>It takes two parameters:</p></li></ul><ol><li><p><strong>Recipient address</strong> — the wallet where payments to this endpoint will be sent.</p></li><li><p><strong>Baazar config</strong> — metadata that describes your service in the Baazar catalog, making it discoverable for AI agents.</p></li></ol><ul><li><p>The discoverable flag in the config is set to true, which ensures your API is automatically listed in the Baazar catalog.</p></li></ul><p>Note: To make your API indexable by Baazar, you must deploy it to a public cloud (e.g.,<a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah pw" href="https://railway.app/"><u> Railway</u></a>, AWS, etc.) and ensure it’s accessible publicly</p><p>Next, let’s create a simple function that simulates a <strong>buyer</strong></p><ul><li><p>It queries the Baazar catalog to list available services.</p></li><li><p>Selects our rock-paper-scissors service.</p></li><li><p>Plays the game while paying <strong>USDC</strong> for each request.</p></li></ul><p>Now create another file called buyer.js, and start with listing the catalog</p><pre data-type="codeBlock" text="const listCatalog = async () =&gt; {
const response = await fetch(&quot;https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources&quot;)
const res = await response.json()
 console.log(res)
 
}

const run = async () =&gt; {
const catalog = await listCatalog();
}

run()"><code><span class="hljs-keyword">const</span> <span class="hljs-title function_">listCatalog</span> = <span class="hljs-keyword">async</span> (<span class="hljs-params"></span>) =&gt; {
<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> <span class="hljs-title function_">fetch</span>(<span class="hljs-string">"https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources"</span>)
<span class="hljs-keyword">const</span> res = <span class="hljs-keyword">await</span> response.<span class="hljs-title function_">json</span>()
 <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(res)
 
}

<span class="hljs-keyword">const</span> <span class="hljs-title function_">run</span> = <span class="hljs-keyword">async</span> (<span class="hljs-params"></span>) =&gt; {
<span class="hljs-keyword">const</span> catalog = <span class="hljs-keyword">await</span> <span class="hljs-title function_">listCatalog</span>();
}

<span class="hljs-title function_">run</span>()</code></pre><p>This will return an array of objects</p><pre data-type="codeBlock" text="{
 “items”: […]
}"><code>{
 “items”: […]
}</code></pre><p>Now that we have the service list, let’s set up a few prerequisites before making a call:</p><ol><li><p><strong>Wallet setup</strong> — We need a wallet to pay for the service. The quickest option is to use a <strong>CDP wallet</strong>, which abstracts all the complexities into just two lines of code. Alternatively, you can bring your own wallet, but then you’ll need to handle the full viem configuration yourself.</p></li><li><p><strong>Making the API call</strong> — There are two approaches:</p></li></ol><ul><li><p>Manually: call the API with fetch or axios, receive the 402 Payment Required response, make the payment, and then retry.</p></li><li><p>Automatically: use the <strong>CDP wrappers</strong> for fetch or axios, which handle the entire payment flow for you.</p></li></ul><p>For this walkthrough, we’ll wrap fetch with <strong>x402-fetch</strong>.</p><pre data-type="codeBlock" text="import { CdpClient } from “@coinbase/cdp-sdk”;
import dotenv from “dotenv”;
import { wrapFetchWithPayment, decodeXPaymentResponse } from “x402-fetch”;

dotenv.config()

// Setup CDP account or bring your own wallet
const cdp = new CdpClient();
const cdpAccount = await cdp.evm.getAccount({ name: “buyer-account”});

// feel free to enable this in testnet, perks for using CDP 😅
// await cdp.evm.requestFaucet({
// address: cdpAccount.address,
// network: “base-sepolia”,
// token: “usdc”
// });

// providing x402 super power to our good old `fetch`
const fetchWithPayment = wrapFetchWithPayment(fetch, cdpAccount);

// … previous listCatalog function

const run = async () =&gt; {
 try {
 const catalog = await listCatalog();
 
 // choosing a service, assuming that it’s our RPS API
 const service = catalog.items[0] 
 const response = await fetchWithPayment(service.resource, {
 method: “POST”,
 headers: {
 “Content-Type”: “application/json”,
 },
 body: JSON.stringify({ move }),
 });

 const result = await response.json();
 console.log(“Game result:”, result);
 const paymentResponse = decodeXPaymentResponse(response.headers.get(“x-payment-response”));
 console.log(paymentResponse)
 } catch (error) {
 console.log(error); 
 } 
}

run()"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">CdpClient</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> “@<span class="hljs-title">coinbase</span><span class="hljs-operator">/</span><span class="hljs-title">cdp</span><span class="hljs-operator">-</span><span class="hljs-title">sdk</span>”;
<span class="hljs-keyword">import</span> <span class="hljs-title">dotenv</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> “<span class="hljs-title">dotenv</span>”;
<span class="hljs-keyword">import</span> { <span class="hljs-title">wrapFetchWithPayment</span>, <span class="hljs-title">decodeXPaymentResponse</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> “<span class="hljs-title">x402</span><span class="hljs-operator">-</span><span class="hljs-title">fetch</span>”;

dotenv.config()

<span class="hljs-comment">// Setup CDP account or bring your own wallet</span>
const cdp <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> CdpClient();
const cdpAccount <span class="hljs-operator">=</span> await cdp.evm.getAccount({ name: “buyer<span class="hljs-operator">-</span>account”});

<span class="hljs-comment">// feel free to enable this in testnet, perks for using CDP 😅</span>
<span class="hljs-comment">// await cdp.evm.requestFaucet({</span>
<span class="hljs-comment">// address: cdpAccount.address,</span>
<span class="hljs-comment">// network: “base-sepolia”,</span>
<span class="hljs-comment">// token: “usdc”</span>
<span class="hljs-comment">// });</span>

<span class="hljs-comment">// providing x402 super power to our good old `fetch`</span>
const fetchWithPayment <span class="hljs-operator">=</span> wrapFetchWithPayment(fetch, cdpAccount);

<span class="hljs-comment">// … previous listCatalog function</span>

const run <span class="hljs-operator">=</span> async () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
 <span class="hljs-keyword">try</span> {
 const catalog <span class="hljs-operator">=</span> await listCatalog();
 
 <span class="hljs-comment">// choosing a service, assuming that it’s our RPS API</span>
 const service <span class="hljs-operator">=</span> catalog.items[<span class="hljs-number">0</span>] 
 const response <span class="hljs-operator">=</span> await fetchWithPayment(service.resource, {
 method: “POST”,
 headers: {
 “Content<span class="hljs-operator">-</span>Type”: “application<span class="hljs-operator">/</span>json”,
 },
 body: JSON.stringify({ move }),
 });

 const result <span class="hljs-operator">=</span> await response.json();
 console.log(“Game result:”, result);
 const paymentResponse <span class="hljs-operator">=</span> decodeXPaymentResponse(response.headers.get(“x<span class="hljs-operator">-</span>payment<span class="hljs-operator">-</span>response”));
 console.log(paymentResponse)
 } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>) </span>{
 console.log(<span class="hljs-function"><span class="hljs-keyword">error</span>)</span>; 
 } 
}

run()</code></pre><p>Using <strong>fetchWithPayment</strong> ensures that whenever the API responds with a 402 Payment Required, the payment is handled automatically and the request is retried — so you get the result without needing to manage the payment flow yourself.</p><h2 id="h-run-the-app" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Run the app</strong></h2><p>Seller</p><pre data-type="codeBlock" text="node index.ts"><code></code></pre><p>Buyer</p><pre data-type="codeBlock" text="node buyer.js"><code></code></pre><p>You’ll see:</p><ol><li><p>The server start</p></li><li><p>The buyer discovering the service</p></li><li><p>The first call returning HTTP 402 with payment details</p></li><li><p>The testnet facilitator issuing a receipt</p></li><li><p>Then retry with X-PAYMENT header</p></li><li><p>The server responds back with a valid response</p></li></ol><h2 id="h-map-the-demo-to-the-real-thing" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Map the Demo to the Real Thing</strong></h2><ul><li><p><strong>Bazaar UI &amp; Catalog</strong>: In production, this is a hosted catalog with ratings, pricing, latency, and networks. Your agent chooses providers that match <strong>budget + policy constraints</strong>.</p></li><li><p><strong>x402</strong>: The pattern stays identical — <strong>service answers unpaid with 402</strong>, agent <strong>settles</strong> via a <strong>facilitator</strong>, then <strong>retries</strong> the exact same HTTP request with a <strong>proof</strong> header.</p></li><li><p><strong>Facilitator</strong>: In production you’d use <strong>Coinbase’s default facilitator</strong> for <strong>USDC on Base</strong> (or run your own / pick a community one). Its job: verify payment and issue a proof your service trusts.</p></li><li><p><strong>Service</strong>: Your API should treat 402 like a <strong>contract</strong>: be explicit about <strong>amount, asset, network, seller, and facilitator URL</strong>, then verify the facilitator’s proof on retry before returning data.</p></li></ul><h2 id="h-hardening-and-extensions" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Hardening &amp; Extensions</strong></h2><ul><li><p><strong>Replay protection:</strong> Bind proofs to <code>paymentRequestId</code> + method + path + query and expire quickly. Note: CDP facilitators are, by default, designed to handle this—providing a 60-second window to pay and retry</p></li><li><p><strong>Tiered responses</strong>: Offer free previews, charge for high-res/long runs.</p></li><li><p><strong>Dynamic pricing</strong>: Quote by <strong>input size</strong> (e.g., seconds of audio, tokens) inside the 402 body.</p></li><li><p><strong>Provider switching</strong>: Your agent can compare <strong>rating/price/latency</strong>, swap providers mid-workflow, and keep moving.</p></li><li><p><strong>Onchain receipts</strong>: Include tx hashes and facilitator attestations to anchor off-chain work to on-chain payments.</p></li></ul><h2 id="h-recap" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Recap</strong></h2><p>You just ran a full, agent-friendly <strong>Bazaar + x402</strong> loop: <strong>discover</strong>, call and get <strong>402 payment required status</strong>, <strong>pay</strong> via a facilitator, <strong>retry with proof</strong>, and receive the <strong>paid</strong> result — no accounts, no subscriptions, <strong>per-request</strong>.</p><h2 id="h-next-steps" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Next Steps</strong></h2><ul><li><p>Swap the mock facilitator for <strong>Coinbase’s default facilitator</strong> on <strong>Base USDC</strong>.</p></li><li><p>Add signature verification using your facilitator’s real public keys.</p></li><li><p>Turn the catalog into a UI with ratings, price filters, and network badges.</p></li></ul><h2 id="h-cta" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>CTA</strong></h2><ul><li><p>Explore <strong>Coinbase Developer Platform docs</strong> for Bazaar/x402 and wallets.</p></li><li><p>Follow <strong>HeimLabs</strong> for upcoming agent demos that chain providers (translate → analyze → summarize → TTS) with <strong>pay-per-step</strong> execution.</p></li></ul><h2 id="h-resources-and-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources &amp; Links</strong></h2><p><strong>Coinbase Developer Docs:</strong></p><div data-type="embedly" src="https://docs.cdp.coinbase.com/" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;Explore our API &amp; SDK references, demos, and guides for building onchain apps.&quot;,&quot;title&quot;:&quot;Coinbase Developer Docs - Coinbase Developer Documentation&quot;,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com/index&quot;,&quot;thumbnail_width&quot;:1200,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFgUlEQVR4nGWUa0xaZxzG32WuSz8s6dqlH9yta4zZuqVdt262mVtv61Z7r13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APB7e/MXAPgD8A4AmwD8ve8X+CvYuNN3BgBsBRuCjsbTgyMqg66Td14t34YqDUQRA1FE2GDWNl9ZAxUUk5MyMFm5+MQM7BlUTCjqztlr99JyqdfvYEIuxv92Iyv4RHTI76kf7Tr91md7/YMuHY3Ef3kk8d3vwkHAcbD9EtgR/kMU5StUacBFwqcXCBtCcX6nivxOFcFDnnMsDumNgyPPRkzP+3TmJwpdu0wrUgzXsGU1jUpirZjMkuNoT4iQMovAS8I2ZxBFf1GlMfmtUbktYdmcC2mskDja/ltVgSjih2fxMPRYATiSD37JhbXq9b6YtT+ub2a3dECNQhpLUMHglVK5ODIn+WE5ppQTl0WOz6JGp5JismqvxJeg4klXkmjIVM8kMg/H1ARHVO4MI20592hDKA6cwILDGPDzQ7APDX7KBj9mA8/q6tTz2ZY2EadVXE6Fqh/zyYxWEo2LIdRl5FEzsfR0LPNmallSAXQxBht2twxNliQU8v9Acy6nsI7H1R64WfX9NXIgigjTjxXAkfehQXAm2J0GdiXDWnG5HS9XrI6l0Unb8NgssnmkarOgx9gsGYHa4IVD4ahLoKd5VGlmqSgRJ4jOaQ7PZCPx99wgb0OVbj5bDGdH6LvTwTf3wfZ7YFs8+DwONrAv+Pb+9Dyy2hRaePMIeozI061u7iexVXiGHEORZhBFCYX8yAdNl1NYJxMY+6Ko34bD5YBTRXAzCP3rJBgdGAu2/gm2RP8HMdkQRNH39DQAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Coinbase Developer Docs - Coinbase Developer Documentation</h2><p>Explore our API &amp; SDK references, demos, and guides for building onchain apps.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"></div></a></div></div><p><strong>x402:</strong></p><div data-type="embedly" src="https://www.x402.org/" data="{&quot;provider_url&quot;:&quot;https://www.x402.org&quot;,&quot;description&quot;:&quot;An open standard for internet-native payments&quot;,&quot;title&quot;:&quot;x402.org&quot;,&quot;url&quot;:&quot;https://www.x402.org/&quot;,&quot;thumbnail_width&quot;:854,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;X402&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:480,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAASCAIAAAC1qksFAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFdUlEQVR4nF3VaUyTdxwH8N/zP56WQsvRcrWVq1DOUaAF2tKWPk+vpy23cnggoLgB25x4sDJdEEUXbwWdLi5zDo/MLTo3pzGR6Azqi2WLOl+YiDvM4jZ9MbMXZslMWJ4HRLfkmyd53vw/z+94ngcACgCKAEqAKQVUDoxVDIhh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msevrzj3qHJ608CPGgv7G7vHDp+4ayJJw7ohPv2EeeAAgS4pRNOJtYBCQqSmqso3yy1MWRQyRPaFzl3v+etL04HfHhR+qDkxYN5+xR8YtPfvzF+4oX/tZYMvFgvk7TKHt3iXHFq26suH9nza+dzuYv9Oi6U1hvHocAEiyKmzNKU19+s6BlPY1qvl9yrZ+3ab9lRcvu7+/Y7/xXcGRs6rOzZDXCqoAICeABaCCJi7I4TZZF35sKIlkZL9VWDhoKR4y5w+X5g5mJrSrGb8aXFrq0xIfZG3fp+hayTjnQ64PzHXKFYP5J7/Iv3I18+jpuDe3MrZ2UFWLgwEbxHlhXl18WVdOyxZ+8PPytv2G8nU6Y4/OsFyd1BqvCitZLhrsSuRUE4+GeBIRn8R4Yfnjx+GbN21XJz23brU9fbp4erpuerr6z0epuw8ld749r30grfOd9O5Nuu6t6ctGstqHdTURlakD5G6AcgRWLK2WnHEoiFt8OaJ8KplXI/cmxwqpMYEk1gOJG3c2Pvix5Y+Hvt9+tU3dy79ytePu1KV/nik61qBMAYwNkF0HmWFIDYOKF1dW/FXYEKlmKIdINaZuynIzXyrxY0U5FSsmTsbFUj6Ocv8CNrtc/dbFLQgAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:854,&quot;height&quot;:480,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.x402.org/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>x402.org</h2><p>An open standard for internet-native payments</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.x402.org</span></div><img src="https://storage.googleapis.com/papyrus_images/8c264830deb2cce2c88a834a4f9adacecccef781b7e9561431afd445545bbd5f.jpg"></div></a></div></div><p><strong>HeimLabs:</strong></p><div data-type="embedly" src="https://www.heimlabs.com/" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV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0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>Clap if this saved you hours, and share what you’re building with the CDP stack!</strong></p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah pw" href="https://x.com/heimlabs"><u>Twitter</u></a>, <a target="_blank" rel="noopener ugc nofollow" class="dont-break-out ah pw" href="https://www.linkedin.com/company/heimlabs"><u>LinkedIn</u></a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>x402</category>
            <category>web3dev</category>
            <category>web3</category>
            <category>x402bazaar</category>
            <category>cdp</category>
            <category>coinbasedeveloperplatform</category>
            <category>http402</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/f7de1adcf06b9e718074b20809e95439a94a718c440e9421a7d53e2295b061ee.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Ship Safer Solana Backends with CDP Wallets v2 Policies - From Scratch in TypeScript]]></title>
            <link>https://paragraph.com/@heimlabs/ship-safer-solana-backends-with-cdp-wallets-v2-policies-from-scratch-in-typescript</link>
            <guid>OlwGsZcQPOQY1UZoNTQS</guid>
            <pubDate>Thu, 23 Oct 2025 14:07:41 GMT</pubDate>
            <description><![CDATA[Automating on-chain actions on Solana can feel risky: one bad key leak or buggy transaction and funds are gone. Traditional guards like code reviews and unit tests help, but they don’t stop a live transaction. Today, you’ll fix that with Coinbase Developer Platform (CDP) Server Wallets v2. We’ll create policies — API-level firewalls that allow only the transactions you intend.]]></description>
            <content:encoded><![CDATA[<hr><h2 style="text-align: center" id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Introduction</h2><p>Automating on-chain actions on Solana can feel risky: one bad key leak or buggy transaction and funds are gone. Traditional guards like code reviews and unit tests help, but they don’t stop a live transaction.</p><p>Today, you’ll fix that with <strong>Coinbase Developer Platform (CDP) Server Wallets v2</strong>. We’ll create <strong>policies</strong> — API-level firewalls that allow only the transactions you intend. By the end, you’ll have a runnable TypeScript script that enforces SOL/SPL allowlists and a strict <strong>IDL-based policy</strong> for <strong>Jupiter v6</strong> swaps.</p><h2 style="text-align: center" id="h-what-youll-build" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What You’ll&nbsp;Build</h2><ul><li><p><span data-name="closed_lock_with_key" class="emoji" data-type="emoji">🔐</span> Create policies that only allow SOL transfers to trusted addresses</p></li><li><p><span data-name="coin" class="emoji" data-type="emoji">🪙</span> Restrict SPL token transfers to approved mints (USDC)</p></li><li><p><span data-name="mag_right" class="emoji" data-type="emoji">🔎</span> Validate instruction data with a custom <strong>IDL</strong> (Jupiter v6 “route”)</p></li><li><p><span data-name="rocket" class="emoji" data-type="emoji">🚀</span> Assemble a single script that creates all policies in one go</p></li></ul><div data-type="youtube" videoid="SrT5_cOclP8">
      <div class="youtube-player" data-id="SrT5_cOclP8" style="background-image: url('https://i.ytimg.com/vi/SrT5_cOclP8/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=SrT5_cOclP8">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><h3 id="h-system-architecture" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">System Architecture</h3><pre data-type="codeBlock" text="Dev Script (TypeScript) 
      │ uses
      ▼
 CDP SDK (Policies API)
      │ creates
      ▼
 Policy Objects (scope: account)
      │ enforced at
      ▼
 Server Wallets v2  ──&gt; Solana Runtime"><code>Dev <span class="hljs-title function_">Script</span> <span class="hljs-params">(TypeScript)</span> 
      │ uses
      ▼
 CDP <span class="hljs-title function_">SDK</span> <span class="hljs-params">(Policies API)</span>
      │ creates
      ▼
 Policy <span class="hljs-title function_">Objects</span> <span class="hljs-params">(scope: account)</span>
      │ enforced at
      ▼
 Server Wallets v2  ──&gt; Solana Runtime</code></pre><h3 id="h-how-it-works-2-3-sentences-each" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>How it works (2–3 sentences each):</strong></h3><ul><li><p><strong>CDP SDK</strong> — Programmatic entry to create/update policies.</p></li><li><p><strong>Policies</strong> — Declarative rules (allowlists, mint restrictions, IDL checks) that gate transactions before signing.</p></li><li><p><strong>Server Wallets v2</strong> — Managed, programmatic wallets that <strong>must</strong> satisfy active policies.</p></li><li><p><strong>Solana</strong> — Actual execution layer; transactions only flow if they pass the policy engine.</p></li></ul><hr><h2 style="text-align: center" id="h-step-by-step-walkthrough" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Step-by-Step Walkthrough</h2><h3 id="h-1-prerequisites-and-project-setup" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1) Prerequisites &amp; Project&nbsp;Setup</h3><p><strong>You’ll need</strong></p><ul><li><p>Node.js v18+</p></li><li><p>A CDP account, <strong>API Key (id + secret)</strong>, and <strong>Wallet Secret</strong> from the CDP Portal</p></li></ul><p><strong>Create &amp; init</strong></p><pre data-type="codeBlock" text="# Create your project
mkdir solana-policy-engine-tutorial
cd solana-policy-engine-tutorial

# Initialize Node.js project
npm init -y"><code># Create your project
mkdir solana<span class="hljs-operator">-</span>policy<span class="hljs-operator">-</span>engine<span class="hljs-operator">-</span>tutorial
cd solana<span class="hljs-operator">-</span>policy<span class="hljs-operator">-</span>engine<span class="hljs-operator">-</span>tutorial

# Initialize Node.js project
npm init <span class="hljs-operator">-</span>y</code></pre><p><strong>Install deps</strong></p><pre data-type="codeBlock" text="npm install @coinbase/cdp-sdk dotenv typescript ts-node @types/node"><code>npm install @coinbase<span class="hljs-operator">/</span>cdp<span class="hljs-operator">-</span>sdk dotenv typescript ts<span class="hljs-operator">-</span>node @types<span class="hljs-operator">/</span>node</code></pre><p><strong>Initialize TypeScript</strong></p><pre data-type="codeBlock" text="npx tsc --init --rootDir src --outDir dist --esModuleInterop --resolveJsonModule --module commonjs --moduleResolution node"><code>npx tsc <span class="hljs-operator">-</span><span class="hljs-operator">-</span>init <span class="hljs-operator">-</span><span class="hljs-operator">-</span>rootDir src <span class="hljs-operator">-</span><span class="hljs-operator">-</span>outDir dist <span class="hljs-operator">-</span><span class="hljs-operator">-</span>esModuleInterop <span class="hljs-operator">-</span><span class="hljs-operator">-</span>resolveJsonModule <span class="hljs-operator">-</span><span class="hljs-operator">-</span>module commonjs <span class="hljs-operator">-</span><span class="hljs-operator">-</span>moduleResolution node</code></pre><p><strong>Scaffold files</strong></p><pre data-type="codeBlock" text="mkdir src
touch src/main.ts
touch .env"><code><span class="hljs-built_in">mkdir</span> src
<span class="hljs-built_in">touch</span> src/main.ts
<span class="hljs-built_in">touch</span> .<span class="hljs-built_in">env</span></code></pre><p><strong>Add secrets to&nbsp;</strong><code>.env</code></p><pre data-type="codeBlock" text="# .env - Get these from the CDP Portal
CDP_API_KEY_ID=&quot;your_api_key_id&quot;
CDP_API_KEY_SECRET=&quot;your_api_key_secret&quot;
CDP_WALLET_SECRET=&quot;your_wallet_secret&quot;"><code><span class="hljs-comment"># .env - Get these from the CDP Portal</span>
<span class="hljs-attr">CDP_API_KEY_ID</span>=<span class="hljs-string">"your_api_key_id"</span>
<span class="hljs-attr">CDP_API_KEY_SECRET</span>=<span class="hljs-string">"your_api_key_secret"</span>
<span class="hljs-attr">CDP_WALLET_SECRET</span>=<span class="hljs-string">"your_wallet_secret"</span></code></pre><hr><h3 id="h-2-bootstrap-the-cdp-client" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2) Bootstrap the CDP&nbsp;Client</h3><p>Create <code>src/main.ts</code>:</p><pre data-type="codeBlock" text="// src/main.ts
import { CdpClient } from &quot;@coinbase/cdp-sdk&quot;;
import dotenv from &quot;dotenv&quot;;

dotenv.config();
const cdp = new CdpClient();
console.log(&quot;CDP Client Initialized Successfully.&quot;);
async function main() {
  console.log(&quot;\n--- Starting Policy Creation Script ---&quot;);
  // We'll call our policy functions here.
  console.log(&quot;\n--- ✅ All Policies Created Successfully ---&quot;);
}
main().catch((error) =&gt; {
  console.error(&quot;\nAn error occurred during policy creation:&quot;, error);
  process.exit(1);
});"><code><span class="hljs-comment">// src/main.ts</span>
<span class="hljs-keyword">import</span> { <span class="hljs-title">CdpClient</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"@coinbase/cdp-sdk"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">dotenv</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"dotenv"</span>;

dotenv.config();
const cdp <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> CdpClient();
console.log(<span class="hljs-string">"CDP Client Initialized Successfully."</span>);
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
  console.log(<span class="hljs-string">"\n--- Starting Policy Creation Script ---"</span>);
  <span class="hljs-comment">// We'll call our policy functions here.</span>
  console.log(<span class="hljs-string">"\n--- ✅ All Policies Created Successfully ---"</span>);
}
main().catch((<span class="hljs-function"><span class="hljs-keyword">error</span>) =&gt; </span>{
  console.error(<span class="hljs-string">"\nAn error occurred during policy creation:"</span>, <span class="hljs-function"><span class="hljs-keyword">error</span>)</span>;
  process.exit(<span class="hljs-number">1</span>);
});</code></pre><hr><h3 id="h-3-foundational-policies" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3) Foundational Policies</h3><h4 id="h-31-sol-address-allowlist" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">3.1 SOL Address Allowlist</h4><p>Only allow SOL transfers to a trusted set of addresses.</p><pre data-type="codeBlock" text="/**
 * Policy 1: SOL Address Allowlist
 * This policy only permits sending SOL to a specific list of trusted addresses.
 * Any attempt to send SOL elsewhere will be blocked at the API level.
 */
async function createSolAllowlistPolicy(cdp: CdpClient) {
    console.log(&quot;\nCreating a SOL address allowlist policy...&quot;);

    const policy = await cdp.policies.createPolicy({
        policy: {
            description: &quot;Allow SOL transfers to treasury addresses&quot;,
            scope: &quot;account&quot;, // This policy will be applied to a specific account
            rules: [
                {
                    action: &quot;accept&quot;, // Required: accept or deny
                    operation: &quot;signSolTransaction&quot;, // Required: Solana transaction operation
                    criteria: [
                        {
                            type: &quot;solAddress&quot;,
                            addresses: [
                                &quot;DtdSSG8ZJRZVv5Jx7K1MeWp7Zxcu19GD5wQRGRpQ9uMF&quot;, // Valid Treasury Address 1
                                &quot;HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT&quot;, // Valid Treasury Address 2
                            ],
                            operator: &quot;in&quot; // The 'to' address must be IN this list
                        }
                    ]
                }
            ]
        }
    });

    console.log(`Successfully created SOL Allowlist Policy with ID: ${policy.id}`);
    return policy.id;
}"><code><span class="hljs-comment">/**
 * Policy 1: SOL Address Allowlist
 * This policy only permits sending SOL to a specific list of trusted addresses.
 * Any attempt to send SOL elsewhere will be blocked at the API level.
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">createSolAllowlistPolicy</span>(<span class="hljs-params">cdp: CdpClient</span>) </span>{
    console.log(<span class="hljs-string">"\nCreating a SOL address allowlist policy..."</span>);

    const policy <span class="hljs-operator">=</span> await cdp.policies.createPolicy({
        policy: {
            description: <span class="hljs-string">"Allow SOL transfers to treasury addresses"</span>,
            scope: <span class="hljs-string">"account"</span>, <span class="hljs-comment">// This policy will be applied to a specific account</span>
            rules: [
                {
                    action: <span class="hljs-string">"accept"</span>, <span class="hljs-comment">// Required: accept or deny</span>
                    operation: <span class="hljs-string">"signSolTransaction"</span>, <span class="hljs-comment">// Required: Solana transaction operation</span>
                    criteria: [
                        {
                            <span class="hljs-keyword">type</span>: <span class="hljs-string">"solAddress"</span>,
                            addresses: [
                                <span class="hljs-string">"DtdSSG8ZJRZVv5Jx7K1MeWp7Zxcu19GD5wQRGRpQ9uMF"</span>, <span class="hljs-comment">// Valid Treasury Address 1</span>
                                <span class="hljs-string">"HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT"</span>, <span class="hljs-comment">// Valid Treasury Address 2</span>
                            ],
                            operator: <span class="hljs-string">"in"</span> <span class="hljs-comment">// The 'to' address must be IN this list</span>
                        }
                    ]
                }
            ]
        }
    });

    console.log(`Successfully created SOL Allowlist Policy with ID: ${policy.id}`);
    <span class="hljs-keyword">return</span> policy.id;
}</code></pre><h4 id="h-32-spl-token-mint-restriction-usdc-only" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">3.2 SPL Token Mint Restriction (USDC&nbsp;Only)</h4><p>Permit transfers only for approved mints (USDC shown below).</p><pre data-type="codeBlock" text="/**
 * Policy 2: SPL Token Mint Restriction
 * This policy only allows transfers of specific SPL tokens (USDC in this case)
 * by checking the token's mint address.
 */
async function createStablecoinOnlyPolicy(cdp: CdpClient) {
    console.log(&quot;\nCreating a stablecoin-only (USDC) transfer policy...&quot;);

    const USDC_MINT_ADDRESS = &quot;EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&quot;;

    const policy = await cdp.policies.createPolicy({
        policy: {
            description: &quot;Allow USDC SPL Token transfers only&quot;,
            scope: &quot;account&quot;,
            rules: [
                {
                    action: &quot;accept&quot;,
                    operation: &quot;signSolTransaction&quot;,
                    criteria: [
                        {
                            type: &quot;mintAddress&quot;,
                            addresses: [USDC_MINT_ADDRESS],
                            operator: &quot;in&quot;
                        }
                    ]
                }
            ]
        }
    });

    console.log(`Successfully created Stablecoin-Only Policy with ID: ${policy.id}`);
    return policy.id;
}"><code><span class="hljs-comment">/**
 * Policy 2: SPL Token Mint Restriction
 * This policy only allows transfers of specific SPL tokens (USDC in this case)
 * by checking the token's mint address.
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">createStablecoinOnlyPolicy</span>(<span class="hljs-params">cdp: CdpClient</span>) </span>{
    console.log(<span class="hljs-string">"\nCreating a stablecoin-only (USDC) transfer policy..."</span>);

    const USDC_MINT_ADDRESS <span class="hljs-operator">=</span> <span class="hljs-string">"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"</span>;

    const policy <span class="hljs-operator">=</span> await cdp.policies.createPolicy({
        policy: {
            description: <span class="hljs-string">"Allow USDC SPL Token transfers only"</span>,
            scope: <span class="hljs-string">"account"</span>,
            rules: [
                {
                    action: <span class="hljs-string">"accept"</span>,
                    operation: <span class="hljs-string">"signSolTransaction"</span>,
                    criteria: [
                        {
                            <span class="hljs-keyword">type</span>: <span class="hljs-string">"mintAddress"</span>,
                            addresses: [USDC_MINT_ADDRESS],
                            operator: <span class="hljs-string">"in"</span>
                        }
                    ]
                }
            ]
        }
    });

    console.log(`Successfully created Stablecoin<span class="hljs-operator">-</span>Only Policy with ID: ${policy.id}`);
    <span class="hljs-keyword">return</span> policy.id;
}</code></pre><hr><h3 id="h-4-advanced-policy-with-a-custom-idl-jupiter-v6" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4) Advanced Policy with a Custom IDL (Jupiter&nbsp;v6)</h3><p>Validate instruction <strong>data</strong> using the program’s <strong>IDL</strong> so only intended Jupiter “route” swaps are allowed — and cap the size.</p><ol><li><p>Save the Jupiter v6 IDL JSON as <code>src/jupiter-v6-idl.json</code> (from explorer/IDL source).</p></li><li><p>Add the policy creator:</p></li></ol><pre data-type="codeBlock" text="/**
 * Policy 3: Advanced Jupiter Swap Policy (solData + minimal IDL)
 * - Enforces a maximum input amount for Jupiter `route` swaps
 * - Validates instruction data against a minimal inline IDL built from
 *   `src/jupiter-v6-idl.json`
 * - Effect: Only allows signing Jupiter `route` swaps when `in_amount` &lt;= 1 SOL;
 *   other transactions won't satisfy this rule
 */
async function createJupiterSwapPolicy(cdp: CdpClient) {
    console.log(&quot;\nCreating an advanced policy for Jupiter swaps...&quot;);

    const MAX_SWAP_AMOUNT_LAMPORTS = &quot;1000000000&quot;; // 1 SOL (lamports, as string)
    const JUPITER_PROGRAM_ID = &quot;JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4&quot;;

    // Build a minimal inline IDL for the `route` instruction for the API
    const routeIx = (jupiterIdl.instructions as any[]).find((ix) =&gt; ix?.name === 'route');
    if (!routeIx) {
        throw new Error('Jupiter IDL does not include route instruction');
    }
    const jupiterRouteIdl = {
        address: JUPITER_PROGRAM_ID,
        instructions: [
            {
                name: 'route',
                discriminator: routeIx.discriminator,
                args: [
                    { name: 'route_plan', type: 'vec&lt;defined:RoutePlanStep&gt;' },
                    { name: 'in_amount', type: 'u64' },
                    { name: 'quoted_out_amount', type: 'u64' },
                    { name: 'slippage_bps', type: 'u16' },
                    { name: 'platform_fee_bps', type: 'u8' },
                ],
            },
        ],
    };

    const policy = await cdp.policies.createPolicy({
        policy: {
            description: &quot;Allow SOL USDC swaps on Jupiter max 1 SOL&quot;,
            scope: &quot;account&quot;,
            rules: [
                {
                    action: &quot;accept&quot;,
                    operation: &quot;signSolTransaction&quot;,
                    criteria: [
                        {
                            type: &quot;solData&quot;,
                            idls: [jupiterRouteIdl],
                            conditions: [
                                {
                                    instruction: &quot;route&quot;,
                                    // Guardrail: limit maximum input amount for swaps
                                    params: [
                                        { name: &quot;in_amount&quot;, operator: &quot;&lt;=&quot;, value: MAX_SWAP_AMOUNT_LAMPORTS }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    });

    console.log(`Successfully created Jupiter Swap Policy with ID: ${policy.id}`);
    return policy.id;
}"><code><span class="hljs-comment">/**
 * Policy 3: Advanced Jupiter Swap Policy (solData + minimal IDL)
 * - Enforces a maximum input amount for Jupiter `route` swaps
 * - Validates instruction data against a minimal inline IDL built from
 *   `src/jupiter-v6-idl.json`
 * - Effect: Only allows signing Jupiter `route` swaps when `in_amount` &lt;= 1 SOL;
 *   other transactions won't satisfy this rule
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">createJupiterSwapPolicy</span>(<span class="hljs-params">cdp: CdpClient</span>) </span>{
    console.log(<span class="hljs-string">"\nCreating an advanced policy for Jupiter swaps..."</span>);

    const MAX_SWAP_AMOUNT_LAMPORTS <span class="hljs-operator">=</span> <span class="hljs-string">"1000000000"</span>; <span class="hljs-comment">// 1 SOL (lamports, as string)</span>
    const JUPITER_PROGRAM_ID <span class="hljs-operator">=</span> <span class="hljs-string">"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"</span>;

    <span class="hljs-comment">// Build a minimal inline IDL for the `route` instruction for the API</span>
    const routeIx <span class="hljs-operator">=</span> (jupiterIdl.instructions <span class="hljs-keyword">as</span> any[]).find((ix) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> ix?.<span class="hljs-built_in">name</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">'route'</span>);
    <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>routeIx) {
        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">'Jupiter IDL does not include route instruction'</span>);
    }
    const jupiterRouteIdl <span class="hljs-operator">=</span> {
        <span class="hljs-keyword">address</span>: JUPITER_PROGRAM_ID,
        instructions: [
            {
                name: <span class="hljs-string">'route'</span>,
                discriminator: routeIx.discriminator,
                args: [
                    { name: <span class="hljs-string">'route_plan'</span>, <span class="hljs-keyword">type</span>: <span class="hljs-string">'vec&lt;defined:RoutePlanStep&gt;'</span> },
                    { name: <span class="hljs-string">'in_amount'</span>, <span class="hljs-keyword">type</span>: <span class="hljs-string">'u64'</span> },
                    { name: <span class="hljs-string">'quoted_out_amount'</span>, <span class="hljs-keyword">type</span>: <span class="hljs-string">'u64'</span> },
                    { name: <span class="hljs-string">'slippage_bps'</span>, <span class="hljs-keyword">type</span>: <span class="hljs-string">'u16'</span> },
                    { name: <span class="hljs-string">'platform_fee_bps'</span>, <span class="hljs-keyword">type</span>: <span class="hljs-string">'u8'</span> },
                ],
            },
        ],
    };

    const policy <span class="hljs-operator">=</span> await cdp.policies.createPolicy({
        policy: {
            description: <span class="hljs-string">"Allow SOL USDC swaps on Jupiter max 1 SOL"</span>,
            scope: <span class="hljs-string">"account"</span>,
            rules: [
                {
                    action: <span class="hljs-string">"accept"</span>,
                    operation: <span class="hljs-string">"signSolTransaction"</span>,
                    criteria: [
                        {
                            <span class="hljs-keyword">type</span>: <span class="hljs-string">"solData"</span>,
                            idls: [jupiterRouteIdl],
                            conditions: [
                                {
                                    instruction: <span class="hljs-string">"route"</span>,
                                    <span class="hljs-comment">// Guardrail: limit maximum input amount for swaps</span>
                                    params: [
                                        { name: <span class="hljs-string">"in_amount"</span>, operator: <span class="hljs-string">"&lt;="</span>, <span class="hljs-built_in">value</span>: MAX_SWAP_AMOUNT_LAMPORTS }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    });

    console.log(`Successfully created Jupiter Swap Policy with ID: ${policy.id}`);
    <span class="hljs-keyword">return</span> policy.id;
}</code></pre><hr><h3 id="h-5-wire-it-all-up" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">5) Wire It All&nbsp;Up</h3><p>Update the bottom of <code>src/main.ts</code> to create all policies:</p><pre data-type="codeBlock" text="/**
 * Main: create three policies in sequence
 */
async function main() {
    console.log(&quot;\n--- Starting Policy Creation Script ---&quot;);

    try {
        // Create foundational policies
        await createSolAllowlistPolicy(cdp);
        await createStablecoinOnlyPolicy(cdp);

        // Create advanced, IDL-based policy
        await createJupiterSwapPolicy(cdp);

        console.log(&quot;\n--- ✅ All Policies Created Successfully ---&quot;);
    } catch (error) {
        console.error(&quot;\nAn error occurred during policy creation:&quot;, error);
        throw error;
    }
}

// Execute the main function with proper error handling
main().catch(error =&gt; {
    console.error(&quot;\nFatal error in policy creation:&quot;, error);
    process.exit(1);
});"><code><span class="hljs-comment">/**
 * Main: create three policies in sequence
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    console.log(<span class="hljs-string">"\n--- Starting Policy Creation Script ---"</span>);

    <span class="hljs-keyword">try</span> {
        <span class="hljs-comment">// Create foundational policies</span>
        await createSolAllowlistPolicy(cdp);
        await createStablecoinOnlyPolicy(cdp);

        <span class="hljs-comment">// Create advanced, IDL-based policy</span>
        await createJupiterSwapPolicy(cdp);

        console.log(<span class="hljs-string">"\n--- ✅ All Policies Created Successfully ---"</span>);
    } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>) </span>{
        console.error(<span class="hljs-string">"\nAn error occurred during policy creation:"</span>, <span class="hljs-function"><span class="hljs-keyword">error</span>)</span>;
        <span class="hljs-keyword">throw</span> <span class="hljs-function"><span class="hljs-keyword">error</span></span>;
    }
}

<span class="hljs-comment">// Execute the main function with proper error handling</span>
main().catch(<span class="hljs-function"><span class="hljs-keyword">error</span> =&gt; </span>{
    console.error(<span class="hljs-string">"\nFatal error in policy creation:"</span>, <span class="hljs-function"><span class="hljs-keyword">error</span>)</span>;
    process.exit(<span class="hljs-number">1</span>);
});</code></pre><p><strong>Run it</strong></p><pre data-type="codeBlock" text="npx tsc &amp;&amp; node dist/main.js"><code>npx tsc <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> node dist<span class="hljs-operator">/</span>main.js</code></pre><p>Watch the console for policy IDs. These policies now protect your <strong>account-scoped</strong> server wallet operations.</p><hr><h2 style="text-align: center" id="h-conclusion-and-call-to-action" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Conclusion &amp; Call to&nbsp;Action</h2><p>You just stood up a <strong>practical Solana policy layer</strong>: SOL allowlists, SPL mint restrictions, and a <strong>Jupiter v6 IDL policy</strong> that inspects instruction data and caps swap size. This is the backbone of safer backends — especially for bots, treasuries, and automated services.</p><h4 id="h-next-steps" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>Next steps</strong></h4><ul><li><p>Expand the allowlists/mints for your app</p></li><li><p>Add program-specific IDL rules for other protocols</p></li><li><p>Combine with alerting &amp; CI to treat policies as code</p></li></ul><h4 id="h-keep-building" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>Keep building</strong></h4><ul><li><p>Coinbase Developer Docs: <code>https://docs.cdp.coinbase.com</code></p></li><li><p>Join the Coinbase Developer Discord to swap patterns and ask questions</p></li></ul><hr><h2 style="text-align: center" id="h-resources-and-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Resources &amp;&nbsp;Links</h2><p><strong>Jupiter — (find program/IDL references via explorers)</strong></p><div data-type="embedly" src="https://www.jup.ag" data="{&quot;provider_url&quot;:&quot;https://www.jup.ag&quot;,&quot;description&quot;:&quot;Jupiter is one of the largest decentralized trading platforms and one of the most active governance communities in crypto. We're building the everything exchange for everyone.&quot;,&quot;title&quot;:&quot;Jupiter: The DeFi Superapp&quot;,&quot;thumbnail_width&quot;:2400,&quot;url&quot;:&quot;https://www.jup.ag&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/1a0b85f80f00e7528a6f8eb0d5ca5b6187de66834ee2652d3f6612f8c7493946.webp&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Jupiter&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1254,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAPoAAAD6AG1e1JrAAAEV0lEQVR4nK1SbUxbVRi+H+ec3tt7295Dy+1tb1ugt7LSLzq+OkYrA4GNyqdYcFIsYRljkQwnCyCfkmBMMRiREswmkjjjPhKdGZqZOBdNFk1MZjSY6B//zGTzz1xMJP7wR83lEtaYJUvMnjw/7nvOe573fd77EjSjowBN7uAJpbA8GHSJYkUoyHEc+ThAQI4VnDasuEiS5DiuNOivqggXupyPRZ0kSQIY9N72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l6uOjKWVPrarPGooSbEVIb4g0+BYjdyWXbdmE0qseEh3LkCVgxtWJUusgOvC4U8hpqQNR5Vki3E/Oup3pVXmtJjVWcGlP52e6Kr9/zdtgvZoxu3deEK1Y1TgrJZdW3Dqq0caodQzkcFElRk4HXBgMJEfMZD5dbWWqW/verMwL8b9O49mEVjPQAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1254,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/1a0b85f80f00e7528a6f8eb0d5ca5b6187de66834ee2652d3f6612f8c7493946.webp&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/1a0b85f80f00e7528a6f8eb0d5ca5b6187de66834ee2652d3f6612f8c7493946.webp"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.jup.ag" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Jupiter: The DeFi Superapp</h2><p>Jupiter is one of the largest decentralized trading platforms and one of the most active governance communities in crypto. We're building the everything exchange for everyone.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.jup.ag</span></div><img src="https://storage.googleapis.com/papyrus_images/1a0b85f80f00e7528a6f8eb0d5ca5b6187de66834ee2652d3f6612f8c7493946.webp"></div></a></div></div><p><strong>CDP Wallets v2 Docs:&nbsp;</strong></p><div data-type="embedly" src="https://docs.cdp.coinbase.com/server-wallets/v2/introduction/welcome" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;The v2 Server Wallet enables developers to programmatically create, manage, and use crypto accounts while CDP secures the private keys and handles complex infrastructure management. Developers can access the v2 Server Wallet through either the CDP SDK or CDP's REST endpoints.&quot;,&quot;title&quot;:&quot;Welcome to Server Wallet v2 - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com/server-wallets/v2/introduction/welcome&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFY0lEQVR4nGWUe0yTVxjGT4zu8sfi3BKMZsuI2dARNXOaKYsaI8MAGmVOFGc6cCrILBTFyU1EmCIXqVALBVrLpbYlla6jq4XSC7WWUimFFlqoLbXcPinFlhZsWS+zy/d9xZjsy5uT88/3e57zvO854E0w6A/8+yYYRDYBn8/3Jhj0+gJLbq99wfPy1dIEtGCaso+abRrDrFoP9Wmmng5OSJ6ZhYpxvtzIe2LgiPWPunUswQizc5jO09J4mhbuEFrNfw0CFD095/L6YboXLr972edweWbtS5OzTjPkGDXbtEarWg/1aqakKotYae5C0B2SsfZuXds7XCpHTeWoyWxVA1tVz+pvYKtAMBgUKEzg0+SqJlkTue5qTl41oXYSmrctuN/13o/Qe1QvhEozX27skIyxRXqWYARGI1wyQqxj9RPblARGXw09VLCAGXJEZ7Y+HbRohgYEQolYKodsrhmba3z6f3QkFo5k9FG3jtk5TONpmhA0yq2h9+FpvXdb5OVNsjKqrJQiLa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yWUeyaPtTqTtTGsJP3v8QNX7oDozeWwT2XAe78uBa9vmX3N5ln3/O8dpgeaU1WpXD0/DlUox3SMZYQh2Np0FHs6JZfrNBklMt+A0Zm5+uMWMzWqPOkyMxpLBExDtK31MIvs0F238HkVfAlsuwgMPlmbY6x6ftY5Z5DTL+b0/QhrxoDWwVgdFXRpUVEkXZVZ1ptzrO5D86ls04cLEJtQ8S8HAyKP2bHBgdgQObLoHw9P8AudwgmRE+lWAAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com/server-wallets/v2/introduction/welcome" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Welcome to Server Wallet v2 - Coinbase Developer Documentation</h2><p>The v2 Server Wallet enables developers to programmatically create, manage, and use crypto accounts while CDP secures the private keys and handles complex infrastructure management. Developers can access the v2 Server Wallet through either the CDP SDK or CDP's REST endpoints.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png"></div></a></div></div><p><strong>CDP SDK Github:&nbsp;</strong></p><div data-type="embedly" src="https://github.com/coinbase/cdp-sdk" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;Client libraries for managing EVM and Solana wallets while relying on CDP to secure private keys. - coinbase/cdp-sdk&quot;,&quot;title&quot;:&quot;GitHub - coinbase/cdp-sdk: Client libraries for managing EVM and Solana wallets while relying on CDP to secure private keys.&quot;,&quot;author_name&quot;:&quot;coinbase&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/coinbase/cdp-sdk&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/8b6d3a331fe40923301c3bb7343d74d8c05c8b886f706a900a0f286a4e6721f3.png&quot;,&quot;author_url&quot;:&quot;https://github.com/coinbase&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAACXBIWXMAAAsTAAALEwEAmpwYAAADb0lEQVR4nKVUX0wURxz+pT71qanxraYPNanhiRj/4INgrDzQZz2gpIl/qg2meMAZTXwgDZqT2MZAG9LG9k2psSI1mhNDBcrx99jzlt3jjj0PEBXvQATOY29n55ibnWZ3lrsDGl76ZbKZ37e/mW/m+80MMAuUUv7dDMaYQamx9ndDGh9ukUa2z0POQB61cfx/zkXX/82fEWHyai6pvFhMqJhkbD1bAFlIJpOJRCIej79bXMQYE0I4ubCwQAiR5aCqqtZcBGPc9fTp7OwsYyy9mmGMnbjiAfgCtldDYQNAGex0clVTQMf415u/N3zfeNXd9M3Z6ouXLjsqq2pdLkdl1clTZ2+0/Oz46us9+w9u+/CjTz797M7dP4uPlO7aXQAAuz4vSKU0S8CAvY0AjuFgrM//quhcG0CZjom9A0qpJMteb7//WWDE5wuI4iOPxzsw4Ons7PP2T05Nezo7b91ua25pdda5EEJd3d2trb/cut3214OHK6rK3YAvW1w/9cDH1QCFZa522Fn7ZmElZ5GOTSCEVFVFSOfmEEIopRpCGKcpNVRV5byOcX4l7JUevl7ivFtafw92nGv+Q4APTr9d1nI7UJTIiM8/Hp4YFQKjQkCSg5IcjESioiz3eQeHhnxDQz6LD0lyKBQKcyaZTJr1WxMA2O9oeHizYwygCuAor7ItEA4rvf/0S3JoYiLiE/xcTxwLRqKTimIzihKR5KASiYbDiijLo0LgmSj5hICGEGPs8eAUHPkBDl0zv/saT1zx5IqcPUUWuFtYVdVUSkNI1zHWrROlIWTGGPMOMq0z0/IP62bk7sH/BKUGXs2krcY76wS2XgXLu4Z5t9TYOn+DgJ296QEwseECEwvZcGuYAoSQ59HJ/oGBmZmXWXF/QBIEPz8njLHpFzPiWLCnp5cxNjc/L4pSb28fxnizUWbyy9iTnmFbQMdpDaFUSotEpwKiLI+Hx8PKippaTqzMxuJjcmhCiS4tJzSE4vG54eGR94n3hJClpSVB8MfexAxK+YY48CrJMPZ86rXn70GEzXBdkU1rzeWvMzfLGIylM7k3M52h2RdtK4vgQLndiiqgqBIOWu1AOew7ZpGcqYA9x+u/PdP1Y227+3y7u6bdXdPR5Oxoct5319y3wgfXvvut4TyU1EFJPRTXwSEnFF+Aw6f+Bby2C31qFhMsAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/8b6d3a331fe40923301c3bb7343d74d8c05c8b886f706a900a0f286a4e6721f3.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/8b6d3a331fe40923301c3bb7343d74d8c05c8b886f706a900a0f286a4e6721f3.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/coinbase/cdp-sdk" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - coinbase/cdp-sdk: Client libraries for managing EVM and Solana wallets while relying on CDP to secure private keys.</h2><p>Client libraries for managing EVM and Solana wallets while relying on CDP to secure private keys. - coinbase/cdp-sdk</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://storage.googleapis.com/papyrus_images/8b6d3a331fe40923301c3bb7343d74d8c05c8b886f706a900a0f286a4e6721f3.png"></div></a></div></div><p><strong>Demo Github:</strong></p><div data-type="embedly" src="https://github.com/HeimLabs/coinbase-cdp-demos" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;A collection of Demo Projects exploring the Coinbase Developer Platform - HeimLabs/coinbase-cdp-demos&quot;,&quot;title&quot;:&quot;GitHub - HeimLabs/coinbase-cdp-demos: A collection of Demo Projects exploring the Coinbase Developer Platform&quot;,&quot;url&quot;:&quot;https://github.com/HeimLabs/coinbase-cdp-demos&quot;,&quot;author_name&quot;:&quot;HeimLabs&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;author_url&quot;:&quot;https://github.com/HeimLabs&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;}" format="small"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/HeimLabs/coinbase-cdp-demos" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - HeimLabs/coinbase-cdp-demos: A collection of Demo Projects exploring the Coinbase Developer Platform</h2><p>A collection of Demo Projects exploring the Coinbase Developer Platform - HeimLabs/coinbase-cdp-demos</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div></div></a></div></div><p><strong>HeimLabs</strong>:</p><div data-type="embedly" src="https://www.heimlabs.com" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJD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Upn00Tz4tOp3TeOD6KGyOXG6IVtLRe3No+5s2J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><hr><p>Clap if this saved you hours, and share what you’re building with the CDP stack!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p><br>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/e2abb80becc36a4c211950daee3a627eeb4733210fb59c98fbe9eea9e5208a93.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Ship a Viral Base Mini App with MiniKit - from Scratch in Next.js]]></title>
            <link>https://paragraph.com/@heimlabs/ship-a-viral-base-mini-app-with-minikit-from-scratch-in-nextjs</link>
            <guid>x7brmIxYYwBBYu6IV1LE</guid>
            <pubDate>Thu, 16 Oct 2025 14:00:04 GMT</pubDate>
            <description><![CDATA[App installs, cold-start social graphs, and clunky wallets kill growth. Traditional apps fight for app-store rankings while your users bounce before the first tap. Today we’ll build a Base Mini App — a lightweight, social-native web app that launches instantly inside clients like the Base App and Farcaster. Using MiniKit (for frames + native hooks) and OnchainKit (for polished UI + onchain utilities), you’ll ship a “Social Trivia” app that feels at home in the feed.]]></description>
            <content:encoded><![CDATA[<hr><h2 id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Introduction</h2><p>App installs, cold-start social graphs, and clunky wallets kill growth. Traditional apps fight for app-store rankings while your users bounce before the first tap.</p><p>Today we’ll build a <strong>Base Mini App</strong> — a lightweight, social-native web app that launches instantly inside clients like the Base App and Farcaster. Using <strong>MiniKit</strong> (for frames + native hooks) and <strong>OnchainKit</strong> (for polished UI + onchain utilities), you’ll ship a “Social Trivia” app that feels at home in the feed and scales via sharing.</p><p>By the end, you’ll have a working Mini App with a clean viral loop, context-aware UI, smooth native controls, and an optional <strong>gasless</strong> onchain leaderboard on Base.</p><h2 id="h-what-youll-build" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What You’ll&nbsp;Build</h2><ul><li><p><span data-name="high_voltage" class="emoji" data-type="emoji">⚡</span> Launch a Next.js Mini App with a signed <strong>Farcaster manifest</strong></p></li><li><p><span data-name="compass" class="emoji" data-type="emoji">🧭</span> Use <strong>MiniKit</strong> hooks for context, auth, share, and navigation</p></li><li><p><span data-name="people_holding_hands" class="emoji" data-type="emoji">🧑‍🤝‍🧑</span> Render identity with <strong>OnchainKit</strong>’s Avatar/Name components</p></li><li><p><span data-name="mega" class="emoji" data-type="emoji">📣</span> Create a <strong>viral loop</strong> with dynamic embeds + <code>useComposeCast</code></p></li><li><p><span data-name="fuelpump" class="emoji" data-type="emoji">⛽</span> Store scores <strong>onchain</strong> with a paymaster-sponsored flow (gasless UX)</p></li></ul><p>(Watch the Video here)</p><div data-type="youtube" videoid="KOeFW0e6HeI">
      <div class="youtube-player" data-id="KOeFW0e6HeI" style="background-image: url('https://i.ytimg.com/vi/KOeFW0e6HeI/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=KOeFW0e6HeI">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><hr><h2 id="h-system-architecture" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">System Architecture</h2><ol><li><p><strong>User → Mini App (WebView in client)</strong>: Tap-to-open from a cast or DM.</p></li><li><p><strong>MiniKit Context</strong>: Provides device safe areas, user FID, client info.</p></li><li><p><strong>UI &amp; Logic (Next.js + OnchainKit)</strong>: Trivia flow, identity display, sharing.</p></li><li><p><strong>Smart Contract (Base)</strong>: Optional leaderboard storage, paymaster-sponsored.</p></li><li><p><strong>Social Client</strong>: Native share sheets, in-app browser, profile/cast deep links.</p></li></ol><p><strong>MiniKit</strong><br>&nbsp;Harnesses the in-client runtime: safe area insets, native buttons, closing flows, social navigation, and sharing.</p><p><strong>OnchainKit</strong><br>&nbsp;UI primitives (Avatar, Name,&nbsp;…) and helpers that match ecosystem UX conventions.</p><p><strong>Blockchain (Base)</strong><br>&nbsp;Leaderboard contract on Base; optional paymaster for gasless writes.</p><hr><h2 id="h-part-1-the-why-onchain-apps-built-for-the-feed" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Part 1: The Why — Onchain Apps, Built for the&nbsp;Feed</h2><p>Mini Apps flip the model. Instead of dragging users to an app store, <strong>the app goes to the user</strong> — living inside the feed, casting UI as content. You inherit an onchain social graph (Farcaster), skip installs, and unlock viral distribution.</p><hr><h2 id="h-part-2-the-how-build-social-trivia-end-to-end" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Part 2: The How — Build “Social Trivia” (End-to-End)</h2><h3 id="h-prerequisites" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Prerequisites</h3><ul><li><p>Farcaster account (for testing + manifest signing)</p></li><li><p>Node.js v18+</p></li><li><p>A tunneling service (e.g., <strong>ngrok</strong>) for public dev URL</p></li></ul><hr><h3 id="h-step-1-scaffold-manifest-and-validation" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 1: Scaffold, Manifest &amp; Validation</h3><p><strong>Bootstrap the project</strong></p><pre data-type="codeBlock" text="# Scaffold a new Mini Appnpx create-onchain --mini"><code># Scaffold a <span class="hljs-keyword">new</span> Mini Appnpx create<span class="hljs-operator">-</span>onchain <span class="hljs-operator">-</span><span class="hljs-operator">-</span>mini</code></pre><p><strong>Create the Farcaster manifest</strong> at <code>/public/.well-known/farcaster.json</code>:</p><pre data-type="codeBlock" text="function withValidProperties(
  properties: Record&lt;string, undefined | string | string[]&gt;,
) {
  return Object.fromEntries(
    Object.entries(properties).filter(([key, value]) =&gt; {
      if (Array.isArray(value)) {
        return value.length &gt; 0;
      }
      return !!value;
    }),
  );
}

export async function GET() {
  const URL = process.env.NEXT_PUBLIC_URL;

  return Response.json({
    accountAssociation: {
      header: process.env.FARCASTER_HEADER,
      payload: process.env.FARCASTER_PAYLOAD,
      signature: process.env.FARCASTER_SIGNATURE,
    },
    frame: withValidProperties({
      version: &quot;1&quot;,
      name: process.env.NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME,
      subtitle: process.env.NEXT_PUBLIC_APP_SUBTITLE,
      description: process.env.NEXT_PUBLIC_APP_DESCRIPTION,
      screenshotUrls: [],
      iconUrl: process.env.NEXT_PUBLIC_APP_ICON,
      splashImageUrl: process.env.NEXT_PUBLIC_APP_SPLASH_IMAGE,
      splashBackgroundColor: process.env.NEXT_PUBLIC_SPLASH_BACKGROUND_COLOR,
      homeUrl: URL,
      webhookUrl: `${URL}/api/webhook`,
      primaryCategory: process.env.NEXT_PUBLIC_APP_PRIMARY_CATEGORY,
      tags: [],
      heroImageUrl: process.env.NEXT_PUBLIC_APP_HERO_IMAGE,
      tagline: process.env.NEXT_PUBLIC_APP_TAGLINE,
      ogTitle: process.env.NEXT_PUBLIC_APP_OG_TITLE,
      ogDescription: process.env.NEXT_PUBLIC_APP_OG_DESCRIPTION,
      ogImageUrl: process.env.NEXT_PUBLIC_APP_OG_IMAGE,
    }),
    baseBuilder: {
      allowedAddresses: [&quot;base-builder-address-here&quot;],
    },
  });
}"><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">withValidProperties</span>(<span class="hljs-params">
  properties: Record&lt;<span class="hljs-keyword">string</span>, undefined | <span class="hljs-keyword">string</span> | <span class="hljs-keyword">string</span>[]&gt;,
</span>) </span>{
  <span class="hljs-keyword">return</span> Object.fromEntries(
    Object.entries(properties).filter(([key, value]) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
      <span class="hljs-keyword">if</span> (Array.isArray(value)) {
        <span class="hljs-keyword">return</span> value.<span class="hljs-built_in">length</span> <span class="hljs-operator">&gt;</span> <span class="hljs-number">0</span>;
      }
      <span class="hljs-keyword">return</span> <span class="hljs-operator">!</span><span class="hljs-operator">!</span>value;
    }),
  );
}

export async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">GET</span>(<span class="hljs-params"></span>) </span>{
  const URL <span class="hljs-operator">=</span> process.env.NEXT_PUBLIC_URL;

  <span class="hljs-keyword">return</span> Response.json({
    accountAssociation: {
      header: process.env.FARCASTER_HEADER,
      payload: process.env.FARCASTER_PAYLOAD,
      signature: process.env.FARCASTER_SIGNATURE,
    },
    frame: withValidProperties({
      version: <span class="hljs-string">"1"</span>,
      name: process.env.NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME,
      subtitle: process.env.NEXT_PUBLIC_APP_SUBTITLE,
      description: process.env.NEXT_PUBLIC_APP_DESCRIPTION,
      screenshotUrls: [],
      iconUrl: process.env.NEXT_PUBLIC_APP_ICON,
      splashImageUrl: process.env.NEXT_PUBLIC_APP_SPLASH_IMAGE,
      splashBackgroundColor: process.env.NEXT_PUBLIC_SPLASH_BACKGROUND_COLOR,
      homeUrl: URL,
      webhookUrl: `${URL}<span class="hljs-operator">/</span>api<span class="hljs-operator">/</span>webhook`,
      primaryCategory: process.env.NEXT_PUBLIC_APP_PRIMARY_CATEGORY,
      tags: [],
      heroImageUrl: process.env.NEXT_PUBLIC_APP_HERO_IMAGE,
      tagline: process.env.NEXT_PUBLIC_APP_TAGLINE,
      ogTitle: process.env.NEXT_PUBLIC_APP_OG_TITLE,
      ogDescription: process.env.NEXT_PUBLIC_APP_OG_DESCRIPTION,
      ogImageUrl: process.env.NEXT_PUBLIC_APP_OG_IMAGE,
    }),
    baseBuilder: {
      allowedAddresses: [<span class="hljs-string">"base-builder-address-here"</span>],
    },
  });
}</code></pre><blockquote><p><em>Dev tip: Farcaster clients can’t access </em><code>localhost</code><em>. Expose your app with </em><strong><em>ngrok</em></strong><em> and validate your URLs using the official </em><strong><em>Farcaster Manifest</em></strong><em> and </em><strong><em>Embed validators</em></strong><em> before debugging anything else.</em></p></blockquote><hr><h3 id="h-step-2-context-aware-ui-with-onchainkit-minikit" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 2: Context-Aware UI with OnchainKit +&nbsp;MiniKit</h3><p><code>app/components/AppLayout.tsx</code></p><pre data-type="codeBlock" text="/// app/components/AppLayout.tsx
'use client';

import { useMiniKit } from '@coinbase/onchainkit/minikit';
import { ReactNode } from 'react';

export default function AppLayout({ children }: { children: ReactNode }) {
  const { context } = useMiniKit();
  
  const style = {
    paddingTop: `${context?.client?.safeAreaInsets?.top ?? 0}px`,
    paddingBottom: `${context?.client?.safeAreaInsets?.bottom ?? 0}px`,
    minHeight: '100vh',
    display: 'flex',
    flexDirection: 'column' as const,
  };
  
  return (
    &lt;main style={style} className=&quot;bg-gradient-to-b from-slate-900 to-slate-800&quot;&gt;
      {children}
    &lt;/main&gt;
  );
}"><code><span class="hljs-comment">/// app/components/AppLayout.tsx</span>
<span class="hljs-string">'use client'</span>;

<span class="hljs-keyword">import</span> { <span class="hljs-title">useMiniKit</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'@coinbase/onchainkit/minikit'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">ReactNode</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'react'</span>;

export default <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">AppLayout</span>(<span class="hljs-params">{ children }: { children: ReactNode }</span>) </span>{
  const { context } <span class="hljs-operator">=</span> useMiniKit();
  
  const style <span class="hljs-operator">=</span> {
    paddingTop: `${context?.client?.safeAreaInsets?.top ?? <span class="hljs-number">0</span>}px`,
    paddingBottom: `${context?.client?.safeAreaInsets?.bottom ?? <span class="hljs-number">0</span>}px`,
    minHeight: <span class="hljs-string">'100vh'</span>,
    display: <span class="hljs-string">'flex'</span>,
    flexDirection: <span class="hljs-string">'column'</span> <span class="hljs-keyword">as</span> const,
  };
  
  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&lt;</span>main style<span class="hljs-operator">=</span>{style} className<span class="hljs-operator">=</span><span class="hljs-string">"bg-gradient-to-b from-slate-900 to-slate-800"</span><span class="hljs-operator">&gt;</span>
      {children}
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>main<span class="hljs-operator">&gt;</span>
  );
}</code></pre><p><code>app/page.tsx</code></p><pre data-type="codeBlock" text="// app/page.tsx
// ⚠️ SECURITY CRITICAL:
// The context object is for display and personalization ONLY.
// It is unverified and must not be used to authorize actions on your backend.
// For secure actions, you must use the useAuthenticate hook.
// app/page.tsx
&quot;use client&quot;;

import { useEffect } from &quot;react&quot;;
import { useMiniKit } from &quot;@coinbase/onchainkit/minikit&quot;;
import AppLayout from &quot;./components/AppLayout&quot;;
import TriviaGame from &quot;./components/TriviaGame&quot;;

export default function App() {
  const { setFrameReady, isFrameReady, context } = useMiniKit();
  const userFid = context?.user?.fid;
  const username = context?.user?.username;
  const pfpUrl = context?.user?.pfpUrl;
  const displayName = context?.user?.displayName;

  useEffect(() =&gt; {
    if (!isFrameReady) {
      setFrameReady();
    }
  }, [setFrameReady, isFrameReady]);

  return (
    &lt;AppLayout&gt;
      &lt;div className=&quot;flex-1 flex flex-col&quot;&gt;
        {/* Header */}
        &lt;div className=&quot;flex items-center justify-between p-4 bg-black/20 backdrop-blur-sm&quot;&gt;
          &lt;div className=&quot;flex items-center gap-3&quot;&gt;
            {userFid ? (
              &lt;&gt;
                {pfpUrl &amp;&amp; (
                  &lt;img
                    src={pfpUrl}
                    alt={displayName || username || 'User'}
                    className=&quot;h-10 w-10 rounded-full&quot;
                  /&gt;
                )}
                &lt;div&gt;
                  &lt;h1 className=&quot;text-xl font-bold text-white&quot;&gt;
                    &lt;span&gt;{displayName || username || 'Anonymous'}&lt;/span&gt;
                  &lt;/h1&gt;
                &lt;/div&gt;
              &lt;/&gt;
            ) : (
              &lt;h1 className=&quot;text-xl font-bold text-white&quot;&gt;Social Trivia&lt;/h1&gt;
            )}
          &lt;/div&gt;
        &lt;/div&gt;

        {/* Game */}
        &lt;div className=&quot;flex-1&quot;&gt;
          &lt;TriviaGame userFid={userFid as number} username={username as string} /&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/AppLayout&gt;
  );
}"><code><span class="hljs-comment">// app/page.tsx</span>
<span class="hljs-comment">// ⚠️ SECURITY CRITICAL:</span>
<span class="hljs-comment">// The context object is for display and personalization ONLY.</span>
<span class="hljs-comment">// It is unverified and must not be used to authorize actions on your backend.</span>
<span class="hljs-comment">// For secure actions, you must use the useAuthenticate hook.</span>
<span class="hljs-comment">// app/page.tsx</span>
<span class="hljs-string">"use client"</span>;

<span class="hljs-keyword">import</span> { <span class="hljs-title">useEffect</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">useMiniKit</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"@coinbase/onchainkit/minikit"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">AppLayout</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"./components/AppLayout"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">TriviaGame</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"./components/TriviaGame"</span>;

export default <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  const { setFrameReady, isFrameReady, context } <span class="hljs-operator">=</span> useMiniKit();
  const userFid <span class="hljs-operator">=</span> context?.user?.fid;
  const username <span class="hljs-operator">=</span> context?.user?.username;
  const pfpUrl <span class="hljs-operator">=</span> context?.user?.pfpUrl;
  const displayName <span class="hljs-operator">=</span> context?.user?.displayName;

  useEffect(() <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
    <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>isFrameReady) {
      setFrameReady();
    }
  }, [setFrameReady, isFrameReady]);

  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&lt;</span>AppLayout<span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span>div className<span class="hljs-operator">=</span><span class="hljs-string">"flex-1 flex flex-col"</span><span class="hljs-operator">&gt;</span>
        {<span class="hljs-comment">/* Header */</span>}
        <span class="hljs-operator">&lt;</span>div className<span class="hljs-operator">=</span><span class="hljs-string">"flex items-center justify-between p-4 bg-black/20 backdrop-blur-sm"</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>div className<span class="hljs-operator">=</span><span class="hljs-string">"flex items-center gap-3"</span><span class="hljs-operator">&gt;</span>
            {userFid ? (
              <span class="hljs-operator">&lt;</span><span class="hljs-operator">&gt;</span>
                {pfpUrl <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> (
                  <span class="hljs-operator">&lt;</span>img
                    src<span class="hljs-operator">=</span>{pfpUrl}
                    alt<span class="hljs-operator">=</span>{displayName <span class="hljs-operator">|</span><span class="hljs-operator">|</span> username <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">'User'</span>}
                    className<span class="hljs-operator">=</span><span class="hljs-string">"h-10 w-10 rounded-full"</span>
                  <span class="hljs-operator">/</span><span class="hljs-operator">&gt;</span>
                )}
                <span class="hljs-operator">&lt;</span>div<span class="hljs-operator">&gt;</span>
                  <span class="hljs-operator">&lt;</span>h1 className<span class="hljs-operator">=</span><span class="hljs-string">"text-xl font-bold text-white"</span><span class="hljs-operator">&gt;</span>
                    <span class="hljs-operator">&lt;</span>span<span class="hljs-operator">&gt;</span>{displayName <span class="hljs-operator">|</span><span class="hljs-operator">|</span> username <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">'Anonymous'</span>}<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>span<span class="hljs-operator">&gt;</span>
                  <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h1<span class="hljs-operator">&gt;</span>
                <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
              <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-operator">&gt;</span>
            ) : (
              <span class="hljs-operator">&lt;</span>h1 className<span class="hljs-operator">=</span><span class="hljs-string">"text-xl font-bold text-white"</span><span class="hljs-operator">&gt;</span>Social Trivia<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h1<span class="hljs-operator">&gt;</span>
            )}
          <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>

        {<span class="hljs-comment">/* Game */</span>}
        <span class="hljs-operator">&lt;</span>div className<span class="hljs-operator">=</span><span class="hljs-string">"flex-1"</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>TriviaGame userFid<span class="hljs-operator">=</span>{userFid <span class="hljs-keyword">as</span> number} username<span class="hljs-operator">=</span>{username <span class="hljs-keyword">as</span> <span class="hljs-keyword">string</span>} <span class="hljs-operator">/</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>AppLayout<span class="hljs-operator">&gt;</span>
  );
}</code></pre><blockquote><p><strong><em>Security note:</em></strong><em> </em><code>context</code><em> is </em><strong><em>not</em></strong><em> authentication. It’s for personalized display only. Use </em><code>useAuthenticate</code><em> for verified, server-authorized actions.</em></p></blockquote><hr><h3 id="h-step-3-engineer-the-viral-social-loop" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 3: Engineer the Viral Social&nbsp;Loop</h3><p><strong>A. Progressive Auth with </strong><code>useAuthenticate</code><br>&nbsp;Let users play <em>first</em>. Only prompt auth when saving a score or calling your backend.</p><p><strong>B. Dynamic Embeds (Share Previews)</strong><br>&nbsp;Generate a share URL like <code>/share?score=95&amp;user=vitalik</code> and render dynamic <code>&lt;meta&gt;</code> tags server-side so the cast preview becomes a personalized challenge card.</p><p><strong>C. Native Share with </strong><code>useComposeCast</code></p><pre data-type="codeBlock" text="// app/components/ResultsScreen.tsx
const { composeCast } = useComposeCast();

const handleShare = () =&gt; {
  const shareUrl = `https://your-trivia-app.xyz/share?score=${score}&amp;user=${username}`;
  composeCast({
    text: `I scored ${score}/100! Can you beat me?`,
    embeds: [shareUrl],
  });
};"><code>// app/components/ResultsScreen.tsx
const { composeCast } = useComposeCast()<span class="hljs-comment">;</span>

const <span class="hljs-attr">handleShare</span> = () =&gt; {
  const <span class="hljs-attr">shareUrl</span> = `https://your-trivia-app.xyz/share?score=<span class="hljs-variable">${score}</span>&amp;user=<span class="hljs-variable">${username}</span>`<span class="hljs-comment">;</span>
  composeCast({
    text: `I scored ${score}/100! Can you beat me?`,
    embeds: <span class="hljs-section">[shareUrl]</span>,
  })<span class="hljs-comment">;</span>
}<span class="hljs-comment">;</span></code></pre><p><strong>D. Deep Social Navigation</strong></p><pre data-type="codeBlock" text="// Leaderboard row → tap to view Farcaster profile
const viewProfile = useViewProfile(playerFid);
return &lt;button onClick={viewProfile}&gt;&lt;Name address={`fid:${playerFid}`} /&gt;&lt;/button&gt;;"><code><span class="hljs-comment">// Leaderboard row → tap to view Farcaster profile</span>
const viewProfile <span class="hljs-operator">=</span> useViewProfile(playerFid);
<span class="hljs-keyword">return</span> <span class="hljs-operator">&lt;</span>button onClick<span class="hljs-operator">=</span>{viewProfile}<span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span>Name <span class="hljs-keyword">address</span><span class="hljs-operator">=</span>{`fid:${playerFid}`} <span class="hljs-operator">/</span><span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>button<span class="hljs-operator">&gt;</span>;</code></pre><p><strong>E. The Linking Rule: </strong><code>useOpenUrl</code><strong> (never raw </strong><code>&lt;a&gt;</code><strong>)</strong></p><pre data-type="codeBlock" text="const openUrl = useOpenUrl('https://en.wikipedia.org/wiki/Trivia');
return &lt;button onClick={openUrl}&gt;Source&lt;/button&gt;;"><code>const openUrl <span class="hljs-operator">=</span> useOpenUrl(<span class="hljs-string">'https://en.wikipedia.org/wiki/Trivia'</span>);
<span class="hljs-keyword">return</span> <span class="hljs-operator">&lt;</span>button onClick<span class="hljs-operator">=</span>{openUrl}<span class="hljs-operator">&gt;</span>Source<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>button<span class="hljs-operator">&gt;</span>;</code></pre><hr><h3 id="h-step-4-native-ui-and-flow-control" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 4: Native UI &amp; Flow&nbsp;Control</h3><p><strong>Primary Action with </strong><code>usePrimaryButton</code></p><pre data-type="codeBlock" text="usePrimaryButton({ text: 'Submit Answer' }, () =&gt; {
  handleSubmitAnswer();
});"><code><span class="hljs-built_in">usePrimaryButton</span>({ text: 'Submit Answer' }, () =&gt; {
  <span class="hljs-built_in">handleSubmitAnswer</span>();
});</code></pre><p><strong>Graceful Exit with </strong><code>useClose</code></p><pre data-type="codeBlock" text="const closeFrame = useClose();
return &lt;button onClick={closeFrame}&gt;Done&lt;/button&gt;;"><code>const closeFrame <span class="hljs-operator">=</span> useClose();
<span class="hljs-keyword">return</span> <span class="hljs-operator">&lt;</span>button onClick<span class="hljs-operator">=</span>{closeFrame}<span class="hljs-operator">&gt;</span>Done<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>button<span class="hljs-operator">&gt;</span>;</code></pre><hr><h3 id="h-step-5-go-onchain-gasless-leaderboard-optional" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 5: Go Onchain — Gasless Leaderboard (Optional)</h3><p><strong>Solidity Contract (simplified tutorial version)</strong></p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract TriviaLeaderboard {
    mapping(address =&gt; uint256) public scores;
    function addScore(uint256 score) public {
        // NOTE: In production, verify a server signature before accepting scores.
        scores[msg.sender] = score;
    }
}"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.20;</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">TriviaLeaderboard</span> </span>{
    <span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> <span class="hljs-keyword">uint256</span>) <span class="hljs-keyword">public</span> scores;
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">addScore</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> score</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> In production, verify a server signature before accepting scores.</span>
        scores[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">=</span> score;
    }
}</code></pre><p><strong>Production Security Tip</strong><br>&nbsp;Never trust client-submitted scores. Verify on a <strong>server</strong> first, then sign <code>{userAddress, score}</code> with your server key. Have the contract check that signature before <code>addScore</code> updates storage. Pair with a <strong>Paymaster</strong> (Coinbase Developer Platform) to sponsor gas so the UX feels Web2-smooth.</p><p><strong>Frontend flow</strong><br>&nbsp;Configure <strong>MiniKitProvider</strong> with your Paymaster URL. Use standard wagmi hooks (<code>useWriteContract</code>) to store scores; MiniKit handles gasless plumbing under the hood.</p><hr><h2 id="h-part-3-ship-it-deployment-verification-and-registration" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Part 3: Ship It — Deployment, Verification &amp; Registration</h2><h3 id="h-step-6-deploy-and-verify-ownership" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 6: Deploy &amp; Verify Ownership</h3><ol><li><p>Deploy to Vercel (or similar).</p></li><li><p>Update the manifest URLs to your final prod domain.</p></li><li><p>In <strong>Base Build</strong> (base.dev): import your app, connect the wallet tied to your Farcaster account, and follow the verification prompts.</p></li><li><p>Merge the provided <code>baseBuilder</code> object into your manifest, for example:</p></li></ol><pre data-type="codeBlock" text="{
  &quot;frame&quot;: {
    &quot;name&quot;: &quot;Social Trivia&quot;,
    &quot;homeUrl&quot;: &quot;https://your-final-app-url.xyz&quot;,
    &quot;noindex&quot;: false
  },
  &quot;baseBuilder&quot;: {
    &quot;allowedAddresses&quot;: [
      &quot;0x...your...verified...address&quot;
    ]
  }
}"><code><span class="hljs-punctuation">{</span>
  <span class="hljs-attr">"frame"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
    <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Social Trivia"</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"homeUrl"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"https://your-final-app-url.xyz"</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"noindex"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span>
  <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">"baseBuilder"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
    <span class="hljs-attr">"allowedAddresses"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
      <span class="hljs-string">"0x...your...verified...address"</span>
    <span class="hljs-punctuation">]</span>
  <span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">}</span></code></pre><p>Redeploy with this <strong>final manifest</strong>, then submit your production URL on Base Build to complete verification.</p><h3 id="h-step-7-official-registration-and-analytics" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 7: Official Registration &amp; Analytics</h3><p>Registering your app unlocks:</p><ul><li><p><strong>Directory discovery</strong> in the Base App</p></li><li><p><strong>Analytics</strong> for installs, usage, and retention</p></li></ul><hr><h3 id="h-conclusion-and-call-to-action" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Conclusion &amp; Call to&nbsp;Action</h3><h4 id="h-recap" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>Recap</strong></h4><p>You built a <strong>social-native Mini App</strong> with MiniKit + OnchainKit: context-aware UI, native controls, viral sharing, deep social navigation, and an optional <strong>gasless</strong> onchain leaderboard on Base.</p><h4 id="h-next-steps" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>Next Steps</strong></h4><ul><li><p>Tweak copy and visuals on your dynamic share previews.</p></li><li><p>Add <code>useAddFrame</code> (save to favorites) and <code>useNotification</code> (re-engagement) as they roll out.</p></li><li><p>Harden your onchain writes with server-verified signatures and a paymaster.</p></li></ul><h4 id="h-cta" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>CTA</strong></h4><ul><li><p>Explore <strong>Base Docs</strong> to go deeper on Mini Apps.</p></li><li><p>Ship your v1, share it in the Base community, and tag <strong>@HeimLabs</strong> with what you build!</p></li></ul><hr><h3 id="h-resources-and-links" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Resources &amp;&nbsp;Links</h3><p><strong>Base Docs (Mini Apps)</strong>:</p><div data-type="embedly" src="https://docs.base.org/get-started/base" data="{&quot;provider_url&quot;:&quot;https://docs.base.org&quot;,&quot;description&quot;:&quot;The #1 Ethereum Layer 2, incubated by Coinbase&quot;,&quot;title&quot;:&quot;Base - Base Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.base.org/get-started/base&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Base Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFFklEQVR4nF2TfVDSdxzHf/+1u7ba7Xbr9l+76/Zwrdt6mKtNt1WezjWdZporn7BpWSgL52FkqcnAJwQOEAQSRAkBgSIg6aeC5gPDRLEMp4dW4LMhUSInDHY/vkZt3/v8/Xq/v+/P+wMFgkGfz//c7fH7/ete77rX+3LN82LN43J7Fpafz8yuTEwvPJyaNY8/GTDbeocm4b5H2p6HN+HR9o7hNrVJpDI2yfo4bb1scQ9TpKcLu2jCrno+DKaOp4MCwWAgiLwNny/46vn9/yw53YtO99yyy760Om6bB3Rd3/jtbosSHpFohkQqo0AxwJX0NogMdGEXtRnh1nB1NVwdqVFLYGsrmWoCWwsFg0FStQL679v+3gdfHYz88sA30XHHP/k8Al1Ubp5waHseqrotctjcpjYJFAM8WR9b3IOgQ1xSI0KsYKrL6KpSqhJP2RxEgMXRQdBHMbEx27a/u3vPF29tfefbqCPZuReST6ISTmQdjUvBlJD6R21KeKS9Y1isNvEV/Zy2XqZITxN21fIQNODiKcpLZEVxtay4WlZULcOSpFiS9HVE4XACwaDHu7HodNuXVm2OFevMYv+oTdVtae8YFqmMfEU/W9zDaNWDQCpfoQH0IlFSUCm+UCnOrxCBgcJL9ni9z5yu2QXn1OOF8ak5i9X+l2VGb5oMJwO8g1jCxkupSlydHEuSYogSwM292pKDF6BCk4Xnb/7AHwh4vBvPnq/NLbumHSuPbPMjVrv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630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.base.org/get-started/base" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Base - Base Documentation</h2><p>The #1 Ethereum Layer 2, incubated by Coinbase</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.base.org</span></div><img src="https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png"></div></a></div></div><p><strong>OnchainKit Documentation</strong>:</p><br><div data-type="embedly" src="https://www.base.org/build/onchainkit" data="{&quot;provider_url&quot;:&quot;https://www.base.org&quot;,&quot;description&quot;:&quot;Base is a secure, low-cost, builder-friendly Ethereum L2 built to bring the next billion users onchain.&quot;,&quot;title&quot;:&quot;Base | OnchainKit&quot;,&quot;mean_alpha&quot;:63.75,&quot;thumbnail_width&quot;:4800,&quot;url&quot;:&quot;https://www.base.org/build/onchainkit&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/d161ea170141220ae0047a3b8bdb0ddf561bd0a6ab4119f8f9b1715fe57f611f.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Base&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:2520,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAACaUlEQVR4nM2UP2vbQBTA1WoQaBDXmERCuAdCqAjTmMp4uLYHKRiiNpcgU0OvJKIW9AjCqOFKG6IOGjRoyOBPkMGDxwxeNGTxmMWDh6z5LqZUInHSpE2oM/THIR6nd+/v3ROEAukC8QbCf4IoirIsS5JUyvMf5dZ4PJ7NZufn58PhkDGWFBwdHcVxfGcSkiS1Wi3OeRzHjDHbtgEA1zwLguD7fpqm/X6fUooL1gqazeadDrIsy/N8MBiEYZhlWZqmWZYpiiI8CIqi5Hl+enp6cnLS6XT6/f7x8fF0OrUs61qtbvb2nk2WZTnP87Ozs9Fo5Pt+FEV5nk8mE8Mwfm/GvwEh5JwnSTIcDimlnPPDw8M0TTVNW9S0ULQ3SZJOp4MxRgjVajXbth3HoZQ6jvMADmRZ3t/fZ4xxzhFCEEKEUJlHs9lcqERicdK27TRNS4sIIV3Xy/CDIMAYLxq+pmnj8djzPLegXq/rug4hrNVquq67rosQmmsDAJaXVwAAiqIAAJaWliqVCgBPbr3OZfimaU4mk9FoFMcxQghjbBgGhLBer7uuGwSB53m/XnGp/Xx19SD+sb3jr7vvPtCPW1673X6/x7+urb3RNE1V1avVLGXDMKbT6WAwYIyFYRhFkWVZpmm2Wq3yvhJC5g4s61kv+rIb9j51g2/fDzbI5vaO34v2dvxuN/i85bWvvf6LpAkhlFLGWBRFlFIIYZmEaZoYYwjhXLtafbruvkXo5QunsUE2Hafx6jV2nAYhmyuq+pdOiKKoaRrGmBBSrVZVVQUAlPPt/jwq1u3WL+Vy2v/RxuOLqXA5Hq5+F+Enh6i1sqKLxBcAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:4800,&quot;height&quot;:2520,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/d161ea170141220ae0047a3b8bdb0ddf561bd0a6ab4119f8f9b1715fe57f611f.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/d161ea170141220ae0047a3b8bdb0ddf561bd0a6ab4119f8f9b1715fe57f611f.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.base.org/build/onchainkit" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Base | OnchainKit</h2><p>Base is a secure, low-cost, builder-friendly Ethereum L2 built to bring the next billion users onchain.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.base.org</span></div><img src="https://storage.googleapis.com/papyrus_images/d161ea170141220ae0047a3b8bdb0ddf561bd0a6ab4119f8f9b1715fe57f611f.png"></div></a></div></div><p><strong>Farcaster Docs</strong>:</p><div data-type="embedly" src="https://docs.farcaster.xyz" data="{&quot;provider_url&quot;:&quot;https://docs.farcaster.xyz&quot;,&quot;description&quot;:&quot;A protocol for building sufficiently decentralized social networks.&quot;,&quot;title&quot;:&quot;Farcaster Docs&quot;,&quot;thumbnail_width&quot;:320,&quot;url&quot;:&quot;https://docs.farcaster.xyz&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/7f4369652e529b1242d739bc37b751bc12910742a6924a4176c71c8b77a538ad.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Farcaster&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:320,&quot;image&quot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FLprZ79QECIi/v0AXilUAoR4l5gx0Nvpq8vM76MqzMTX9BSGeOpkTTaP6dpeZZjmUy26+n36FchXNanB8DLhd0dIEJ0HTr71c98h+Y1/owLS089OA74gUEi0OGKX7t63Qxc/OGKp+714j4i2Q06zapBPUIHYyffUeeJzw+qJ55/bAqQbAjaeNi//b7kWzcC84fU+fbGUEkTamsIAjTBEnzAAOEjpOK7kiUgMuUdAsAe0FlRUB3/LWRuCPz0ROuO/38QvAQ6JcvbXEckYDcALy3Rq7cBHzXnp7lV1pcBMYNOcniBFwnzYhexlroX6PwHJagwsGt821IAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:320,&quot;height&quot;:320,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/7f4369652e529b1242d739bc37b751bc12910742a6924a4176c71c8b77a538ad.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/7f4369652e529b1242d739bc37b751bc12910742a6924a4176c71c8b77a538ad.jpg"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.farcaster.xyz" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Farcaster Docs</h2><p>A protocol for building sufficiently decentralized social networks.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.farcaster.xyz</span></div><img src="https://storage.googleapis.com/papyrus_images/7f4369652e529b1242d739bc37b751bc12910742a6924a4176c71c8b77a538ad.jpg"></div></a></div></div><p><strong>Base Discord</strong>:&nbsp;</p><div data-type="embedly" src="https://discord.com/invite/buildonbase" data="{&quot;provider_url&quot;:&quot;https://discord.com&quot;,&quot;description&quot;:&quot;Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users onchain | 476227 members&quot;,&quot;title&quot;:&quot;Join the Base Discord Server!&quot;,&quot;thumbnail_width&quot;:512,&quot;url&quot;:&quot;https://discord.com/invite/buildonbase&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/eed2f9c1aba4df7bbc52983d3863b29958979e9f9af242835b54603c923e2719.jpg&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Discord&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:288,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAASCAIAAAC1qksFAAAACXBIWXMAAAsTAAALEwEAmpwYAAACbElEQVR4nG1Vy2oUQRQ9iEEGCbhx5Z+4059yI4F8Qjazyq57+lVT05O2O8k4CILfIOhPZJuFSMs9p29NaYSip7q67uucc+8A2AAtUAMV9yXQAFug4Gtv6+wABKADRp4XeHnka0HbCS8Oy/lpDcAn+lz85s+SAVKMAEQabOi0tPPn93Rd8mTHnJLrCs/umNNIKzOrswq0avrdcrPjc6DHwK8Fzo9ZBjyxVVs1mLA6sKaBAJhZS+8t06ndpuGKlo4ddsAeuOGmw6svGRTaRHNqgUdeq/zcEunpq+SpCFDI6M+RJz2DVXTKUgwHMdEw/MTLCStBuuwqXwUj1bTp6EjpRwYOvCD0Bmbq6VsSpOff9Vdwlm/7ninv6UsY6pMq6x3M1qHfO4udUyhgJvBHbEQ3SIyNrpAtN9Ffg8tGxIz8FK2g1WcT2PmRZOwkUwUUXorRZsIo3HvnSSg7XR5cHSNXT/kq5MhNVB8I8SRWnXTALe9NfjUyhoTQcEOny3lwSFW9UtzkfSBYxbAkHzJA1cm9I7PLuk8en9KrmwuBEpJiiE9vSwhohVQkSUDk5b5GCndwUuXtRKkKb/lZI2FP4cupnmqLhvbCOjVU0iuZWB3M1kbWwqE4CBnhwcdDy6W20MxQY3LMWYCn8q+WCWb5LdNNYyu1pbja0pco2TBlXUvIqKtVlnL6DweacSGro3MtRc9alreuzuRoyf3hYX58nK/W8/p6/nj5+8PFr6v17F11ciRk1KvSVUJMafbOhCw1PBjpzTe8/4m33/HuB15/dXGfhp2kJp1IvOI8urr0j5SEoIl2Y0wabgkQ6SofB8Ufc/KMXPX/rR4AAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:512,&quot;height&quot;:288,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/eed2f9c1aba4df7bbc52983d3863b29958979e9f9af242835b54603c923e2719.jpg&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/eed2f9c1aba4df7bbc52983d3863b29958979e9f9af242835b54603c923e2719.jpg"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://discord.com/invite/buildonbase" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Join the Base Discord Server!</h2><p>Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users onchain | 476227 members</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://discord.com</span></div><img src="https://storage.googleapis.com/papyrus_images/eed2f9c1aba4df7bbc52983d3863b29958979e9f9af242835b54603c923e2719.jpg"></div></a></div></div><p><strong>Demo Codebase:</strong></p><div data-type="embedly" src="https://github.com/HeimLabs/coinbase-cdp-demos" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;A collection of Demo Projects exploring the Coinbase Developer Platform - HeimLabs/coinbase-cdp-demos&quot;,&quot;title&quot;:&quot;GitHub - HeimLabs/coinbase-cdp-demos: A collection of Demo Projects exploring the Coinbase Developer Platform&quot;,&quot;author_name&quot;:&quot;HeimLabs&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/HeimLabs/coinbase-cdp-demos&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/1184c4aac7c53ae8c27a0a040a12fcb5d21223b82df8ba7b24156d77710413e8.png&quot;,&quot;author_url&quot;:&quot;https://github.com/HeimLabs&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC9UlEQVR4nJVU3UsUURS/GVEPfRBRQVlPJv4TPehLL0EURGVET75ohloYEpJamNIG9qKJWJBRgUo9B+bXhkKUtSy57IeuuzN3Pu7Mrjt3XGfm7r0Ts7Otu8sa24/DzD1nfnN/555zZoCdBStBcYTS3L2UluPmdnAXhRvatg0Ko2WpFYIx2zAM07DS6S2spQghbtwRoJRyPOQgREhBiqooqq7rPA8xxjJCSFEikWg4HAkEQ6Ik81BQFHVzUwuFI5G1dazrlmXZtj0xPnkM1J6sqq0+Xl9zuuHyhdturo6AZVmBYPDL3MLS8jfv1+WVn7/mFhanpj/Ne5dmZhdGx16/zFr/oGfAM9Q/6Jlf9M7Mzg14hnqeDP4OBN1k29u6AQBHwJmG+j6w7+J+UE0ymZ0ShSNr33+srEejG7F4MBTWNFxYxzwKfcZYOr3t5mfb9r07vQAcbLp1t/FSU93Z80fBuZ0eUEo/TH98/PTZu/dTr968ff5iOBAM57dju8PlWKYj0NnaB8Dha1cedrT07AXVJ/bUUUrLN7nMUGVRQshf3RO0tXYBcKjqVDsAJ5xaHahheQHKmJpIQkHmeJHjRRmpMlKgIMrZngui01hRkqEgxzkIBXkjxsfi0DBMV4xSR8bvW33Q1tfZ2n2/pbej+dHE+OROkxljMlI4XozG4jyUYnGOh0Kcg1kxZT0aX4/GFTVhWcQ0LUKIYZqEkAqn2S0RMwwD61spDWOs6+m0hvWUpqU0bBiGhnVNw24//wHGGClGocD/gVWQe56TE2DlQP/+IooJztS5n24lyI2pKMmiJNGCl9REkocC1nV3TjZivCwjlwwFESFll8Sdq5LEq2GYEyAZZpKMYRKUSPGiwosylJBhkW2TJDSdg1JiUycZlk5bHJSRmiTMNiwioYSIVJNkSIYVmpVh1LZlFftD0HQcUtwDRh2znQq4fnadP1bxI4dZQYkaR3yu3Rz1561xxHd9OBcsIRS6+XWJ3Rj2XR3zN3d5/Z89fwDYGVBzJosewwAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/1184c4aac7c53ae8c27a0a040a12fcb5d21223b82df8ba7b24156d77710413e8.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/1184c4aac7c53ae8c27a0a040a12fcb5d21223b82df8ba7b24156d77710413e8.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/HeimLabs/coinbase-cdp-demos" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - HeimLabs/coinbase-cdp-demos: A collection of Demo Projects exploring the Coinbase Developer Platform</h2><p>A collection of Demo Projects exploring the Coinbase Developer Platform - HeimLabs/coinbase-cdp-demos</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://storage.googleapis.com/papyrus_images/1184c4aac7c53ae8c27a0a040a12fcb5d21223b82df8ba7b24156d77710413e8.png"></div></a></div></div><p><strong>HeimLabs</strong>:</p><div data-type="embedly" src="https://www.heimlabs.com" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbm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2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><hr><p>Clap if this saved you hours, and share what you’re building with the CDP stack!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/9c30f2e4e131691928bd932b11f129a3dd0b398dc4696879aa896eb5d954f094.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Build a Monetized Miniapp on TBA with x402 - From Scratch in TypeScript]]></title>
            <link>https://paragraph.com/@heimlabs/build-a-monetized-miniapp-on-tba-with-x402-from-scratch-in-typescript</link>
            <guid>V77Fsls77jl9hNMky3uo</guid>
            <pubDate>Thu, 09 Oct 2025 14:03:04 GMT</pubDate>
            <description><![CDATA[Onchain social commerce has been too click-heavy: break out of the feed, connect a wallet, fight a checkout. Conversion drops. 
Miniapps on TBA (The Base App) + the x402 protocol fix this. Miniapps are lightweight web apps that run directly inside a TBA feed. x402 revives HTTP’s dormant 402 Payment Required to turn any API route into a vending machine for paid content—seamlessly funded by onchain payments via Coinbase Developer Platform. ]]></description>
            <content:encoded><![CDATA[<hr><h3 style="text-align: center" id="h-introduction" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Introduction</h3><p>Onchain social commerce has been too click-heavy: break out of the feed, connect a wallet, fight a checkout. Conversion drops.</p><p>Miniapps on <strong>TBA (The Base App)</strong> + the <strong>x402 protocol</strong> fix this. Miniapps are lightweight web apps that run directly inside a TBA feed. x402 revives HTTP’s dormant <code>402 Payment Required</code> to turn <strong>any</strong> API route into a vending machine for paid content—seamlessly funded by onchain payments via Coinbase Developer Platform.</p><p>In this tutorial, we’ll build a fun, monetized <strong>Onchain Fortune Cookie</strong> Miniapp end-to-end:</p><ul><li><p>Bootstrap with the official x402 template</p></li><li><p>Add a backend API and protect it with an x402 paywall</p></li><li><p>Ship a mobile-ready React UI for the full flow inside TBA</p></li><li><p>Upgrade to a <strong>premium tier</strong> with different pricing</p></li></ul><p>By the end, you’ll have a working Miniapp you can share in a TBA cast and charge for — no janky redirects.</p><hr><h3 style="text-align: center" id="h-what-youll-build" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">What You’ll&nbsp;Build</h3><ul><li><p><span data-name="toolbox" class="emoji" data-type="emoji">🧰</span> Clone and run the official <strong>x402</strong> TypeScript full-stack template</p></li><li><p><span data-name="closed_lock_with_key" class="emoji" data-type="emoji">🔐</span> Add <strong>/api/fortune</strong> protected by x402 (<code>$0.01</code>)</p></li><li><p><span data-name="credit_card" class="emoji" data-type="emoji">💳</span> Add a <strong>premium /api/golden-fortune</strong> tier (<code>$0.10</code>)</p></li><li><p><span data-name="android" class="emoji" data-type="emoji">📱</span> A mobile-friendly <strong>Next.js</strong> page with two purchase buttons</p></li><li><p><span data-name="rocket" class="emoji" data-type="emoji">🚀</span> Test in <strong>TBA</strong> using an <strong>ngrok</strong> URL that resolves into a Frame + “Use App” button</p></li></ul><p>(Watch the Full Video here)</p><div data-type="youtube" videoid="zNh59xz6W6E">
      <div class="youtube-player" data-id="zNh59xz6W6E" style="background-image: url('https://i.ytimg.com/vi/zNh59xz6W6E/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=zNh59xz6W6E">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><hr><h3 style="text-align: center" id="h-system-architecture" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">System Architecture</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/55e580d79e193492e016b97c27691d51e2f1d8f67bb18b08301c21093d745971.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAWCAIAAAAuOwkTAAAACXBIWXMAAAsTAAALEwEAmpwYAAADGElEQVR4nO2UzWsTQRjGVxcGHRzHIcusb7frOjQdFhYCi6495FDcS6Fo0MUceshhbRatFGlt0BylFFJSaKBBClkkSJFAzuLN9i/QHouK7UXsSUGEnoVsG2I//ALRg89peHdmfjPPPPsqyn/9hNQ9HeuMk0r367EDk4/a4UiA67phGI4Xi1EU2bZNKR2/eXO8WBwvFu9OTZmmyTm/NzOzsLBQLpdHRkYQQqcIuXb9+tzcXCOOK5XKncnJvr4+ACiVSvPV6sPZ2Yezs9lsdhdw2fcXa7XHzWYjjl3XpZQu1euNOG7EcbvdTqcHAODZ8+fb29uv3765NzODECKELNZq7z982NnZ+fzly4vVVSGEZVnz1erGxsa7zc1Wu33l6tVdAKWUMTY4OHiGMSml53m6rqdSqXR6gFKKMUYIMcbS6QHOeSqVSjzhnJ+mVAhxFkDTtGQapRQALMsihFBKvzHKtm1d1zOZjO/7ACClTKcHFEUBAF3XFUUxTRMhtM9ewzD2baRpGgAc8hL71mOMXdc1DCMMw0KhAAC+7x8EAEAC6L6zpmnJgQ4B9CYBY2wYRu8Eq6Pp6ekwDCcmJsrlciaTcRzn4A1+E2B24sT2pGkapdRxHMaYbdue52WzWcuyvmfRDwHogEWmaQohPM/L5/NBEEgpHceRUh7yxxwFUPfM7QV0i7ZtG4aBEAqCYHh4WFVV6Oh3biCEAABVVaWUuVyOc66qapK9bi/4NYBpmgAQBMHo6Kiu60KIZC9CCGOMEKKq6jnT/HFMk3d3HCfJHEKIc24YRi6Xk1JeGhpKbLVtW+uo+6NhjC3LAgDOOSEEY5wsFEIkKdgFXPb9+Wo1aRUXLl5kjD1aXn60vLxUrz9uNpODP1lZ2draWltbi6IIY3ya0vsPHqyvr3/89Ond5uaTlZXznVbxtNV6/fbNy1evXqyu3sjndwGu60ZRFIZht9kl41u3b5dKpSSdlUoljuNmszk2NoYQOnHy5N2pqXZHrVZrqV7v7+8HgEKhsFirNeL4zuTkpaEh5R/S8b2Q9BZ7w7Ov+DfO+If0FQoM2JoIkHOoAAAAAElFTkSuQmCC" nextheight="544" nextwidth="800" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Key pieces:</strong></p><ul><li><p><strong>Miniapp UI (Next.js/React):</strong> Simple mobile layout with buttons that call <code>/api/fortune</code> and <code>/api/golden-fortune</code>. The fetch looks “normal”; x402 handles the payment handshake behind the scenes.</p></li><li><p><strong>x402 Middleware:</strong> Wraps routes in <code>paymentMiddleware</code>, pricing in fiat strings (e.g., <code>"$0.01"</code>), and selects Base or Base Sepolia. It triggers the onchain payment flow when a protected route is hit.</p></li><li><p><strong>Protected API Routes:</strong> Ordinary Next.js <code>route.ts</code> handlers—your business logic only runs <strong>after</strong> a successful payment.</p></li><li><p><strong>CDP + OnchainKit:</strong> Provides wallet infra, payment facilitation, and a smooth purchase flow.</p></li><li><p><strong>TBA + Frames:</strong> Your public HTTPS URL resolves into a Frame; the “Use App” button launches the Miniapp inline.</p></li></ul><hr><h3 style="text-align: center" id="h-part-1-project-setup" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Part 1: Project&nbsp;Setup</h3><p>We’ll start from the official <strong>x402</strong> template to skip boilerplate.</p><h3 id="h-11-clone-the-repository-and-install-dependencies" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.1 Clone the repository &amp; install dependencies</h3><pre data-type="codeBlock" text="git clone https://github.com/coinbase/x402.git
cd x402/examples/typescript/fullstack/farcaster-miniapp

# Install all deps for the example
pnpm install
# Build the monorepo packages (critical)
cd ../../
pnpm install
pnpm build
# Go back to the example
cd fullstack/farcaster-miniapp"><code>git <span class="hljs-built_in">clone</span> https://github.com/coinbase/x402.git
<span class="hljs-built_in">cd</span> x402/examples/typescript/fullstack/farcaster-miniapp

<span class="hljs-comment"># Install all deps for the example</span>
pnpm install
<span class="hljs-comment"># Build the monorepo packages (critical)</span>
<span class="hljs-built_in">cd</span> ../../
pnpm install
pnpm build
<span class="hljs-comment"># Go back to the example</span>
<span class="hljs-built_in">cd</span> fullstack/farcaster-miniapp</code></pre><h3 id="h-12-configure-environment-variables" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.2 Configure environment variables</h3><pre data-type="codeBlock" text="# Copy the example env
cp env.example .env.local"><code><span class="hljs-comment"># Copy the example env</span>
<span class="hljs-built_in">cp</span> env.example .env.local</code></pre><p>Edit&nbsp;<code>.env.local</code>:</p><pre data-type="codeBlock" text="# where payments land
RESOURCE_WALLET_ADDRESS=0xYourReceivingAddress

# base-sepolia for testing; switch to base for prod
NETWORK=base-sepolia
# CDP portal &gt; OnchainKit
NEXT_PUBLIC_ONCHAINKIT_API_KEY=your_onchainkit_key
NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME=Onchain Fortune Cookie
# Use emoji placeholders - no image files needed
NEXT_PUBLIC_APP_HERO_IMAGE=https://emojicdn.elk.sh/🥠?style=apple&amp;size=600
NEXT_PUBLIC_APP_ICON=https://emojicdn.elk.sh/🥠?style=apple&amp;size=200
NEXT_PUBLIC_APP_SPLASH_IMAGE=https://emojicdn.elk.sh/🥠?style=apple&amp;size=200
NEXT_PUBLIC_ICON_URL=https://emojicdn.elk.sh/🥠?style=apple&amp;size=200"><code><span class="hljs-comment"># where payments land</span>
<span class="hljs-attr">RESOURCE_WALLET_ADDRESS</span>=<span class="hljs-number">0</span>xYourReceivingAddress

<span class="hljs-comment"># base-sepolia for testing; switch to base for prod</span>
<span class="hljs-attr">NETWORK</span>=base-sepolia
<span class="hljs-comment"># CDP portal &gt; OnchainKit</span>
<span class="hljs-attr">NEXT_PUBLIC_ONCHAINKIT_API_KEY</span>=your_onchainkit_key
<span class="hljs-attr">NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME</span>=<span class="hljs-literal">On</span>chain Fortune Cookie
<span class="hljs-comment"># Use emoji placeholders - no image files needed</span>
<span class="hljs-attr">NEXT_PUBLIC_APP_HERO_IMAGE</span>=https://emojicdn.elk.sh/🥠?style=apple&amp;size=<span class="hljs-number">600</span>
<span class="hljs-attr">NEXT_PUBLIC_APP_ICON</span>=https://emojicdn.elk.sh/🥠?style=apple&amp;size=<span class="hljs-number">200</span>
<span class="hljs-attr">NEXT_PUBLIC_APP_SPLASH_IMAGE</span>=https://emojicdn.elk.sh/🥠?style=apple&amp;size=<span class="hljs-number">200</span>
<span class="hljs-attr">NEXT_PUBLIC_ICON_URL</span>=https://emojicdn.elk.sh/🥠?style=apple&amp;size=<span class="hljs-number">200</span></code></pre><blockquote><p><em>Tip: For production, move to </em><code>NETWORK=base</code><em> and swap </em><code>RESOURCE_WALLET_ADDRESS</code><em> accordingly.</em></p></blockquote><hr><h3 style="text-align: center" id="h-part-2-backend-fortune-api" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Part 2: Backend — Fortune&nbsp;API</h3><p>Create a simple paid content endpoint.</p><h3 id="h-21-create-the-route" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2.1 Create the&nbsp;route</h3><p><strong>File:</strong> <code>app/api/fortune/route.ts</code></p><pre data-type="codeBlock" text="import { NextResponse } from &quot;next/server&quot;;

const fortunes = [
  &quot;Your next transaction will be blessed with low gas fees.&quot;,
  &quot;A 100x gem is in your near future. DYOR.&quot;,
  &quot;The blockchain whispers secrets of prosperity to you.&quot;,
  &quot;You will successfully avoid a rug pull this week.&quot;,
  &quot;GM will bring you good luck today.&quot;,
  &quot;Diamond hands will lead to diamond rings.&quot;,
  &quot;A wild airdrop appears! It's super effective.&quot;,
];
export async function GET() {
  // Runs only AFTER a successful x402 payment
  const ix = Math.floor(Math.random() * fortunes.length);
  return NextResponse.json({ fortune: fortunes[ix], timestamp: new Date().toISOString() });"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">NextResponse</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"next/server"</span>;

const fortunes <span class="hljs-operator">=</span> [
  <span class="hljs-string">"Your next transaction will be blessed with low gas fees."</span>,
  <span class="hljs-string">"A 100x gem is in your near future. DYOR."</span>,
  <span class="hljs-string">"The blockchain whispers secrets of prosperity to you."</span>,
  <span class="hljs-string">"You will successfully avoid a rug pull this week."</span>,
  <span class="hljs-string">"GM will bring you good luck today."</span>,
  <span class="hljs-string">"Diamond hands will lead to diamond rings."</span>,
  <span class="hljs-string">"A wild airdrop appears! It's super effective."</span>,
];
export async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">GET</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-comment">// Runs only AFTER a successful x402 payment</span>
  const ix <span class="hljs-operator">=</span> Math.floor(Math.random() <span class="hljs-operator">*</span> fortunes.<span class="hljs-built_in">length</span>);
  <span class="hljs-keyword">return</span> NextResponse.json({ fortune: fortunes[ix], timestamp: <span class="hljs-keyword">new</span> Date().toISOString() });</code></pre><hr><h3 id="h-part-3-protect-with-x402" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Part 3: Protect with&nbsp;x402</h3><p>Wrap the route with <code>paymentMiddleware</code> and set the price.</p><p><strong>File:</strong> <code>middleware.ts</code></p><pre data-type="codeBlock" text="import { facilitator } from &quot;@coinbase/x402&quot;;
import { Address } from &quot;viem&quot;;
import { paymentMiddleware } from &quot;x402-next&quot;;

const payTo = process.env.RESOURCE_WALLET_ADDRESS as Address;
const network = (process.env.NETWORK || &quot;base-sepolia&quot;) as &quot;base&quot; | &quot;base-sepolia&quot;;
export const middleware = paymentMiddleware(
  payTo,
  {
    &quot;/api/fortune&quot;: {
      price: &quot;$0.01&quot;,
      network,
      config: { description: &quot;Your onchain fortune cookie!&quot; },
    },
  },
  facilitator,
);
export const config = {
  matcher: [&quot;/api/fortune&quot;],
  runtime: &quot;nodejs&quot;,
};"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">facilitator</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"@coinbase/x402"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">Address</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"viem"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">paymentMiddleware</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"x402-next"</span>;

const payTo <span class="hljs-operator">=</span> process.env.RESOURCE_WALLET_ADDRESS <span class="hljs-keyword">as</span> Address;
const network <span class="hljs-operator">=</span> (process.env.NETWORK <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">"base-sepolia"</span>) <span class="hljs-keyword">as</span> <span class="hljs-string">"base"</span> <span class="hljs-operator">|</span> <span class="hljs-string">"base-sepolia"</span>;
export const middleware <span class="hljs-operator">=</span> paymentMiddleware(
  payTo,
  {
    <span class="hljs-string">"/api/fortune"</span>: {
      price: <span class="hljs-string">"$0.01"</span>,
      network,
      config: { description: <span class="hljs-string">"Your onchain fortune cookie!"</span> },
    },
  },
  facilitator,
);
export const config <span class="hljs-operator">=</span> {
  matcher: [<span class="hljs-string">"/api/fortune"</span>],
  runtime: <span class="hljs-string">"nodejs"</span>,
};</code></pre><p>Any request to <code>/api/fortune</code> now triggers a <code>$0.01</code> payment before the handler executes.</p><hr><h3 id="h-part-4-frontend-ui-nextjs" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Part 4: Frontend UI (Next.js)</h3><p>Create a minimal, mobile-first page with two buttons (standard + premium). If your template already includes a full page, you can replace it; otherwise add this as <code>app/page.tsx</code>.</p><p><strong>File:</strong> <code>app/page.tsx</code></p><pre data-type="codeBlock" text="&quot;use client&quot;;

import { useState } from &quot;react&quot;;
export default function FortuneCookieApp() {
  const [loading, setLoading] = useState&lt;null | &quot;basic&quot; | &quot;golden&quot;&gt;(null);
  const [result, setResult] = useState&lt;string&gt;(&quot;&quot;);
  async function fetchFortune(path: &quot;/api/fortune&quot; | &quot;/api/golden-fortune&quot;, tier: &quot;basic&quot; | &quot;golden&quot;) {
    try {
      setLoading(tier);
      setResult(&quot;&quot;);
      const res = await fetch(path, { method: &quot;GET&quot; });
      // If payment is needed, the x402 middleware will orchestrate it.
      // From the client, this remains a normal fetch that resolves after purchase.
      if (!res.ok) {
        const text = await res.text();
        throw new Error(`Request failed: ${res.status} ${text}`);
      }
      const data = await res.json();
      setResult(data.fortune ?? JSON.stringify(data));
    } catch (e: any) {
      setResult(e?.message ?? &quot;Something went wrong.&quot;);
    } finally {
      setLoading(null);
    }
  }
  return (
    &lt;main className=&quot;min-h-screen bg-[#0c0c10] text-white flex flex-col items-center px-4 py-10&quot;&gt;
      &lt;div className=&quot;w-full max-w-md&quot;&gt;
        &lt;div className=&quot;flex flex-col items-center gap-3 mb-8&quot;&gt;
          &lt;div className=&quot;text-6xl&quot;&gt;🥠&lt;/div&gt;
          &lt;h1 className=&quot;text-2xl font-semibold text-center&quot;&gt;Onchain Fortune Cookie&lt;/h1&gt;
          &lt;p className=&quot;text-sm opacity-80 text-center&quot;&gt;
            Grab a fortune inside TBA. Pay per request using x402 on Base Sepolia.
          &lt;/p&gt;
        &lt;/div&gt;
        &lt;div className=&quot;grid grid-cols-1 gap-3&quot;&gt;
          &lt;button
            onClick={() =&gt; fetchFortune(&quot;/api/fortune&quot;, &quot;basic&quot;)}
            disabled={loading !== null}
            className=&quot;rounded-2xl px-4 py-4 bg-white/10 hover:bg-white/15 transition border border-white/10&quot;
          &gt;
            {loading === &quot;basic&quot; ? &quot;Purchasing…&quot; : &quot;Buy Fortune - $0.01&quot;}
          &lt;/button&gt;
          &lt;button
            onClick={() =&gt; fetchFortune(&quot;/api/golden-fortune&quot;, &quot;golden&quot;)}
            disabled={loading !== null}
            className=&quot;rounded-2xl px-4 py-4 bg-yellow-500/20 hover:bg-yellow-500/25 transition border border-yellow-500/30&quot;
          &gt;
            {loading === &quot;golden&quot; ? &quot;Purchasing… &quot; : &quot;Buy GOLDEN Fortune - $0.10&quot;}
          &lt;/button&gt;
        &lt;/div&gt;
        &lt;div className=&quot;mt-6 min-h-[96px] rounded-2xl border border-white/10 bg-white/5 p-4&quot;&gt;
          &lt;div className=&quot;text-xs uppercase tracking-wide opacity-60 mb-1&quot;&gt;Result&lt;/div&gt;
          &lt;p className=&quot;text-base leading-6&quot;&gt;{result || &quot;-&quot;}&lt;/p&gt;
        &lt;/div&gt;
        &lt;p className=&quot;mt-6 text-xs opacity-60 text-center&quot;&gt;
          Network: {process.env.NEXT_PUBLIC_NETWORK ?? &quot;base-sepolia&quot;} · Powered by x402
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/main&gt;
  );
}"><code><span class="hljs-string">"use client"</span>;

<span class="hljs-keyword">import</span> { <span class="hljs-title">useState</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"react"</span>;
export default <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">FortuneCookieApp</span>(<span class="hljs-params"></span>) </span>{
  const [loading, setLoading] <span class="hljs-operator">=</span> useState<span class="hljs-operator">&lt;</span>null <span class="hljs-operator">|</span> <span class="hljs-string">"basic"</span> <span class="hljs-operator">|</span> <span class="hljs-string">"golden"</span><span class="hljs-operator">&gt;</span>(null);
  const [result, setResult] <span class="hljs-operator">=</span> useState<span class="hljs-operator">&lt;</span><span class="hljs-keyword">string</span><span class="hljs-operator">&gt;</span>(<span class="hljs-string">""</span>);
  async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fetchFortune</span>(<span class="hljs-params">path: <span class="hljs-string">"/api/fortune"</span> | <span class="hljs-string">"/api/golden-fortune"</span>, tier: <span class="hljs-string">"basic"</span> | <span class="hljs-string">"golden"</span></span>) </span>{
    <span class="hljs-keyword">try</span> {
      setLoading(tier);
      setResult(<span class="hljs-string">""</span>);
      const res <span class="hljs-operator">=</span> await fetch(path, { method: <span class="hljs-string">"GET"</span> });
      <span class="hljs-comment">// If payment is needed, the x402 middleware will orchestrate it.</span>
      <span class="hljs-comment">// From the client, this remains a normal fetch that resolves after purchase.</span>
      <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>res.ok) {
        const text <span class="hljs-operator">=</span> await res.text();
        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(`Request failed: ${res.status} ${text}`);
      }
      const data <span class="hljs-operator">=</span> await res.json();
      setResult(data.fortune ?? JSON.stringify(data));
    } <span class="hljs-keyword">catch</span> (e: any) {
      setResult(e?.message ?? <span class="hljs-string">"Something went wrong."</span>);
    } finally {
      setLoading(null);
    }
  }
  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&lt;</span>main className<span class="hljs-operator">=</span><span class="hljs-string">"min-h-screen bg-[#0c0c10] text-white flex flex-col items-center px-4 py-10"</span><span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span>div className<span class="hljs-operator">=</span><span class="hljs-string">"w-full max-w-md"</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div className<span class="hljs-operator">=</span><span class="hljs-string">"flex flex-col items-center gap-3 mb-8"</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>div className<span class="hljs-operator">=</span><span class="hljs-string">"text-6xl"</span><span class="hljs-operator">&gt;</span>🥠<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>h1 className<span class="hljs-operator">=</span><span class="hljs-string">"text-2xl font-semibold text-center"</span><span class="hljs-operator">&gt;</span>Onchain Fortune Cookie<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h1<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>p className<span class="hljs-operator">=</span><span class="hljs-string">"text-sm opacity-80 text-center"</span><span class="hljs-operator">&gt;</span>
            Grab a fortune inside TBA. Pay per request <span class="hljs-keyword">using</span> <span class="hljs-title">x402</span> <span class="hljs-title">on</span> <span class="hljs-title">Base</span> <span class="hljs-title">Sepolia</span>.
          <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">p</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">div</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-title">div</span> <span class="hljs-title">className</span><span class="hljs-operator">=</span>"<span class="hljs-title">grid</span> <span class="hljs-title">grid</span><span class="hljs-operator">-</span><span class="hljs-title">cols</span><span class="hljs-operator">-</span>1 <span class="hljs-title">gap</span><span class="hljs-operator">-</span>3"<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span><span class="hljs-title">button</span>
            <span class="hljs-title">onClick</span><span class="hljs-operator">=</span>{() <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> <span class="hljs-title">fetchFortune</span>("<span class="hljs-operator">/</span><span class="hljs-title">api</span><span class="hljs-operator">/</span><span class="hljs-title">fortune</span>", "<span class="hljs-title">basic</span>")}
            <span class="hljs-title">disabled</span><span class="hljs-operator">=</span>{<span class="hljs-title">loading</span> <span class="hljs-operator">!</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-title">null</span>}
            <span class="hljs-title">className</span><span class="hljs-operator">=</span>"<span class="hljs-title">rounded</span><span class="hljs-operator">-</span>2<span class="hljs-title">xl</span> <span class="hljs-title">px</span><span class="hljs-operator">-</span>4 <span class="hljs-title">py</span><span class="hljs-operator">-</span>4 <span class="hljs-title">bg</span><span class="hljs-operator">-</span><span class="hljs-title">white</span><span class="hljs-operator">/</span>10 <span class="hljs-title">hover</span>:<span class="hljs-title">bg</span><span class="hljs-operator">-</span><span class="hljs-title">white</span><span class="hljs-operator">/</span>15 <span class="hljs-title">transition</span> <span class="hljs-title">border</span> <span class="hljs-title">border</span><span class="hljs-operator">-</span><span class="hljs-title">white</span><span class="hljs-operator">/</span>10"
          <span class="hljs-operator">&gt;</span>
            {<span class="hljs-title">loading</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> "<span class="hljs-title">basic</span>" ? "<span class="hljs-title">Purchasing</span>…" : "<span class="hljs-title">Buy</span> <span class="hljs-title">Fortune</span> <span class="hljs-operator">-</span> <span class="hljs-title">$0</span>.01"}
          <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">button</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span><span class="hljs-title">button</span>
            <span class="hljs-title">onClick</span><span class="hljs-operator">=</span>{() <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> <span class="hljs-title">fetchFortune</span>("<span class="hljs-operator">/</span><span class="hljs-title">api</span><span class="hljs-operator">/</span><span class="hljs-title">golden</span><span class="hljs-operator">-</span><span class="hljs-title">fortune</span>", "<span class="hljs-title">golden</span>")}
            <span class="hljs-title">disabled</span><span class="hljs-operator">=</span>{<span class="hljs-title">loading</span> <span class="hljs-operator">!</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-title">null</span>}
            <span class="hljs-title">className</span><span class="hljs-operator">=</span>"<span class="hljs-title">rounded</span><span class="hljs-operator">-</span>2<span class="hljs-title">xl</span> <span class="hljs-title">px</span><span class="hljs-operator">-</span>4 <span class="hljs-title">py</span><span class="hljs-operator">-</span>4 <span class="hljs-title">bg</span><span class="hljs-operator">-</span><span class="hljs-title">yellow</span><span class="hljs-operator">-</span>500<span class="hljs-operator">/</span>20 <span class="hljs-title">hover</span>:<span class="hljs-title">bg</span><span class="hljs-operator">-</span><span class="hljs-title">yellow</span><span class="hljs-operator">-</span>500<span class="hljs-operator">/</span>25 <span class="hljs-title">transition</span> <span class="hljs-title">border</span> <span class="hljs-title">border</span><span class="hljs-operator">-</span><span class="hljs-title">yellow</span><span class="hljs-operator">-</span>500<span class="hljs-operator">/</span>30"
          <span class="hljs-operator">&gt;</span>
            {<span class="hljs-title">loading</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> "<span class="hljs-title">golden</span>" ? "<span class="hljs-title">Purchasing</span>… " : "<span class="hljs-title">Buy</span> <span class="hljs-title">GOLDEN</span> <span class="hljs-title">Fortune</span> <span class="hljs-operator">-</span> <span class="hljs-title">$0</span>.10"}
          <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">button</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">div</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-title">div</span> <span class="hljs-title">className</span><span class="hljs-operator">=</span>"<span class="hljs-title">mt</span><span class="hljs-operator">-</span>6 <span class="hljs-title">min</span><span class="hljs-operator">-</span><span class="hljs-title">h</span><span class="hljs-operator">-</span>[96<span class="hljs-title">px</span>] <span class="hljs-title">rounded</span><span class="hljs-operator">-</span>2<span class="hljs-title">xl</span> <span class="hljs-title">border</span> <span class="hljs-title">border</span><span class="hljs-operator">-</span><span class="hljs-title">white</span><span class="hljs-operator">/</span>10 <span class="hljs-title">bg</span><span class="hljs-operator">-</span><span class="hljs-title">white</span><span class="hljs-operator">/</span>5 <span class="hljs-title">p</span><span class="hljs-operator">-</span>4"<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span><span class="hljs-title">div</span> <span class="hljs-title">className</span><span class="hljs-operator">=</span>"<span class="hljs-title">text</span><span class="hljs-operator">-</span><span class="hljs-title">xs</span> <span class="hljs-title">uppercase</span> <span class="hljs-title">tracking</span><span class="hljs-operator">-</span><span class="hljs-title">wide</span> <span class="hljs-title">opacity</span><span class="hljs-operator">-</span>60 <span class="hljs-title">mb</span><span class="hljs-operator">-</span>1"<span class="hljs-operator">&gt;</span><span class="hljs-title">Result</span><span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">div</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span><span class="hljs-title">p</span> <span class="hljs-title">className</span><span class="hljs-operator">=</span>"<span class="hljs-title">text</span><span class="hljs-operator">-</span><span class="hljs-title">base</span> <span class="hljs-title">leading</span><span class="hljs-operator">-</span>6"<span class="hljs-operator">&gt;</span>{<span class="hljs-title">result</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> "<span class="hljs-operator">-</span>"}<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">p</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">div</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-title">p</span> <span class="hljs-title">className</span><span class="hljs-operator">=</span>"<span class="hljs-title">mt</span><span class="hljs-operator">-</span>6 <span class="hljs-title">text</span><span class="hljs-operator">-</span><span class="hljs-title">xs</span> <span class="hljs-title">opacity</span><span class="hljs-operator">-</span>60 <span class="hljs-title">text</span><span class="hljs-operator">-</span><span class="hljs-title">center</span>"<span class="hljs-operator">&gt;</span>
          <span class="hljs-title">Network</span>: {<span class="hljs-title">process</span>.<span class="hljs-title">env</span>.<span class="hljs-title">NEXT_PUBLIC_NETWORK</span> ?? "<span class="hljs-title">base</span><span class="hljs-operator">-</span><span class="hljs-title">sepolia</span>"} · <span class="hljs-title">Powered</span> <span class="hljs-title">by</span> <span class="hljs-title">x402</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">p</span><span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">div</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span><span class="hljs-title">main</span><span class="hljs-operator">&gt;</span>
  );
}</code></pre><blockquote><p><em>Note: The </em><strong><em>payment UX is handled by x402</em></strong><em> when your protected route is hit. Your client code stays simple: call </em><code>fetch</code><em> and display the response.</em></p></blockquote><hr><h3 id="h-part-5-test-locally-in-tba" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Part 5: Test Locally in&nbsp;TBA</h3><p>We’ll expose your dev server to the internet so TBA can frame it.</p><ol><li><p><strong>Run dev server</strong></p></li></ol><pre data-type="codeBlock" text="pnpm dev"><code></code></pre><ol><li><p><strong>Expose with ngrok</strong> (new terminal)</p></li></ol><pre data-type="codeBlock" text="ngrok http 3000"><code><span class="hljs-string">ngrok</span> <span class="hljs-string">http</span> <span class="hljs-number">3000</span></code></pre><ol><li><p><strong>Update your env</strong></p></li></ol><p>Copy the public <code>https://…</code> URL from ngrok to&nbsp;<code>.env.local</code>:</p><pre data-type="codeBlock" text="NEXT_PUBLIC_URL=https://your-ngrok-id.ngrok-free.app"><code><span class="hljs-attr">NEXT_PUBLIC_URL</span>=https://your-ngrok-id.ngrok-free.app</code></pre><p>Restart dev:</p><pre data-type="codeBlock" text="# stop then
pnpm dev"><code><span class="hljs-meta"># stop then</span>
pnpm dev</code></pre><ol><li><p><strong>Open in TBA</strong></p></li></ol><ul><li><p>In TBA, create a new cast with your <code>NEXT_PUBLIC_URL</code>.</p></li><li><p>The URL resolves to a <strong>Frame</strong> with a <strong>Use App</strong> button.</p></li><li><p>Tap it to launch your Miniapp inline and complete a purchase.</p></li></ul><hr><h3 id="h-part-6-tiered-pricing-premium-golden-fortune" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Part 6: Tiered Pricing (Premium “Golden Fortune”)</h3><h3 id="h-61-premium-backend-route" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6.1 Premium backend&nbsp;route</h3><p><strong>File:</strong> <code>app/api/golden-fortune/route.ts</code></p><pre data-type="codeBlock" text="import { NextResponse } from &quot;next/server&quot;;

const goldenFortunes = [
  &quot;You've found the legendary Diamond Hand Pepe. Hodl for unimaginable gains.&quot;,
  &quot;The memecoin you ape into next will not be a rug. This is financial advice.&quot;,
  &quot;Satoshi's ghost will reveal the next big narrative to you tonight.&quot;,
];
export async function GET() {
  const ix = Math.floor(Math.random() * goldenFortunes.length);
  return NextResponse.json({ fortune: goldenFortunes[ix], isGolden: true, timestamp: new Date().toISOString() });
}"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">NextResponse</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"next/server"</span>;

const goldenFortunes <span class="hljs-operator">=</span> [
  <span class="hljs-string">"You've found the legendary Diamond Hand Pepe. Hodl for unimaginable gains."</span>,
  <span class="hljs-string">"The memecoin you ape into next will not be a rug. This is financial advice."</span>,
  <span class="hljs-string">"Satoshi's ghost will reveal the next big narrative to you tonight."</span>,
];
export async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">GET</span>(<span class="hljs-params"></span>) </span>{
  const ix <span class="hljs-operator">=</span> Math.floor(Math.random() <span class="hljs-operator">*</span> goldenFortunes.<span class="hljs-built_in">length</span>);
  <span class="hljs-keyword">return</span> NextResponse.json({ fortune: goldenFortunes[ix], isGolden: <span class="hljs-literal">true</span>, timestamp: <span class="hljs-keyword">new</span> Date().toISOString() });
}</code></pre><h3 id="h-62-update-middleware-with-a-second-priced-route" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">6.2 Update middleware with a second priced&nbsp;route</h3><p><strong>File:</strong> <code>middleware.ts</code> (updated)</p><pre data-type="codeBlock" text="import { facilitator } from &quot;@coinbase/x402&quot;;
import { Address } from &quot;viem&quot;;
import { paymentMiddleware } from &quot;x402-next&quot;;

const payTo = process.env.RESOURCE_WALLET_ADDRESS as Address;
const network = (process.env.NETWORK || &quot;base-sepolia&quot;) as &quot;base&quot; | &quot;base-sepolia&quot;;
export const middleware = paymentMiddleware(
  payTo,
  {
    &quot;/api/fortune&quot;: {
      price: &quot;$0.01&quot;,
      network,
      config: { description: &quot;Your onchain fortune cookie!&quot; },
    },
    &quot;/api/golden-fortune&quot;: {
      price: &quot;$0.10&quot;,
      network,
      config: { description: &quot;Your GOLDEN onchain fortune cookie!&quot; },
    },
  },
  facilitator,
);
export const config = {
  matcher: [&quot;/api/fortune&quot;, &quot;/api/golden-fortune&quot;],
  runtime: &quot;nodejs&quot;,
};"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">facilitator</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"@coinbase/x402"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">Address</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"viem"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">paymentMiddleware</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"x402-next"</span>;

const payTo <span class="hljs-operator">=</span> process.env.RESOURCE_WALLET_ADDRESS <span class="hljs-keyword">as</span> Address;
const network <span class="hljs-operator">=</span> (process.env.NETWORK <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">"base-sepolia"</span>) <span class="hljs-keyword">as</span> <span class="hljs-string">"base"</span> <span class="hljs-operator">|</span> <span class="hljs-string">"base-sepolia"</span>;
export const middleware <span class="hljs-operator">=</span> paymentMiddleware(
  payTo,
  {
    <span class="hljs-string">"/api/fortune"</span>: {
      price: <span class="hljs-string">"$0.01"</span>,
      network,
      config: { description: <span class="hljs-string">"Your onchain fortune cookie!"</span> },
    },
    <span class="hljs-string">"/api/golden-fortune"</span>: {
      price: <span class="hljs-string">"$0.10"</span>,
      network,
      config: { description: <span class="hljs-string">"Your GOLDEN onchain fortune cookie!"</span> },
    },
  },
  facilitator,
);
export const config <span class="hljs-operator">=</span> {
  matcher: [<span class="hljs-string">"/api/fortune"</span>, <span class="hljs-string">"/api/golden-fortune"</span>],
  runtime: <span class="hljs-string">"nodejs"</span>,
};</code></pre><blockquote><p><em>No UI changes needed if you used the two-button page above.</em></p></blockquote><hr><h3 id="h-the-final-demo" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">The Final&nbsp;Demo</h3><ul><li><p>Run <code>pnpm dev</code> and <code>ngrok http 3000</code></p></li><li><p>Cast your ngrok URL in TBA → “Use App”</p></li><li><p>Purchase <strong>Fortune</strong> (<code>$0.01</code>) or <strong>Golden Fortune</strong> (<code>$0.10</code>)</p></li><li><p>See the paid content return in-app — no context switching</p></li></ul><hr><h3 id="h-conclusion-and-next-steps" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Conclusion &amp; Next&nbsp;Steps</h3><p>You just shipped a multi-tier, monetized Miniapp that runs <strong>inside</strong> TBA, using <strong>x402</strong> to price-gate API routes and <strong>CDP</strong> infra to handle payments.</p><p><strong>Next ideas:</strong></p><ul><li><p>Add more tiers and content types (e.g., images, signed data, gated downloads)</p></li><li><p>Switch to <code>NETWORK=base</code> for production and set a mainnet receiver wallet</p></li><li><p>Personalize pricing per route, per user, or time-boxed sales</p></li><li><p>Track purchases and receipts for analytics</p></li></ul><p><strong>Source:</strong> Explore the official x402 examples repo to extend this project.<br>&nbsp;<strong>Community:</strong> Join the Coinbase Developer Platform Discord to share builds and get help.</p><hr><h3 id="h-resources-and-links" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Resources &amp;&nbsp;Links</h3><p><strong>x402 Examples</strong>&nbsp;</p><div data-type="embedly" src="https://github.com/coinbase/x402" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;A payments protocol for the internet. Built on HTTP. - coinbase/x402&quot;,&quot;title&quot;:&quot;GitHub - coinbase/x402: A payments protocol for the internet. Built on HTTP.&quot;,&quot;author_name&quot;:&quot;coinbase&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/coinbase/x402&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/528dfc8a6dabda2bfbbee7fb9baa7681b38ff6f1aa2fa4ad089205cb093c763e.png&quot;,&quot;author_url&quot;:&quot;https://github.com/coinbase&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAIAAAD4YuoOAAAACXBIWXMAAAsTAAALEwEAmpwYAAADHklEQVR4nK1UW0gUURj+JaOLGEUEvhYUVGBRPRRq5INEDxGJdAEjMXoQ7YYRFZIk2kvUQ0VBb90vVF7yEpiy6i7urjvrzra71m6r0u5mrruj6zpnzs7MmRMzs7ibSmX08XP45+ef/zv/7QDVQAjRz/mgC9npPBCizPnULZBmmhtuTmj6WxCiIEEaHZvy+Ce4aUGSk/5JAqQhFotxHBcKhSYiEYyxKIpIEDiOi8fj3wKBj11dFovV1N8fDofTQydEmVJaWtsMkA8rymHrZYBCyKnQWVUCJAj37j+8WnPtel19WfnpC9WXio8crTp7vrjkyPHSk3fu3jtRVp6xLBsAslavW7J8dWNj02xVKaUCltSb5tYAHDKxwW7ryM7TjwAKk3bd1e5wdBsM1oEBs9nMMPbmlvc9vX3vWzu6DQb/8HBbe8fLV6/b2juevXz16PGTSCSSnkEyUNHNc7c71Qxgc9H5F5BTERifTpVI0oBxAiE0w/OSJCFBIIQghOLxGQEJogZCCMY4FpuOcpMzPB/luHB4YirGq4Hy6/Mqn+478xyyT916YgYoHef4VAZer7en12S22Bg7y9jZQccns8U66GAdThfrdDF2lnW6zBabZcDmcrvNFhvr/OTzfXW53S63Z+xHVA2U1wCwrfjKuwdvGIASgAJ9qlJT9M+QtIFp7fNBQQPsroOCG7C9prS2OdXkxUJZjPN/yEAHIQoW5YQmurI4AqJt5h/XLc3/10VbcGkXXGmq6fpE/Q2TSiCK4tDQl57evkAgOEtuHbAxjL3bYBBFkVLqHx5hGLvRaKKUBkPfPUOf3zY2DTrY9MvOvkj+0WB7pzFJgEUJCTjOoy8+v93hdDjdrMsT51F0ajoQGuu3MG63JzbJYcSPBYPGXiMXjUpYiEYmTH0mv9cry+rvCCeSImBJlj/7Rls+GGZ4lMCJX3qgEFkhMqXpuRNRlvV+KZSKiqKPkK4n+/j7EkFeVVLyz6Ykrwr2VGrGCyUbN11ZDudWQnUWXFqTeXFVRnWWqlevzby8FA6s3wC7jkHuQdhRnJLth9Vzy8G9h/f/BANvEbYKt6yPAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/528dfc8a6dabda2bfbbee7fb9baa7681b38ff6f1aa2fa4ad089205cb093c763e.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/528dfc8a6dabda2bfbbee7fb9baa7681b38ff6f1aa2fa4ad089205cb093c763e.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/coinbase/x402" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - coinbase/x402: A payments protocol for the internet. Built on HTTP.</h2><p>A payments protocol for the internet. Built on HTTP. - coinbase/x402</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://storage.googleapis.com/papyrus_images/528dfc8a6dabda2bfbbee7fb9baa7681b38ff6f1aa2fa4ad089205cb093c763e.png"></div></a></div></div><p><strong>Coinbase Developer Docs</strong></p><div data-type="embedly" src="https://docs.cdp.coinbase.com" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;Explore our API &amp; SDK references, demos, and guides for building onchain apps.&quot;,&quot;title&quot;:&quot;Coinbase Developer Docs - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFgUlEQVR4nGWUa0xaZxzG32WuSz8s6dqlH9yta4zZuqVdt262mVtv61Z7r13vo9rLvHS1Vm213pW1iooOKaKIgoqAPYh4QRAFpIhCQRRU0IBUvFAtCmidOi6V5XBM02QnT07eT7/nyfN/3z9Y9XrdnlerXq/v4HG5XKter9PlWVxy2hzLz+cWzRaHccKmN1k1I9NqnUWumejqM4ufmjp6RnkyA/fJCEekY7UPQYJBJn+AztXSuJrq5n5EVY19AEFPvlhwumG6E5Z7acVlX1ieti2OT8+bLHa9yao1zKh1lm7NhEQ1JlKY2nzoJvFwfftQ3RtcCkdN4ajJbBWJrSqDlCS2Cni9XkGPEWwKK6RKqWTi3aRkHL5k3DJrdSy9mV3po3eqnnUoTDyZoUk8zBbqIMEgjPZxyT4iEVIS6hR4hryYvibYwGSxH7xd09U3punvFXSIRRKZxbowZV0Ynfwf3VcLR6xntQ8x+QM0robqQyPcYrq8iNaNrZblUaUYijSnQpJTIVmryOv7I/NYdrot1pdjFrthwjZgXGsGocONi/WQYJDB0yKFlPnQf9N78qtkGI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X9NXIgigjTjxXAkfehQXAm2J0GdiXDWnG5HS9XrI6l0Unb8NgssnmkarOgx9gsGYHa4IVD4ahLoKd5VGlmqSgRJ4jOaQ7PZCPx99wgb0OVbj5bDGdH6LvTwTf3wfZ7YFs8+DwONrAv+Pb+9Dyy2hRaePMIeozI061u7iexVXiGHEORZhBFCYX8yAdNl1NYJxMY+6Ko34bD5YBTRXAzCP3rJBgdGAu2/gm2RP8HMdkQRNH39DQAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Coinbase Developer Docs - Coinbase Developer Documentation</h2><p>Explore our API &amp; SDK references, demos, and guides for building onchain apps.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"></div></a></div></div><p><strong>HeimLabs</strong></p><div data-type="embedly" src="https://www.heimlabs.com" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATYMJAzwU9BnohmElgcLDzgRVipZSwWpVeb1BvyKZ3FLqGSr2v5Dn7OuK/JYfRAt/xkrwj2YYej2Vf9aKLAiyCpZX8C6DAwgd6BmjM+kZfbnzh3LoKtn5+Xo2azOOBEQfH1MpYSCJaoVWuY3TPFVh6KwNvr2+6NnoBjU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;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>TBA (The Base App):</strong> (see product links)</p><div data-type="embedly" src="https://www.base.org" data="{&quot;provider_url&quot;:&quot;https://www.base.org&quot;,&quot;description&quot;:&quot;Base is an open stack that empowers builders, creators, and people everywhere to build apps, grow businesses, create what they love, and earn onchain.&quot;,&quot;title&quot;:&quot;Base&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://www.base.org/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/726176724f7d20305710e6664c082ebe005a4b6afe7151cda7725339fe698b75.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Base&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:642,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB4ElEQVR4nGP4T2PAMFws+Pv3L6YcsuBfbApIswAOfv/+/RcD/CcXgCz4/fv3nTt34Ab9/v37////P378eP/+/bt37759+/b79+93797hMeX3779gV/1DRggLLl68qKik3NbW7uzs4urq5u7u0djUmJGRoaSkrKmlHRUVJS4h0dvbB7ebZB88ffp006ZNW7ZsmTR5ckNDY0tL68pVq/wDAqqqqto7Omrr6vPy8vbt2/fp00fMsPr9GyRS37R7wqQjf//+e/Hi86tXX968+frs2cefP39DLbh+/bqzs0tOTm5RUXFQUFBuXl5YWLijk1NuXt7s2bNjYmJKSkocHB0lJaW+fPmCFuHfvoFN0WpjYNBhYNADkzoMDPoMDDoFJZuhFty5cycnJ3fmzJldXV31DQ29vX1NTU0rVqzMyMhsbmmZO3ducUlJVVX11KnTIBZg9QEDQwQDQyYDQwIDQyoDay4DQ8Dy5RegFpw7d05PT3/q1GkdHZ2cXDyNTU3ZOTl+fv51dfX29g6fPn2iNJk+ffo0KSk5OSVl+vTpmZlZ69evb2tr27RpU1tbe1FR0evXryGJCk8M//7999u332gIkpAQ+QBNPyVpHxmALEDOXBAGnPzx48d/ysCwKez+08wCAPyQt5pujf1VAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:642,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/726176724f7d20305710e6664c082ebe005a4b6afe7151cda7725339fe698b75.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/726176724f7d20305710e6664c082ebe005a4b6afe7151cda7725339fe698b75.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.base.org" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Base</h2><p>Base is an open stack that empowers builders, creators, and people everywhere to build apps, grow businesses, create what they love, and earn onchain.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.base.org</span></div><img src="https://storage.googleapis.com/papyrus_images/726176724f7d20305710e6664c082ebe005a4b6afe7151cda7725339fe698b75.png"></div></a></div></div><p>Clap if this saved you hours, and share what you’re building with the CDP stack!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/315f75ff499ad9842b682cecd24430f415e6e51f4bf4451fdcdb2a941a66f52c.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Build an Autonomous Onchain Agent with CDP Data APIs & Server Wallets - From Awareness to Action in TypeScript]]></title>
            <link>https://paragraph.com/@heimlabs/build-an-autonomous-onchain-agent-with-cdp-data-apis-and-server-wallets-from-awareness-to-action-in-typescript</link>
            <guid>fPfRNJLoNsGQ9jh0hHWH</guid>
            <pubDate>Thu, 02 Oct 2025 13:30:50 GMT</pubDate>
            <description><![CDATA[Running onchain apps used to mean babysitting nodes and guarding private keys. Even simple automations — like watching for payments and reacting — were fragile and slow to build. 

Today, we’ll fix that. 
You’ll build a fully autonomous onchain agent that uses Coinbase Developer Platform (CDP) Data APIs for real‑time awareness and Server Wallets v2 for secure, programmatic actions.]]></description>
            <content:encoded><![CDATA[<hr><h3 id="h-introduction" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Introduction</h3><p>Running onchain apps used to mean babysitting nodes and guarding private keys. Even simple automations — like watching for payments and reacting — were fragile and slow to build.</p><p>Today, we’ll fix that. You’ll build a <strong>fully autonomous onchain agent</strong> that uses <strong>Coinbase Developer Platform (CDP) Data APIs</strong> for real‑time awareness and <strong>Server Wallets v2</strong> for secure, programmatic actions. In TypeScript. From scratch.</p><h4 id="h-by-the-end-youll-have-a-bot-that" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">By the end, you’ll have a bot&nbsp;that:</h4><ul><li><p>Detects incoming <strong>USDC</strong> transfers on <strong>Base</strong> via the <strong>SQL API</strong></p></li><li><p>Automatically forwards a <strong>5% platform fee</strong> using <strong>Server Wallets v2</strong></p></li><li><p>Periodically reports your <strong>treasury’s USDC balance</strong> using the <strong>Token Balances API</strong></p></li></ul><hr><h3 id="h-what-youll-build" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">What You’ll&nbsp;Build</h3><ul><li><p><span data-name="telescope" class="emoji" data-type="emoji">🔭</span> <strong>Monitor</strong> USDC <code>Transfer</code> events on Base with the SQL API</p></li><li><p><span data-name="robot" class="emoji" data-type="emoji">🤖</span> <strong>React</strong> by sending onchain ERC‑20 transfers via Server Wallets v2</p></li><li><p><span data-name="bar_chart" class="emoji" data-type="emoji">📊</span> <strong>Report</strong> treasury balance with the Token Balances API</p></li><li><p><span data-name="shield" class="emoji" data-type="emoji">🛡</span> <strong>Operate</strong> with secure key management — no raw keys in your app</p></li><li><p><span data-name="toolbox" class="emoji" data-type="emoji">🧰</span> <strong>Ship</strong> a clean, copy‑pasteable TypeScript project</p></li></ul><p>(Watch the full video here)</p><div data-type="youtube" videoid="G52NP-nTHqA">
      <div class="youtube-player" data-id="G52NP-nTHqA" style="background-image: url('https://i.ytimg.com/vi/G52NP-nTHqA/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=G52NP-nTHqA">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><hr><h4 id="h-components-in-brief" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>Components in&nbsp;brief</strong></h4><ul><li><p><strong>CDP Data APIs</strong>: SQL API for event queries; Token Balances API for wallet state.</p></li><li><p><strong>Server Wallets v2</strong>: Managed wallets with secure signing and transaction dispatch.</p></li><li><p><strong>Viem</strong>: ABI encoding for ERC‑20 <code>transfer</code>.</p></li><li><p><strong>Axios + dotenv</strong>: Simple HTTP + secret management.</p></li></ul><hr><h3 id="h-stepbystep-walkthrough" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step‑by‑Step Walkthrough</h3><h3 id="h-step-1-bootstrap-your-typescript-project" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 1: Bootstrap Your TypeScript Project</h3><p><strong>Create and initialize</strong></p><pre data-type="codeBlock" text="mkdir cdp-payment-bot &amp;&amp; cd cdp-payment-bot
npm init -y
npm pkg set type=&quot;module&quot;"><code>mkdir cdp<span class="hljs-operator">-</span>payment<span class="hljs-operator">-</span>bot <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> cd cdp<span class="hljs-operator">-</span>payment<span class="hljs-operator">-</span>bot
npm init <span class="hljs-operator">-</span>y
npm pkg set <span class="hljs-keyword">type</span><span class="hljs-operator">=</span><span class="hljs-string">"module"</span></code></pre><p><strong>Install dependencies</strong></p><pre data-type="codeBlock" text="npm install @coinbase/cdp-sdk dotenv axios viem"><code>npm install @coinbase<span class="hljs-operator">/</span>cdp<span class="hljs-operator">-</span>sdk dotenv axios viem</code></pre><p><strong>Scaffold files</strong></p><pre data-type="codeBlock" text="mkdir src
printf &quot;&quot; &gt; src/bot.ts
printf &quot;&quot; &gt; .env"><code><span class="hljs-built_in">mkdir</span> src
<span class="hljs-built_in">printf</span> <span class="hljs-string">""</span> &gt; src/bot.ts
<span class="hljs-built_in">printf</span> <span class="hljs-string">""</span> &gt; .<span class="hljs-built_in">env</span></code></pre><p><strong>Create </strong><code>tsconfig.json</code></p><pre data-type="codeBlock" text="{
  &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;ES2022&quot;,
    &quot;module&quot;: &quot;NodeNext&quot;,
    &quot;moduleResolution&quot;: &quot;NodeNext&quot;,
    &quot;esModuleInterop&quot;: true,
    &quot;strict&quot;: true,
    &quot;skipLibCheck&quot;: true,
    &quot;outDir&quot;: &quot;./dist&quot;
  }
}"><code><span class="hljs-punctuation">{</span>
  <span class="hljs-attr">"compilerOptions"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
    <span class="hljs-attr">"target"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"ES2022"</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"module"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"NodeNext"</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"moduleResolution"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"NodeNext"</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"esModuleInterop"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"strict"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"skipLibCheck"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">"outDir"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"./dist"</span>
  <span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">}</span></code></pre><p><strong>Add secrets to&nbsp;</strong><code>.env</code></p><pre data-type="codeBlock" text="# .env
CDP_API_KEY_SECRET=&quot;your-api-key-secret-here&quot;
CDP_API_KEY_ID=&quot;your-api-key-id-here&quot;
CDP_WALLET_SECRET=&quot;your-wallet-secret-here&quot;
CDP_CLIENT_API_KEY=&quot;your-client-api-key-here&quot;"><code><span class="hljs-comment"># .env</span>
<span class="hljs-attr">CDP_API_KEY_SECRET</span>=<span class="hljs-string">"your-api-key-secret-here"</span>
<span class="hljs-attr">CDP_API_KEY_ID</span>=<span class="hljs-string">"your-api-key-id-here"</span>
<span class="hljs-attr">CDP_WALLET_SECRET</span>=<span class="hljs-string">"your-wallet-secret-here"</span>
<span class="hljs-attr">CDP_CLIENT_API_KEY</span>=<span class="hljs-string">"your-client-api-key-here"</span></code></pre><blockquote><p><em>✅ Tip: Make sure your keys have access to </em><strong><em>Data APIs</em></strong><em> and </em><strong><em>Server Wallets v2</em></strong><em> in the CDP dashboard.</em></p></blockquote><hr><h3 id="h-step-2-paste-the-bot-awareness-action" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 2: Paste the Bot (Awareness →&nbsp;Action)</h3><p>Create <code>src/bot.ts</code> and paste the full, tested script below.</p><pre data-type="codeBlock" text="import { CdpClient } from &quot;@coinbase/cdp-sdk&quot;;
import axios from &quot;axios&quot;;
import dotenv from &quot;dotenv&quot;;
import { encodeFunctionData } from &quot;viem&quot;;

// Load environment variables
dotenv.config();

// Validate required environment variables
if (
  !process.env.CDP_API_KEY_ID ||
  !process.env.CDP_API_KEY_SECRET ||
  !process.env.CDP_WALLET_SECRET ||
  !process.env.CDP_CLIENT_API_KEY
) {
  console.error(&quot;❌ ERROR: Missing required environment variable!&quot;);
  console.error(
    &quot;Please ensure CDP_API_KEY_ID, CDP_API_KEY_SECRET, CDP_WALLET_SECRET, and CDP_CLIENT_API_KEY are set in your .env file&quot;
  );
  process.exit(1);
}

// Initialize the CDP Client
const cdp = new CdpClient();
console.log(&quot;🚀 CDP Client Initialized.&quot;);

// OFFICIAL Base Mainnet USDC Contract Address
const USDC_CONTRACT_ADDRESS = &quot;0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&quot;;

// CDP SQL API Endpoint
const CDP_API_URL = &quot;https://api.cdp.coinbase.com/platform/v2/data/query/run&quot;;

// A minimal ABI for the ERC-20 transfer function
const erc20Abi = [
  {
    name: &quot;transfer&quot;,
    type: &quot;function&quot;,
    inputs: [
      { type: &quot;address&quot;, name: &quot;to&quot; },
      { type: &quot;uint256&quot;, name: &quot;amount&quot; },
    ],
    outputs: [{ type: &quot;boolean&quot; }],
    stateMutability: &quot;nonpayable&quot;,
  },
] as const;

// Type definition for EVM Account
interface EvmAccount {
  address: string;
  name?: string;
}

/**
 * Provisions a new EVM account managed by CDP or retrieves an existing one.
 */
async function provisionAccount(name: string): Promise&lt;EvmAccount&gt; {
    try {
      console.log(`[Provisioner] Checking for account named '${name}'...`);
      const account = await cdp.evm.getOrCreateAccount({ name });
      console.log(
        `[Provisioner] ✅ Account '${name}' ready at address: ${account.address}`
      );
      return account;
    } catch (error) {
      console.error(
        `[Provisioner] ❌ Failed to provision account '${name}':`,
        error
      );
      throw error;
    }
}

/**
 * Queries the CDP SQL API to find new USDC transfers to our receiver address.
 * Uses the base.events table to query Transfer events
 */
async function checkForNewPayments(
    receiverAddress: string,
    lastCheckedTimestamp: string
  ): Promise&lt;any[]&gt; {
    // Query the base.events table for Transfer events
    // Using parameter access pattern: parameters['field']::Type
    const sql = `
      SELECT
    transaction_hash,
    parameters['from']::String AS from_address,
    parameters['to']::String AS to_address,
    parameters['value']::UInt256 AS value,
    block_timestamp
  FROM
    base.events
  WHERE
    event_signature = 'Transfer(address,address,uint256)'
    AND address = LOWER('${USDC_CONTRACT_ADDRESS}')
    AND LOWER(parameters['to']::String) = LOWER('${receiverAddress}')
    AND block_timestamp &gt; '${lastCheckedTimestamp}'
  ORDER BY
    block_timestamp ASC
  LIMIT 100
    `;
  
    try {
      const headers = {
        Authorization: `Bearer ${process.env.CDP_CLIENT_API_KEY}`,
        &quot;Content-Type&quot;: &quot;application/json&quot;,
      };
  
      const response = await axios.post(CDP_API_URL, { sql }, { headers });
  
      if (response.data &amp;&amp; response.data.result) {
        const resultCount = response.data.result.length;
        if (resultCount &gt; 0) {
          console.log(`[SQL API] Found ${resultCount} new payment(s)`);
        }
        return response.data.result;
      }
  
      return [];
    } catch (error: any) {
      if (error.response) {
        console.error(&quot;[SQL API] ❌ Error response:&quot;, {
          status: error.response.status,
          data: error.response.data,
        });
      } else if (error.request) {
        console.error(&quot;[SQL API] ❌ No response received&quot;);
      } else {
        console.error(&quot;[SQL API] ❌ Error:&quot;, error.message);
      }
      return [];
    }
}

/**
 * Uses the Token Balances API to check and report the treasury's USDC balance.
 */
async function reportTreasuryBalance(treasury: EvmAccount): Promise&lt;void&gt; {
    try {
      const response = await cdp.evm.listTokenBalances({
        address: treasury.address as `0x${string}`,
        network: &quot;base&quot;,
      });
  
      // Find USDC balance in the response
      const usdcBalance = response.balances.find(
        (b: any) =&gt;
          b.token.contractAddress?.toLowerCase() ===
          USDC_CONTRACT_ADDRESS.toLowerCase()
      );
  
      if (usdcBalance) {
        // USDC has 6 decimals
        const amount =
          Number(BigInt(usdcBalance.amount.amount) / BigInt(1e4)) / 100;
        console.log(
          `[Reporter] 💰 Treasury Balance: ${amount.toLocaleString(&quot;en-US&quot;, {
            style: &quot;currency&quot;,
            currency: &quot;USD&quot;,
          })} USDC`
        );
      } else {
        console.log(`[Reporter] 💰 Treasury Balance: $0.00 USDC`);
      }
    } catch (error: any) {
      console.error(
        &quot;[Reporter] ❌ Error fetching treasury balance:&quot;,
        error.message || error
      );
    }
}

/**
 * Sends the calculated platform fee from the receiver wallet to the treasury wallet.
 */
async function sendFeeTransaction(
    receiverAccount: EvmAccount,
    treasuryAddress: string,
    feeAmount: bigint
  ): Promise&lt;string | undefined&gt; {
    try {
      // Convert to human-readable amount for logging (USDC has 6 decimals)
      const humanAmount = Number(feeAmount) / 1e6;
      console.log(
        `[Reactor] Forwarding fee of ${humanAmount.toFixed(
          6
        )} USDC to treasury...`
      );
  
      // Create the transaction data for ERC-20 transfer
      const data = encodeFunctionData({
        abi: erc20Abi,
        functionName: &quot;transfer&quot;,
        args: [treasuryAddress as `0x${string}`, feeAmount],
      });
  
      // Send the transaction using CDP SDK
      const result = await cdp.evm.sendTransaction({
        address: receiverAccount.address as `0x${string}`,
        network: &quot;base&quot;,
        transaction: {
          to: USDC_CONTRACT_ADDRESS,
          value: 0n, // No ETH value for token transfer
          data: data,
        },
      });
  
      console.log(
        `[Reactor] ✅ Fee transaction sent! Hash: https://basescan.org/tx/${result.transactionHash}`
      );
      return result.transactionHash;
    } catch (error: any) {
      console.error(
        &quot;[Reactor] ❌ Failed to send fee transaction:&quot;,
        error.message || error
      );
  
      // Check if it's a gas-related error
      if (
        error.message?.includes(&quot;gas&quot;) ||
        error.message?.includes(&quot;insufficient&quot;)
      ) {
        console.error(
          &quot;[Reactor] 💡 Hint: Ensure the receiver account has enough ETH for gas fees&quot;
        );
      }
  
      return undefined;
    }
}

/**
 * Main function to run the autonomous payment bot
 */
async function main() {
    console.log(&quot;--- 🏁 Starting Onchain Agent ---&quot;);
    console.log(`📅 Current time: ${new Date().toISOString()}`);
  
    try {
      // 1. Provision the wallets our agent will use
      const receiverAccount = await provisionAccount(&quot;payment-receiver-bot&quot;);
      const treasuryAccount = await provisionAccount(&quot;platform-treasury-bot&quot;);
  
      // 2. CRITICAL WARNING
      console.log(
        &quot;\n❗️❗️ WARNING: THIS AGENT OPERATES ON BASE MAINNET WITH REAL FUNDS ❗️❗️&quot;
      );
      console.log(&quot;⚠️  Please ensure the following before starting:&quot;);
      console.log(&quot;   1. Fund the receiver with ETH for gas fees&quot;);
      console.log(&quot;   2. Test with small amounts first&quot;);
      console.log(&quot;   3. Monitor the addresses below:\n&quot;);
      console.log(`💰 Receiver Address: ${receiverAccount.address}`);
      console.log(`🏦 Treasury Address: ${treasuryAccount.address}`);
      console.log(
        &quot;\nPress Ctrl+C to exit if you need to prepare the accounts first.\n&quot;
      );
  
      // Initialize timestamp for payment tracking - SQL format
      let lastCheckedTimestamp = new Date().toISOString().replace('T', ' ').substring(0, 19);
  
      // Test SQL API connectivity with a simple query
      console.log(&quot;--- 🔍 Testing SQL API Connectivity ---&quot;);
      const testSql = `
        SELECT COUNT(*) as count 
        FROM base.events 
        WHERE event_signature = 'Transfer(address,address,uint256)' 
        LIMIT 1
      `;
  
      try {
        const testResponse = await axios.post(
          CDP_API_URL,
          { sql: testSql },
          {
            headers: {
              Authorization: `Bearer ${process.env.CDP_CLIENT_API_KEY}`,
              &quot;Content-Type&quot;: &quot;application/json&quot;,
            },
          }
        );
        console.log(`[Test] ✅ SQL API connected successfully`);
      } catch (error: any) {
        console.error(
          &quot;[Test] ❌ Failed to connect to SQL API:&quot;,
          error.response?.data || error.message
        );
        console.error(
          &quot;Please check your CDP_CLIENT_API_KEY and ensure it has proper permissions&quot;
        );
        process.exit(1);
      }
  
      // Loop 1: Check for new payments every 10 seconds
      console.log(
        &quot;\n--- ⏰ Starting Payment Monitoring Loop (every 10 seconds) ---&quot;
      );
      const paymentInterval = setInterval(async () =&gt; {
        try {
          const newPayments = await checkForNewPayments(
            receiverAccount.address,
            lastCheckedTimestamp
          );
  
          if (newPayments.length &gt; 0) {
            console.log(
              `\n[Detector] 🎉 Found ${newPayments.length} new payment(s)!`
            );
  
            for (const payment of newPayments) {
              console.log(
                `[Detector] Processing payment from ${payment.from_address}`
              );
              console.log(
                `[Detector] Amount: ${BigInt(payment.value)} (smallest unit)`
              );
  
              const paymentValue = BigInt(payment.value);
              const feeValue = paymentValue / 20n; // Calculate 5% fee
  
              if (feeValue &gt; 0n) {
                const txHash = await sendFeeTransaction(
                  receiverAccount,
                  treasuryAccount.address,
                  feeValue
                );
                if (txHash) {
                  console.log(
                    `[Reactor] Successfully processed fee for payment ${payment.transaction_hash}`
                  );
                }
              } else {
                console.log(`[Reactor] Payment amount too small to collect fee`);
              }
  
              // Update the timestamp to avoid reprocessing
              lastCheckedTimestamp = payment.block_timestamp;
            }
          } else {
            // Quiet log - only show periodically
            const now = new Date();
            if (now.getSeconds() % 30 === 0) {
              console.log(
                `[Monitor] Watching for new USDC payments... (${now.toLocaleTimeString()})`
              );
            }
          }
        } catch (error) {
          console.error(&quot;[Payment Loop] Error in payment monitoring:&quot;, error);
        }
      }, 10000);
  
      // Loop 2: Report treasury balance every 60 seconds
      console.log(
        &quot;--- 📈 Starting Treasury Reporting Loop (every 60 seconds) ---&quot;
      );
      const reportingInterval = setInterval(async () =&gt; {
        await reportTreasuryBalance(treasuryAccount);
      }, 60000);
  
      // Initial balance report
      await reportTreasuryBalance(treasuryAccount);
  
      // Graceful shutdown handler
      process.on(&quot;SIGINT&quot;, () =&gt; {
        console.log(&quot;\n\n--- 🛑 Shutting down gracefully ---&quot;);
        clearInterval(paymentInterval);
        clearInterval(reportingInterval);
        console.log(&quot;✅ All intervals cleared. Goodbye!&quot;);
        process.exit(0);
      });
    } catch (error: any) {
      console.error(
        &quot;\n❌ Critical error during initialization:&quot;,
        error.message || error
      );
      process.exit(1);
    }
  }

// Run the main function
main().catch((error) =&gt; {
  console.error(&quot;\n❌ Unhandled error:&quot;, error);
  process.exit(1);
});"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">CdpClient</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"@coinbase/cdp-sdk"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">axios</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"axios"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">dotenv</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"dotenv"</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">encodeFunctionData</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"viem"</span>;

<span class="hljs-comment">// Load environment variables</span>
dotenv.config();

<span class="hljs-comment">// Validate required environment variables</span>
<span class="hljs-keyword">if</span> (
  <span class="hljs-operator">!</span>process.env.CDP_API_KEY_ID <span class="hljs-operator">|</span><span class="hljs-operator">|</span>
  <span class="hljs-operator">!</span>process.env.CDP_API_KEY_SECRET <span class="hljs-operator">|</span><span class="hljs-operator">|</span>
  <span class="hljs-operator">!</span>process.env.CDP_WALLET_SECRET <span class="hljs-operator">|</span><span class="hljs-operator">|</span>
  <span class="hljs-operator">!</span>process.env.CDP_CLIENT_API_KEY
) {
  console.error(<span class="hljs-string">"❌ ERROR: Missing required environment variable!"</span>);
  console.error(
    <span class="hljs-string">"Please ensure CDP_API_KEY_ID, CDP_API_KEY_SECRET, CDP_WALLET_SECRET, and CDP_CLIENT_API_KEY are set in your .env file"</span>
  );
  process.exit(<span class="hljs-number">1</span>);
}

<span class="hljs-comment">// Initialize the CDP Client</span>
const cdp <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> CdpClient();
console.log(<span class="hljs-string">"🚀 CDP Client Initialized."</span>);

<span class="hljs-comment">// OFFICIAL Base Mainnet USDC Contract Address</span>
const USDC_CONTRACT_ADDRESS <span class="hljs-operator">=</span> <span class="hljs-string">"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"</span>;

<span class="hljs-comment">// CDP SQL API Endpoint</span>
const CDP_API_URL <span class="hljs-operator">=</span> <span class="hljs-string">"https://api.cdp.coinbase.com/platform/v2/data/query/run"</span>;

<span class="hljs-comment">// A minimal ABI for the ERC-20 transfer function</span>
const erc20Abi <span class="hljs-operator">=</span> [
  {
    name: <span class="hljs-string">"transfer"</span>,
    <span class="hljs-keyword">type</span>: <span class="hljs-string">"function"</span>,
    inputs: [
      { <span class="hljs-keyword">type</span>: <span class="hljs-string">"address"</span>, name: <span class="hljs-string">"to"</span> },
      { <span class="hljs-keyword">type</span>: <span class="hljs-string">"uint256"</span>, name: <span class="hljs-string">"amount"</span> },
    ],
    outputs: [{ <span class="hljs-keyword">type</span>: <span class="hljs-string">"boolean"</span> }],
    stateMutability: <span class="hljs-string">"nonpayable"</span>,
  },
] <span class="hljs-keyword">as</span> const;

<span class="hljs-comment">// Type definition for EVM Account</span>
<span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">EvmAccount</span> </span>{
  <span class="hljs-keyword">address</span>: <span class="hljs-keyword">string</span>;
  name?: <span class="hljs-keyword">string</span>;
}

<span class="hljs-comment">/**
 * Provisions a new EVM account managed by CDP or retrieves an existing one.
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">provisionAccount</span>(<span class="hljs-params">name: <span class="hljs-keyword">string</span></span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">EvmAccount</span>&gt; </span>{
    <span class="hljs-keyword">try</span> {
      console.log(`[Provisioner] Checking <span class="hljs-keyword">for</span> account named <span class="hljs-string">'${name}'</span>...`);
      const account <span class="hljs-operator">=</span> await cdp.evm.getOrCreateAccount({ name });
      console.log(
        `[Provisioner] ✅ Account <span class="hljs-string">'${name}'</span> ready at <span class="hljs-keyword">address</span>: ${account.<span class="hljs-built_in">address</span>}`
      );
      <span class="hljs-keyword">return</span> account;
    } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>) </span>{
      console.error(
        `[Provisioner] ❌ Failed to provision account <span class="hljs-string">'${name}'</span>:`,
        <span class="hljs-function"><span class="hljs-keyword">error</span>
      )</span>;
      <span class="hljs-keyword">throw</span> <span class="hljs-function"><span class="hljs-keyword">error</span></span>;
    }
}

<span class="hljs-comment">/**
 * Queries the CDP SQL API to find new USDC transfers to our receiver address.
 * Uses the base.events table to query Transfer events
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">checkForNewPayments</span>(<span class="hljs-params">
    receiverAddress: <span class="hljs-keyword">string</span>,
    lastCheckedTimestamp: <span class="hljs-keyword">string</span>
  </span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">any</span>[]&gt; </span>{
    <span class="hljs-comment">// Query the base.events table for Transfer events</span>
    <span class="hljs-comment">// Using parameter access pattern: parameters['field']::Type</span>
    const sql <span class="hljs-operator">=</span> `
      SELECT
    transaction_hash,
    parameters[<span class="hljs-string">'from'</span>]::String AS from_address,
    parameters[<span class="hljs-string">'to'</span>]::String AS to_address,
    parameters[<span class="hljs-string">'value'</span>]::UInt256 AS value,
    block_timestamp
  FROM
    base.events
  WHERE
    event_signature <span class="hljs-operator">=</span> <span class="hljs-string">'Transfer(address,address,uint256)'</span>
    AND <span class="hljs-keyword">address</span> <span class="hljs-operator">=</span> LOWER(<span class="hljs-string">'${USDC_CONTRACT_ADDRESS}'</span>)
    AND LOWER(parameters[<span class="hljs-string">'to'</span>]::String) <span class="hljs-operator">=</span> LOWER(<span class="hljs-string">'${receiverAddress}'</span>)
    AND block_timestamp <span class="hljs-operator">&gt;</span> <span class="hljs-string">'${lastCheckedTimestamp}'</span>
  ORDER BY
    block_timestamp ASC
  LIMIT <span class="hljs-number">100</span>
    `;
  
    <span class="hljs-keyword">try</span> {
      const headers <span class="hljs-operator">=</span> {
        Authorization: `Bearer ${process.env.CDP_CLIENT_API_KEY}`,
        <span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>,
      };
  
      const response <span class="hljs-operator">=</span> await axios.post(CDP_API_URL, { sql }, { headers });
  
      <span class="hljs-keyword">if</span> (response.data <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> response.data.result) {
        const resultCount <span class="hljs-operator">=</span> response.data.result.<span class="hljs-built_in">length</span>;
        <span class="hljs-keyword">if</span> (resultCount <span class="hljs-operator">&gt;</span> <span class="hljs-number">0</span>) {
          console.log(`[SQL API] Found ${resultCount} <span class="hljs-keyword">new</span> payment(s)`);
        }
        <span class="hljs-keyword">return</span> response.data.result;
      }
  
      <span class="hljs-keyword">return</span> [];
    } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>: <span class="hljs-title">any</span>) </span>{
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">error</span>.response) {
        console.error(<span class="hljs-string">"[SQL API] ❌ Error response:"</span>, {
          status: <span class="hljs-keyword">error</span>.response.status,
          data: <span class="hljs-keyword">error</span>.response.data,
        });
      } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-keyword">error</span>.request) {
        console.error(<span class="hljs-string">"[SQL API] ❌ No response received"</span>);
      } <span class="hljs-keyword">else</span> {
        console.error(<span class="hljs-string">"[SQL API] ❌ Error:"</span>, <span class="hljs-keyword">error</span>.message);
      }
      <span class="hljs-keyword">return</span> [];
    }
}

<span class="hljs-comment">/**
 * Uses the Token Balances API to check and report the treasury's USDC balance.
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">reportTreasuryBalance</span>(<span class="hljs-params">treasury: EvmAccount</span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title">void</span>&gt; </span>{
    <span class="hljs-keyword">try</span> {
      const response <span class="hljs-operator">=</span> await cdp.evm.listTokenBalances({
        <span class="hljs-keyword">address</span>: treasury.<span class="hljs-built_in">address</span> <span class="hljs-keyword">as</span> `0x${<span class="hljs-keyword">string</span>}`,
        network: <span class="hljs-string">"base"</span>,
      });
  
      <span class="hljs-comment">// Find USDC balance in the response</span>
      const usdcBalance <span class="hljs-operator">=</span> response.balances.find(
        (b: any) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span>
          b.token.contractAddress?.toLowerCase() <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span>
          USDC_CONTRACT_ADDRESS.toLowerCase()
      );
  
      <span class="hljs-keyword">if</span> (usdcBalance) {
        <span class="hljs-comment">// USDC has 6 decimals</span>
        const amount <span class="hljs-operator">=</span>
          Number(BigInt(usdcBalance.amount.amount) <span class="hljs-operator">/</span> BigInt(<span class="hljs-number">1e4</span>)) <span class="hljs-operator">/</span> <span class="hljs-number">100</span>;
        console.log(
          `[Reporter] 💰 Treasury Balance: ${amount.toLocaleString(<span class="hljs-string">"en-US"</span>, {
            style: <span class="hljs-string">"currency"</span>,
            currency: <span class="hljs-string">"USD"</span>,
          })} USDC`
        );
      } <span class="hljs-keyword">else</span> {
        console.log(`[Reporter] 💰 Treasury Balance: $0<span class="hljs-number">.00</span> USDC`);
      }
    } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>: <span class="hljs-title">any</span>) </span>{
      console.error(
        <span class="hljs-string">"[Reporter] ❌ Error fetching treasury balance:"</span>,
        <span class="hljs-keyword">error</span>.message <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-function"><span class="hljs-keyword">error</span>
      )</span>;
    }
}

<span class="hljs-comment">/**
 * Sends the calculated platform fee from the receiver wallet to the treasury wallet.
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sendFeeTransaction</span>(<span class="hljs-params">
    receiverAccount: EvmAccount,
    treasuryAddress: <span class="hljs-keyword">string</span>,
    feeAmount: bigint
  </span>): <span class="hljs-title">Promise</span>&lt;<span class="hljs-title"><span class="hljs-keyword">string</span></span> | <span class="hljs-title">undefined</span>&gt; </span>{
    <span class="hljs-keyword">try</span> {
      <span class="hljs-comment">// Convert to human-readable amount for logging (USDC has 6 decimals)</span>
      const humanAmount <span class="hljs-operator">=</span> Number(feeAmount) <span class="hljs-operator">/</span> <span class="hljs-number">1e6</span>;
      console.log(
        `[Reactor] Forwarding fee of ${humanAmount.toFixed(
          <span class="hljs-number">6</span>
        )} USDC to treasury...`
      );
  
      <span class="hljs-comment">// Create the transaction data for ERC-20 transfer</span>
      const data <span class="hljs-operator">=</span> encodeFunctionData({
        <span class="hljs-built_in">abi</span>: erc20Abi,
        functionName: <span class="hljs-string">"transfer"</span>,
        args: [treasuryAddress <span class="hljs-keyword">as</span> `0x${<span class="hljs-keyword">string</span>}`, feeAmount],
      });
  
      <span class="hljs-comment">// Send the transaction using CDP SDK</span>
      const result <span class="hljs-operator">=</span> await cdp.evm.sendTransaction({
        <span class="hljs-keyword">address</span>: receiverAccount.<span class="hljs-built_in">address</span> <span class="hljs-keyword">as</span> `0x${<span class="hljs-keyword">string</span>}`,
        network: <span class="hljs-string">"base"</span>,
        transaction: {
          to: USDC_CONTRACT_ADDRESS,
          <span class="hljs-built_in">value</span>: 0n, <span class="hljs-comment">// No ETH value for token transfer</span>
          data: data,
        },
      });
  
      console.log(
        `[Reactor] ✅ Fee transaction sent<span class="hljs-operator">!</span> Hash: https:<span class="hljs-comment">//basescan.org/tx/${result.transactionHash}`</span>
      );
      <span class="hljs-keyword">return</span> result.transactionHash;
    } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>: <span class="hljs-title">any</span>) </span>{
      console.error(
        <span class="hljs-string">"[Reactor] ❌ Failed to send fee transaction:"</span>,
        <span class="hljs-keyword">error</span>.message <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-function"><span class="hljs-keyword">error</span>
      )</span>;
  
      <span class="hljs-comment">// Check if it's a gas-related error</span>
      <span class="hljs-keyword">if</span> (
        <span class="hljs-keyword">error</span>.message?.includes(<span class="hljs-string">"gas"</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span>
        <span class="hljs-keyword">error</span>.message?.includes(<span class="hljs-string">"insufficient"</span>)
      ) {
        console.error(
          <span class="hljs-string">"[Reactor] 💡 Hint: Ensure the receiver account has enough ETH for gas fees"</span>
        );
      }
  
      <span class="hljs-keyword">return</span> undefined;
    }
}

<span class="hljs-comment">/**
 * Main function to run the autonomous payment bot
 */</span>
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    console.log(<span class="hljs-string">"--- 🏁 Starting Onchain Agent ---"</span>);
    console.log(`📅 Current time: ${<span class="hljs-keyword">new</span> Date().toISOString()}`);
  
    <span class="hljs-keyword">try</span> {
      <span class="hljs-comment">// 1. Provision the wallets our agent will use</span>
      const receiverAccount <span class="hljs-operator">=</span> await provisionAccount(<span class="hljs-string">"payment-receiver-bot"</span>);
      const treasuryAccount <span class="hljs-operator">=</span> await provisionAccount(<span class="hljs-string">"platform-treasury-bot"</span>);
  
      <span class="hljs-comment">// 2. CRITICAL WARNING</span>
      console.log(
        <span class="hljs-string">"\n❗️❗️ WARNING: THIS AGENT OPERATES ON BASE MAINNET WITH REAL FUNDS ❗️❗️"</span>
      );
      console.log(<span class="hljs-string">"⚠️  Please ensure the following before starting:"</span>);
      console.log(<span class="hljs-string">"   1. Fund the receiver with ETH for gas fees"</span>);
      console.log(<span class="hljs-string">"   2. Test with small amounts first"</span>);
      console.log(<span class="hljs-string">"   3. Monitor the addresses below:\n"</span>);
      console.log(`💰 Receiver Address: ${receiverAccount.<span class="hljs-built_in">address</span>}`);
      console.log(`🏦 Treasury Address: ${treasuryAccount.<span class="hljs-built_in">address</span>}`);
      console.log(
        <span class="hljs-string">"\nPress Ctrl+C to exit if you need to prepare the accounts first.\n"</span>
      );
  
      <span class="hljs-comment">// Initialize timestamp for payment tracking - SQL format</span>
      let lastCheckedTimestamp <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> Date().toISOString().replace(<span class="hljs-string">'T'</span>, <span class="hljs-string">' '</span>).substring(<span class="hljs-number">0</span>, <span class="hljs-number">19</span>);
  
      <span class="hljs-comment">// Test SQL API connectivity with a simple query</span>
      console.log(<span class="hljs-string">"--- 🔍 Testing SQL API Connectivity ---"</span>);
      const testSql <span class="hljs-operator">=</span> `
        SELECT COUNT(<span class="hljs-operator">*</span>) <span class="hljs-keyword">as</span> count 
        FROM base.events 
        WHERE event_signature <span class="hljs-operator">=</span> <span class="hljs-string">'Transfer(address,address,uint256)'</span> 
        LIMIT <span class="hljs-number">1</span>
      `;
  
      <span class="hljs-keyword">try</span> {
        const testResponse <span class="hljs-operator">=</span> await axios.post(
          CDP_API_URL,
          { sql: testSql },
          {
            headers: {
              Authorization: `Bearer ${process.env.CDP_CLIENT_API_KEY}`,
              <span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>,
            },
          }
        );
        console.log(`[Test] ✅ SQL API connected successfully`);
      } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>: <span class="hljs-title">any</span>) </span>{
        console.error(
          <span class="hljs-string">"[Test] ❌ Failed to connect to SQL API:"</span>,
          <span class="hljs-keyword">error</span>.response?.data <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-keyword">error</span>.message
        );
        console.error(
          <span class="hljs-string">"Please check your CDP_CLIENT_API_KEY and ensure it has proper permissions"</span>
        );
        process.exit(<span class="hljs-number">1</span>);
      }
  
      <span class="hljs-comment">// Loop 1: Check for new payments every 10 seconds</span>
      console.log(
        <span class="hljs-string">"\n--- ⏰ Starting Payment Monitoring Loop (every 10 seconds) ---"</span>
      );
      const paymentInterval <span class="hljs-operator">=</span> setInterval(async () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
        <span class="hljs-keyword">try</span> {
          const newPayments <span class="hljs-operator">=</span> await checkForNewPayments(
            receiverAccount.<span class="hljs-built_in">address</span>,
            lastCheckedTimestamp
          );
  
          <span class="hljs-keyword">if</span> (newPayments.<span class="hljs-built_in">length</span> <span class="hljs-operator">&gt;</span> <span class="hljs-number">0</span>) {
            console.log(
              `\n[Detector] 🎉 Found ${newPayments.<span class="hljs-built_in">length</span>} <span class="hljs-keyword">new</span> payment(s)<span class="hljs-operator">!</span>`
            );
  
            <span class="hljs-keyword">for</span> (const payment of newPayments) {
              console.log(
                `[Detector] Processing payment <span class="hljs-keyword">from</span> ${payment.from_address}`
              );
              console.log(
                `[Detector] Amount: ${BigInt(payment.<span class="hljs-built_in">value</span>)} (smallest unit)`
              );
  
              const paymentValue <span class="hljs-operator">=</span> BigInt(payment.<span class="hljs-built_in">value</span>);
              const feeValue <span class="hljs-operator">=</span> paymentValue <span class="hljs-operator">/</span> 20n; <span class="hljs-comment">// Calculate 5% fee</span>
  
              <span class="hljs-keyword">if</span> (feeValue <span class="hljs-operator">&gt;</span> 0n) {
                const txHash <span class="hljs-operator">=</span> await sendFeeTransaction(
                  receiverAccount,
                  treasuryAccount.<span class="hljs-built_in">address</span>,
                  feeValue
                );
                <span class="hljs-keyword">if</span> (txHash) {
                  console.log(
                    `[Reactor] Successfully processed fee <span class="hljs-keyword">for</span> payment ${payment.transaction_hash}`
                  );
                }
              } <span class="hljs-keyword">else</span> {
                console.log(`[Reactor] Payment amount too small to collect fee`);
              }
  
              <span class="hljs-comment">// Update the timestamp to avoid reprocessing</span>
              lastCheckedTimestamp <span class="hljs-operator">=</span> payment.block_timestamp;
            }
          } <span class="hljs-keyword">else</span> {
            <span class="hljs-comment">// Quiet log - only show periodically</span>
            const <span class="hljs-built_in">now</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> Date();
            <span class="hljs-keyword">if</span> (<span class="hljs-built_in">now</span>.getSeconds() <span class="hljs-operator">%</span> <span class="hljs-number">30</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) {
              console.log(
                `[Monitor] Watching <span class="hljs-keyword">for</span> <span class="hljs-keyword">new</span> USDC payments... (${<span class="hljs-built_in">now</span>.toLocaleTimeString()})`
              );
            }
          }
        } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>) </span>{
          console.error(<span class="hljs-string">"[Payment Loop] Error in payment monitoring:"</span>, <span class="hljs-function"><span class="hljs-keyword">error</span>)</span>;
        }
      }, <span class="hljs-number">10000</span>);
  
      <span class="hljs-comment">// Loop 2: Report treasury balance every 60 seconds</span>
      console.log(
        <span class="hljs-string">"--- 📈 Starting Treasury Reporting Loop (every 60 seconds) ---"</span>
      );
      const reportingInterval <span class="hljs-operator">=</span> setInterval(async () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
        await reportTreasuryBalance(treasuryAccount);
      }, <span class="hljs-number">60000</span>);
  
      <span class="hljs-comment">// Initial balance report</span>
      await reportTreasuryBalance(treasuryAccount);
  
      <span class="hljs-comment">// Graceful shutdown handler</span>
      process.on(<span class="hljs-string">"SIGINT"</span>, () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
        console.log(<span class="hljs-string">"\n\n--- 🛑 Shutting down gracefully ---"</span>);
        clearInterval(paymentInterval);
        clearInterval(reportingInterval);
        console.log(<span class="hljs-string">"✅ All intervals cleared. Goodbye!"</span>);
        process.exit(<span class="hljs-number">0</span>);
      });
    } <span class="hljs-keyword">catch</span> (<span class="hljs-function"><span class="hljs-keyword">error</span>: <span class="hljs-title">any</span>) </span>{
      console.error(
        <span class="hljs-string">"\n❌ Critical error during initialization:"</span>,
        <span class="hljs-keyword">error</span>.message <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-function"><span class="hljs-keyword">error</span>
      )</span>;
      process.exit(<span class="hljs-number">1</span>);
    }
  }

<span class="hljs-comment">// Run the main function</span>
main().catch((<span class="hljs-function"><span class="hljs-keyword">error</span>) =&gt; </span>{
  console.error(<span class="hljs-string">"\n❌ Unhandled error:"</span>, <span class="hljs-function"><span class="hljs-keyword">error</span>)</span>;
  process.exit(<span class="hljs-number">1</span>);
});</code></pre><hr><h3 id="h-step-3-run-the-agent" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 3: Run the&nbsp;Agent</h3><p><strong>Build and start</strong></p><pre data-type="codeBlock" text="npx tsc &amp;&amp; node dist/bot.js"><code>npx tsc <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> node dist<span class="hljs-operator">/</span>bot.js</code></pre><p>You’ll see the monitoring and reporting loops start. Send a small USDC transfer to the <strong>receiver</strong> address printed in the console. The bot will:</p><ul><li><p>Detect the payment via SQL API</p></li><li><p>Compute a 5% fee</p></li><li><p>Send an ERC‑20 transfer from the receiver to the treasury</p></li><li><p>Log the transaction hash and update the treasury balance report</p></li></ul><blockquote><p><span data-name="warning" class="emoji" data-type="emoji">⚠</span><em> </em><strong><em>Mainnet Warning:</em></strong><em> This script targets </em><strong><em>Base mainnet</em></strong><em> and moves real funds. Start with tiny amounts, keep the receiver funded with ETH for gas, and monitor activity closely.</em></p></blockquote><hr><h3 id="h-conclusion-and-call-to-action" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Conclusion &amp; Call to&nbsp;Action</h3><p>You just built an <strong>Awareness → Action</strong> loop using <strong>CDP Data APIs</strong> and <strong>Server Wallets v2</strong> — a foundation for autonomous DeFi bots, game backends, and more. Because CDP unifies EVM networks, you can adapt this pattern to Ethereum, Polygon, and beyond with minimal changes.</p><h4 id="h-next-steps" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>Next Steps</strong></h4><ul><li><p>Swap the SQL query to watch a different contract or event signature</p></li><li><p>Add rate‑limiting, alerts, or retries around the reactor</p></li><li><p>Extend reporting (e.g., multi‑token balances, PnL snapshots)</p></li></ul><h4 id="h-cta" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>CTA</strong></h4><ul><li><p>Explore <strong>CDP Docs</strong>: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.cdp.coinbase.com">https://docs.cdp.coinbase.com</a></p></li><li><p>Join the <strong>Coinbase Developer Discord</strong></p></li><li><p>Follow <strong>HeimLabs</strong> for more builder‑first tutorials</p></li></ul><hr><h3 id="h-resources-and-links" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Resources &amp;&nbsp;Links</h3><p><strong>CDP Documentation</strong>:</p><div data-type="embedly" src="https://docs.cdp.coinbase.com" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;Explore our API &amp; SDK references, demos, and guides for building onchain apps.&quot;,&quot;title&quot;:&quot;Coinbase Developer Docs - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFgUlEQVR4nGWUa0xaZxzG32WuSz8s6dqlH9yta4zZuqVdt262mVtv61Z7r13vo9rLvHS1Vm213pW1iooOKaKIgoqAPYh4QRAFpIhCQRRU0IBUvFAtCmidOi6V5XBM02QnT07eT7/nyfN/3z9Y9XrdnlerXq/v4HG5XKter9PlWVxy2hzLz+cWzRaHccKmN1k1I9NqnUWumejqM4ufmjp6RnkyA/fJCEekY7UPQYJBJn+AztXSuJrq5n5EVY19AEFPvlhwumG6E5Z7acVlX1ieti2OT8+bLHa9yao1zKh1lm7NhEQ1JlKY2nzoJvFwfftQ3RtcCkdN4ajJbBWJrSqDlCS2Cni9XkGPEWwKK6RKqWTi3aRkHL5k3DJrdSy9mV3po3eqnnUoTDyZoUk8zBbqIMEgjPZxyT4iEVIS6hR4hryYvibYwGSxH7xd09U3punvFXSIRRKZxbowZV0Ynfwf3VcLR6xntQ8x+QM0robqQyPcYrq8iNaNrZblUaUYijSnQpJTIVmryOv7I/NYdrot1pdjFrthwjZgXGsGocONi/WQYJDB0yKFlPnQf9N78qtkGIoUXd6ZWSrKIIpSCcJUgjDtUceawYrL7XR7llZcNseyxfpyfHreOGHTmaz9I9NyX+9IMwidzt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4ahLoKd5VGlmqSgRJ4jOaQ7PZCPx99wgb0OVbj5bDGdH6LvTwTf3wfZ7YFs8+DwONrAv+Pb+9Dyy2hRaePMIeozI061u7iexVXiGHEORZhBFCYX8yAdNl1NYJxMY+6Ko34bD5YBTRXAzCP3rJBgdGAu2/gm2RP8HMdkQRNH39DQAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Coinbase Developer Docs - Coinbase Developer Documentation</h2><p>Explore our API &amp; SDK references, demos, and guides for building onchain apps.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"></div></a></div></div><p><strong>Server Wallets v2</strong>:</p><div data-type="embedly" src="https://docs.cdp.coinbase.com/server-wallets/v2/introduction/welcome" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;The v2 Server Wallet enables developers to programmatically create, manage, and use crypto accounts while CDP secures the private keys and handles complex infrastructure management. Developers can access the v2 Server Wallet through either the CDP SDK or CDP's REST endpoints.&quot;,&quot;title&quot;:&quot;Welcome to Server Wallet v2 - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com/server-wallets/v2/introduction/welcome&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFY0lEQVR4nGWUe0yTVxjGT4zu8sfi3BKMZsuI2dARNXOaKYsaI8MAGmVOFGc6cCrILBTFyU1EmCIXqVALBVrLpbYlla6jq4XSC7WWUimFFlqoLbXcPinFlhZsWS+zy/d9xZjsy5uT88/3e57zvO854E0w6A/8+yYYRDYBn8/3Jhj0+gJLbq99wfPy1dIEtGCaso+abRrDrFoP9Wmmng5OSJ6ZhYpxvtzIe2LgiPWPunUswQizc5jO09J4mhbuEFrNfw0CFD095/L6YboXLr972edweWbtS5OzTjPkGDXbtEarWg/1aqakKotYae5C0B2SsfZuXds7XCpHTeWoyWxVA1tVz+pvYKtAMBgUKEzg0+SqJlkTue5qTl41oXYSmrctuN/13o/Qe1QvhEozX27skIyxRXqWYARGI1wyQqxj9RPblARGXw09VLCAGXJEZ7Y+HbRohgYEQolYKodsrhmba3z6f3QkFo5k9FG3jtk5TONpmhA0yq2h9+FpvXdb5OVNsjKqrJQiLaVIQxEFkRXth8frh2yLFshhnLIPm0LJoHQ4cckoSzD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a9vmX3N5ln3/O8dpgeaU1WpXD0/DlUox3SMZYQh2Np0FHs6JZfrNBklMt+A0Zm5+uMWMzWqPOkyMxpLBExDtK31MIvs0F238HkVfAlsuwgMPlmbY6x6ftY5Z5DTL+b0/QhrxoDWwVgdFXRpUVEkXZVZ1ptzrO5D86ls04cLEJtQ8S8HAyKP2bHBgdgQObLoHw9P8AudwgmRE+lWAAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com/server-wallets/v2/introduction/welcome" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Welcome to Server Wallet v2 - Coinbase Developer Documentation</h2><p>The v2 Server Wallet enables developers to programmatically create, manage, and use crypto accounts while CDP secures the private keys and handles complex infrastructure management. Developers can access the v2 Server Wallet through either the CDP SDK or CDP's REST endpoints.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/887d812b5b945e292f15a41fd1da8f50ec3114039e5d3d34c95d1888d74f1c96.png"></div></a></div></div><p><strong>Data APIs (SQL + Balances)</strong>:</p><div data-type="embedly" src="https://docs.cdp.coinbase.com/data/introduction/welcome" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;Welcome to the onchain data documentation for developers! This is a suite of enterprise-grade developer tools that simplify reading and interacting with blockchain data. To learn more about our motivations and development history, please refer to our development blog series. Log into the Coinbase Developer Platform portal- directly or from Coinbase.com.&quot;,&quot;title&quot;:&quot;Welcome to Onchain Data - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com/data/introduction/welcome&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/40d45e2806fd0c86bf20f9c7a06675e0217db65083e4f205be2f2d1725357dd4.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFV0lEQVR4nGWUf1CSdxzHv7vV7bZ/qnXbbrW1Vs31Y7l+bdllW5NVsx/m2nVWG3NbN6vN5MhKXf44aTPNREXETBMJkQ7lSIYSPyUCJAgVBWUgiT+eMAgEDYwfwe55Huq67bnPPff89Xq/v+/v+/OASDQaCj+LRKPIRzgYDEai0UAwPOsLuKb9Dx/P2qBpy7hryOroN9l1Rqinf/xur016zypSjXQpzLw7Jo7E2CY0sASDTP4Ag6en8/pp3D50mm/1AhQ98cgbCMH0ADwh31zQ7fXbXbNjdo8Vcg9ZHXrzlM4IKfvHZdpRidp6G0F3SIfbhYabL3GbOLomjq6Bra1na6+yNPVsLYhGowKVBSxOr6DKqQ2Uszl5VaTaMcjpmPa97F2D0Lu1D0Rqa5fC3CEdZ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F8AkmHzr3pR7bvA3z+Y7kT7fuWr4mYc2WXYl7jr329scnzlUu/HAr5jA+ITnj1SWbwfyPFsUfBAviAXgDgJUg/ihYuB3Az7sALIu53kkAiUUgIR9syYNnLhjyPHk6FwzN+ANOr3/y8cyDKY/R5rz/j109BPGUZp7SzBIZqH/3Ufn62nYNoUF2gSI5Uy349RI39TwTk0lLwtPX/VT/TloNTP+SALYVgk25IP4cWHsGrMbDAm6vf2LKY7Y9Nlge6Z63k3fHxEa6T0V+OFVINfNrRLjyzgzCrbRc1gF8y86T1I3p9UsPk+DQUe8JBWBDDoyOw4EVv4Plp/4F/+0rY43lpDAAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/40d45e2806fd0c86bf20f9c7a06675e0217db65083e4f205be2f2d1725357dd4.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/40d45e2806fd0c86bf20f9c7a06675e0217db65083e4f205be2f2d1725357dd4.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com/data/introduction/welcome" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Welcome to Onchain Data - Coinbase Developer Documentation</h2><p>Welcome to the onchain data documentation for developers! This is a suite of enterprise-grade developer tools that simplify reading and interacting with blockchain data. To learn more about our motivations and development history, please refer to our development blog series. Log into the Coinbase Developer Platform portal- directly or from Coinbase.com.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/40d45e2806fd0c86bf20f9c7a06675e0217db65083e4f205be2f2d1725357dd4.png"></div></a></div></div><p><strong>Viem:</strong></p><div data-type="embedly" src="https://viem.sh" data="{&quot;provider_url&quot;:&quot;https://viem.sh&quot;,&quot;description&quot;:&quot;Build reliable Ethereum apps &amp; libraries with lightweight, composable, &amp; type-safe modules from viem.&quot;,&quot;title&quot;:&quot;Viem · TypeScript Interface for Ethereum&quot;,&quot;mean_alpha&quot;:87.2886904762,&quot;thumbnail_width&quot;:2400,&quot;url&quot;:&quot;https://viem.sh&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/a3f92356a83f2afb90140ed319ab06747fd925ef10e4dde4b76826a4c2791d9b.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Viem&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1260,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAABYlAAAWJQFJUiTwAAADRElEQVR4nK2U32sTSxTHgzdlw6ab2YyT2c2ma9OmyWyczbrbne42aV9E8N5oigoaioXah1htpRZT470g+AMFXxQfFF+rKKiI/4Io3GfvH+R9kOTIGNsIPgiHw0wycz453+/JJDQtuz8QwhjnKDUta4IQOvLML0Zizz6rE6hbKNiWNQGR1clvACCEDSNfKNi2PWma1jCD/LwJVdVGxgiAbU8Wi9OmaWGcs+3JQsGemioVi9OWNWEYeYTwyOqFgs0YK5crEJVyhTFWLE7tBWCcy+oEIew4vN1eTiZTY0k1mUwlk6kDB8YUJW0Y+X0+6WNKpnaY/bNx9MqFxdaJY2dO/3m50757c32xEY8lVYR0CcAI4UuXNo4f/6vTuXjnzr1Wa2lz88r29rWdnV63u3Pq1BlFSe93QlW1Q/ah2YD7Nadarbqc11w+G/ilUkmq1AcghBOJRK9349Onf5eXz3/58v+bN2+3t699+PDx5ctXr1+/3d3dTST+GGm1qmopBaUUpKq6qmqKklGUjKrqIySy7cn79x80myc/f/7v3bv3Z8+ee/78xcOHjx4/fvL06TPZgTRDbkfa8wNAVTXDyJtmXlHSA5MPWtbEzEyFEEqpSalpGPnBr0trWlZR0rCA0lmdEEJhAS6OBhBCo2g+iupBMOe6NSHmPC8YqOp5XsAYC8PI8wLPOyLEHGPVIBBCxMOlIeSw/AAYH89QanrekTiu+37IWDUMoziedxwuRByGkevWOHcH2ePcdRzuur7jcKhFqUkIhTU8AfKP9d0DQujKymq3e31tbW1zc6vb3Wm3l+v1hfX1jdXVC53O5U7nYq/3d7O5xBgTIm61lra2rjabJ1dWVm/duu04XJIAhnEO41x/fICMcc51fSFix+G+HwoRc+4xxkAiaKtcdjj3SqWZcrkCh4vFacaqpdKMaVqGkZeeAQZeswTsKTWrVTeO5xuNxUZjwXF4HPct4dyr1xdAMc69KJoXYi4IZsMw8v0AbDNNa3w8I3UHV+R09AESCxbJeUBIh2uQpXtSbhgQ+GRPQPU+AAwYZsgM54azbBymUwqN8cHB9pv68qu+RMN9DY8a3IRBhCz7g8cVrsAxGcNvM0JY1/FXCm7J55tntaIAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:2400,&quot;height&quot;:1260,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/a3f92356a83f2afb90140ed319ab06747fd925ef10e4dde4b76826a4c2791d9b.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/a3f92356a83f2afb90140ed319ab06747fd925ef10e4dde4b76826a4c2791d9b.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://viem.sh" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Viem · TypeScript Interface for Ethereum</h2><p>Build reliable Ethereum apps &amp; libraries with lightweight, composable, &amp; type-safe modules from viem.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://viem.sh</span></div><img src="https://storage.googleapis.com/papyrus_images/a3f92356a83f2afb90140ed319ab06747fd925ef10e4dde4b76826a4c2791d9b.png"></div></a></div></div><p><strong>HeimLabs</strong>:</p><div data-type="embedly" src="https://www.heimlabs.com" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Y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mMq4NhkXAcBtAD0ONDUjByZqFinjOjl0cfDx2PP/rCl6Upn00Tz4tOp3TeOD6KGyOXG6IVtLRe3No+5s2J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><a target="_blank" rel="noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy building! <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>web3</category>
            <category>sql</category>
            <category>api</category>
            <category>onchain</category>
            <category>dev</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/13a9e1c764ea5350d05b9dac28ef7d2bd3a5b8c96079dc2893c712d895e39802.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[A Developer's Deep Dive into Base Accounts - The Complete Guide]]></title>
            <link>https://paragraph.com/@heimlabs/a-developers-deep-dive-into-base-accounts-the-complete-guide</link>
            <guid>LugOFY5t0TOmRA1BZlus</guid>
            <pubDate>Fri, 26 Sep 2025 13:30:03 GMT</pubDate>
            <description><![CDATA[Seed phrases, gas pop-ups, “approve then transfer” — the classic wallet UX slows users (and your growth) to a crawl. Base Accounts fix this. Built on ERC-4337, they’re a programmable, multi-chain account layer that unlocks passkeys, social recovery, sponsored gas, batching, and more. In this hands-on guide, you’ll learn why Base Accounts matter and how to ship a production-grade app: passwordless auth, one-tap USDC payments, gasless calls, sub-accounts for zero-prompt interactions...]]></description>
            <content:encoded><![CDATA[<hr><p>Seed phrases, gas pop-ups, “approve then transfer” — the classic wallet UX slows users (and your growth) to a crawl. <strong>Base Accounts</strong> fix this. Built on ERC-4337, they’re a programmable, multi-chain account layer that unlocks passkeys, social recovery, sponsored gas, batching, and more.</p><p>In this hands-on guide, you’ll learn <strong>why</strong> Base Accounts matter and <strong>how</strong> to ship a production-grade app: passwordless auth, one-tap USDC payments, gasless calls, sub-accounts for zero-prompt interactions, and automated subscriptions with spend permissions.</p><h2 id="h-what-youll-build" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What You’ll&nbsp;Build</h2><ul><li><p> Scaffold a Next.js + wagmi app with <strong>“Sign in with Base.”</strong></p></li><li><p> Add <strong>Base Pay</strong> for one-tap USDC checkout (testnet friendly).</p></li><li><p> Use <strong>Paymasters</strong> to sponsor gas (true gasless UX).</p></li><li><p> Create <strong>Sub-Accounts</strong> for zero-prompt actions.</p></li><li><p> Automate billing with <strong>Spend Permissions</strong> (revocable allowances).</p></li></ul><p>(Watch the Full Video here)</p><div data-type="youtube" videoid="LFWf8yGGpR4">
      <div class="youtube-player" data-id="LFWf8yGGpR4" style="background-image: url('https://i.ytimg.com/vi/LFWf8yGGpR4/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=LFWf8yGGpR4">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><hr><h2 id="h-why-base-accounts-vs-eoas" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Why Base Accounts (vs.&nbsp;EOAs)</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8b5217394f874750498520856d221732b88774bfaf1b75872dcf3fa2182e5f59.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAXCAIAAADlZ9q2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAHgUlEQVR4nLWV+1/S9x7H+xva9jhnBsgdsVCR21e5qODUQkBBUEsUuaSUuqwc2UnxBpoXtCBT0bC8YCig6ShaOtfwskynaUePmfU4W67OttOaW2er7fE5D6JzOj3O+fV8/oHn43V7f3Yc2zdbkHA7jzd9kOvLYnpTyEMyxkgmc0Qa5ZQynYmkTg7OzCacicY0QKhaCryCiqwgw8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SJ3xpHZe+Hlu2DkWsYkV2ggRDBDBQMNVkBA6Mf+CVHSBACsgoorwwVosQoNHav1fppzlyGWPZzO9WUxPBnQljeaUUC+nUu3J5G5+hC0pzMrb08rbY2ETGpn4+iiCESL4PzIKppyKLw9HnyAhS0IRR4iIImxQHjpIjUVo0HAlEpYTDJPvCsr8w/upO/7f75+rvq0nvhl+vAAAAABJRU5ErkJggg==" nextheight="565" nextwidth="800" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Powered by <strong>Account Abstraction (ERC-4337)</strong>, Base Accounts bring modern app UX to onchain.</p><hr><h2 id="h-system-architecture" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">System Architecture</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/94f1d0ffedcd16456ff284b87d5ea084e0418087aaf0d868656406dcfa871914.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAWCAIAAAAuOwkTAAAACXBIWXMAAAsTAAALEwEAmpwYAAADkElEQVR4nK1VQWjcRhSdMqDDgBgG1BmGqTqIlacDAtE5qCndw1IFe2EPwrugg8Gi0Sm22V20jWn2aJZgSnprKDmXUHIqOTW3BhooIb430JYYSjBLWJqjTcmloCmbjbdNYqfvIDSS5j/9//5/AwAAruv2er28Rq/XI4RACPM8H4/Hw6oajUaMMSHEZ5cujUaj7e3tLMtc111ZWdmtsTeZJEkCADDG7E0mu7u74/G4LEvXdYEFxvjy1ta1/f0vr1+/vLX1LqUQwmFVPZ3NptPpd7dvc86VUj/cvfvw4ODx4eE3N2+6rvuhMT8/eHBycvLw4GB1bQ0AkKbpT/fvH02nvzx6dG1/nxDyDwGEUAihlNJaSymjKFJKBUEgpTTGCCEQQhhjKaWu4fs+hJAQYj/gnFNKAQCe53HOkyQRQnDOHccBi/A8LwiC94TY6fcHg0EURVLKMGwsfkMp9TxvvnQcR0r5UhQApJQQQrAMxpgxxvO8VquVpmkQBJTSIAhsinYPY+z8BDZcHMdFjWazyRizBK/IwPf9U3FsAf+FwPO8MGwwxmQNznkYNsKwYW+UUrTGWxEwxhafOI4TRVGz2dzY2Mjz/OManucRQiwZQmiZ4D9LtEywvF/UzdZutzdqKKXsBCxGPFsGQgh7b/csl0gpRQixQ9rpdCilxpjTDfomBBanCCCEYdjAGNvGy7JMCBFF0VsRUEpJDYyx4zjGGEqpHVJjjG2885TIgjEWx3Ge52VZDgYDY8xcg3nQc2pgwRjjnEMIHceBEGKMoyjSWpdl2ev1yrKM4zhJkv9TA7UgclmWSqmzaeC/3KZWAJsKxthaNCGEc+7XsIb2mhLNX88zgHVN7BBprTHGWZZprQkhp9zwbBoghLTWAIB2u53nOUJICLH4Ewgha3Z2aa/vv8LsfN83xnQ6nU/TdPXiRcZYFEUAgHlTCiGsBjbEm7ophJAxprVO0zSO4yAIOOfGGGt2jDGEkOu6tr5SSkqp4ziEEOscjLHFA0drbZvthdSEkM+vXPmqxmAwYIy9A8DeZHJ8fDybzX68d8/3/Q+0/v7OnceHh388efL1jRsY4yRJfv39t7+ePz+aTte7XQBAlmVH0+mfz549nc2+vXXrxZGJELKzvrq21mq1MMYQwo8uXNjp94dVtd7t2j4ZVtVmUQyrqigKW5zNovji6tXNolBKAQDCsLHe7e70+0VRfNJs2kP/b1/c+IK3o5b5AAAAAElFTkSuQmCC" nextheight="544" nextwidth="800" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Components at a glance</strong></p><ul><li><p><strong>Base Account SDK &amp; UI</strong>: Auth, checkout, sub-accounts, permissions.</p></li><li><p><strong>wagmi</strong>: Chain config + connectors.</p></li><li><p><strong>Paymaster</strong>: Sponsors user gas.</p></li><li><p><strong>Sub-Accounts</strong>: App-scoped, embedded wallets for zero-prompt actions.</p></li><li><p><strong>Spend Permissions</strong>: Off-chain signed allowances you can execute on a schedule.</p></li></ul><hr><h2 id="h-part-1-project-scaffolding-and-setup" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Part 1 — Project Scaffolding &amp;&nbsp;Setup</h2><h3 id="h-1-create-the-app" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1. Create the&nbsp;app</h3><pre data-type="codeBlock" text="# Next.js + wagmi
npm create wagmi@latest base-accounts-demo
cd base-accounts-demo"><code># Next.js <span class="hljs-operator">+</span> wagmi
npm create wagmi@latest base<span class="hljs-operator">-</span>accounts<span class="hljs-operator">-</span>demo
cd base<span class="hljs-operator">-</span>accounts<span class="hljs-operator">-</span>demo</code></pre><h3 id="h-2-install-base-accounts-sdk-and-ui" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2. Install Base Accounts SDK &amp;&nbsp;UI</h3><pre data-type="codeBlock" text="npm install @base-org/account @base-org/account-ui"><code>npm install @base<span class="hljs-operator">-</span>org<span class="hljs-operator">/</span>account @base<span class="hljs-operator">-</span>org<span class="hljs-operator">/</span>account<span class="hljs-operator">-</span>ui</code></pre><h3 id="h-3-configure-wagmi-with-base-base-sepolia" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3. Configure wagmi with Base + Base&nbsp;Sepolia</h3><pre data-type="codeBlock" text="import { http, createConfig } from 'wagmi';
import { baseSepolia } from 'wagmi/chains';
import { baseAccount } from '@wagmi/connectors';

export const config = createConfig({
  chains: [baseSepolia],
  connectors: [
    baseAccount({
      appName: 'Base Accounts Demo',
      appLogoUrl: 'https://base.org/logo.png',
    }),
  ],
  transports: {
    [baseSepolia.id]: http(),
  },
  // Enable server-side rendering
  ssr: true,
});

export function getConfig() {
  return config
}"><code><span class="hljs-keyword">import</span> { http, createConfig } <span class="hljs-keyword">from</span> <span class="hljs-string">'wagmi'</span>;
<span class="hljs-keyword">import</span> { baseSepolia } <span class="hljs-keyword">from</span> <span class="hljs-string">'wagmi/chains'</span>;
<span class="hljs-keyword">import</span> { baseAccount } <span class="hljs-keyword">from</span> <span class="hljs-string">'@wagmi/connectors'</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> config = <span class="hljs-title function_">createConfig</span>({
  <span class="hljs-attr">chains</span>: [baseSepolia],
  <span class="hljs-attr">connectors</span>: [
    <span class="hljs-title function_">baseAccount</span>({
      <span class="hljs-attr">appName</span>: <span class="hljs-string">'Base Accounts Demo'</span>,
      <span class="hljs-attr">appLogoUrl</span>: <span class="hljs-string">'https://base.org/logo.png'</span>,
    }),
  ],
  <span class="hljs-attr">transports</span>: {
    [baseSepolia.<span class="hljs-property">id</span>]: <span class="hljs-title function_">http</span>(),
  },
  <span class="hljs-comment">// Enable server-side rendering</span>
  <span class="hljs-attr">ssr</span>: <span class="hljs-literal">true</span>,
});

<span class="hljs-keyword">export</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">getConfig</span>(<span class="hljs-params"></span>) {
  <span class="hljs-keyword">return</span> config
}</code></pre><p>This enables <strong>“Sign in with Base”</strong> as a first-class connector.</p><hr><h2 id="h-part-2-passwordless-auth-siwe" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Part 2 — Passwordless Auth&nbsp;(SIWE)</h2><p>Use EIP-4361 (<strong>SIWE</strong>) with a server-side nonce + signature verification. <em>Never</em> verify on the client.</p><h3 id="h-1-ui-a-consistent-trusted-sign-in-client-fetch-nonce-request-signat" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1. UI: a consistent, trusted sign-in + Client: fetch nonce → request&nbsp;signat</h3><pre data-type="codeBlock" text="import React from 'react'
import { createBaseAccountSDK } from '@base-org/account'

type LoginFormProps = {
  onSignIn?: (address: string) =&gt; void;
  isSigningIn?: boolean;
};

export function LoginForm({ onSignIn, isSigningIn }: LoginFormProps) {
  const handleSignIn = async () =&gt; {
    try {
      const provider = createBaseAccountSDK({ appName: 'Base Accounts Demo' }).getProvider()
      const nonce = window.crypto.randomUUID().replace(/-/g, '')
      const response = await provider.request({
        method: 'wallet_connect',
        params: [
          {
            version: '1',
            capabilities: {
              signInWithEthereum: {
                // chainid must be a hex string
                chainId: &quot;0x&quot; + (8453).toString(16),
                nonce,
              },
            },
          },
        ],
      }) as { accounts: { address: string; capabilities?: { signInWithEthereum?: { message: string; signature: `0x${string}` } } }[] }

      // Extract SIWE message &amp; signature and verify on server
      const account = response.accounts[0]
      const { address } = account
      const siwe = account.capabilities?.signInWithEthereum as { message: string; signature: `0x${string}` }
      const message = siwe?.message
      const signature = siwe?.signature

      const verifyRes = await fetch('/api/auth/verify', {
        method: 'POST',
        headers: { 'content-type': 'application/json' },
        body: JSON.stringify({ address, message, signature }),
      })
      if (!verifyRes.ok) {
        const err = await verifyRes.json().catch(() =&gt; ({}))
        throw new Error(err?.error || 'Verification failed')
      }

      onSignIn?.(address)
    } catch (err) {
      console.error('Sign in failed:', err)
    }
  }

  return (
    &lt;button type=&quot;button&quot; onClick={handleSignIn} disabled={!!isSigningIn} style={{
      display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8, padding: '12px 16px',
      backgroundColor: '#ffffff', border: '1px solid #e5e7eb', borderRadius: 8, cursor: isSigningIn ? 'not-allowed' : 'pointer',
      minWidth: 180, height: 44
    }}&gt;
      &lt;div style={{ width: 16, height: 16, backgroundColor: '#0052FF', borderRadius: 2 }} /&gt;
      &lt;span&gt;{isSigningIn ? 'Signing in...' : 'Sign in with Base'}&lt;/span&gt;
    &lt;/button&gt;
  )
}"><code><span class="hljs-keyword">import</span> <span class="hljs-title">React</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'react'</span>
<span class="hljs-title"><span class="hljs-keyword">import</span></span> { <span class="hljs-title">createBaseAccountSDK</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'@base-org/account'</span>

<span class="hljs-title"><span class="hljs-keyword">type</span></span> <span class="hljs-title">LoginFormProps</span> <span class="hljs-operator">=</span> {
  <span class="hljs-title">onSignIn</span>?: (<span class="hljs-title"><span class="hljs-keyword">address</span></span>: <span class="hljs-title"><span class="hljs-keyword">string</span></span>) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> <span class="hljs-title">void</span>;
  isSigningIn?: boolean;
};

export <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">LoginForm</span>(<span class="hljs-params">{ onSignIn, isSigningIn }: LoginFormProps</span>) </span>{
  const handleSignIn <span class="hljs-operator">=</span> async () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
    <span class="hljs-keyword">try</span> {
      const provider <span class="hljs-operator">=</span> createBaseAccountSDK({ appName: <span class="hljs-string">'Base Accounts Demo'</span> }).getProvider()
      const nonce <span class="hljs-operator">=</span> window.crypto.randomUUID().replace(<span class="hljs-operator">/</span><span class="hljs-operator">-</span><span class="hljs-operator">/</span>g, <span class="hljs-string">''</span>)
      const response <span class="hljs-operator">=</span> await provider.request({
        method: <span class="hljs-string">'wallet_connect'</span>,
        params: [
          {
            version: <span class="hljs-string">'1'</span>,
            capabilities: {
              signInWithEthereum: {
                <span class="hljs-comment">// chainid must be a hex string</span>
                chainId: <span class="hljs-string">"0x"</span> <span class="hljs-operator">+</span> (<span class="hljs-number">8453</span>).toString(<span class="hljs-number">16</span>),
                nonce,
              },
            },
          },
        ],
      }) <span class="hljs-keyword">as</span> { accounts: { <span class="hljs-keyword">address</span>: <span class="hljs-keyword">string</span>; capabilities?: { signInWithEthereum?: { message: <span class="hljs-keyword">string</span>; signature: `0x${<span class="hljs-keyword">string</span>}` } } }[] }

      <span class="hljs-comment">// Extract SIWE message &amp; signature and verify on server</span>
      const account <span class="hljs-operator">=</span> response.accounts[<span class="hljs-number">0</span>]
      const { <span class="hljs-keyword">address</span> } <span class="hljs-operator">=</span> account
      const siwe <span class="hljs-operator">=</span> account.capabilities?.signInWithEthereum <span class="hljs-keyword">as</span> { message: <span class="hljs-keyword">string</span>; signature: `0x${<span class="hljs-keyword">string</span>}` }
      const message <span class="hljs-operator">=</span> siwe?.message
      const signature <span class="hljs-operator">=</span> siwe?.signature

      const verifyRes <span class="hljs-operator">=</span> await fetch(<span class="hljs-string">'/api/auth/verify'</span>, {
        method: <span class="hljs-string">'POST'</span>,
        headers: { <span class="hljs-string">'content-type'</span>: <span class="hljs-string">'application/json'</span> },
        body: JSON.stringify({ <span class="hljs-keyword">address</span>, message, signature }),
      })
      <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>verifyRes.ok) {
        const err <span class="hljs-operator">=</span> await verifyRes.json().catch(() <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> ({}))
        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(err?.error <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">'Verification failed'</span>)
      }

      onSignIn?.(<span class="hljs-keyword">address</span>)
    } <span class="hljs-keyword">catch</span> (err) {
      console.error(<span class="hljs-string">'Sign in failed:'</span>, err)
    }
  }

  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&lt;</span>button <span class="hljs-keyword">type</span><span class="hljs-operator">=</span><span class="hljs-string">"button"</span> onClick<span class="hljs-operator">=</span>{handleSignIn} disabled<span class="hljs-operator">=</span>{<span class="hljs-operator">!</span><span class="hljs-operator">!</span>isSigningIn} style<span class="hljs-operator">=</span>{{
      display: <span class="hljs-string">'flex'</span>, alignItems: <span class="hljs-string">'center'</span>, justifyContent: <span class="hljs-string">'center'</span>, gap: <span class="hljs-number">8</span>, padding: <span class="hljs-string">'12px 16px'</span>,
      backgroundColor: <span class="hljs-string">'#ffffff'</span>, border: <span class="hljs-string">'1px solid #e5e7eb'</span>, borderRadius: <span class="hljs-number">8</span>, cursor: isSigningIn ? <span class="hljs-string">'not-allowed'</span> : <span class="hljs-string">'pointer'</span>,
      minWidth: <span class="hljs-number">180</span>, height: <span class="hljs-number">44</span>
    }}<span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span>div style<span class="hljs-operator">=</span>{{ width: <span class="hljs-number">16</span>, height: <span class="hljs-number">16</span>, backgroundColor: <span class="hljs-string">'#0052FF'</span>, borderRadius: <span class="hljs-number">2</span> }} <span class="hljs-operator">/</span><span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span>span<span class="hljs-operator">&gt;</span>{isSigningIn ? <span class="hljs-string">'Signing in...'</span> : <span class="hljs-string">'Sign in with Base'</span>}<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>span<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>button<span class="hljs-operator">&gt;</span>
  )
}</code></pre><h3 id="h-2-backend-verify-and-create-a-session" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2. Backend: verify and create a&nbsp;session</h3><pre data-type="codeBlock" text="import { NextRequest, NextResponse } from 'next/server'

// Demo behavior:
// - This route mirrors the agent project: accepts an address and issues a simple session cookie.
// - It intentionally does NOT verify a signed message (no viem.verifyMessage) to keep the demo minimal.
//   To enforce SIWE-style verification in production:
//     1) Request { address, message, signature } from the client.
//     2) Extract &amp; validate a one-time nonce persisted in a shared store (e.g. Redis/DB).
//     3) Verify with viem's public client verifyMessage before issuing a session.
const nonces = new Set&lt;string&gt;()

export async function POST(request: NextRequest) {
  try {
    const { address } = await request.json()

    if (!address) {
      return NextResponse.json({ error: 'Missing address' }, { status: 400 })
    }

    // Create session token (simplified - in production use proper JWT with SESSION_SECRET)
    // For demo purposes, using simple encoding - in production, use proper JWT:
    // const jwt = require('jsonwebtoken')
    // const sessionToken = jwt.sign({ address, timestamp: Date.now() }, process.env.SESSION_SECRET)
    const sessionToken = Buffer.from(`${address}:${Date.now()}`).toString('base64')
    const response = NextResponse.json({ ok: true, address, sessionToken })
    response.cookies.set('session', sessionToken, {
      httpOnly: true,
      secure: false,
      sameSite: 'strict',
      maxAge: 60 * 60 * 24 * 7,
    })
    return response
  } catch (error) {
    console.error('Auth verification error:', error)
    return NextResponse.json({ error: 'Internal server error' }, { status: 500 })
  }
}

export async function GET() {
  const array = new Uint8Array(16)
  crypto.getRandomValues(array)
  const nonce = Array.from(array, (byte) =&gt; byte.toString(16).padStart(2, '0')).join('')
  nonces.add(nonce)
  return NextResponse.json({ nonce })
}"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">NextRequest</span>, <span class="hljs-title">NextResponse</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'next/server'</span>

<span class="hljs-comment">// Demo behavior:</span>
<span class="hljs-comment">// - This route mirrors the agent project: accepts an address and issues a simple session cookie.</span>
<span class="hljs-comment">// - It intentionally does NOT verify a signed message (no viem.verifyMessage) to keep the demo minimal.</span>
<span class="hljs-comment">//   To enforce SIWE-style verification in production:</span>
<span class="hljs-comment">//     1) Request { address, message, signature } from the client.</span>
<span class="hljs-comment">//     2) Extract &amp; validate a one-time nonce persisted in a shared store (e.g. Redis/DB).</span>
<span class="hljs-comment">//     3) Verify with viem's public client verifyMessage before issuing a session.</span>
<span class="hljs-title">const</span> <span class="hljs-title">nonces</span> <span class="hljs-operator">=</span> <span class="hljs-title"><span class="hljs-keyword">new</span></span> <span class="hljs-title">Set</span><span class="hljs-operator">&lt;</span><span class="hljs-title"><span class="hljs-keyword">string</span></span><span class="hljs-operator">&gt;</span>()

<span class="hljs-title">export</span> <span class="hljs-title">async</span> <span class="hljs-title"><span class="hljs-keyword">function</span></span> <span class="hljs-title">POST</span>(<span class="hljs-title">request</span>: <span class="hljs-title">NextRequest</span>) {
  <span class="hljs-title"><span class="hljs-keyword">try</span></span> {
    <span class="hljs-title">const</span> { <span class="hljs-title"><span class="hljs-keyword">address</span></span> } <span class="hljs-operator">=</span> <span class="hljs-title">await</span> <span class="hljs-title">request</span>.<span class="hljs-title">json</span>()

    <span class="hljs-title"><span class="hljs-keyword">if</span></span> (<span class="hljs-operator">!</span><span class="hljs-title"><span class="hljs-keyword">address</span></span>) {
      <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title"><span class="hljs-keyword">error</span></span>: <span class="hljs-string">'Missing address'</span> }, { <span class="hljs-title">status</span>: 400 })
    }

    <span class="hljs-comment">// Create session token (simplified - in production use proper JWT with SESSION_SECRET)</span>
    <span class="hljs-comment">// For demo purposes, using simple encoding - in production, use proper JWT:</span>
    <span class="hljs-comment">// const jwt = require('jsonwebtoken')</span>
    <span class="hljs-comment">// const sessionToken = jwt.sign({ address, timestamp: Date.now() }, process.env.SESSION_SECRET)</span>
    <span class="hljs-title">const</span> <span class="hljs-title">sessionToken</span> <span class="hljs-operator">=</span> <span class="hljs-title">Buffer</span>.<span class="hljs-title"><span class="hljs-keyword">from</span></span>(`<span class="hljs-title">$</span>{<span class="hljs-title"><span class="hljs-keyword">address</span></span>}:<span class="hljs-title">$</span>{<span class="hljs-title">Date</span>.<span class="hljs-title"><span class="hljs-built_in">now</span></span>()}`).<span class="hljs-title">toString</span>(<span class="hljs-string">'base64'</span>)
    <span class="hljs-title">const</span> <span class="hljs-title">response</span> <span class="hljs-operator">=</span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title">ok</span>: <span class="hljs-title"><span class="hljs-literal">true</span></span>, <span class="hljs-title"><span class="hljs-keyword">address</span></span>, <span class="hljs-title">sessionToken</span> })
    <span class="hljs-title">response</span>.<span class="hljs-title">cookies</span>.<span class="hljs-title">set</span>(<span class="hljs-string">'session'</span>, <span class="hljs-title">sessionToken</span>, {
      <span class="hljs-title">httpOnly</span>: <span class="hljs-title"><span class="hljs-literal">true</span></span>,
      <span class="hljs-title">secure</span>: <span class="hljs-title"><span class="hljs-literal">false</span></span>,
      <span class="hljs-title">sameSite</span>: <span class="hljs-string">'strict'</span>,
      <span class="hljs-title">maxAge</span>: 60 <span class="hljs-operator">*</span> 60 <span class="hljs-operator">*</span> 24 <span class="hljs-operator">*</span> 7,
    })
    <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">response</span>
  } <span class="hljs-title"><span class="hljs-keyword">catch</span></span> (<span class="hljs-title"><span class="hljs-keyword">error</span></span>) {
    <span class="hljs-title">console</span>.<span class="hljs-title"><span class="hljs-keyword">error</span></span>(<span class="hljs-string">'Auth verification error:'</span>, <span class="hljs-title"><span class="hljs-keyword">error</span></span>)
    <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title"><span class="hljs-keyword">error</span></span>: <span class="hljs-string">'Internal server error'</span> }, { <span class="hljs-title">status</span>: 500 })
  }
}

<span class="hljs-title">export</span> <span class="hljs-title">async</span> <span class="hljs-title"><span class="hljs-keyword">function</span></span> <span class="hljs-title">GET</span>() {
  <span class="hljs-title">const</span> <span class="hljs-title">array</span> <span class="hljs-operator">=</span> <span class="hljs-title"><span class="hljs-keyword">new</span></span> <span class="hljs-title">Uint8Array</span>(16)
  <span class="hljs-title">crypto</span>.<span class="hljs-title">getRandomValues</span>(<span class="hljs-title">array</span>)
  <span class="hljs-title">const</span> <span class="hljs-title">nonce</span> <span class="hljs-operator">=</span> <span class="hljs-title">Array</span>.<span class="hljs-title"><span class="hljs-keyword">from</span></span>(<span class="hljs-title">array</span>, (<span class="hljs-title"><span class="hljs-keyword">byte</span></span>) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> <span class="hljs-title"><span class="hljs-keyword">byte</span></span>.<span class="hljs-title">toString</span>(16).<span class="hljs-title">padStart</span>(2, <span class="hljs-string">'0'</span>)).<span class="hljs-title">join</span>(<span class="hljs-string">''</span>)
  <span class="hljs-title">nonces</span>.<span class="hljs-title">add</span>(<span class="hljs-title">nonce</span>)
  <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title">nonce</span> })
}</code></pre><blockquote><p><strong><em>Tip:</em></strong><em> Persist nonces + sessions in Redis/DB in production.</em></p></blockquote><hr><h2 id="h-part-3-one-tap-payments-with-base-pay" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Part 3 — One-Tap Payments with Base&nbsp;Pay</h2><h3 id="h-1-drop-in-checkout-ui" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1. Drop-in checkout&nbsp;UI</h3><pre data-type="codeBlock" text="// components/CheckoutForm.tsx
import { BasePayButton } from '@base-org/account-ui/react';

export function CheckoutForm({ onPay, isPaying }) {
  return (
    &lt;div&gt;
      &lt;h3&gt;Awesome Product - $1.00&lt;/h3&gt;
      &lt;BasePayButton onClick={onPay} disabled={isPaying} /&gt;
    &lt;/div&gt;
  );
}"><code><span class="hljs-comment">// components/CheckoutForm.tsx</span>
<span class="hljs-keyword">import</span> { <span class="hljs-title">BasePayButton</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'@base-org/account-ui/react'</span>;

export <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">CheckoutForm</span>(<span class="hljs-params">{ onPay, isPaying }</span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&lt;</span>div<span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span>h3<span class="hljs-operator">&gt;</span>Awesome Product <span class="hljs-operator">-</span> $1<span class="hljs-number">.00</span><span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h3<span class="hljs-operator">&gt;</span>
      <span class="hljs-operator">&lt;</span>BasePayButton onClick<span class="hljs-operator">=</span>{onPay} disabled<span class="hljs-operator">=</span>{isPaying} <span class="hljs-operator">/</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
  );
}</code></pre><h3 id="h-2-initiate-payment-and-poll" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2. Initiate payment and&nbsp;poll</h3><pre data-type="codeBlock" text="// pages/checkout.tsx (excerpt)
import { pay, getPaymentStatus } from '@base-org/account';
import { useState } from 'react';

function CheckoutPage() {
  const [status, setStatus] = useState&lt;'idle'|'pending'|'completed'|'failed'&gt;('idle');
  const handlePayment = async () =&gt; {
    setStatus('pending');
    try {
      const { id } = await pay({ amount: '1.00', to: '0xRecipientAddress', testnet: true });
      const poll = async () =&gt; {
        const { status: s, userTxHash } = await getPaymentStatus({ id, testnet: true });
        if (s === 'completed') { setStatus('completed'); console.log('Tx:', userTxHash); }
        else if (s === 'failed') { setStatus('failed'); }
        else setTimeout(poll, 1000);
      };
      poll();
    } catch {
      setStatus('failed');
    }
  };
}"><code><span class="hljs-comment">// pages/checkout.tsx (excerpt)</span>
<span class="hljs-keyword">import</span> { <span class="hljs-title">pay</span>, <span class="hljs-title">getPaymentStatus</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'@base-org/account'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">useState</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'react'</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">CheckoutPage</span>(<span class="hljs-params"></span>) </span>{
  const [status, setStatus] <span class="hljs-operator">=</span> useState<span class="hljs-operator">&lt;</span><span class="hljs-string">'idle'</span><span class="hljs-operator">|</span><span class="hljs-string">'pending'</span><span class="hljs-operator">|</span><span class="hljs-string">'completed'</span><span class="hljs-operator">|</span><span class="hljs-string">'failed'</span><span class="hljs-operator">&gt;</span>(<span class="hljs-string">'idle'</span>);
  const handlePayment <span class="hljs-operator">=</span> async () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
    setStatus(<span class="hljs-string">'pending'</span>);
    <span class="hljs-keyword">try</span> {
      const { id } <span class="hljs-operator">=</span> await pay({ amount: <span class="hljs-string">'1.00'</span>, to: <span class="hljs-string">'0xRecipientAddress'</span>, testnet: <span class="hljs-literal">true</span> });
      const poll <span class="hljs-operator">=</span> async () <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> {
        const { status: s, userTxHash } <span class="hljs-operator">=</span> await getPaymentStatus({ id, testnet: <span class="hljs-literal">true</span> });
        <span class="hljs-keyword">if</span> (s <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">'completed'</span>) { setStatus(<span class="hljs-string">'completed'</span>); console.log(<span class="hljs-string">'Tx:'</span>, userTxHash); }
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (s <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-string">'failed'</span>) { setStatus(<span class="hljs-string">'failed'</span>); }
        <span class="hljs-keyword">else</span> setTimeout(poll, <span class="hljs-number">1000</span>);
      };
      poll();
    } <span class="hljs-keyword">catch</span> {
      setStatus(<span class="hljs-string">'failed'</span>);
    }
  };
}</code></pre><hr><h2 id="h-part-4-the-magic-gasless-zero-prompt-auto-billing" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Part 4 — The Magic: Gasless + Zero-Prompt + Auto-Billing</h2><h3 id="h-a-true-gasless-ux-with-paymasters" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">A) True Gasless UX with Paymasters</h3><p>Proxy your Paymaster URL through your backend.</p><pre data-type="codeBlock" text="import { ensureBaseProviderConnected, getBaseAccountProvider } from '@/lib/base-account-sdk'
import { toHex } from 'viem'

/**
 * Gas Sponsorship (Paymaster) functionality for Base Account
 * Complete implementation of sponsored transactions
 */

export interface PaymasterConfig {
  url: string
  type: 'eth'
  sponsorshipRules?: {
    maxGasLimit?: number
    allowedMethods?: string[]
    dailyLimit?: number
  }
}

// In production, use your own paymaster proxy endpoints for security and control
export const PAYMASTER_CONFIGS = {
  default: {
    // Proxy or CDP Paymaster URL: set via env for security
    url:
      process.env.NEXT_PUBLIC_PAYMASTER_PROXY_SERVER_URL ||
      'https://api.developer.coinbase.com/rpc/v1/base-sepolia/demo',
    type: 'eth' as const,
    sponsorshipRules: {
      maxGasLimit: 1000000,
      dailyLimit: 10
    }
  }
}

/**
 * Send sponsored transaction
 * In production: implement your own paymaster proxy for security and control
 */

/**
 * Send sponsored calls with custom configuration
 */
// Send a transaction sponsored by a Paymaster using wallet_sendCalls.
// - userAddress: user's smart account address
// - calls: array of low-level calls to execute
// - chainId: Base Sepolia (84532) in this tutorial
export async function sendSponsoredCalls(
  userAddress: `0x${string}`,
  chainId: number,
  calls: Array&lt;{ 
    to: `0x${string}`
    value?: string
    data?: `0x${string}` 
  }&gt;,
  config: PaymasterConfig = PAYMASTER_CONFIGS.default
): Promise&lt;string | null&gt; {
  const provider = getBaseAccountProvider()
  await ensureBaseProviderConnected()

  try {
    const normalizedCalls = calls.map((c) =&gt; ({
      to: c.to,
      data: (c.data || '0x') as `0x${string}`,
      value: toHex(c.value ? BigInt(c.value) : 0n),
    }))

    const txHash = await provider.request({
      method: 'wallet_sendCalls',
      params: [{
        from: userAddress,
        chainId: toHex(84532),
        version: '1',
        calls: normalizedCalls,
        capabilities: { 
          paymasterService: { 
            url: process.env.NEXT_PUBLIC_PAYMASTER_PROXY_SERVER_URL || 'https://api.developer.coinbase.com/rpc/v1/base-sepolia/demo',
            ...(config.sponsorshipRules &amp;&amp; { data: config.sponsorshipRules })
          } 
        },
      }],
    }) as string

    console.log('Sponsored calls sent:', txHash)
    return txHash
  } catch (error) {
    console.error('Sponsored calls failed:', error)
    return null
  }
}"><code><span class="hljs-keyword">import</span> { ensureBaseProviderConnected, getBaseAccountProvider } <span class="hljs-keyword">from</span> <span class="hljs-string">'@/lib/base-account-sdk'</span>
<span class="hljs-keyword">import</span> { toHex } <span class="hljs-keyword">from</span> <span class="hljs-string">'viem'</span>

<span class="hljs-comment">/**
 * Gas Sponsorship (Paymaster) functionality for Base Account
 * Complete implementation of sponsored transactions
 */</span>

<span class="hljs-keyword">export</span> <span class="hljs-keyword">interface</span> <span class="hljs-title class_">PaymasterConfig</span> {
  <span class="hljs-attr">url</span>: <span class="hljs-built_in">string</span>
  <span class="hljs-attr">type</span>: <span class="hljs-string">'eth'</span>
  sponsorshipRules?: {
    maxGasLimit?: <span class="hljs-built_in">number</span>
    allowedMethods?: <span class="hljs-built_in">string</span>[]
    dailyLimit?: <span class="hljs-built_in">number</span>
  }
}

<span class="hljs-comment">// In production, use your own paymaster proxy endpoints for security and control</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> <span class="hljs-variable constant_">PAYMASTER_CONFIGS</span> = {
  <span class="hljs-attr">default</span>: {
    <span class="hljs-comment">// Proxy or CDP Paymaster URL: set via env for security</span>
    <span class="hljs-attr">url</span>:
      process.<span class="hljs-property">env</span>.<span class="hljs-property">NEXT_PUBLIC_PAYMASTER_PROXY_SERVER_URL</span> ||
      <span class="hljs-string">'https://api.developer.coinbase.com/rpc/v1/base-sepolia/demo'</span>,
    <span class="hljs-attr">type</span>: <span class="hljs-string">'eth'</span> <span class="hljs-keyword">as</span> <span class="hljs-keyword">const</span>,
    <span class="hljs-attr">sponsorshipRules</span>: {
      <span class="hljs-attr">maxGasLimit</span>: <span class="hljs-number">1000000</span>,
      <span class="hljs-attr">dailyLimit</span>: <span class="hljs-number">10</span>
    }
  }
}

<span class="hljs-comment">/**
 * Send sponsored transaction
 * In production: implement your own paymaster proxy for security and control
 */</span>

<span class="hljs-comment">/**
 * Send sponsored calls with custom configuration
 */</span>
<span class="hljs-comment">// Send a transaction sponsored by a Paymaster using wallet_sendCalls.</span>
<span class="hljs-comment">// - userAddress: user's smart account address</span>
<span class="hljs-comment">// - calls: array of low-level calls to execute</span>
<span class="hljs-comment">// - chainId: Base Sepolia (84532) in this tutorial</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">sendSponsoredCalls</span>(<span class="hljs-params">
  userAddress: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  chainId: <span class="hljs-built_in">number</span>,
  calls: <span class="hljs-built_in">Array</span>&lt;{ 
    to: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
    value?: <span class="hljs-built_in">string</span>
    data?: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span> 
  }&gt;,
  config: PaymasterConfig = PAYMASTER_CONFIGS.<span class="hljs-keyword">default</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">string</span> | <span class="hljs-literal">null</span>&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">await</span> <span class="hljs-title function_">ensureBaseProviderConnected</span>()

  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> normalizedCalls = calls.<span class="hljs-title function_">map</span>(<span class="hljs-function">(<span class="hljs-params">c</span>) =&gt;</span> ({
      <span class="hljs-attr">to</span>: c.<span class="hljs-property">to</span>,
      <span class="hljs-attr">data</span>: (c.<span class="hljs-property">data</span> || <span class="hljs-string">'0x'</span>) <span class="hljs-keyword">as</span> <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
      <span class="hljs-attr">value</span>: <span class="hljs-title function_">toHex</span>(c.<span class="hljs-property">value</span> ? <span class="hljs-title class_">BigInt</span>(c.<span class="hljs-property">value</span>) : <span class="hljs-number">0n</span>),
    }))

    <span class="hljs-keyword">const</span> txHash = <span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
      <span class="hljs-attr">method</span>: <span class="hljs-string">'wallet_sendCalls'</span>,
      <span class="hljs-attr">params</span>: [{
        <span class="hljs-attr">from</span>: userAddress,
        <span class="hljs-attr">chainId</span>: <span class="hljs-title function_">toHex</span>(<span class="hljs-number">84532</span>),
        <span class="hljs-attr">version</span>: <span class="hljs-string">'1'</span>,
        <span class="hljs-attr">calls</span>: normalizedCalls,
        <span class="hljs-attr">capabilities</span>: { 
          <span class="hljs-attr">paymasterService</span>: { 
            <span class="hljs-attr">url</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">NEXT_PUBLIC_PAYMASTER_PROXY_SERVER_URL</span> || <span class="hljs-string">'https://api.developer.coinbase.com/rpc/v1/base-sepolia/demo'</span>,
            ...(config.<span class="hljs-property">sponsorshipRules</span> &amp;&amp; { <span class="hljs-attr">data</span>: config.<span class="hljs-property">sponsorshipRules</span> })
          } 
        },
      }],
    }) <span class="hljs-keyword">as</span> <span class="hljs-built_in">string</span>

    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'Sponsored calls sent:'</span>, txHash)
    <span class="hljs-keyword">return</span> txHash
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(<span class="hljs-string">'Sponsored calls failed:'</span>, error)
    <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>
  }
}</code></pre><p>The wallet clearly shows <strong>“Fee: Sponsored.”</strong></p><h3 id="h-b-eliminate-pop-ups-with-sub-accounts" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">B) Eliminate Pop-ups with Sub-Accounts</h3><p>Create an app-scoped, embedded wallet so frequent actions won’t prompt.</p><pre data-type="codeBlock" text="import { ensureBaseProviderConnected, getBaseAccountProvider } from '@/lib/base-account-sdk'
import { toHex } from 'viem'

// Minimal interface for sub-account info as returned by wallet_getSubAccounts
type SubAccountInfo = {
  address: `0x${string}`
  factory?: `0x${string}`
  factoryData?: `0x${string}`
}

type GetSubAccountsResponse = {
  subAccounts?: SubAccountInfo[]
}

type AddSubAccountResponse = SubAccountInfo

/**
 * Comprehensive Sub-Account management for Base Account
 * Implements all sub-account capabilities from Base Account documentation
 */

/**
 * Get existing sub-accounts for the user
 */
export async function getSubAccounts(
  universalAddress: `0x${string}`,
  chainId: number,
  domain?: string
): Promise&lt;SubAccountInfo[]&gt; {
  const provider = getBaseAccountProvider()
  await ensureBaseProviderConnected()

  try {
    const { subAccounts } = (await provider.request({
      method: 'wallet_getSubAccounts',
      params: [{ 
        version: '1', 
        account: universalAddress, 
        domain: domain || window.location.origin, 
        chainId: toHex(84532) 
      }],
    })) as GetSubAccountsResponse

    return subAccounts || []
  } catch (error) {
    console.error('Failed to get sub-accounts:', error)
    return []
  }
}

/**
 * Create a new sub-account
 */
export async function createSubAccount(
  accountType: 'create' | 'import' = 'create',
  factory?: `0x${string}`,
  factoryData?: `0x${string}`
): Promise&lt;`0x${string}` | null&gt; {
  const provider = getBaseAccountProvider()
  await ensureBaseProviderConnected()

  try {
    const newSubAccount = (await provider.request({
      method: 'wallet_addSubAccount',
      params: [{ 
        version: '1', 
        account: { 
          type: accountType,
          factory,
          factoryData
        } 
      }],
    })) as AddSubAccountResponse

    console.log('Created new sub-account:', newSubAccount.address)
    return newSubAccount.address
  } catch (error) {
    console.error('Failed to create sub-account:', error)
    return null
  }
}

/**
 * Get or create a sub-account
 */
export async function getOrCreateSubAccount(
  universalAddress: `0x${string}`,
  chainId: number,
  domain?: string
): Promise&lt;`0x${string}`&gt; {
  const provider = getBaseAccountProvider()
  await ensureBaseProviderConnected()

  // 1. Check if a sub-account already exists for the domain
  const existingSubAccounts = await getSubAccounts(universalAddress, chainId, domain)

  if (existingSubAccounts.length &gt; 0) {
    console.log('Found existing sub-account:', existingSubAccounts[0].address)
    return existingSubAccounts[0].address
  }

  // 2. If not, create a new one
  const newSubAccountAddress = await createSubAccount()
  if (!newSubAccountAddress) {
    throw new Error('Failed to create sub-account')
  }

  return newSubAccountAddress
}

/**
 * Remove a sub-account
 */
export async function removeSubAccount(
  subAccountAddress: `0x${string}`
): Promise&lt;boolean&gt; {
  const provider = getBaseAccountProvider()
  await ensureBaseProviderConnected()

  try {
    await provider.request({
      method: 'wallet_removeSubAccount',
      params: [{ 
        version: '1', 
        account: subAccountAddress 
      }],
    })

    console.log('Removed sub-account:', subAccountAddress)
    return true
  } catch (error) {
    console.error('Failed to remove sub-account:', error)
    return false
  }
}

/**
 * Transfer funds between main account and sub-account
 */
export async function transferToSubAccount(
  fromAddress: `0x${string}`,
  toSubAccount: `0x${string}`,
  amount: string,
  chainId: number
): Promise&lt;string | null&gt; {
  const provider = getBaseAccountProvider()
  await ensureBaseProviderConnected()

  try {
    const txHash = await provider.request({
      method: 'wallet_sendCalls',
      params: [{
        from: fromAddress,
        chainId: toHex(chainId),
        version: '1',
        calls: [{
          to: toSubAccount,
          value: amount,
          data: '0x'
        }]
      }]
    }) as string

    console.log('Transfer to sub-account sent:', txHash)
    return txHash
  } catch (error) {
    console.error('Transfer to sub-account failed:', error)
    return null
  }
}

/**
 * Execute transaction from sub-account
 */
export async function executeFromSubAccount(
  subAccountAddress: `0x${string}`,
  calls: Array&lt;{
    to: `0x${string}`
    value?: string
    data?: `0x${string}`
  }&gt;,
  chainId: number
): Promise&lt;string | null&gt; {
  const provider = getBaseAccountProvider()
  await ensureBaseProviderConnected()

  try {
    const txHash = await provider.request({
      method: 'wallet_sendCalls',
      params: [{
        from: subAccountAddress,
        chainId: toHex(chainId),
        version: '1',
        calls
      }]
    }) as string

    console.log('Sub-account transaction sent:', txHash)
    return txHash
  } catch (error) {
    console.error('Sub-account transaction failed:', error)
    return null
  }
}

/**
 * Get sub-account balance
 */
export async function getSubAccountBalance(
  subAccountAddress: `0x${string}`,
  tokenAddress?: `0x${string}`
): Promise&lt;string | null&gt; {
  const provider = getBaseAccountProvider()

  try {
    if (tokenAddress) {
      // Get ERC20 token balance using balanceOf(address)
      // 0x70a08231 is the function selector for balanceOf
      const balance = await provider.request({
        method: 'eth_call',
        params: [{
          to: tokenAddress,
          data: `0x70a08231000000000000000000000000${subAccountAddress.slice(2)}`
        }, 'latest']
      }) as string
      return balance
    } else {
      // Get native ETH balance of the sub-account
      const balance = await provider.request({
        method: 'eth_getBalance',
        params: [subAccountAddress, 'latest']
      }) as string
      return balance
    }
  } catch (error) {
    console.error('Failed to get sub-account balance:', error)
    return null
  }
}"><code><span class="hljs-keyword">import</span> { ensureBaseProviderConnected, getBaseAccountProvider } <span class="hljs-keyword">from</span> <span class="hljs-string">'@/lib/base-account-sdk'</span>
<span class="hljs-keyword">import</span> { toHex } <span class="hljs-keyword">from</span> <span class="hljs-string">'viem'</span>

<span class="hljs-comment">// Minimal interface for sub-account info as returned by wallet_getSubAccounts</span>
<span class="hljs-keyword">type</span> <span class="hljs-title class_">SubAccountInfo</span> = {
  <span class="hljs-attr">address</span>: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
  factory?: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
  factoryData?: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
}

<span class="hljs-keyword">type</span> <span class="hljs-title class_">GetSubAccountsResponse</span> = {
  subAccounts?: <span class="hljs-title class_">SubAccountInfo</span>[]
}

<span class="hljs-keyword">type</span> <span class="hljs-title class_">AddSubAccountResponse</span> = <span class="hljs-title class_">SubAccountInfo</span>

<span class="hljs-comment">/**
 * Comprehensive Sub-Account management for Base Account
 * Implements all sub-account capabilities from Base Account documentation
 */</span>

<span class="hljs-comment">/**
 * Get existing sub-accounts for the user
 */</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">getSubAccounts</span>(<span class="hljs-params">
  universalAddress: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  chainId: <span class="hljs-built_in">number</span>,
  domain?: <span class="hljs-built_in">string</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-title class_">SubAccountInfo</span>[]&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">await</span> <span class="hljs-title function_">ensureBaseProviderConnected</span>()

  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> { subAccounts } = (<span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
      <span class="hljs-attr">method</span>: <span class="hljs-string">'wallet_getSubAccounts'</span>,
      <span class="hljs-attr">params</span>: [{ 
        <span class="hljs-attr">version</span>: <span class="hljs-string">'1'</span>, 
        <span class="hljs-attr">account</span>: universalAddress, 
        <span class="hljs-attr">domain</span>: domain || <span class="hljs-variable language_">window</span>.<span class="hljs-property">location</span>.<span class="hljs-property">origin</span>, 
        <span class="hljs-attr">chainId</span>: <span class="hljs-title function_">toHex</span>(<span class="hljs-number">84532</span>) 
      }],
    })) <span class="hljs-keyword">as</span> <span class="hljs-title class_">GetSubAccountsResponse</span>

    <span class="hljs-keyword">return</span> subAccounts || []
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(<span class="hljs-string">'Failed to get sub-accounts:'</span>, error)
    <span class="hljs-keyword">return</span> []
  }
}

<span class="hljs-comment">/**
 * Create a new sub-account
 */</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">createSubAccount</span>(<span class="hljs-params">
  accountType: <span class="hljs-string">'create'</span> | <span class="hljs-string">'import'</span> = <span class="hljs-string">'create'</span>,
  factory?: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  factoryData?: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span> | <span class="hljs-literal">null</span>&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">await</span> <span class="hljs-title function_">ensureBaseProviderConnected</span>()

  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> newSubAccount = (<span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
      <span class="hljs-attr">method</span>: <span class="hljs-string">'wallet_addSubAccount'</span>,
      <span class="hljs-attr">params</span>: [{ 
        <span class="hljs-attr">version</span>: <span class="hljs-string">'1'</span>, 
        <span class="hljs-attr">account</span>: { 
          <span class="hljs-attr">type</span>: accountType,
          factory,
          factoryData
        } 
      }],
    })) <span class="hljs-keyword">as</span> <span class="hljs-title class_">AddSubAccountResponse</span>

    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'Created new sub-account:'</span>, newSubAccount.<span class="hljs-property">address</span>)
    <span class="hljs-keyword">return</span> newSubAccount.<span class="hljs-property">address</span>
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(<span class="hljs-string">'Failed to create sub-account:'</span>, error)
    <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>
  }
}

<span class="hljs-comment">/**
 * Get or create a sub-account
 */</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">getOrCreateSubAccount</span>(<span class="hljs-params">
  universalAddress: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  chainId: <span class="hljs-built_in">number</span>,
  domain?: <span class="hljs-built_in">string</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">await</span> <span class="hljs-title function_">ensureBaseProviderConnected</span>()

  <span class="hljs-comment">// 1. Check if a sub-account already exists for the domain</span>
  <span class="hljs-keyword">const</span> existingSubAccounts = <span class="hljs-keyword">await</span> <span class="hljs-title function_">getSubAccounts</span>(universalAddress, chainId, domain)

  <span class="hljs-keyword">if</span> (existingSubAccounts.<span class="hljs-property">length</span> &gt; <span class="hljs-number">0</span>) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'Found existing sub-account:'</span>, existingSubAccounts[<span class="hljs-number">0</span>].<span class="hljs-property">address</span>)
    <span class="hljs-keyword">return</span> existingSubAccounts[<span class="hljs-number">0</span>].<span class="hljs-property">address</span>
  }

  <span class="hljs-comment">// 2. If not, create a new one</span>
  <span class="hljs-keyword">const</span> newSubAccountAddress = <span class="hljs-keyword">await</span> <span class="hljs-title function_">createSubAccount</span>()
  <span class="hljs-keyword">if</span> (!newSubAccountAddress) {
    <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Error</span>(<span class="hljs-string">'Failed to create sub-account'</span>)
  }

  <span class="hljs-keyword">return</span> newSubAccountAddress
}

<span class="hljs-comment">/**
 * Remove a sub-account
 */</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">removeSubAccount</span>(<span class="hljs-params">
  subAccountAddress: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">boolean</span>&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">await</span> <span class="hljs-title function_">ensureBaseProviderConnected</span>()

  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
      <span class="hljs-attr">method</span>: <span class="hljs-string">'wallet_removeSubAccount'</span>,
      <span class="hljs-attr">params</span>: [{ 
        <span class="hljs-attr">version</span>: <span class="hljs-string">'1'</span>, 
        <span class="hljs-attr">account</span>: subAccountAddress 
      }],
    })

    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'Removed sub-account:'</span>, subAccountAddress)
    <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(<span class="hljs-string">'Failed to remove sub-account:'</span>, error)
    <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
  }
}

<span class="hljs-comment">/**
 * Transfer funds between main account and sub-account
 */</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">transferToSubAccount</span>(<span class="hljs-params">
  fromAddress: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  toSubAccount: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  amount: <span class="hljs-built_in">string</span>,
  chainId: <span class="hljs-built_in">number</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">string</span> | <span class="hljs-literal">null</span>&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">await</span> <span class="hljs-title function_">ensureBaseProviderConnected</span>()

  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> txHash = <span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
      <span class="hljs-attr">method</span>: <span class="hljs-string">'wallet_sendCalls'</span>,
      <span class="hljs-attr">params</span>: [{
        <span class="hljs-attr">from</span>: fromAddress,
        <span class="hljs-attr">chainId</span>: <span class="hljs-title function_">toHex</span>(chainId),
        <span class="hljs-attr">version</span>: <span class="hljs-string">'1'</span>,
        <span class="hljs-attr">calls</span>: [{
          <span class="hljs-attr">to</span>: toSubAccount,
          <span class="hljs-attr">value</span>: amount,
          <span class="hljs-attr">data</span>: <span class="hljs-string">'0x'</span>
        }]
      }]
    }) <span class="hljs-keyword">as</span> <span class="hljs-built_in">string</span>

    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'Transfer to sub-account sent:'</span>, txHash)
    <span class="hljs-keyword">return</span> txHash
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(<span class="hljs-string">'Transfer to sub-account failed:'</span>, error)
    <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>
  }
}

<span class="hljs-comment">/**
 * Execute transaction from sub-account
 */</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">executeFromSubAccount</span>(<span class="hljs-params">
  subAccountAddress: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  calls: <span class="hljs-built_in">Array</span>&lt;{
    to: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
    value?: <span class="hljs-built_in">string</span>
    data?: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
  }&gt;,
  chainId: <span class="hljs-built_in">number</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">string</span> | <span class="hljs-literal">null</span>&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">await</span> <span class="hljs-title function_">ensureBaseProviderConnected</span>()

  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> txHash = <span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
      <span class="hljs-attr">method</span>: <span class="hljs-string">'wallet_sendCalls'</span>,
      <span class="hljs-attr">params</span>: [{
        <span class="hljs-attr">from</span>: subAccountAddress,
        <span class="hljs-attr">chainId</span>: <span class="hljs-title function_">toHex</span>(chainId),
        <span class="hljs-attr">version</span>: <span class="hljs-string">'1'</span>,
        calls
      }]
    }) <span class="hljs-keyword">as</span> <span class="hljs-built_in">string</span>

    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'Sub-account transaction sent:'</span>, txHash)
    <span class="hljs-keyword">return</span> txHash
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(<span class="hljs-string">'Sub-account transaction failed:'</span>, error)
    <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>
  }
}

<span class="hljs-comment">/**
 * Get sub-account balance
 */</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">getSubAccountBalance</span>(<span class="hljs-params">
  subAccountAddress: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  tokenAddress?: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">string</span> | <span class="hljs-literal">null</span>&gt; {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()

  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">if</span> (tokenAddress) {
      <span class="hljs-comment">// Get ERC20 token balance using balanceOf(address)</span>
      <span class="hljs-comment">// 0x70a08231 is the function selector for balanceOf</span>
      <span class="hljs-keyword">const</span> balance = <span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
        <span class="hljs-attr">method</span>: <span class="hljs-string">'eth_call'</span>,
        <span class="hljs-attr">params</span>: [{
          <span class="hljs-attr">to</span>: tokenAddress,
          <span class="hljs-attr">data</span>: <span class="hljs-string">`0x70a08231000000000000000000000000<span class="hljs-subst">${subAccountAddress.slice(<span class="hljs-number">2</span>)}</span>`</span>
        }, <span class="hljs-string">'latest'</span>]
      }) <span class="hljs-keyword">as</span> <span class="hljs-built_in">string</span>
      <span class="hljs-keyword">return</span> balance
    } <span class="hljs-keyword">else</span> {
      <span class="hljs-comment">// Get native ETH balance of the sub-account</span>
      <span class="hljs-keyword">const</span> balance = <span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
        <span class="hljs-attr">method</span>: <span class="hljs-string">'eth_getBalance'</span>,
        <span class="hljs-attr">params</span>: [subAccountAddress, <span class="hljs-string">'latest'</span>]
      }) <span class="hljs-keyword">as</span> <span class="hljs-built_in">string</span>
      <span class="hljs-keyword">return</span> balance
    }
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(<span class="hljs-string">'Failed to get sub-account balance:'</span>, error)
    <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>
  }
}</code></pre><h3 id="h-c-automated-subscriptions-with-spend-permissions" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">C) Automated Subscriptions with Spend Permissions</h3><ol><li><p><strong>User grants allowance</strong> (off-chain EIP-712).</p></li><li><p><strong>Cron job executes batched, gasless charges</strong> from the sub-account.</p></li></ol><pre data-type="codeBlock" text="import { getBaseAccountProvider } from '@/lib/base-account-sdk'
import {
  requestSpendPermission as sdkRequestSpendPermission,
  prepareSpendCallData,
} from '@base-org/account/spend-permission'

// Simplified type alias for the permission object returned by the SDK
export type Permission = any

// Request a Spend Permission using the SDK helper
// - account: user's Base Account (smart account) the permission applies to
// - spender: your app's spender address that will execute future transfers
// - token: ERC-20 token address (USDC on Base Mainnet in our UI)
// - allowance: spend limit in token base units for each period
// - periodInDays: recurring period window (e.g., 30 days)
// - chainId: chain on which the permission is valid (8453 = Base Mainnet)
export async function requestSpendPermission(
  account: `0x${string}`,
  spender: `0x${string}`,
  token: `0x${string}`,
  allowance: bigint,
  periodInDays: number,
  chainId: number = 8453,
) {
  const provider = getBaseAccountProvider()
  const permission = await sdkRequestSpendPermission({
    provider,
    account,
    spender,
    token,
    chainId,
    allowance,
    periodInDays,
  })
  return permission as Permission
}

// Prepare and execute spend calls using wallet_sendCalls v2
// - On first use, returned array typically includes approveWithSignature then spend
// - On subsequent uses, only the spend call is included
export async function executeSpendCalls(
  permission: Permission,
  amount: bigint | undefined,
  spender: `0x${string}`,
  chainId: number = 8453,
) {
  const provider = getBaseAccountProvider()
  const calls = await prepareSpendCallData(permission as any, amount ?? 'max-remaining-allowance')
  const txHash = (await provider.request({
    method: 'wallet_sendCalls',
    params: [
      {
        version: '2.0',
        atomicRequired: true,
        from: spender,
        calls: calls as any,
      },
    ],
  })) as string
  return txHash
}

// Optional storage helper (demo): persist the permission in a backend store
// In production, replace with your database and proper authentication
export async function storeSpendPermission(
  permission: Permission,
  metadata?: { description?: string; category?: string; frequency?: 'monthly' | 'weekly' | 'daily' },
): Promise&lt;boolean&gt; {
  try {
    const response = await fetch('/api/subscriptions/save', {
      method: 'POST',
      headers: { 'content-type': 'application/json' },
      body: JSON.stringify({
        signature: permission?.signature || '0x',
        spendPermissionData: permission,
        metadata: { createdAt: new Date().toISOString(), ...metadata },
      }),
    })
    return response.ok
  } catch (e) {
    return false
  }
}"><code><span class="hljs-keyword">import</span> { getBaseAccountProvider } <span class="hljs-keyword">from</span> <span class="hljs-string">'@/lib/base-account-sdk'</span>
<span class="hljs-keyword">import</span> {
  requestSpendPermission <span class="hljs-keyword">as</span> sdkRequestSpendPermission,
  prepareSpendCallData,
} <span class="hljs-keyword">from</span> <span class="hljs-string">'@base-org/account/spend-permission'</span>

<span class="hljs-comment">// Simplified type alias for the permission object returned by the SDK</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">type</span> <span class="hljs-title class_">Permission</span> = <span class="hljs-built_in">any</span>

<span class="hljs-comment">// Request a Spend Permission using the SDK helper</span>
<span class="hljs-comment">// - account: user's Base Account (smart account) the permission applies to</span>
<span class="hljs-comment">// - spender: your app's spender address that will execute future transfers</span>
<span class="hljs-comment">// - token: ERC-20 token address (USDC on Base Mainnet in our UI)</span>
<span class="hljs-comment">// - allowance: spend limit in token base units for each period</span>
<span class="hljs-comment">// - periodInDays: recurring period window (e.g., 30 days)</span>
<span class="hljs-comment">// - chainId: chain on which the permission is valid (8453 = Base Mainnet)</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">requestSpendPermission</span>(<span class="hljs-params">
  account: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  spender: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  token: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  allowance: <span class="hljs-built_in">bigint</span>,
  periodInDays: <span class="hljs-built_in">number</span>,
  chainId: <span class="hljs-built_in">number</span> = <span class="hljs-number">8453</span>,
</span>) {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">const</span> permission = <span class="hljs-keyword">await</span> <span class="hljs-title function_">sdkRequestSpendPermission</span>({
    provider,
    account,
    spender,
    token,
    chainId,
    allowance,
    periodInDays,
  })
  <span class="hljs-keyword">return</span> permission <span class="hljs-keyword">as</span> <span class="hljs-title class_">Permission</span>
}

<span class="hljs-comment">// Prepare and execute spend calls using wallet_sendCalls v2</span>
<span class="hljs-comment">// - On first use, returned array typically includes approveWithSignature then spend</span>
<span class="hljs-comment">// - On subsequent uses, only the spend call is included</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">executeSpendCalls</span>(<span class="hljs-params">
  permission: Permission,
  amount: <span class="hljs-built_in">bigint</span> | <span class="hljs-literal">undefined</span>,
  spender: <span class="hljs-string">`0x<span class="hljs-subst">${<span class="hljs-built_in">string</span>}</span>`</span>,
  chainId: <span class="hljs-built_in">number</span> = <span class="hljs-number">8453</span>,
</span>) {
  <span class="hljs-keyword">const</span> provider = <span class="hljs-title function_">getBaseAccountProvider</span>()
  <span class="hljs-keyword">const</span> calls = <span class="hljs-keyword">await</span> <span class="hljs-title function_">prepareSpendCallData</span>(permission <span class="hljs-keyword">as</span> <span class="hljs-built_in">any</span>, amount ?? <span class="hljs-string">'max-remaining-allowance'</span>)
  <span class="hljs-keyword">const</span> txHash = (<span class="hljs-keyword">await</span> provider.<span class="hljs-title function_">request</span>({
    <span class="hljs-attr">method</span>: <span class="hljs-string">'wallet_sendCalls'</span>,
    <span class="hljs-attr">params</span>: [
      {
        <span class="hljs-attr">version</span>: <span class="hljs-string">'2.0'</span>,
        <span class="hljs-attr">atomicRequired</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-attr">from</span>: spender,
        <span class="hljs-attr">calls</span>: calls <span class="hljs-keyword">as</span> <span class="hljs-built_in">any</span>,
      },
    ],
  })) <span class="hljs-keyword">as</span> <span class="hljs-built_in">string</span>
  <span class="hljs-keyword">return</span> txHash
}

<span class="hljs-comment">// Optional storage helper (demo): persist the permission in a backend store</span>
<span class="hljs-comment">// In production, replace with your database and proper authentication</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">storeSpendPermission</span>(<span class="hljs-params">
  permission: Permission,
  metadata?: { description?: <span class="hljs-built_in">string</span>; category?: <span class="hljs-built_in">string</span>; frequency?: <span class="hljs-string">'monthly'</span> | <span class="hljs-string">'weekly'</span> | <span class="hljs-string">'daily'</span> },
</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">boolean</span>&gt; {
  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> <span class="hljs-title function_">fetch</span>(<span class="hljs-string">'/api/subscriptions/save'</span>, {
      <span class="hljs-attr">method</span>: <span class="hljs-string">'POST'</span>,
      <span class="hljs-attr">headers</span>: { <span class="hljs-string">'content-type'</span>: <span class="hljs-string">'application/json'</span> },
      <span class="hljs-attr">body</span>: <span class="hljs-title class_">JSON</span>.<span class="hljs-title function_">stringify</span>({
        <span class="hljs-attr">signature</span>: permission?.<span class="hljs-property">signature</span> || <span class="hljs-string">'0x'</span>,
        <span class="hljs-attr">spendPermissionData</span>: permission,
        <span class="hljs-attr">metadata</span>: { <span class="hljs-attr">createdAt</span>: <span class="hljs-keyword">new</span> <span class="hljs-title class_">Date</span>().<span class="hljs-title function_">toISOString</span>(), ...metadata },
      }),
    })
    <span class="hljs-keyword">return</span> response.<span class="hljs-property">ok</span>
  } <span class="hljs-keyword">catch</span> (e) {
    <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
  }
}</code></pre><pre data-type="codeBlock" text="import { NextResponse } from 'next/server'

// In-memory store for demo (use database in production)
const subscriptionsStore: Array&lt;{ 
  id: string
  signature: string
  spendPermissionData: any
  metadata: any
  createdAt: string
}&gt; = []

/**
 * Save spend permission signatures for subscriptions
 */
export async function POST(request: Request) {
  try {
    const body = await request.json()
    
    if (!body || !body.signature || !body.spendPermissionData) {
      return NextResponse.json({ error: 'Invalid payload' }, { status: 400 })
    }

    const subscription = {
      id: `sub_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
      signature: body.signature,
      spendPermissionData: body.spendPermissionData,
      metadata: body.metadata || {},
      createdAt: new Date().toISOString()
    }

    subscriptionsStore.push(subscription)

    console.log('Saved subscription:', subscription.id)
    
    return NextResponse.json({ 
      ok: true, 
      subscriptionId: subscription.id,
      message: 'Subscription saved successfully'
    })
  } catch (e) {
    console.error('Subscription save error:', e)
    return NextResponse.json({ error: 'Invalid JSON or processing error' }, { status: 400 })
  }
}

/**
 * Get all subscriptions (for demo purposes)
 */
export async function GET(request: Request) {
  const { searchParams } = new URL(request.url)
  const userAddress = searchParams.get('address')

  let filteredSubscriptions = subscriptionsStore

  if (userAddress) {
    filteredSubscriptions = subscriptionsStore.filter(sub =&gt; 
      sub.spendPermissionData.account?.toLowerCase() === userAddress.toLowerCase()
    )
  }

  return NextResponse.json({ 
    subscriptions: filteredSubscriptions,
    total: filteredSubscriptions.length
  })
}

/**
 * Execute a subscription (for backend use)
 */
export async function PUT(request: Request) {
  try {
    const body = await request.json()
    const { subscriptionId, amount } = body

    if (!subscriptionId || !amount) {
      return NextResponse.json({ error: 'Missing subscriptionId or amount' }, { status: 400 })
    }

    const subscription = subscriptionsStore.find(sub =&gt; sub.id === subscriptionId)
    if (!subscription) {
      return NextResponse.json({ error: 'Subscription not found' }, { status: 404 })
    }

    // In production, this would:
    // 1. Validate the spend permission
    // 2. Execute the transaction on-chain
    // 3. Update subscription usage
    // 4. Return transaction hash

    console.log('Executed subscription:', subscriptionId, 'for amount:', amount)

    return NextResponse.json({
      ok: true,
      transactionHash: `0x${Math.random().toString(16).slice(2, 66)}`,
      amount,
      timestamp: new Date().toISOString()
    })
  } catch (e) {
    console.error('Subscription execution error:', e)
    return NextResponse.json({ error: 'Execution failed' }, { status: 500 })
  }
}"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">NextResponse</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'next/server'</span>

<span class="hljs-comment">// In-memory store for demo (use database in production)</span>
<span class="hljs-title">const</span> <span class="hljs-title">subscriptionsStore</span>: <span class="hljs-title">Array</span><span class="hljs-operator">&lt;</span>{ 
  <span class="hljs-title">id</span>: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
  <span class="hljs-title">signature</span>: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
  <span class="hljs-title">spendPermissionData</span>: <span class="hljs-title">any</span>
  <span class="hljs-title">metadata</span>: <span class="hljs-title">any</span>
  <span class="hljs-title">createdAt</span>: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
}<span class="hljs-operator">&gt;</span> <span class="hljs-operator">=</span> []

<span class="hljs-comment">/**
 * Save spend permission signatures for subscriptions
 */</span>
<span class="hljs-title">export</span> <span class="hljs-title">async</span> <span class="hljs-title"><span class="hljs-keyword">function</span></span> <span class="hljs-title">POST</span>(<span class="hljs-title">request</span>: <span class="hljs-title">Request</span>) {
  <span class="hljs-title"><span class="hljs-keyword">try</span></span> {
    <span class="hljs-title">const</span> <span class="hljs-title">body</span> <span class="hljs-operator">=</span> <span class="hljs-title">await</span> <span class="hljs-title">request</span>.<span class="hljs-title">json</span>()
    
    <span class="hljs-title"><span class="hljs-keyword">if</span></span> (<span class="hljs-operator">!</span><span class="hljs-title">body</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-operator">!</span><span class="hljs-title">body</span>.<span class="hljs-title">signature</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-operator">!</span><span class="hljs-title">body</span>.<span class="hljs-title">spendPermissionData</span>) {
      <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title"><span class="hljs-keyword">error</span></span>: <span class="hljs-string">'Invalid payload'</span> }, { <span class="hljs-title">status</span>: 400 })
    }

    <span class="hljs-title">const</span> <span class="hljs-title">subscription</span> <span class="hljs-operator">=</span> {
      <span class="hljs-title">id</span>: `<span class="hljs-title">sub_$</span>{<span class="hljs-title">Date</span>.<span class="hljs-title"><span class="hljs-built_in">now</span></span>()}<span class="hljs-title"><span class="hljs-keyword">_</span>$</span>{<span class="hljs-title">Math</span>.<span class="hljs-title">random</span>().<span class="hljs-title">toString</span>(36).<span class="hljs-title">substr</span>(2, 9)}`,
      <span class="hljs-title">signature</span>: <span class="hljs-title">body</span>.<span class="hljs-title">signature</span>,
      <span class="hljs-title">spendPermissionData</span>: <span class="hljs-title">body</span>.<span class="hljs-title">spendPermissionData</span>,
      <span class="hljs-title">metadata</span>: <span class="hljs-title">body</span>.<span class="hljs-title">metadata</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> {},
      <span class="hljs-title">createdAt</span>: <span class="hljs-title"><span class="hljs-keyword">new</span></span> <span class="hljs-title">Date</span>().<span class="hljs-title">toISOString</span>()
    }

    <span class="hljs-title">subscriptionsStore</span>.<span class="hljs-title">push</span>(<span class="hljs-title">subscription</span>)

    <span class="hljs-title">console</span>.<span class="hljs-title">log</span>(<span class="hljs-string">'Saved subscription:'</span>, <span class="hljs-title">subscription</span>.<span class="hljs-title">id</span>)
    
    <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ 
      <span class="hljs-title">ok</span>: <span class="hljs-title"><span class="hljs-literal">true</span></span>, 
      <span class="hljs-title">subscriptionId</span>: <span class="hljs-title">subscription</span>.<span class="hljs-title">id</span>,
      <span class="hljs-title">message</span>: <span class="hljs-string">'Subscription saved successfully'</span>
    })
  } <span class="hljs-title"><span class="hljs-keyword">catch</span></span> (<span class="hljs-title">e</span>) {
    <span class="hljs-title">console</span>.<span class="hljs-title"><span class="hljs-keyword">error</span></span>(<span class="hljs-string">'Subscription save error:'</span>, <span class="hljs-title">e</span>)
    <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title"><span class="hljs-keyword">error</span></span>: <span class="hljs-string">'Invalid JSON or processing error'</span> }, { <span class="hljs-title">status</span>: 400 })
  }
}

<span class="hljs-comment">/**
 * Get all subscriptions (for demo purposes)
 */</span>
<span class="hljs-title">export</span> <span class="hljs-title">async</span> <span class="hljs-title"><span class="hljs-keyword">function</span></span> <span class="hljs-title">GET</span>(<span class="hljs-title">request</span>: <span class="hljs-title">Request</span>) {
  <span class="hljs-title">const</span> { <span class="hljs-title">searchParams</span> } <span class="hljs-operator">=</span> <span class="hljs-title"><span class="hljs-keyword">new</span></span> <span class="hljs-title">URL</span>(<span class="hljs-title">request</span>.<span class="hljs-title">url</span>)
  <span class="hljs-title">const</span> <span class="hljs-title">userAddress</span> <span class="hljs-operator">=</span> <span class="hljs-title">searchParams</span>.<span class="hljs-title">get</span>(<span class="hljs-string">'address'</span>)

  <span class="hljs-title">let</span> <span class="hljs-title">filteredSubscriptions</span> <span class="hljs-operator">=</span> <span class="hljs-title">subscriptionsStore</span>

  <span class="hljs-title"><span class="hljs-keyword">if</span></span> (<span class="hljs-title">userAddress</span>) {
    <span class="hljs-title">filteredSubscriptions</span> <span class="hljs-operator">=</span> <span class="hljs-title">subscriptionsStore</span>.<span class="hljs-title">filter</span>(<span class="hljs-title">sub</span> <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> 
      <span class="hljs-title">sub</span>.<span class="hljs-title">spendPermissionData</span>.<span class="hljs-title">account</span>?.<span class="hljs-title">toLowerCase</span>() <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-title">userAddress</span>.<span class="hljs-title">toLowerCase</span>()
    )
  }

  <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ 
    <span class="hljs-title">subscriptions</span>: <span class="hljs-title">filteredSubscriptions</span>,
    <span class="hljs-title">total</span>: <span class="hljs-title">filteredSubscriptions</span>.<span class="hljs-title">length</span>
  })
}

<span class="hljs-comment">/**
 * Execute a subscription (for backend use)
 */</span>
<span class="hljs-title">export</span> <span class="hljs-title">async</span> <span class="hljs-title"><span class="hljs-keyword">function</span></span> <span class="hljs-title">PUT</span>(<span class="hljs-title">request</span>: <span class="hljs-title">Request</span>) {
  <span class="hljs-title"><span class="hljs-keyword">try</span></span> {
    <span class="hljs-title">const</span> <span class="hljs-title">body</span> <span class="hljs-operator">=</span> <span class="hljs-title">await</span> <span class="hljs-title">request</span>.<span class="hljs-title">json</span>()
    <span class="hljs-title">const</span> { <span class="hljs-title">subscriptionId</span>, <span class="hljs-title">amount</span> } <span class="hljs-operator">=</span> <span class="hljs-title">body</span>

    <span class="hljs-title"><span class="hljs-keyword">if</span></span> (<span class="hljs-operator">!</span><span class="hljs-title">subscriptionId</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-operator">!</span><span class="hljs-title">amount</span>) {
      <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title"><span class="hljs-keyword">error</span></span>: <span class="hljs-string">'Missing subscriptionId or amount'</span> }, { <span class="hljs-title">status</span>: 400 })
    }

    <span class="hljs-title">const</span> <span class="hljs-title">subscription</span> <span class="hljs-operator">=</span> <span class="hljs-title">subscriptionsStore</span>.<span class="hljs-title">find</span>(<span class="hljs-title">sub</span> <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> <span class="hljs-title">sub</span>.<span class="hljs-title">id</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-title">subscriptionId</span>)
    <span class="hljs-title"><span class="hljs-keyword">if</span></span> (<span class="hljs-operator">!</span><span class="hljs-title">subscription</span>) {
      <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title"><span class="hljs-keyword">error</span></span>: <span class="hljs-string">'Subscription not found'</span> }, { <span class="hljs-title">status</span>: 404 })
    }

    <span class="hljs-comment">// In production, this would:</span>
    <span class="hljs-comment">// 1. Validate the spend permission</span>
    <span class="hljs-comment">// 2. Execute the transaction on-chain</span>
    <span class="hljs-comment">// 3. Update subscription usage</span>
    <span class="hljs-comment">// 4. Return transaction hash</span>

    <span class="hljs-title">console</span>.<span class="hljs-title">log</span>(<span class="hljs-string">'Executed subscription:'</span>, <span class="hljs-title">subscriptionId</span>, <span class="hljs-string">'for amount:'</span>, <span class="hljs-title">amount</span>)

    <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({
      <span class="hljs-title">ok</span>: <span class="hljs-title"><span class="hljs-literal">true</span></span>,
      <span class="hljs-title">transactionHash</span>: `0<span class="hljs-title">x$</span>{<span class="hljs-title">Math</span>.<span class="hljs-title">random</span>().<span class="hljs-title">toString</span>(16).<span class="hljs-title">slice</span>(2, 66)}`,
      <span class="hljs-title">amount</span>,
      <span class="hljs-title">timestamp</span>: <span class="hljs-title"><span class="hljs-keyword">new</span></span> <span class="hljs-title">Date</span>().<span class="hljs-title">toISOString</span>()
    })
  } <span class="hljs-title"><span class="hljs-keyword">catch</span></span> (<span class="hljs-title">e</span>) {
    <span class="hljs-title">console</span>.<span class="hljs-title"><span class="hljs-keyword">error</span></span>(<span class="hljs-string">'Subscription execution error:'</span>, <span class="hljs-title">e</span>)
    <span class="hljs-title"><span class="hljs-keyword">return</span></span> <span class="hljs-title">NextResponse</span>.<span class="hljs-title">json</span>({ <span class="hljs-title"><span class="hljs-keyword">error</span></span>: <span class="hljs-string">'Execution failed'</span> }, { <span class="hljs-title">status</span>: 500 })
  }
}</code></pre><blockquote><p><strong><em>Production notes:</em></strong><em> Store signed permissions securely server-side; add replay protection; monitor balances; expose a “Cancel subscription” UI that revokes the permission.</em></p></blockquote><hr><h2 id="h-conclusion-and-next-steps" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Conclusion &amp; Next&nbsp;Steps</h2><p>You now have a full stack that feels like a modern app:</p><ul><li><p><strong>Sign in with Base</strong> (no passwords).</p></li><li><p><strong>One-tap USDC payments</strong> via Base Pay.</p></li><li><p><strong>Gasless actions</strong> with Paymasters.</p></li><li><p><strong>Zero-prompt UX</strong> using Sub-Accounts.</p></li><li><p><strong>Automated billing</strong> with Spend Permissions.</p></li></ul><p><strong>Next steps</strong></p><ul><li><p>Swap Base Sepolia → <strong>Base mainnet</strong> when ready.</p></li><li><p>Add swap/NFT flows with OnchainKit components.</p></li><li><p>Migrate keys/session state to a hardened backend.</p></li><li><p>Instrument analytics for funnel visibility (auth → pay → retention).</p></li></ul><hr><h2 id="h-resources-and-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Resources &amp;&nbsp;Links</h2><p><strong>Base Accounts Docs:</strong></p><div data-type="embedly" src="https://docs.base.org/base-account/overview/what-is-base-account" data="{&quot;provider_url&quot;:&quot;https://docs.base.org&quot;,&quot;description&quot;:&quot;What is a Base Account and how the Base Account SDK lets you add universal sign-in and one-tap USDC payments to any app.&quot;,&quot;title&quot;:&quot;Base Account Overview - Base Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.base.org/base-account/overview/what-is-base-account&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/62302389dac47dde55a4bfc4a76e07c81ed5c623da5aa688a4fae6c0376d76e0.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Base Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFY0lEQVR4nF2Ua0xaZxjH32Rf9qlb9mXbh25Lq02XbCau23pzXVyXtU26dGtnXVutGkutVWlxKSK0oNQbFe0F1A6qiEcKXvDoqWKRy6iA4BVwqEwKdWItYgVF0aooy+Ft3bKT99P58Pv/z+953gM2Q6H14MZSYDUYDK6ura2urS2vvAqsvFoMrM7NL0/P+p9N+566vGPOWctf7qHRaaPFpTNN/tHnVBodcr1dph1vVY9JFSNNipEGuVUsGxbJhpF2Czx1mBlshkKbIfxZDwZDb56NjU2vf3luYdnjC7i9AcdzL6QbLK7uwQl1n1OufyrTjmMaW4tytDHMrQ9zBZhJgJmq0SE+OsiTDvDRQRAKhWrrjADERkRGfB4VtWfP1zt37or59nBiEuHXxNT0K5SfTyez7taMTc7pTJOagQkVTrdjGhuqHmtSjODoMLcaHeJJB36X9lc29nElvRyxER48QIqaAUjIzMqM+eZQ3Okz+w/GpFy4nF/IJlMLSJSbl65Q2RX1ZrtbHdbSqbe3aWzSsBCRbFiImavRIcjliI33HhrLkZ5ypKcM6WEL9Wyh/l9FW3I2Q6GVtfW5hWW3N+Dy+J0v5s12t2ZgQml0yLTjbRobXlxuhUJ40gGIhtBbtboSgbaoprvwwesDtoa8sro671/yeBcn3V6Hyzs+8dJqn+kfnd4yA7tDLVvFuZLeuyIDW6hn1eogN5+nYVSp6eFzo1L9+guC4dbzS688vsCUx+987rNNvBwOB2iH/obeIR1q4aODlY19UMitMDqfp6F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;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/62302389dac47dde55a4bfc4a76e07c81ed5c623da5aa688a4fae6c0376d76e0.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/62302389dac47dde55a4bfc4a76e07c81ed5c623da5aa688a4fae6c0376d76e0.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.base.org/base-account/overview/what-is-base-account" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Base Account Overview - Base Documentation</h2><p>What is a Base Account and how the Base Account SDK lets you add universal sign-in and one-tap USDC payments to any app.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.base.org</span></div><img src="https://storage.googleapis.com/papyrus_images/62302389dac47dde55a4bfc4a76e07c81ed5c623da5aa688a4fae6c0376d76e0.png"></div></a></div></div><p><strong>Coinbase Developer Docs:</strong></p><div data-type="embedly" src="https://docs.cdp.coinbase.com" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;Explore our API &amp; SDK references, demos, and guides for building onchain apps.&quot;,&quot;title&quot;:&quot;Coinbase Developer Docs - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFgUlEQVR4nGWUa0xaZxzG32WuSz8s6dqlH9yta4zZuqVdt262mVtv61Z7r13vo9rLvHS1Vm213pW1iooOKaKIgoqAPYh4QRAFpIhCQRRU0IBUvFAtCmidOi6V5XBM02QnT07eT7/nyfN/3z9Y9XrdnlerXq/v4HG5XKter9PlWVxy2hzLz+cWzRaHccKmN1k1I9NqnUWumejqM4ufmjp6RnkyA/fJCEekY7UPQYJBJn+AztXSuJrq5n5EVY19AEFPvlhwumG6E5Z7acVlX1ieti2OT8+bLHa9yao1zKh1lm7NhEQ1JlKY2nzoJvFwfftQ3RtcCkdN4ajJbBWJrSqDlCS2Cni9XkGPEWwKK6RKqWTi3aRkHL5k3DJrdSy9mV3po3eqnnUoTDyZoUk8zBbqIMEgjPZxyT4iEVIS6hR4hryYvibYwGSxH7xd09U3punvFXSIRRKZxbowZV0Ynfwf3VcLR6xntQ8x+QM0robqQyPcYrq8iNaNrZblUaUYijSnQpJTIVmryOv7I/NYdrot1pdjFrthwjZgXGsGocONi/WQYJDB0yKFlPnQf9N78qtkGIoUXd6ZWSrKIIpSCcJUgjDtUceawYrL7XR7llZcNseyxfpyfHreOGHTmaz9I9NyX+9IMwidztW+Dl5Ml2Np3TkVEnR5ZzpBmIxvT8IJEgr5sQWtsQWtt/O4awZuzyunyzP/z79WxxIy2OGxWa1hRqmzSNXmN+lILSS2ilCnKKJ1I6nTCUKEezuPG53THPmg6Xo2B9GagcfjWV5xIVdzcmZ+dMo+YITpXX1rdPjCCHWv6Y+YMB1d3plBEKYQOhIK+bcwXI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,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Coinbase Developer Docs - Coinbase Developer Documentation</h2><p>Explore our API &amp; SDK references, demos, and guides for building onchain apps.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"></div></a></div></div><p><strong>Base Docs</strong> — network specifics &amp; tooling</p><div data-type="embedly" src="https://docs.base.org/get-started/base" data="{&quot;provider_url&quot;:&quot;https://docs.base.org&quot;,&quot;description&quot;:&quot;The #1 Ethereum Layer 2, incubated by Coinbase&quot;,&quot;title&quot;:&quot;Base - Base Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.base.org/get-started/base&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Base Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFFklEQVR4nF2TfVDSdxzHf/+1u7ba7Xbr9l+76/Zwrdt6mKtNt1WezjWdZporn7BpWSgL52FkqcnAJwQOEAQSRAkBgSIg6aeC5gPDRLEMp4dW4LMhUSInDHY/vkZt3/v8/Xq/v+/P+wMFgkGfz//c7fH7/ete77rX+3LN82LN43J7Fpafz8yuTEwvPJyaNY8/GTDbeocm4b5H2p6HN+HR9o7hNrVJpDI2yfo4bb1scQ9TpKcLu2jCrno+DKaOp4MCwWAgiLwNny/46vn9/yw53YtO99yyy760Om6bB3Rd3/jtbosSHpFohkQqo0AxwJX0NogMdGEXtRnh1nB1NVwdqVFLYGsrmWoCWwsFg0FStQL679v+3gdfHYz88sA30XHHP/k8Al1Ubp5waHseqrotctjcpjYJFAM8WR9b3IOgQ1xSI0KsYKrL6KpSqhJP2RxEgMXRQdBHMbEx27a/u3vPF29tfefbqCPZuReST6ISTmQdjUvBlJD6R21KeKS9Y1isNvEV/Zy2XqZITxN21fIQNODiKcpLZEVxtay4WlZULcOSpFiS9HVE4XACwaDHu7HodNuXVm2OFevMYv+oTdVtae8YFqmMfEU/W9zDaNWDQCpfoQH0IlFSUCm+UCnOrxCBgcJL9ni9z5yu2QXn1OOF8ak5i9X+l2VGb5oMJwO8g1jCxkupSlydHEuSYogSwM292pKDF6BCk4Xnb/7AHwh4vBvPnq/NLbumHSuPbPMjVrvRMq03TWoMD0DugA5iIbC1ZXQVCORiCJ17tQWFF2SW8DNwTaeKeaeKealYTiqWsymw4fOte32ul+tzy66pJ0tjk7Nh+0p4BGyVK73HaNWH6bg6eVG1rKBSfLa8NSeEBtBkDDupkJVU0JCAZiagmYjAus9nttp1vUgUbWqTxvBgxGrvG5rqHLRqDA+kd4aFt4xc6T2mSE/mw6TG1/Sw8QxcUyqWk1TISkAzj+UzfspnxObRYvNo0Xk0pEUrzlXWdfH8M7fNsTLxeNFomX7TvlhtAo2s58NVjXfKGbcvkRVYkhTQs/CI8RMXOQloJuAeOUOJyiZHZZMjM2sjM2sRgbud+lD73wZHwOC2WSYdHX3jqm6LRDMkUAyA6Gu4ugqmGk9Rhr0DejKGHY9mhtGHMmoiTlftTyPuDQ0iMPPUkXIK9WvW2Z+Pp38fm6zsGDRPOOBQPvK7ZuEtI0/ez2jVkwWdlSwNnqIEuaPwgjA9Oo8G0AdOV+1NI+5JIXyWfG1XYvmuxHLIHwi43Gtj4xMjY9Z+0yjce7+1HaZfV3JvwFUMCYEuu0aTYcp4Z3EN6QXk1PPkzKLG/AoRCi9IxzWFvUdlkyNC6N0phF2J5Tvjy3bGl3147MqOuMuIwMLy6g2Jks4SNPKl9QwhlSUmUoX1HAWmlIInNZeQWs4U0U7kVsalX/kl58/Ec3W5V1sycE0g9zfpHx+/Brjv/4jfFlOy5Shua0wJIvD46XyLWE5nCQg1jA7DfbPV3m36W20Yk8Pm5puDLLCAprsVLA2uTo4hSkD0YKuHUeSD6dV704jAOEBDh4uhH/6AvsMiA+7LsYTU32K1D5htnYNWVbdFemcYXBYVVJN6qzjU+t+uCDNC4SSgmdFnKJGZtfvTiJ8mVQD6lqO4TfShQujrAmQ83o0l54sn805wvf8TaBAZqM1dBLa2lLpZnpzQbpMKWcB+xOmqPSmEnfFlO+Iub9Ijf0e4B85D+/Khfef+BW+M2lc/hwRkAAAAAElFTkSuQmCC&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.base.org/get-started/base" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Base - Base Documentation</h2><p>The #1 Ethereum Layer 2, incubated by Coinbase</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.base.org</span></div><img src="https://storage.googleapis.com/papyrus_images/074f75581a674df219f106bae65162e19f90f28449c66b8e403d68dc20ae6101.png"></div></a></div></div><p><strong>HeimLabs</strong> — more tutorials and examples</p><div data-type="embedly" src="https://github.com/HeimLabs/coinbase-cdp-demos" data="{&quot;provider_url&quot;:&quot;https://github.com&quot;,&quot;description&quot;:&quot;A collection of Demo Projects exploring the Coinbase Developer Platform - HeimLabs/coinbase-cdp-demos&quot;,&quot;title&quot;:&quot;GitHub - HeimLabs/coinbase-cdp-demos: A collection of Demo Projects exploring the Coinbase Developer Platform&quot;,&quot;author_name&quot;:&quot;HeimLabs&quot;,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://github.com/HeimLabs/coinbase-cdp-demos&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/2ea1909aeab6f855df4ba295790e269bda5d34f68c6bd85f6a2da37047227163.png&quot;,&quot;author_url&quot;:&quot;https://github.com/HeimLabs&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;GitHub&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:600,&quot;image&quot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Xh3GIJITf2/izcKokm7/KloTX/4itfl+83B65QvEeCZ34AAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:600,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/2ea1909aeab6f855df4ba295790e269bda5d34f68c6bd85f6a2da37047227163.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/2ea1909aeab6f855df4ba295790e269bda5d34f68c6bd85f6a2da37047227163.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://github.com/HeimLabs/coinbase-cdp-demos" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>GitHub - HeimLabs/coinbase-cdp-demos: A collection of Demo Projects exploring the Coinbase Developer Platform</h2><p>A collection of Demo Projects exploring the Coinbase Developer Platform - HeimLabs/coinbase-cdp-demos</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://github.com</span></div><img src="https://storage.googleapis.com/papyrus_images/2ea1909aeab6f855df4ba295790e269bda5d34f68c6bd85f6a2da37047227163.png"></div></a></div></div><p><strong>HeimLabs Website</strong>:</p><div data-type="embedly" src="https://www.heimlabs.com/?source=post_page-----d4c839ca1688---------------------------------------" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/?source=post_page-----d4c839ca1688---------------------------------------&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4GbSGNF3HlSQbmcqJTjUbV0iV6+PANfLBWGxVgZAUVC8BJTEzwMgASGBCeRxpLYfKmwUkEt1chXGdXNNmOz37OmtKCJ0a3PlDWoxLVifhUPAnzwCyHnwQASGAos0xLdy4jAjacVUvzyDCqqzVhNa56x6NrZnPZQoI11b3Lbulx0j13fYVC2MrO3BPxHCG6IB0X3AaY7kkATYMJAzwU9BnohmElgcLDzgRVipZSwWpVeb1BvyKZ3FLqGSr2v5Dn7OuK/JYfRAt/xkrwj2YYej2Vf9aKLAiyCpZX8C6DAwgd6BmjM+kZfbnzh3LoKtn5+Xo2azOOBEQfH1MpYSCJaoVWuY3TPFVh6KwNvr2+6NnoBjU2gw8nfW2omm5dcjTw2EmudOHsWWfRtFD96F0CBRQBGDx3O1pXoMqpsdJ2XqfRZFwfzaueoSwSQJQQnD1gMWyAW1SrFq6sjF7sHUajore74zZFxFGv9PtGGBl9EuxJo85pr3Vs+3bzhfLapjeD9BwCgDBev6usZfm3wVP8LRw8kTvT1HB3af3IwMXxudKIi0ADgEvLCUlGNXt0Srhg9dAbFulBf1+2hXjRxBY1/hD6+gPoPoh39aP/e2/NcA66s7SpJ/RQAB7MUbFXFax26IDMz4KZDuaaFQe/KgHupVRM0z3qizFfvczbxwY8BKyOXGjWtOfS2UGB468ZfXz+GXkqhr35EY8PfTV5ByVdRfOcf746g1cvGC+y7zNp1/7yBOdF++ETy3NGDo/u6UmuWtaX63zmZer+2crMzq9Nl6VgUHsu1xQXgUUmiSvHK57d/0r7x8/rqM/GdaMfLKPkGOjCABvp+SR66ndr7V3/PjX2J6373HuPMhrsAHEwzQC8Fm0rgMcgKtZRXL/Ub0v1aKl8jypdynSQwBNjFfDaDDM9W1IZKh6KhY0uCqQ114/FNX3Tv/LNz60972n5O7ka9HTfPj6Dr3yAX026cWXffL8LBTIFFznOmcx0yrmMq4NhkXAcBtAD0ONDUjByZqFinjOjl0cfDx2PP/rCl6Upn00Tz4tOp3TeOD6KGyOXG6IVtLRe3No+5s2J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://www.heimlabs.com/?source=post_page-----d4c839ca1688---------------------------------------" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>CDP Discord:</strong></p><div data-type="embedly" src="https://discord.com/invite/coinbase-developer-platform?source=post_page-----d4c839ca1688---------------------------------------" data="{&quot;provider_url&quot;:&quot;https://discord.com&quot;,&quot;description&quot;:&quot;Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.&quot;,&quot;title&quot;:&quot;Discord - Group Chat That's All Fun &amp; Games&quot;,&quot;mean_alpha&quot;:86.3007936508,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://discord.com/invite/coinbase-developer-platform?source=post_page-----d4c839ca1688---------------------------------------&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Discord&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFhElEQVR4nFVRaUxbBRz/vfa9tq/te330eO/1oO1r+3pAV0bpQQ9KYdC1HKMOCrs6mMgEhhsbLAq6sYVtusSI082pLMYM4xGPaTTziFE/bIlH1MzEDx6Jnzy+GKPxi4kJhpIlM/nln/+Hf37XH0DkDmypIQxsvQPR2mwGWoAYkARaa0jVsLkngUTtoKV2H719uRX/F2gmqAxBZYGm/2vkQXTfwZ4C0kAGaAe6oegGWaC0PZSupGcLJmEHiAyQcFsnVJou3MES1mlKfstMnaG/JrBpJLlBpxgBCrW9g1AWSU0/YxisM5ZFsV8US6LQIQhZm5h02GNWwW+t74W6X63q4gxlKNKoZd+M3wQkCeRu19Jcs5yBshuq8RbrkkK5XQ6MuxoH5aa+YLjd7Uu43U2iKHNcvYG1s4w9JMectqDWVNCn3tQ6pmo8MQBRluozqnZskBKx23VHbzceAzIaZjjqPK5WD/SVpuzRXGNLVzyeDTXE3M6wxSxzBo+BlXiTLyQneV5S24aZ+HXUjdUcpwCkVIqBOmqw9gN/TWDzH5sayRpyQM5q2VcYmHK6EtFgV77rwdS2Cz65jzPUcwYPw9YLQjDob+csLsJ9mA6+DvWAmh4A2YmNBqg80BpqqB4+siLaezVsJ8NtI6gMRecUVJ7Wl2hdD9ARcEx0ZIYdtnhjsBhpGfH5Ou22CMe6OE5iOJfZGpQDacbioEIXLG0/QtVDKIsgOgDNALRloH119fq//67PzV0cHTu7tHTl/vufPjL75MIDq8fnnikVFoFOr2M0IGfs1pZwILu1MSNYPHUmia2TGLNHY3SJUrMcSukEN5P4wFr6A4p+ENuBDkC3F/o9UA8Gtkw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quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://discord.com/invite/coinbase-developer-platform?source=post_page-----d4c839ca1688---------------------------------------" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Discord - Group Chat That's All Fun &amp; Games</h2><p>Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://discord.com</span></div><img src="https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png"></div></a></div></div><p>Clap if this saved you hours, and share what you’re building with the CDP stack!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>web3</category>
            <category>web3dev</category>
            <category>base</category>
            <category>buildonbase</category>
            <category>cdp</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/4d5fa47f50330f8969821543b6b45998e147521c5da4bc481f5c0ad008e293c1.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Build a Whale-Watching On-Chain Analytics Tool with the Coinbase SQL API (Node.js Tutorial)]]></title>
            <link>https://paragraph.com/@heimlabs/build-a-whale-watching-on-chain-analytics-tool-with-the-coinbase-sql-api-nodejs-tutorial</link>
            <guid>gUaJMd14bVQtBeAGbCJi</guid>
            <pubDate>Wed, 17 Sep 2025 16:30:39 GMT</pubDate>
            <description><![CDATA[IntroductionWhat’s the biggest bottleneck when building data-rich on-chain apps? It’s not your idea — it’s the engineering headache of getting reliable, queryable blockchain data. For years, developers had two painful choices:Run your own indexing infra (expensive and brittle).Rely on rigid REST endpoints that can’t answer your custom questions.The Coinbase Developer Platform SQL API changes that. It’s a zero-infrastructure, production-grade indexing solution that lets you query live and hist...]]></description>
            <content:encoded><![CDATA[<hr><h3 id="h-introduction" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Introduction</h3><p>What’s the biggest bottleneck when building data-rich on-chain apps? It’s not your idea — it’s the <strong>engineering headache</strong> of getting reliable, queryable blockchain data.</p><p>For years, developers had two painful choices:</p><ol><li><p>Run your own indexing infra (expensive and brittle).</p></li><li><p>Rely on rigid REST endpoints that can’t answer your custom questions.</p></li></ol><p>The <strong>Coinbase Developer Platform SQL API</strong> changes that. It’s a <strong>zero-infrastructure, production-grade indexing solution</strong> that lets you query live and historical blockchain data with SQL — the universal language of developers.</p><p>Today, we’ll explain how it works (and why it’s reorg-proof), then walk through a <strong>hands-on Node.js tutorial</strong> where you’ll build a <strong>“Whale Watcher”</strong> that finds the largest USDC transfers on Base.</p><p><strong>Watch how it works (and why it’s reorg-proof)</strong></p><div data-type="youtube" videoid="aRF8WykTWN0">
      <div class="youtube-player" data-id="aRF8WykTWN0" style="background-image: url('https://i.ytimg.com/vi/aRF8WykTWN0/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=aRF8WykTWN0">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><p><strong>Walk-through a hands-on Node.js tutorial where you’ll build a “Whale Watcher” that finds the largest USDC transfers on Base. Watch here:</strong></p><div data-type="youtube" videoid="e3i5c78UYYc">
      <div class="youtube-player" data-id="e3i5c78UYYc" style="background-image: url('https://i.ytimg.com/vi/e3i5c78UYYc/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=e3i5c78UYYc">
          <img src="https://paragraph.com/editor/youtube/play.png" class="play">
        </a>
      </div></div><h3 id="h-youll-build" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">You’ll&nbsp;Build</h3><ul><li><p><span data-name="gear" class="emoji" data-type="emoji">⚙</span> Bootstrap a Node.js project and connect to the CDP SQL API.</p></li><li><p><span data-name="chains" class="emoji" data-type="emoji">⛓</span> Query blockchain tables (blocks, events) in SQL.</p></li><li><p><span data-name="spouting_whale" class="emoji" data-type="emoji">🐳</span> Build a “Whale Watcher” that finds the biggest USDC transfers.</p></li><li><p><span data-name="bar_chart" class="emoji" data-type="emoji">📊</span> Handle large datasets and API limits like a pro.</p></li></ul><h3 id="h-why-sql-api-matters-explainer" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Why SQL API Matters (Explainer)</h3><p>Blockchains are <strong>living ledgers</strong> — sometimes the network disagrees on the “latest” state. These temporary forks are called <strong>reorgs</strong>.</p><p>For developers, reorgs are brutal: you might show a user a confirmed payment, only for it to vanish when the chain reorganizes.</p><p>The SQL API solves this elegantly with an <strong>action column</strong>:</p><ol><li><p>When a transaction first appears → <code>action = 1</code> (credit). <span data-name="check_mark_button" class="emoji" data-type="emoji">✅</span></p></li><li><p>If it gets dropped in a reorg → a new record with <code>action = -1</code> (debit). <span data-name="cross_mark" class="emoji" data-type="emoji">❌</span></p></li></ol><p>To get the truth, just <strong>SUM(action)</strong>. If the result is &gt; 0, the transaction is valid. No manual reconciliation needed — the API handles it.</p><p>That’s why the SQL API isn’t just another endpoint. It’s your <strong>on-chain data warehouse</strong>.</p><h3 id="h-system-architecture" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">System Architecture</h3><p><strong>Data Flow:</strong></p><pre data-type="codeBlock" text="Developer → SQL API → Blockchain Tables → JSON Result → App Logic"><code>Developer → <span class="hljs-keyword">SQL</span> API → Blockchain Tables → JSON <span class="hljs-keyword">Result</span> → App Logic</code></pre><ul><li><p><strong>SQL API</strong>: Secure endpoint that accepts custom SQL queries.</p></li><li><p><strong>Tables</strong>: <code>base.blocks</code>, <code>base.events</code>, and more.</p></li><li><p><strong>Output</strong>: JSON with schema, rows, and metadata.</p></li><li><p><strong>Your App</strong>: Processes and visualizes the results.</p></li></ul><p>Think of it as BigQuery or Snowflake — but pointed at the blockchain.</p><h3 id="h-step-1-project-setup" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 1: Project&nbsp;Setup</h3><pre data-type="codeBlock" text="mkdir cdp-sql-tutorial &amp;&amp; cd cdp-sql-tutorial
npm init -y
npm install axios dotenv"><code>mkdir cdp<span class="hljs-operator">-</span>sql<span class="hljs-operator">-</span>tutorial <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> cd cdp<span class="hljs-operator">-</span>sql<span class="hljs-operator">-</span>tutorial
npm init <span class="hljs-operator">-</span>y
npm install axios dotenv</code></pre><p>Update <strong>package.json</strong> to mark the project as ESM:</p><pre data-type="codeBlock" text="&quot;type&quot;: &quot;module&quot;"><code><span class="hljs-attr">"type"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"module"</span></code></pre><p>Create a&nbsp;<code>.env</code> file:</p><pre data-type="codeBlock" text="CDP_CLIENT_API_KEY=your-client-api-key"><code>CDP_CLIENT_API_KEY<span class="hljs-operator">=</span>your<span class="hljs-operator">-</span>client<span class="hljs-operator">-</span>api<span class="hljs-operator">-</span>key</code></pre><p>Make sure&nbsp;<code>.env</code> is in your&nbsp;<code>.gitignore</code>.</p><h3 id="h-step-2-first-query-latest-block" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 2: First Query — Latest&nbsp;Block</h3><p>Create <strong>queryApi.js</strong>:</p><pre data-type="codeBlock" text="import axios from 'axios';
import dotenv from 'dotenv';
dotenv.config();

const API_URL = 'https://api.cdp.coinbase.com/platform/v2/data/query/run';
const API_KEY = process.env.CDP_CLIENT_API_KEY;
async function runSqlQuery(sql) {
  const headers = { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' };
  const response = await axios.post(API_URL, { sql }, { headers });
  return response.data;
}
async function main() {
  const query = `
    SELECT block_number, block_hash, timestamp, miner, gas_used, transaction_count
    FROM base.blocks
    ORDER BY block_number DESC
    LIMIT 1
  `;
  const result = await runSqlQuery(query);
  console.log(JSON.stringify(result, null, 2));
}
main();"><code><span class="hljs-keyword">import</span> <span class="hljs-title">axios</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'axios'</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">dotenv</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'dotenv'</span>;
dotenv.config();

const API_URL <span class="hljs-operator">=</span> <span class="hljs-string">'https://api.cdp.coinbase.com/platform/v2/data/query/run'</span>;
const API_KEY <span class="hljs-operator">=</span> process.env.CDP_CLIENT_API_KEY;
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">runSqlQuery</span>(<span class="hljs-params">sql</span>) </span>{
  const headers <span class="hljs-operator">=</span> { Authorization: `Bearer ${API_KEY}`, <span class="hljs-string">'Content-Type'</span>: <span class="hljs-string">'application/json'</span> };
  const response <span class="hljs-operator">=</span> await axios.post(API_URL, { sql }, { headers });
  <span class="hljs-keyword">return</span> response.data;
}
async <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
  const query <span class="hljs-operator">=</span> `
    SELECT block_number, block_hash, timestamp, miner, gas_used, transaction_count
    FROM base.blocks
    ORDER BY block_number DESC
    LIMIT <span class="hljs-number">1</span>
  `;
  const result <span class="hljs-operator">=</span> await runSqlQuery(query);
  console.log(JSON.stringify(result, null, <span class="hljs-number">2</span>));
}
main();</code></pre><p>Run it:</p><pre data-type="codeBlock" text="node queryApi.js
"><code>node queryApi.js
</code></pre><p>✅ You just pulled the latest block on Base.</p><h3 id="h-step-3-whale-watcher-top-usdc-transfers" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 3: Whale Watcher — Top USDC Transfers</h3><p>Append this inside your <code>main()</code> function.</p><pre data-type="codeBlock" text="const usdcContract = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913';

const whaleQuery = `
  SELECT parameters['from']::String AS sender,
         parameters['to']::String AS recipient,
         parameters['value']::UInt256 AS amount
  FROM base.events
  WHERE event_signature = 'Transfer(address,address,uint256)'
    AND address = '${usdcContract}'
  LIMIT 10000
`;
const whaleResult = await runSqlQuery(whaleQuery);
if (whaleResult.result.length &gt; 0) {
  const sorted = whaleResult.result.sort((a, b) =&gt; BigInt(b.amount) - BigInt(a.amount));
  const top5 = sorted.slice(0, 5).map(t =&gt; ({
    sender: t.sender,
    recipient: t.recipient,
    usdc: Number(BigInt(t.amount) / BigInt(1e6)).toLocaleString()
  }));
  console.log('--- Top 5 USDC Transfers ---');
  console.log(top5);
}"><code>const usdcContract <span class="hljs-operator">=</span> <span class="hljs-string">'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'</span>;

const whaleQuery <span class="hljs-operator">=</span> `
  SELECT parameters[<span class="hljs-string">'from'</span>]::String AS sender,
         parameters[<span class="hljs-string">'to'</span>]::String AS recipient,
         parameters[<span class="hljs-string">'value'</span>]::UInt256 AS amount
  FROM base.events
  WHERE event_signature <span class="hljs-operator">=</span> <span class="hljs-string">'Transfer(address,address,uint256)'</span>
    AND <span class="hljs-keyword">address</span> <span class="hljs-operator">=</span> <span class="hljs-string">'${usdcContract}'</span>
  LIMIT <span class="hljs-number">10000</span>
`;
const whaleResult <span class="hljs-operator">=</span> await runSqlQuery(whaleQuery);
<span class="hljs-keyword">if</span> (whaleResult.result.<span class="hljs-built_in">length</span> <span class="hljs-operator">&gt;</span> <span class="hljs-number">0</span>) {
  const sorted <span class="hljs-operator">=</span> whaleResult.result.sort((a, b) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> BigInt(b.amount) <span class="hljs-operator">-</span> BigInt(a.amount));
  const top5 <span class="hljs-operator">=</span> sorted.slice(<span class="hljs-number">0</span>, <span class="hljs-number">5</span>).map(t <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> ({
    sender: t.sender,
    recipient: t.recipient,
    usdc: Number(BigInt(t.amount) <span class="hljs-operator">/</span> BigInt(<span class="hljs-number">1e6</span>)).toLocaleString()
  }));
  console.log(<span class="hljs-string">'--- Top 5 USDC Transfers ---'</span>);
  console.log(top5);
}</code></pre><p>Run again:</p><pre data-type="codeBlock" text="node queryApi.js
"><code>node queryApi.js
</code></pre><p>You’ll see the <strong>biggest whales moving USDC</strong> on Base. <span data-name="spouting_whale" class="emoji" data-type="emoji">🐳</span></p><h3 id="h-step-4-working-with-limits" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Step 4: Working with&nbsp;Limits</h3><p>The SQL API enforces guardrails:</p><ul><li><p><span data-name="stopwatch" class="emoji" data-type="emoji">⏱</span> 30s timeout per query</p></li><li><p><span data-name="bar_chart" class="emoji" data-type="emoji">📊</span> 10,000 rows max</p></li><li><p><span data-name="link" class="emoji" data-type="emoji">🔗</span> Up to 5 JOINs</p></li></ul><p>Pro tip: <strong>paginate by time</strong>. Use <code>WHERE block_timestamp BETWEEN&nbsp;...</code> to fetch daily/weekly chunks.</p><hr><h3 id="h-conclusion" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h3><p>You’ve just:</p><ul><li><p>Learned why the SQL API is reorg-proof.</p></li><li><p>Queried live block data with a few lines of Node.js.</p></li><li><p>Built a whale-watching analytics tool in under 50 lines of code.</p></li></ul><p>This same approach powers dashboards, bots, and monitoring tools. No infra, no indexers — just SQL.</p><hr><h3 id="h-resources-and-links" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Resources &amp;&nbsp;Links</h3><p><strong>Coinbase Developer Docs</strong>:</p><div data-type="embedly" src="https://docs.cdp.coinbase.com" data="{&quot;provider_url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;description&quot;:&quot;Explore our API &amp; SDK references, demos, and guides for building onchain apps.&quot;,&quot;title&quot;:&quot;Coinbase Developer Docs - Coinbase Developer Documentation&quot;,&quot;mean_alpha&quot;:254.698015873,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://docs.cdp.coinbase.com&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Coinbase Developer Documentation&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFgUlEQVR4nGWUa0xaZxzG32WuSz8s6dqlH9yta4zZuqVdt262mVtv61Z7r13vo9rLvHS1Vm213pW1iooOKaKIgoqAPYh4QRAFpIhCQRRU0IBUvFAtCmidOi6V5XBM02QnT07eT7/nyfN/3z9Y9XrdnlerXq/v4HG5XKter9PlWVxy2hzLz+cWzRaHccKmN1k1I9NqnUWumejqM4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uHY3Ef3kk8d3vwkHAcbD9EtgR/kMU5StUacBFwqcXCBtCcX6nivxOFcFDnnMsDumNgyPPRkzP+3TmJwpdu0wrUgzXsGU1jUpirZjMkuNoT4iQMovAS8I2ZxBFf1GlMfmtUbktYdmcC2mskDja/ltVgSjih2fxMPRYATiSD37JhbXq9b6YtT+ub2a3dECNQhpLUMHglVK5ODIn+WE5ppQTl0WOz6JGp5JismqvxJeg4klXkmjIVM8kMg/H1ARHVO4MI20592hDKA6cwILDGPDzQ7APDX7KBj9mA8/q6tTz2ZY2EadVXE6Fqh/zyYxWEo2LIdRl5FEzsfR0LPNmallSAXQxBht2twxNliQU8v9Acy6nsI7H1R64WfX9NXIgigjTjxXAkfehQXAm2J0GdiXDWnG5HS9XrI6l0Unb8NgssnmkarOgx9gsGYHa4IVD4ahLoKd5VGlmqSgRJ4jOaQ7PZCPx99wgb0OVbj5bDGdH6LvTwTf3wfZ7YFs8+DwONrAv+Pb+9Dyy2hRaePMIeozI061u7iexVXiGHEORZhBFCYX8yAdNl1NYJxMY+6Ko34bD5YBTRXAzCP3rJBgdGAu2/gm2RP8HMdkQRNH39DQAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://docs.cdp.coinbase.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Coinbase Developer Docs - Coinbase Developer Documentation</h2><p>Explore our API &amp; SDK references, demos, and guides for building onchain apps.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://docs.cdp.coinbase.com</span></div><img src="https://storage.googleapis.com/papyrus_images/5b28950924e5d2657b565cec702f1b289e3b61126eaec5d8be876a9c768817e5.png"></div></a></div></div><p><strong>HeimLabs</strong>:</p><div data-type="embedly" src="https://heimlabs.com" data="{&quot;provider_url&quot;:&quot;https://www.heimlabs.com&quot;,&quot;description&quot;:&quot;Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.&quot;,&quot;title&quot;:&quot;HeimLabs | Trusted Blockchain Solutions Provider&quot;,&quot;mean_alpha&quot;:77.734079602,&quot;thumbnail_width&quot;:1920,&quot;url&quot;:&quot;https://www.heimlabs.com/&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Heimlabs&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:1005,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEt0lEQVR4nJ2Ue0xTdxTHD7W3j3t7b1ta2tpaatvbclvbUtoCpbcIdUhBWkFm62OCG/gAFiK4aX0wATvAaZWpDFCH3eyUzLk4N8aCRsfizJzGBJc9SBazZcteZo8Yp1myJb8F0W0m/jFNvn+cnJyczzn5/c4XRJD1CCLBSoJDBB4SvGSaDwc/ASwBPgLyCXATYCeBma6Eh29tE4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J6Ze0DDg0H8x2Z7gXmO0maALOYY5PhXo2klFZFGxsubU+gpqcuL5935L0T6MtJ9NlVdPpNVBM6Vc4OephtVkOjVh75v1aBg4kAhuI4FAJWLSo1KRcF53Y/WXcpyPYW2WPHhtHX36Jbt9AHH6Kq+QP5lpiLaaHVK2bJwg9ndiQwEo49HXMpCXaWJEArQ7Syyp65Ipd5unntWGfHpN8Zc9L1RlVEmx5SEEUSfsEjuKmFAms6N0chLFDgPjVVpBEHMiUlRmW5QVGWKS1RksUqUaEUyxenZVMwBwgwP5oosIo5DinHKeG674rnEXNcEk42BVYCsqbL/gZ0R39X+sv98wAAAABJRU5ErkJggg==&quot;,&quot;img&quot;:{&quot;width&quot;:1920,&quot;height&quot;:1005,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://heimlabs.com" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>HeimLabs | Trusted Blockchain Solutions Provider</h2><p>Revolutionize your business with HeimLabs' blockchain development solutions. Our expert team offers end-to-end services for smart contracts, DApps &amp; more.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://www.heimlabs.com</span></div><img src="https://storage.googleapis.com/papyrus_images/654f563366c4f3e2312c1d913b725e02cde675fef9ec4ab7d82094a8a1c2a712.png"></div></a></div></div><p><strong>CDP Discord:</strong></p><div data-type="embedly" src="https://discord.com/invite/coinbase-developer-platform" data="{&quot;provider_url&quot;:&quot;https://discord.com&quot;,&quot;description&quot;:&quot;Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.&quot;,&quot;title&quot;:&quot;Discord - Group Chat That's All Fun &amp; Games&quot;,&quot;mean_alpha&quot;:86.3007936508,&quot;thumbnail_width&quot;:1200,&quot;url&quot;:&quot;https://discord.com/invite/coinbase-developer-platform&quot;,&quot;thumbnail_url&quot;:&quot;https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png&quot;,&quot;version&quot;:&quot;1.0&quot;,&quot;provider_name&quot;:&quot;Discord&quot;,&quot;type&quot;:&quot;link&quot;,&quot;thumbnail_height&quot;:630,&quot;image&quot;:{&quot;base64&quot;:&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAIAAAAzPjmrAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFhElEQVR4nFVRaUxbBRz/vfa9tq/te330eO/1oO1r+3pAV0bpQQ9KYdC1HKMOCrs6mMgEhhsbLAq6sYVtusSI082pLMYM4xGPaTTziFE/bIlH1MzEDx6Jnzy+GKPxi4kJhpIlM/nln/+Hf37XH0DkDmypIQxsvQPR2mwGWoAYkARaa0jVsLkngUTtoKV2H719uRX/F2gmqAxBZYGm/2vkQXTfwZ4C0kAGaAe6oegGWaC0PZSupGcLJmEHiAyQcFsnVJou3MES1mlKfstMnaG/JrBpJLlBpxgBCrW9g1AWSU0/YxisM5ZFsV8US6LQIQhZm5h02GNWwW+t74W6X63q4gxlKNKoZd+M3wQkCeRu19Jcs5yBshuq8RbrkkK5XQ6MuxoH5aa+YLjd7Uu43U2iKHNcvYG1s4w9JMectqDWVNCn3tQ6pmo8MQBRluozqnZskBKx23VHbzceA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zjO51nutjkmQQxNbVj4+/9X1Gz9J8jmCO0+Kl2nvNX/yS538vlZ+R+V+nhCWnOpS1r64K/91tfyDruE9Pv2rLf/PUN/Lnzx29trCuUcqy8bkN9gonanCcADU/hOl2VJkD1RjJHuAoqYyoc+LlVsK4Qxpu6zxvUr731C6HzNK54z10yqx0ugbKzasMcyzD3R+m2hcU2gu2gp/O+9ab+t6/YWlytrJQ2s7h0z5W4C6H/QgtCPQ7dMaqlp2H8HcrdTfo2SmrY5LDVteIZ0XVM6rutC7huabXOILU/o7vv1nMf+7kP9N5b5KOi5x8mtK8ZIh+plzcN21a928/VZncbHQc6I9d07s/eU/2bI9+eg2cSYAAAAASUVORK5CYII=&quot;,&quot;img&quot;:{&quot;width&quot;:1200,&quot;height&quot;:630,&quot;src&quot;:&quot;https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png&quot;}}}" format="small"><link rel="preload" as="image" href="https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png"><div class="react-component embed my-5" data-drag-handle="true" data-node-view-wrapper="" style="white-space:normal"><a class="link-embed-link" href="https://discord.com/invite/coinbase-developer-platform" target="_blank" rel="noreferrer"><div class="link-embed"><div class="flex-1"><div><h2>Discord - Group Chat That's All Fun &amp; Games</h2><p>Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.</p></div><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link h-3 w-3 my-auto inline mr-1"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>https://discord.com</span></div><img src="https://storage.googleapis.com/papyrus_images/fd5daf4cc4569214cd87e650d89285a0aac548020f1d6734eaffa8b0add2160e.png"></div></a></div></div><p>Clap if this saved you hours, and share what you’re building with the CDP stack!</p><p><strong>Follow HeimLabs</strong> for unapologetically practical Web3 dev content.<br><a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://x.com/heimlabs">Twitter</a>, <a target="_blank" rel="noopener ugc nofollow noopener noopener noopener noopener" class="dont-break-out markup--anchor markup--p-anchor" href="https://www.linkedin.com/company/heimlabs">LinkedIn</a>.</p><p>Happy Building <span data-name="rocket" class="emoji" data-type="emoji">🚀</span></p>]]></content:encoded>
            <author>heimlabs@newsletter.paragraph.com (HeimLabs)</author>
            <category>web3</category>
            <category>coinbase</category>
            <category>cdp</category>
            <category>base</category>
            <category>buildonbase</category>
            <category>sql</category>
            <category>api</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/e3f9b2743b2aa229595d2e9c79cc9d425ccf8bf54fa61d876a1bb082168f70fa.jpg" length="0" type="image/jpg"/>
        </item>
    </channel>
</rss>