<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Krrish Sehgal on Medium]]></title>
        <description><![CDATA[Stories by Krrish Sehgal on Medium]]></description>
        <link>https://medium.com/@krrishsehgal03?source=rss-1247ae2b25b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hzYC5hCg0AGKbHnXkD--5A.png</url>
            <title>Stories by Krrish Sehgal on Medium</title>
            <link>https://medium.com/@krrishsehgal03?source=rss-1247ae2b25b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:08:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krrishsehgal03/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Keep and Grow]]></title>
            <link>https://medium.com/@krrishsehgal03/keep-and-grow-f369708f1dc7?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f369708f1dc7</guid>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 12:45:43 GMT</pubDate>
            <atom:updated>2026-08-11T12:45:43.694Z</atom:updated>
            <content:encoded><![CDATA[<p>Maybe you were never just the bird,<br>and maybe I was never just the string.</p><p>Maybe we both got tangled<br>somewhere along the way,<br>lost in things we couldn’t understand.</p><p>You say you were left with wounds,<br>but maybe wounds don’t always mean<br>the story has to end there.</p><p>Maybe the kite forgot the string,<br>maybe the bird forgot how to fly.</p><p>But somehow,<br>we found our way back.</p><p>Maybe some things aren’t<br>use and throw.</p><p>Maybe some things are<br>keep and grow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f369708f1dc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating the Value-for-Value Economy]]></title>
            <link>https://medium.com/@krrishsehgal03/automating-the-value-for-value-economy-46a03d8e5aee?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/46a03d8e5aee</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[albyhub]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[nostr]]></category>
            <category><![CDATA[lightning-network]]></category>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Fri, 24 Oct 2025 18:54:14 GMT</pubDate>
            <atom:updated>2025-10-24T18:54:14.333Z</atom:updated>
            <content:encoded><![CDATA[<p>The “value-for-value” model, where users directly support creators, is a cornerstone of decentralized social protocols like Nostr. This support is often sent via “zaps” — small Bitcoin Lightning payments. However, as the network grows, manually finding and rewarding high-quality content becomes a significant bottleneck.</p><p>The <strong>ZapCampaign-MCP</strong> project offers a fascinating solution. It’s a server that bridges the gap between AI agents, the Nostr protocol, and the Bitcoin Lightning network. It allows a user (or an AI agent) to automatically discover, analyze, and reward Nostr content, transforming a manual, hours-long process into an automated, minutes-long task.</p><p>This post explores the technical architecture, features, and unique payment flows of this innovative project.</p><h3>Core Concepts &amp; Technologies</h3><p>To understand ZapCampaign-MCP, you first need to grasp its three main pillars:</p><ol><li><strong>Nostr:</strong> A simple, open, and decentralized social protocol. Think of it as a set of relays that pass JSON-based messages (called “notes” or “posts”) between users, identified by public keys.</li><li><strong>Bitcoin Lightning Zaps:</strong> A standard for sending micro-payments (tips) over the Bitcoin Lightning Network, commonly integrated into Nostr clients.</li><li><strong>MCP (Model Context Protocol):</strong> A protocol that allows AI models and agents to interact with external tools and services. An “MCP Server” like this one exposes a set of capabilities (e.g., “fetch posts,” “send zap”) that an AI agent can discover and use.</li><li><strong>@getalby/paidmcp</strong>: This is the core of making the tools paid. It&#39;s an Alby-provided library (or &quot;middleware&quot;) that I&#39;ve wrapped around my AI tools. It <em>automatically</em> requests a payment from your client <em>before</em> my tool will run. This is the mechanism that enforces the 1-sat fee.</li></ol><p>The project itself is a <strong>TypeScript</strong>-based MCP server designed to be used with an MCP client like <strong>Goose Desktop</strong>. It uses the <strong>Google Gemini API(since free) </strong>for its AI capabilities and <strong>Alby’s Nostr Wallet Connect (NWC)</strong> to handle all Bitcoin payments.</p><p>Here is a technical blog post draft based on the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMIYDm9oa58LrYTvOugK5g.png" /></figure><h3>Key Features</h3><p>The server’s functionality is exposed through a series of MCP tools that an AI agent can call. The primary tools include:</p><ul><li><strong>fetchPosts</strong>: Queries Nostr relays to find posts based on filters like hashtags (e.g., #Bitcoin) or user public keys.</li><li><strong>scorePosts</strong>: This is the AI core. It takes a list of post IDs, fetches their content, and uses the <strong>Google Gemini API</strong> to assign a quality score from 0-100, providing a detailed breakdown for its reasoning.</li><li><strong>analyzeContent</strong>: Another AI-powered tool that performs sentiment analysis, topic extraction, and audience identification on a set of posts.</li><li><strong>smartFilter</strong>: A powerful batch tool that uses AI to categorize a large list of posts into &quot;high&quot;, &quot;medium&quot;, &quot;low&quot; or &quot;spam&quot; quality tiers.</li><li><strong>createCampaign</strong>: Prepares a payment campaign (e.g., &quot;Zap 100 sats to the top 5 posts&quot;).</li><li><strong>executeCampaign</strong>: The final step that executes the campaign, using the Alby NWC to send the zaps to the designated Nostr creators.</li></ul><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUUb8P2-yIj5w9-doaqgag.png" /></figure><h3>The AI-Powered Payment Flow</h3><p>The most interesting technical aspect of this project is its micro-payment and incentive model. It uses two different sets of wallets: one for the server operator (to get paid for AI costs) and one for the end-user (to pay for campaigns).</p><p>Here is the flow:</p><ol><li><strong>Operator Setup:</strong> The person running the ZapCampaign-MCP server adds their <strong>Google Gemini API Key</strong> and an <strong>Alby/Lightning wallet NWC String</strong> to their environment variables.</li><li><strong>User Setup:</strong> An end-user adds the ZapCampaign-MCP server as an extension in their Goose Desktop client. They <em>also</em> add the official <strong>Alby MCP</strong> extension, linking it to their <em>own</em> funded Alby wallet for <em>sending</em> payments.</li><li><strong>The AI Tool Fee:</strong> When the user’s AI agent decides to use a paid tool (like scorePosts), the ZapCampaign server states its price (e.g., 1 sat). The user&#39;s Goose client, via the Alby MCP, automatically pays this 1-sat fee to the <em>server operator&#39;s</em> NWC wallet.</li><li><strong>AI Execution:</strong> Once paid, the ZapCampaign server executes the function, calling the Google Gemini API (using the operator’s key) and returning the results (e.g., the quality scores).</li><li><strong>The Campaign Payment:</strong> When the user executes a campaign (e.g., “Zap 200 sats to 5 posts”), the user’s Alby MCP pays the 1,000 sats (200 x 5) <em>directly</em> from the user’s wallet to the Lightning addresses of the 5 Nostr creators.</li></ol><p>The server operator covers the AI API costs and is compensated with a small micro-payment, while the user retains full control over their campaign budget, paying creators directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v04CJD6p65ak6_-JDoWtTQ.png" /></figure><h3>Use Cases &amp; Conclusion</h3><p>This project moves beyond simple bot-like automation. It enables sophisticated, AI-driven strategies for community engagement.</p><ul><li><strong>Company Campaigns:</strong> A company can run a #BitcoinBuilder hashtag campaign and automatically zap the top 10 highest-quality posts daily, all for a few sats in AI fees.</li><li><strong>Creator Curation:</strong> A creator can find all posts discussing #Nostr with a positive sentiment and a quality score above 80, then send them all a 50-sat zap as thanks.</li><li><strong>Market Analysis:</strong> An agent could be tasked to “Fetch 20 posts each for #Bitcoin and #Lightning, score them all, and tell me which hashtag has higher-quality discussion right now,&quot; costing only 2 sats for the analysis.</li></ul><p>ZapCampaign-MCP is a perfect example of the new, composable economy. It combines decentralized social (Nostr), permissionless payments (Bitcoin Lightning), and intelligent automation (AI via MCP) into a single, powerful tool. It’s a template for a future where AI agents can actively and economically participate in human social networks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46a03d8e5aee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Clear Bitcoin Goals with the GROW Model by Bitvocation]]></title>
            <link>https://medium.com/@krrishsehgal03/setting-clear-bitcoin-goals-with-the-grow-model-by-bitvocation-077d9e2bea1e?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/077d9e2bea1e</guid>
            <category><![CDATA[bitcoin-wallet]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Mon, 06 Oct 2025 05:12:44 GMT</pubDate>
            <atom:updated>2025-10-06T05:12:44.261Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Jobtober: Setting Clear Bitcoin Goals with the GROW Model</strong></p><p>Jobtober’s Day 3 theme was about setting clear goals using the <strong>GROW model</strong> (Goal, Reality, Options, Will). Here’s how I’m applying it to my own Bitcoin journey.</p><h3>Goal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*2m_iS82OHS1SilZgEuorBA.jpeg" /></figure><p>My main goal for Jobtober is to keep <strong>learning more about Bitcoin and the Lightning Network, contribute effective PRs on </strong><a href="https://github.com/krrish-sehgal"><strong>GitHub</strong></a><strong>, and document my journey through technical writing</strong>. Along the way, I want to make my <a href="https://krrishsehgal.vercel.app/">website</a> and resume more Bitcoin-oriented.</p><p>More broadly, I want to use Jobtober as a way to cut through the noise and truly become part of the signal in the Bitcoin space.</p><p>I’ll measure success if I can:</p><ul><li>Stay consistent in interacting with the Bitcoin community</li><li>Support others where I can</li><li>Land a few bounties along the way to sustain my work</li></ul><h3>Reality</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*VKxQYGAnYTrPjvz9wOQxYw.jpeg" /></figure><p>Right now, I’m still at the beginning of building visibility in the Bitcoin ecosystem. I don’t have a huge number of Bitcoin connections yet, but I’ve made progress:</p><ul><li>Since April, I’ve been contributing to <strong>Caravan multisig vault</strong></li><li>I cracked <strong>Summer of Bitcoin internship in Unchained-Caravan</strong></li><li>Over the past two weeks, I’ve been <strong>insanely active on GitHub</strong>, contributing to both <strong>Alby</strong> and <strong>Caravan</strong></li></ul><p>This tells me I’m moving in the right direction, but I still need to grow my presence, connections, and consistency.</p><h3>Options</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uY3uNuM_CqQfctbu-3KqYg.jpeg" /></figure><p>To close the gap between where I am and where I want to be, I see a few clear options:</p><ul><li>Join more Bitcoin communities and stay active in them</li><li>Contribute more PRs to open-source projects like Alby and Caravan</li><li>Follow and connect with more Bitcoiners online</li><li>Share my learnings regularly — especially by writing and posting about Bitcoin concepts I’m picking up</li></ul><h3>Will (Way Forward)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GghICqAYFeuacEdPeFD_-w.png" /></figure><p>Here’s my commitment for Jobtober:</p><ul><li>Build visibility on <strong>Twitter (X)</strong> and <strong>LinkedIn</strong> by following more Bitcoin developers and interacting with their work</li><li><strong>Post more consistently on Twitter</strong>, sharing short Bitcoin-related glossary terms and insights I learn every day</li><li>Engage with Bitcoin devs to collaborate, contribute, and grow my proof of work</li></ul><p>These steps may look small, but stacked consistently over time, they’ll help me carve out a stronger presence in the Bitcoin community.</p><p>That’s my plan. Now it’s time to get to work — one glossary post, one PR, and one connection at a time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=077d9e2bea1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2025 Journey : AI-Driven Blockchain Rewards System and Gamification]]></title>
            <link>https://medium.com/@krrishsehgal03/gsoc-2025-journey-ai-driven-blockchain-rewards-system-and-gamification-78a6d54d07e3?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/78a6d54d07e3</guid>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 09:14:01 GMT</pubDate>
            <atom:updated>2025-08-26T09:27:57.643Z</atom:updated>
            <content:encoded><![CDATA[<h3>GSoC 2025 Journey : AI-Driven Blockchain Rewards System and Gamification</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TTNmTgbWEyAYchOwtIXIPw.jpeg" /></figure><p>Hi! I’m <strong>Krrish Sehgal</strong>, a 19-year-old Computer Science undergraduate from India. I’m passionate about <strong>Web3, AI, and open source software</strong>. This summer, I had the incredible opportunity to contribute to <strong>OWASP</strong> <strong>BLT </strong>(Bug Logging Tool) through <strong>Google Summer of Code (GSoC)</strong> 2025.</p><p>Over the last few months, I worked on integrating <strong>blockchain-powered features</strong> into OWASP’s BLT (Bug Logging Tool) ecosystem — spanning across <strong>Bitcoin Ordinals, Runes, Solana</strong>, and even AI-driven enhancements.</p><p>This blog serves as my final GSoC report, where I’ll walk through everything I contributed, the milestones achieved, and what’s next for the project.</p><h3>🔑 At a Glance: My Contributions</h3><ul><li><strong>45 merged PRs</strong> in the main <a href="https://github.com/OWASP-BLT/BLT">BLT repository</a> 👉 <a href="https://github.com/OWASP-BLT/BLT/pulls?q=is%3Apr+is%3Amerged+author%3Akrrish-sehgal">View all here</a></li><li><strong>4 merged PRs</strong> in <a href="https://github.com/OWASP-BLT/BLT-Action">BLT-Action</a> 👉 <a href="https://github.com/OWASP-BLT/BLT-Action/pulls?q=is%3Apr+is%3Amerged+author%3Akrrish-sehgal">View all here</a></li><li><strong>3 merged PRs</strong> in <a href="https://github.com/OWASP-BLT/BLT-Flutter">BLT-Flutter</a> 👉 <a href="https://github.com/OWASP-BLT/BLT-Flutter/pulls?q=is%3Apr+is%3Amerged+author%3Akrrish-sehgal">View all here</a></li><li><strong>Deployed the BACON token</strong> on <strong>Bitcoin Ordinals/Runes and Solana :</strong></li><li><a href="https://ordinals.com/inscription/9ebf269d5b73ade615e439cbb0ed6427697672e7c60b761dc2e566f4a5a80050i0">Ordinals inscription</a></li><li><a href="https://explorer.solana.com/address/mntjJdXMvLkALMnyYFsdvxUnFXjLzLPpiNQwQSC58BL">Solana deployment link</a></li><li><a href="https://medium.com/@krrishsehgal03/how-to-deploy-runes-and-ordinals-on-bitcoin-84a387abe678">Runes deployment blog</a></li></ul><h3>🚀 GSoC Project Milestones</h3><p>My GSoC project revolved around extending OWASP BLT with <strong>tokenized engagement systems</strong> and improving user experience. Here’s a breakdown:</p><h3>1. Deploying BACON Token on Ordinals and Solana</h3><ul><li>Implemented token deployment on <strong>Bitcoin Ordinals</strong> and <strong>Solana SPL tokens</strong>.</li><li>This formed the backbone of the project — enabling BACON to serve as a reward mechanism for contributors.</li><li>PRs: <a href="https://github.com/OWASP-BLT/BLT/pull/4136">BLT #4136</a> &amp; <a href="https://github.com/OWASP-BLT/BLT/pull/4288">BLT #4288</a></li><li>Deployed Tokens: <a href="https://ordinals.com/inscription/9ebf269d5b73ade615e439cbb0ed6427697672e7c60b761dc2e566f4a5a80050i0">Bitcoin Runes</a> &amp; <a href="https://explorer.solana.com/address/mntjJdXMvLkALMnyYFsdvxUnFXjLzLPpiNQwQSC58BL">Solana</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*I1YXLY0gyW8OBTKnNo1Vaw.jpeg" /></figure><h3>2. Integrating BACON into OWASP BLT</h3><ul><li>Brought BACON token support into the BLT ecosystem.</li><li>Allowed users to claim tokens as rewards for solving issues, writing blogs, or participating in challenges.</li><li>PR: <a href="https://github.com/OWASP-BLT/BLT/pull/4368">BLT #4368</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JF9h6f6XJWvF9qf4actHsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPPMvQISFgQ2s1TdzPfPBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*sz1mnBugNNPhUcsYdiXoBw.png" /></figure><h3>3. Enhancing UI/UX for Token Claims</h3><ul><li>Built <strong>leaderboards and challenge claim flows</strong> to gamify contributions.</li><li>Designed token claim UI for a smoother and more engaging contributor experience.</li><li>PR: <a href="https://github.com/OWASP-BLT/BLT/pull/4445">BLT #4445</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5Dxj9DsW1gKeKhMJACBVw.png" /></figure><h3>4. AI-Based Scoring System</h3><ul><li>Implemented an <strong>AI scoring system</strong> to evaluate blogs, issues, and suggestions.</li><li>This reduced manual evaluation and helped scale contributor recognition.</li><li>PR: <a href="https://github.com/OWASP-BLT/BLT/pull/4398">BLT #4398</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*TfIg-PnE_xN0jUZaa1KMNQ.png" /></figure><h3>5. Automating BACON Token Distribution</h3><ul><li>To Build an <strong>automation pipeline</strong> to distribute BACON tokens to contributors.</li><li>Currently paused due to Bitcoin mainnet node and Ordinals server are also paused due to high cost, but will resume as adoption grows.</li></ul><h3>6. Enabling Staking for Bounties &amp; Challenges</h3><ul><li>Implemented staking functionality so users can stake BACON for challenge participation.</li><li>This adds skin-in-the-game mechanics to the ecosystem.</li><li>PR: <a href="https://github.com/OWASP-BLT/BLT/pull/4461">BLT #4461</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HLzlc1qvO8FdWuDc7AV3vw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oVeJEONuSgyY5tc6wIjL1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Stoa6dSk90zdtthqfalAyw.png" /></figure><h3>7. Documentation</h3><ul><li>Authored a detailed guide on <strong>deploying Ordinals and Runes on Bitcoin</strong>, which would help others replicate the process.</li><li>Blog: <a href="https://medium.com/@krrishsehgal03/how-to-deploy-runes-and-ordinals-on-bitcoin-84a387abe678">How to Deploy Runes and Ordinals on Bitcoin</a></li></ul><h3>8. Additional Bug Fixes</h3><ul><li>Contributed to maintaining the overall stability of the projects by fixing various bugs.</li><li><a href="https://github.com/OWASP-BLT/BLT/pull/4501">https://github.com/OWASP-BLT/BLT/pull/4501</a></li><li><a href="https://github.com/OWASP-BLT/BLT/pull/4509">https://github.com/OWASP-BLT/BLT/pull/4509</a></li></ul><h3>📚 What I Learned</h3><p>One of the best parts of GSoC was how much I got to <strong>explore and learn</strong> beyond just writing code.</p><ul><li><strong>Bitcoin Ordinals</strong> → I learned how the Ordinals protocol works under the hood — how data (like runes and inscriptions) can be attached directly to individual satoshis. This gave me an understanding of how Bitcoin is evolving beyond a payment network into a programmable layer, and the practical challenges of running Bitcoin mainnet nodes for such deployments.</li><li><strong>Solana</strong> → While deploying the BACON token on Solana, I studied its unique infrastructure. I learned about Solana’s <strong>account-based model</strong>, how programs interact with accounts, and how ownership is structured differently compared to EVM chains. I also explored the <strong>Solana SDK</strong>, token standards, and transaction flows, which gave me a strong foundation for building future Solana-based apps.</li><li><strong>Non-Custodial Wallets</strong> → I researched how non-custodial wallets work, where the user remains in control of their private keys. I learned how to integrate them into apps, handle secure transaction signing, and design flows where the backend never touches sensitive data. This was critical for building trust in decentralized ecosystems.</li><li><strong>Staking</strong> → While adding staking functionality to BLT challenges, I gained insights into how staking creates commitment and accountability. I explored how staking ties into <strong>tokenomics</strong>, adds game-theory mechanics, and builds more sustainable incentive systems in Web3 applications.</li></ul><p>👉 These learnings helped me bridge theory and practice, and gave me real-world experience with <strong>Bitcoin, Solana, wallets, and tokenomics</strong> — knowledge I’ll carry forward into future open-source and blockchain projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78a6d54d07e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy Runes and Ordinals on Bitcoin]]></title>
            <link>https://medium.com/@krrishsehgal03/how-to-deploy-runes-and-ordinals-on-bitcoin-84a387abe678?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/84a387abe678</guid>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 04:42:55 GMT</pubDate>
            <atom:updated>2025-08-26T04:42:55.753Z</atom:updated>
            <content:encoded><![CDATA[<p>Ordinals and Runes are two innovative protocols built on top of Bitcoin. Ordinals allow users to “inscribe” data (like NFTs) directly onto individual satoshis, while Runes introduce a fungible token standard on Bitcoin.</p><p>To run them yourself, you need:</p><ul><li>A fully synced <strong>Bitcoin Core node (mainnet)</strong></li><li>The <strong>ord indexer</strong> to track inscriptions/runes</li><li>The <strong>ord server</strong> to expose a REST API and explorer</li></ul><p>This guide takes you from a <strong>fresh Ubuntu server</strong> all the way to a <strong>running Ordinals &amp; Runes explorer</strong>.</p><h3>1. System Requirements</h3><p>Running Ordinals requires a <strong>full archival Bitcoin node</strong> (pruning disabled).</p><ul><li><strong>Disk:</strong> 1 TB SSD (as of 2025, Bitcoin blockchain &gt; 600 GB and growing).</li><li><strong>RAM:</strong> 16 GB recommended.</li><li><strong>CPU:</strong> Modern 4+ core CPU.</li><li><strong>OS:</strong> Ubuntu 20.04 / 22.04.</li></ul><h3>2. Install Bitcoin Core</h3><p>We’ll install Bitcoin Core from the official binaries.</p><h3>Environment Variables</h3><pre>export ARCH=x86_64<br>export BITCOIN_VERSION=27.0   # check https://bitcoincore.org/bin/ for latest<br>export BITCOIN_URL=https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${ARCH}-linux-gnu.tar.gz<br>export BITCOIN_DATA_DIR=/blockchain/bitcoin/data</pre><h3>Create User</h3><pre>sudo mkdir -p /opt/bitcoin/${BITCOIN_VERSION}<br>sudo mkdir -p ${BITCOIN_DATA_DIR}<br>sudo tar -xzvf bitcoin-${BITCOIN_VERSION}-${ARCH}-linux-gnu.tar.gz -C /opt/bitcoin/${BITCOIN_VERSION} --strip-components=1 --exclude=*-qt<br>sudo ln -s /opt/bitcoin/${BITCOIN_VERSION} /opt/bitcoin/current<br>sudo rm -rf /tmp/*<br>sudo chown -R bitcoin:bitcoin ${BITCOIN_DATA_DIR}</pre><h3>Dependencies</h3><pre>sudo apt update<br>sudo apt install -y ca-certificates gnupg gpg wget jq</pre><h3>Download &amp; Verify</h3><pre>cd /tmp<br>wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc<br>wget -qO bitcoin-${BITCOIN_VERSION}-${ARCH}-linux-gnu.tar.gz &quot;${BITCOIN_URL}&quot;<br>sha256sum bitcoin-${BITCOIN_VERSION}-${ARCH}-linux-gnu.tar.gz</pre><p>(Compare with the hash inside SHA256SUMS.asc).</p><h3>Extract</h3><pre>sudo mkdir -p /opt/bitcoin/${BITCOIN_VERSION}<br>sudo mkdir -p ${BITCOIN_DATA_DIR}<br>sudo tar -xzvf bitcoin-${BITCOIN_VERSION}-${ARCH}-linux-gnu.tar.gz -C /opt/bitcoin/${BITCOIN_VERSION} --strip-components=1 --exclude=*-qt<br>sudo ln -s /opt/bitcoin/${BITCOIN_VERSION} /opt/bitcoin/current<br>sudo rm -rf /tmp/*<br>sudo chown -R bitcoin:bitcoin ${BITCOIN_DATA_DIR}</pre><h3>3. Configure Bitcoin Core</h3><p>Create the config file (mainnet, <strong>no pruning</strong>).</p><pre>cat &gt; bitcoin.conf.tmp &lt;&lt; EOF<br>datadir=${BITCOIN_DATA_DIR}<br>server=1<br>txindex=1<br>rpcallowip=127.0.0.1<br>rpcuser=${BITCOIN_RPC_USER:-bitcoin}<br>rpcpassword=${BITCOIN_RPC_PASSWORD:-$(openssl rand -hex 24)}<br>[main]<br>rpcbind=127.0.0.1<br>rpcport=8332<br>EOF</pre><p><strong>Move config in place:</strong></p><pre>sudo mv bitcoin.conf.tmp $BITCOIN_DATA_DIR/bitcoin.conf<br>sudo chown bitcoin:bitcoin $BITCOIN_DATA_DIR/bitcoin.conf<br>sudo ln -sfn $BITCOIN_DATA_DIR /home/bitcoin/.bitcoin<br>sudo chown -R bitcoin:bitcoin /home/bitcoin</pre><h3>4. Run Bitcoin Core as a Service</h3><pre>cat &gt; bitcoind.service &lt;&lt; EOF<br>[Unit]<br>Description=Bitcoin Core Mainnet<br>After=network.target</pre><pre>[Service]<br>User=bitcoin<br>Group=bitcoin<br>WorkingDirectory=${BITCOIN_DATA_DIR}<br>Type=simple<br>ExecStart=/opt/bitcoin/current/bin/bitcoind -conf=$BITCOIN_DATA_DIR/bitcoin.conf</pre><pre>[Install]<br>WantedBy=multi-user.target<br>EOF</pre><pre>sudo mv bitcoind.service /etc/systemd/system/bitcoind.service<br>sudo systemctl daemon-reload<br>sudo systemctl enable bitcoind<br>sudo systemctl start bitcoind</pre><p>Check logs:</p><pre>sudo journalctl -fu bitcoind</pre><h3>5. Wait for Full Sync</h3><p>The <strong>Initial Block Download (IBD)</strong> will take hours/days. You can monitor progress:</p><pre>bitcoin-cli -getinfo</pre><p>Once synced (progress=1.000000), move forward.</p><h3>6. Install Ordinals</h3><p>Ordinals requires <strong>Rust</strong>.</p><h3>Install Rust</h3><pre>curl --proto &#39;=https&#39; --tlsv1.2 -sSf https://sh.rustup.rs | sh<br>source $HOME/.cargo/env</pre><h3>Clone &amp; Build Ord</h3><pre>git clone https://github.com/ordinals/ord.git<br>cd ord<br>cargo build --release</pre><p>Binary will be at: ./target/release/ord</p><h3>7. Setup Ordinals Index</h3><p>Ord uses the same Bitcoin data directory. You must run it against <strong>your synced Bitcoin Core</strong>.</p><pre>ord --bitcoin-data-dir=$BITCOIN_DATA_DIR --index-sats --index-runes --index-transactions</pre><p>This creates the Ordinals index database. It will take a long time on first run.</p><h3>8. Run Ord Server</h3><p>Once indexing is complete, start the explorer API:</p><pre>ord server</pre><p>By default it runs on <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080</a>.</p><p>You can now:</p><ul><li>View inscriptions</li><li>Explore satoshis</li><li>Query runes</li></ul><h3>9. Running Ord as a Systemd Service (Optional)</h3><p>If you want ord to run in background:</p><pre>cat &gt; ord.service &lt;&lt; EOF<br>[Unit]<br>Description=Ordinals Indexer &amp; Server<br>After=network.target bitcoind.service</pre><pre>[Service]<br>User=bitcoin<br>ExecStart=/home/bitcoin/ord/target/release/ord server --bitcoin-data-dir=$BITCOIN_DATA_DIR --index-sats --index-runes --index-transactions<br>Restart=always</pre><pre>[Install]<br>WantedBy=multi-user.target<br>EOF</pre><pre>sudo mv ord.service /etc/systemd/system/ord.service<br>sudo systemctl daemon-reload<br>sudo systemctl enable ord<br>sudo systemctl start ord</pre><h3>10. Verify</h3><ul><li>Bitcoin Node RPC:</li></ul><pre>bitcoin-cli getblockchaininfo</pre><ul><li>Ord server: open browser → <a href="http://localhost:8080/">http://localhost:8080</a></li></ul><h3>✅ Conclusion</h3><p>You now have:</p><ul><li>A <strong>full Bitcoin Core mainnet node</strong></li><li><strong>Ordinals &amp; Runes indexer</strong></li><li>A running <strong>ord server</strong> to explore inscriptions/tokens</li></ul><p>This setup allows you to run your own Bitcoin NFT + Rune explorer, without depending on third-party services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84a387abe678" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding BCURv2 Air-Gapped Hardware Wallet Support in Caravan]]></title>
            <link>https://medium.com/@krrishsehgal03/adding-bcurv2-air-gapped-hardware-wallet-support-in-caravan-5234fa3b1ab4?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5234fa3b1ab4</guid>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Mon, 18 Aug 2025 06:36:46 GMT</pubDate>
            <atom:updated>2025-08-19T01:48:17.358Z</atom:updated>
            <content:encoded><![CDATA[<p>This summer, I had the opportunity to work on <a href="https://www.caravanmultisig.com/#/"><strong>Caravan</strong></a>, an open-source project maintained by <a href="https://www.unchained.com/">Unchained Capital</a>, as part of <a href="https://www.summerofbitcoin.org/"><strong>Summer of Bitcoin</strong></a>.</p><p>Caravan is a stateless multisig coordinator for Bitcoin wallets, and my project focused on <strong>adding support for BC-UR v2 (Blockchain Commons Uniform Resources v2).</strong></p><p>Air-gapped hardware wallets rely on QR codes to securely exchange information with software coordinators. With BCURv2, we get a standardized and more efficient way to transmit Bitcoin data such as extended public keys (xpubs) and Partially Signed Bitcoin Transactions (PSBTs). By bringing BCURv2 support into Caravan, we make it easier for users to interact with modern hardware wallets like <strong>SeedSigner</strong> and <strong>Keystone</strong>, while keeping their keys fully offline.</p><h3>My Contributions:</h3><p>Over the course of the program, I worked on five main areas:</p><h4>1. Xpub Export via BCURv2</h4><p>I implemented support for <strong>exporting extended public keys (xpubs) using BCURv2</strong>. This allows users to import their hardware wallet’s public keys into Caravan securely via animated QR codes.<br> 🔗 <a href="https://github.com/caravan-bitcoin/caravan/pull/299">PR #299</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SChoNSa7yAN7rs2C6VfA7Q.png" /></figure><h4>2. BCURv2 Testing Framework</h4><p>To ensure correctness and reliability, I added a comprehensive <strong>test suite for BCURv2 implementation</strong> inside caravan-wallets. This included parsing and validating BCURv2-encoded payloads and making sure the round-trip encoding/decoding worked as expected.<br> 🔗 <a href="https://github.com/caravan-bitcoin/caravan/pull/315">PR #315</a></p><h4>3. Dependency Injection in Decoder Tests</h4><p>I refactored the decoder tests using a <strong>dependency injection pattern</strong>, making the test setup more modular and easier to extend. This ensures that future developers can plug in different BCUR decoders or test cases without breaking existing functionality.<br> 🔗 <a href="https://github.com/caravan-bitcoin/caravan/pull/328">PR #328</a></p><h4>4. PSBT Signing with BCURv2</h4><p>The next milestone was enabling <strong>PSBT signing</strong> via BCURv2. This lets users sign Bitcoin transactions on air-gapped devices and re-import the signatures back into Caravan via QR codes. I extended the test suite to validate this end-to-end flow.<br> 🔗 <a href="https://github.com/caravan-bitcoin/caravan/pull/353">PR #353</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bz2vM7U8IJO739nT8IfYw.png" /><figcaption>Options to fully sign a PSBT</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*auxstOompVjnSzMFu7S5oQ.png" /><figcaption>Export PSBT through a QR to sign</figcaption></figure><h4>5. Integration into the Caravan Website</h4><p>Finally, I integrated <strong>xpub export and PSBT signing via BCURv2 into Caravan’s main web app</strong>. With this, Caravan now officially supports <strong>air-gapped hardware wallets</strong>, making it possible to fully coordinate multisig wallets without ever connecting the signing device to a computer.<br> 🔗 <a href="https://github.com/caravan-bitcoin/caravan/pull/363">PR #363</a></p><h3>Impact</h3><p>With these changes, Caravan users can:<br> ✅ Import xpubs from BCURv2-compatible devices<br> ✅ Export and sign PSBTs via animated QR codes<br> ✅ Coordinate multisig transactions entirely offline<br> ✅ Use a growing ecosystem of BCURv2-enabled hardware wallets</p><p>This work helps strengthen Caravan’s role as a <strong>device-agnostic, open-source coordinator</strong>, lowering reliance on USB-connected devices and enabling safer, more versatile multisig setups.</p><h3>Recognition from SeedSigner</h3><p>Since my work was focused on <strong>integrating BCURv2 QR support into Caravan</strong>, it naturally aligned with SeedSigner’s mission of enabling secure, air-gapped Bitcoin transactions. After I contributed BCURv2 features to Caravan, SeedSigner gave me a shoutout on Twitter for the integration work 🎉.</p><p>It was motivating to see how my contributions not only improved Caravan but also resonated with the wider Bitcoin open-source community. I even wrote a separate blog post about this experience:<br> 👉 <a href="https://medium.com/@krrishsehgal03/how-i-got-a-shoutout-from-seedsigner-for-my-work-on-bc-ur-v2-qr-support-in-caravan-04ff2c1bca55">How I Got a Shoutout from SeedSigner for My Work on BCURv2 QR Support in Caravan</a></p><h3>Swags for Midterm Evaluation</h3><p>As a fun bonus, all contributors who cleared the <strong>midterm evaluation</strong> in Summer of Bitcoin received official SoB swags — a small but meaningful reminder of the journey and the community spirit behind it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*gv56i8SBKcDCNF2LMgXFjw.png" /><figcaption>SoB Swags</figcaption></figure><h3>Acknowledgements</h3><p>I’m grateful to my mentors from <strong>Caravan</strong> and the <strong>Summer of Bitcoin</strong> community for guiding me throughout this project. It was a rewarding experience to contribute to Bitcoin’s open-source ecosystem and work on something that improves real-world user security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5234fa3b1ab4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Got a Shoutout from SeedSigner for My Work on BC-UR v2 QR Support in Caravan]]></title>
            <link>https://medium.com/@krrishsehgal03/how-i-got-a-shoutout-from-seedsigner-for-my-work-on-bc-ur-v2-qr-support-in-caravan-04ff2c1bca55?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/04ff2c1bca55</guid>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 20:15:12 GMT</pubDate>
            <atom:updated>2025-08-18T06:39:40.487Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Built BC-UR v2 Xpub Export for Caravan and Got Recognized By SeedSigner</h3><p>Working on open-source projects is incredibly rewarding — not just for the learning, but also for the unexpected encouragement from contributors you respect. One such moment that made my week was getting a public shoutout from a fellow Bitcoin project maintainer for my work on <a href="https://www.caravanmultisig.com/#/">Caravan</a>, a multisig coordination tool built by Unchained Capital.</p><p>This is a breakdown of the contribution that led to it: <strong>adding BC-UR v2 QR decoding support</strong>, specifically for crypto-hdkey and crypto-account types, along with animated QR parsing—all tightly integrated into Caravan’s wallet package.</p><h3>⚙️ Background: What is BC-UR v2 and Why Caravan Needed It</h3><p><a href="https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-urtypes.md">BC-UR v2</a> (Blockchain Commons UR) is a stateless binary QR encoding protocol optimized for transmitting structured crypto data like PSBTs, xpubs, and signatures — especially useful on air-gapped hardware wallets like SeedSigner or Keystone.</p><p>While Caravan already had robust multisig and PSBT capabilities, it lacked modern QR interoperability. Devices like SeedSigner, which use animated QR codes, were hard to integrate cleanly. That’s where I saw a gap.</p><h3>🔍 Step 1: Building a Decoder from Scratch</h3><p>The first challenge was to build a <strong>modular decoder</strong> that could parse animated BC-UR v2 QRs in real time and extract structured data like:</p><ul><li>Extended public keys (crypto-hdkey)</li><li>PSBTs (crypto-psbt)</li><li>Partially signed transactions or signatures (crypto-output)</li></ul><p>To do this, I:</p><ol><li><strong>Studied the BC-UR registry types</strong>, specifically the schemas in <a href="https://github.com/KeystoneHQ/bc-ur-registry">@keystonehq/bc-ur-registry</a>.</li><li>Created a decoder class, BCURDecoder2, that abstracts away:</li></ol><ul><li>Fragmented animated QR reassembly (based on sequence numbers)</li><li>Registry-type identification</li><li>Parsing of data payload into usable structures (e.g., xpub → fingerprint + path + key)</li></ul><p>This became the basis of <a href="https://github.com/caravan-bitcoin/caravan/pull/299">PR #299</a>.</p><h3>🛠️ Refactoring the Architecture</h3><p>Initially, QR logic was scattered across multiple UI components. I modularized the codebase so that decoding logic sits in a reusable bcur2 directory inside caravan-wallets.</p><p>This allowed:</p><ul><li><strong>Reusability</strong> for both PSBT import and xpub scanning</li><li><strong>Simplified frontend logic</strong>: UI just feeds QR fragments into the decoder and reacts to the result</li><li><strong>Separation of concerns</strong> between animation decoding, type parsing, and user workflows</li></ul><h3>🧪 Testing and Validation</h3><p>To prevent regressions, I wrote unit tests using vitest, mocking out bc-ur-registry inputs. This helped validate corner cases like:</p><ul><li>Out-of-order QR fragments</li><li>Corrupted sequences</li><li>Multiple valid types in one scanning session</li></ul><h3>💡 Real Win: Supporting SeedSigner and Keystone Seamlessly</h3><p>This work directly enabled animated QR interoperability in Caravan. Users could now:</p><ul><li>Scan xpubs exported from SeedSigner or Keystone</li></ul><h3>🔈 The Shoutout That Made It Worth It</h3><p>Shortly after the PR landed, a maintainer from SeedSigner gave me a shoutout for the work</p><p>It was validating because:</p><ul><li>It showed the code was understandable and reusable</li><li>It encouraged adoption of QR-based workflows in other projects</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*CfJ1YjjV4Ajrz-wLAV0yvg.png" /></figure><h3>📦 What I Learned</h3><ul><li><strong>Spec-level understanding</strong> is key when working with binary protocols like BC-UR</li><li><strong>Refactoring early</strong> saved me from spaghetti QR logic later on</li><li><strong>Small contributions compound</strong> — this feature now powers multiple workflows</li></ul><h3>📌 Final Thoughts</h3><p>If you’re contributing to an open-source project and see a missing link — don’t hesitate to build it. Even if it starts small (a decoder class, a QR handler), it can evolve into something the whole ecosystem benefits from.</p><p>And who knows? You might just get a shoutout that reminds you you’re on the right path.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04ff2c1bca55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Cracked Google Summer of Code and Summer of Bitcoin]]></title>
            <link>https://medium.com/@krrishsehgal03/how-i-cracked-google-summer-of-code-and-summer-of-bitcoin-all-in-my-second-year-of-college-aa399093ca14?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa399093ca14</guid>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Wed, 21 May 2025 18:50:33 GMT</pubDate>
            <atom:updated>2025-05-21T18:51:38.557Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Hi, I’m Krrish Sehgal — a tech head and curious builder. In my 4th semester of college, I achieved something I once thought was nearly impossible: I got selected for both <strong>Google Summer of Code (GSoC)</strong> and <strong>Summer of Bitcoin (SoB)</strong> — two of the most prestigious open-source fellowships in the world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_s9NdAwlv3ZP_JdCTNuJZg.png" /><figcaption>-Napolean Hill (Change money to offer-letter tho)</figcaption></figure><p>What’s more surprising? I didn’t have a long open-source history. What I did have was curiosity, consistency, and a deepening love for building useful things. This blog shares how I got here — what worked, what didn’t, and how you can do it too, even if you’re starting from zero.</p><h3>How My Journey Started and What was it Like?</h3><h4>The GSoC Discovery</h4><p>I first heard about GSoC through <a href="https://www.youtube.com/@ApnaCollegeOfficial">Apna College</a>. By January 2024, I was <em>trying</em> to explore it — but with <strong>zero serious dev experience</strong>. Sure, I knew basic HTML/CSS/JS, but that alone won’t get you far in open source.</p><p>Instead of applying half-heartedly, I made a decision: <strong>focus on building and learning first</strong>.</p><p>Even though I didn’t apply in 2024, seeing LinkedIn posts of first-year students getting in made me aware of what’s possible — but I knew I had made the right call for myself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*G3An9fRjDOaHQRfc2L0q1A.png" /></figure><h4>Setting Goals &amp; Getting Obsessed</h4><p>Fast forward to October 2024: during my second internship, I hit a moment of personal reflection (I chickened out of talking to someone I wanted to), and that triggered a weird but effective motivation. I told myself, “If I can’t do that, at least let me start working towards something meaningful.”</p><p>So I got up, sat down, and started looking for GSoC organizations. I found one with a Django codebase — something I knew nothing about — but also it had a semi-active Flutter project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gFp1HTsNsfbeCyySrOnCAQ.jpeg" /></figure><p><a href="https://github.com/OWASP-BLT/BLT-Flutter/pull/461">My first ever merged contribution</a>? A Flutter feature related to copy-paste functionality. I learned how <strong>Flutter communicates with native Kotlin using method channels</strong>. That one merge gave me the confidence to keep going.</p><p>A couple of weeks in, my GSoC org released a <a href="https://github.com/OWASP-BLT/BLT/issues/2916">leaderboard</a>. It showed top contributors, and I went back to previous year leaderboard and noticed someone who cracked GSoC 2024 had <strong>50–60 PRs</strong> merged. That’s when I set a mental goal:</p><blockquote>I’ll get at least 40–50 PRs in before May.</blockquote><p>That’s when the obsession kicked in.</p><p>Each PR felt like a kill in Fortnite or a perfect Wu Shang combo in Brawlhalla. From breaking my head over failing test cases to finally seeing that purple merge button — <strong>the dopamine hits were real</strong>.</p><h4>Taking on Tougher Issues</h4><p>One major turning point was when I worked on a <a href="https://github.com/OWASP-BLT/BLT-Flutter/pull/464"><strong>call-blocking extension</strong></a> in Flutter for the OWASP BLT app. It needed deep native integration — something Flutter alone couldn’t handle. I had to dive into Swift for the <a href="https://github.com/OWASP-BLT/BLT-Flutter/pull/465">iOS side</a>. It took 10–11 hours daily for a week.</p><p>Another feature was a <strong>plagiarism detection mode</strong>, <a href="https://github.com/OWASP-BLT/BLT/pull/3160">integrating OpenAI</a>. I even <a href="https://github.com/OWASP-BLT/BLT/pull/3134">started with Hugging Face</a> but later pivoted due to size issues. This forced me to learn about <strong>vector comparisons</strong> and <strong>algorithmic matching</strong> — a super technical(concepts like abstract syntax trees, Levenshtein distance or difflib) and satisfying experience.</p><p>When I’d get stuck, I’d remind myself:</p><blockquote>“If I don’t solve this one specific problem, I’m not going to make it — so stop whining and fix it.”</blockquote><h3>The Bitcoin Chapter: Ordinals, Runes, and Mainnet Nodes</h3><p>In January, I pushed myself to pick a challenge that no one else had solved in my GSoC org: <strong>deploying a token on the Bitcoin blockchain using the new Ordinals + Runes protocol</strong> (released April 2024).</p><p>It was one of the toughest things I’ve ever done. I ran four servers synced to the Bitcoin mainnet, one on regtest, and another running an Ordinals server. I dove deep into how <a href="https://github.com/ordinals/ord">Ordinals</a> and Bitcoin internals work, even reaching out to core maintainers like Greg, ETS, and Json on the Ordicord Discord server to get everything up and running.</p><p>Eventually, on <strong>Feb 21, 2025 @ 22:40:11 UTC</strong>, I successfully etched my token. That experience? Mind-blowing. <a href="https://ordinals.com/inscription/9ebf269d5b73ade615e439cbb0ed6427697672e7c60b761dc2e566f4a5a80050i0"><em>(Link to token proof here)</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*I1YXLY0gyW8OBTKnNo1Vaw.jpeg" /></figure><p>This deep dive sparked my interest in Bitcoin. And just when I thought I’d take a breather, I saw a LinkedIn post:</p><blockquote>“Summer of Bitcoin applications are open!”</blockquote><h3>The Summer of Bitcoin Journey</h3><p>I applied for SoB the very next day. The entry process involved solving <strong>3 technical challenges</strong>, each with a 1-week deadline.</p><p>The tasks were amazing — they taught me about:</p><ul><li>How Bitcoin transactions are formed</li><li>SegWit</li><li>Multisig wallets</li><li>And more low-level transaction logic</li></ul><p>Since I already had experience deploying a Bitcoin node for my GSoC org project, <strong>Challenge 1 (setting up regtest)</strong> was a breeze.</p><p>I completed all three in two weeks and was selected for the next round. They were the hardest two weeks up until then because it involved a lot of learning on the go about the bitcoin blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*9tbI88NZPc24VDt6hlPQPA.jpeg" /></figure><h3>Picking the Right Org for SoB in the Proposal Round</h3><p>By March, my GSoC selection felt locked in. But I had <em>no motivation</em> left for SoB. Life threw in some perspective again, and I realized if I didn’t start contributing, I wouldn’t have a good proposal.</p><h4>Finding Unchained-Caravan</h4><p>I started again with only 3 weeks left for proposal submission deadline and explored all the listed SoB orgs and shortlisted based on two things:</p><ol><li>Number of projects under each org</li><li>Complexity and fit for me as a dev</li></ol><p>Caravan had 3 projects and relatively <strong>less competition</strong>. It was a <strong>monorepo with both packages and a website</strong>, which was ideal. I began contributing to the website, then gradually shifted to the core package.</p><p>But none of my early PRs were eye-catching. So I made a <strong>bold move</strong>:</p><blockquote>I started building the entire proposed project myself.</blockquote><p>Within a week, I pushed 2 working but unrefined <a href="https://github.com/caravan-bitcoin/caravan/pull/246">PRs</a> that covered 4<strong>0% of the one of the project proposal</strong> listed under Caravan.</p><p>The code wasn’t pretty — but it worked. And that’s what open source is about. Someone could’ve even used my code in their proposal — and I’d have been totally fine with it. That’s the beauty of community-driven building.</p><h3>The Final Results</h3><p><strong>May 5, 8:30 PM:</strong> I was at the gym, just about to hit a leg press set. I checked my email —</p><blockquote>I got selected for Summer of Bitcoin.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8361h7kvyN98ruOPI1SlWA.png" /></figure><p>I was so pumped I had the best workout of my life.</p><p><strong>May 8, 11:35 PM:</strong> I got the GSoC result. I was already confident by February when my token was etched. Seeing that final confirmation was just the cherry on top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_227_Ejgx7VP2PRo-TIKOw.png" /></figure><h3>How I Searched and Selected Organizations (GSoC and SoB)</h3><p>I went full detective mode.</p><p>For GSoC, I connected with people on LinkedIn and just <strong>kept asking questions</strong> — how they chose their orgs, what tech stacks they used, how they contributed. Then I explored those orgs myself and often landed on different projects within the same org.</p><p>For Summer of Bitcoin, it was even more intense. I had much less time, so I relied heavily on willpower. I listed all the organizations and chose the one I genuinely enjoyed working with — one that had a tech stack I was somewhat familiar with, an active community, and relatively less competition. I had to learn Bitcoin concepts from scratch and quickly build something meaningful.</p><p>Some tips:</p><ul><li>Use <a href="https://www.gsocorganizations.dev/">gsocorganisations.dev </a>to explore orgs based on tech stack, difficulty, and history.</li></ul><h3>How to Write a Strong Proposal (Especially for SoB)</h3><p>One word: <strong>Contributions</strong>.</p><p>Your proposal is secondary — <strong>your code speaks louder</strong>. That’s what worked for me in both cases.</p><p>Sure, I’ve seen people get selected with 4–5 contributions and killer proposals — but not in the orgs I was in. They all expected meaningful code contributions <em>first</em>.</p><p>So if you’re spending hours tweaking the formatting of your proposal and haven’t merged a PR yet — <strong>rethink your priorities</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa399093ca14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Secured ML Models for Real-Time Authentication on Browsers]]></title>
            <link>https://medium.com/@krrishsehgal03/how-we-secured-ml-models-for-real-time-authentication-on-browsers-3411ae40bc05?source=rss-1247ae2b25b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3411ae40bc05</guid>
            <category><![CDATA[man-in-the-middle-attack]]></category>
            <category><![CDATA[security-machine-learning]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <category><![CDATA[uidai-problem]]></category>
            <category><![CDATA[frontend-authentication]]></category>
            <dc:creator><![CDATA[Krrish Sehgal]]></dc:creator>
            <pubDate>Sat, 21 Dec 2024 08:50:50 GMT</pubDate>
            <atom:updated>2024-12-21T09:05:44.814Z</atom:updated>
            <content:encoded><![CDATA[<p>Securing sensitive operations at the frontend is crucial, whether it’s transferring ML models for browser-based authentication or protecting any data and logic. The system design outlined below ensures secure transfer and execution of ML models while being adaptable for any use case requiring frontend security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*EEpQnQ1sT1V3Gj7UBv-m_A.jpeg" /></figure><p>This approach prevents unauthorized access, protects sensitive data, and eliminates man-in-the-middle (MITM) attacks using encryption, digital signatures, and secure communication protocols. It ensures data integrity, confidentiality, and authenticity, making it suitable for ML applications, financial systems, and other critical frontend processes.</p><h3>Step 1: Backend Setup — CIDR, Secure Key Management and Model Upload</h3><p>The first step involved managing sensitive keys and securely storing machine learning models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*y5ERa0kGZNUj-uh5quwRNA.png" /></figure><ol><li><strong>Generating the RSA Key Pair</strong>:</li></ol><p>An RSA key pair was generated to enable secure signing of model hashes for digital signature verification(more on this is explained below). This ensured only authorised parties could modify models or data.</p><p>2. <strong>Uploading to S3</strong>:</p><p>A CI/CD pipeline using GitHub Actions automated the process of uploading models and the private RSA key to S3. To maintain security, the pipeline ensured sensitive files were removed from the repository after upload.</p><p>3. <strong>KMS Encryption in S3</strong>:</p><p>AWS Key Management Service (KMS) was used to encrypt and decrypt sensitive files automatically, ensuring secure storage and restricted access to authorised environments.</p><p>4. <strong>Versioning System</strong>:</p><p>A versioning system was implemented to trigger the pipeline only when changes were made to the versions file, ensuring efficient deployment and avoiding unnecessary uploads.</p><p>5. <strong>Cloning the CIDR<br></strong>MongoDB was used to simulate the Central Identities Data Repository (CIDR), allowing us to work with a realistic representation of the system. This simulation demonstrated how the solution could be seamlessly integrated with the actual CIDR in production.</p><h3>Step 2: Secure Model Transfer from Backend to Frontend</h3><p>The second step involved session management and securely running the models on the frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8U8NetDEx8wKs5CtNvySBw.png" /></figure><ol><li><strong>OTP Verification and Session Creation:</strong></li></ol><p>The process started with verifying the OTP through Aadhaar to ensure user authenticity. After OTP verification, a session was created to maintain secure communication between the frontend and backend.</p><p>2. <strong>Frontend Key Pair Generation</strong>:</p><p>The frontend generated an ECDH key pair, securely storing the private key in the cache and sending the public key to the backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*ZV847En-IypV4TMAhcJC0A.png" /></figure><p><strong>3. Backend Receives Frontend Request:</strong></p><ul><li><strong>Digital signature: </strong><br>- The backend retrieves all models from S3, which are automatically decrypted via KMS, and combines their buffers into a single large buffer.<br>- A SHA hash is generated from the combined buffer and signed with the backend’s private RSA key, creating a digital signature.<br>- After signing, the private RSA key is discarded to prevent any potential exposure.</li><li><strong>Model Encryption</strong>: <br>- To securely transfer the models, the backend uses the Diffie-Hellman Key Exchange (DHKE) for encryption.<br>- The backend generates an ECDH key pair and, using its private key and the frontend’s public ECDH key, derives a shared secret, which is then used to generate an AES encryption key.<br>- The AES key is used to encrypt the models.</li><li><strong>Response:</strong><br>- The encrypted models, backend’s ECDH public key (for DHKE decryption), and the digital signature are sent to the frontend.</li></ul><p>This step was essential to securely transfer models from the backend to the frontend while ensuring both confidentiality and integrity. The Diffie-Hellman key exchange provided encryption, and digital signatures will ensure that the models are tamper-proof and verifiable. The next challenge was enabling the frontend to decrypt and utilize the models for face liveness detection.</p><h3>Step 3: Frontend Decryption and Model Usage</h3><p>The third step involved generating the aes key for decrypting the models on frontend and running them securely for liveness detection ,anti-spoofing and further for face verification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*m9FUbBEjr8uoJNvS16XnVQ.png" /></figure><ol><li><strong>Decrypting the Models:</strong></li></ol><ul><li>The frontend uses the same algorithm used by backend (DHKE) to securely decrypt the models.</li><li>By combining its private ECDH key with the backend’s public ECDH key, the frontend generates a shared secret.</li><li>The AES key derived from this shared secret allows the frontend to decrypt the models, ensuring secure transfer.</li></ul><p><strong>2. Storing Encrypted Models:<br></strong> Encrypted models are securely stored in the frontend’s cache, ensuring quick access without compromising security.</p><p><strong>3. Model Scripts Obfuscation:</strong></p><p>Scripts interacting with the models were pre-obfuscated to prevent reverse engineering and protect the system’s functionality.</p><p><strong>4. Liveness Detection and Anti-Spoofing</strong>:</p><p>The models on the frontend are used for liveness detection and anti-spoofing. The user’s image is sent to a Flask API for authentication, with the results validated against the CIDR records using the Aadhaar number.</p><p><strong>5. Face Verification and Request Forwarding</strong>:<br>Once the user is verified, the frontend sends the request to the backend, which includes the changes the user wants to make, along with the models SHA hash used for liveness detection and anti-spoofing for digital signature verification.</p><h3>Step 4: Backend Verification for Authentication</h3><p>The fourth step involved verifying the digital signatures to detect model tampering, authenticating the user, and applying any profile changes submitted by the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytPL8eGyBlMvnPN_XGfbEQ.png" /></figure><ol><li><strong>Digital Signature Verification:</strong></li></ol><ul><li>The backend verifies the digital signature received from the frontend to ensure the integrity of the models. This is done by comparing the SHA hash from the frontend with the digital signature, using the backend’s RSA public key (corresponding to the private key used for signing).</li><li>If the verification fails (indicating tampering), the backend <strong>rejects the authentication request</strong> and does not update the CIDR.</li></ul><p>2. <strong>Successful Verification</strong></p><p>Once the digital signature and model versions are verified, the user is authenticated and authorized to update their CIDR profile and access other features on the website.</p><h3>Step 5: Scaling and Deployment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6rCsVlVpyrCL8XpfhMBwQ.png" /></figure><ol><li><strong>AWS Instance and Domain Setup:</strong></li></ol><ul><li>Launched an <strong>AWS EC2 instance</strong> to host the backend services.</li><li>Purchased and configured a custom domain, ensuring secure transmission using <strong>HTTPS</strong> via SSL/TLS certificates.</li></ul><p><strong>2. Reverse Proxy with Nginx:</strong></p><ul><li>Configured <strong>Nginx</strong> as a reverse proxy to handle incoming traffic efficiently and securely.</li><li>Ensured that it serves as a gateway between clients and the backend services, improving scalability and security</li></ul><p><strong>3 .Frontend Deployment with AWS Amplify:</strong></p><ul><li>Deployed the frontend application on <strong>AWS Amplify</strong>, leveraging its automatic deployment capabilities.</li><li>Set up a CI/CD pipeline to trigger deployments automatically after every push to the GitHub repository.</li></ul><p><strong>4. Monitoring and Metrics:</strong></p><ul><li>Integrated <strong>Prometheus</strong> for collecting application metrics and performance data.</li><li>Used <strong>Grafana</strong> for visualizing these metrics, ensuring real-time monitoring of system health and identifying potential bottlenecks.</li></ul><h3>An Optimized Scaling Approach Not Implemented Due to Time Constraints</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*jH08gPup0e2m0pRn0Asbfw.png" /></figure><ol><li><strong>Containerization with Docker:</strong></li></ol><ul><li>Create Docker images for backend microservices, encapsulating the application and dependencies to ensure portability, scalability, and streamlining deployments.</li></ul><p>2.<strong> AWS Elastic Container Registry (ECR):</strong></p><ul><li>Storing Docker images in AWS ECR for seamless access and integration during deployment processes.</li></ul><p>3. <strong>Kubernetes Orchestration with EKS:</strong></p><ul><li>Used Amazon Elastic Kubernetes Service (EKS) to orchestrate Docker containers.</li><li>Manage load balancing across multiple pods for high availability by using auto-healing mechanisms in Kubernetes</li><li>Ensure reliability under heavy traffic with automated cluster management.</li></ul><h4><strong>Ending Remarks:</strong></h4><p>This system was specifically designed for UIDAI’s Problem Statement 1670 for Smart India Hackathon 2024 and emerged as the winner for that PSID. It showcases how sensitive operations, such as running ML models in browsers, can be secured against tampering and unauthorized access.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3411ae40bc05" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>