<?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 Abhinav Patra on Medium]]></title>
        <description><![CDATA[Stories by Abhinav Patra on Medium]]></description>
        <link>https://medium.com/@abhinavpatra?source=rss-f45ec6fda22d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wRsk6qFdr_kJyTzy</url>
            <title>Stories by Abhinav Patra on Medium</title>
            <link>https://medium.com/@abhinavpatra?source=rss-f45ec6fda22d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:30:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhinavpatra/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[what are all these options you get when you do an npm create vite@latest]]></title>
            <link>https://abhinavpatra.medium.com/what-are-all-these-options-you-get-when-you-do-an-npm-create-vite-latest-e64c03cddf90?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e64c03cddf90</guid>
            <category><![CDATA[vites]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 10:00:58 GMT</pubDate>
            <atom:updated>2026-11-16T10:00:58.977Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*MLzdmGcWoCzJsyVEnv3MAg.png" /></figure><p>After the obvious project name, and then selecting the framework we get the following options</p><h3>Frameworks</h3><p>Vanilla is the basic format, with no packages or any other jsx or tsx format, just a basic outlay with some js files and standard engine</p><p>Vue is obviously the Vue.js framework, you’ll be surprised how many websites still use and run on this, surprisingly high tbh.</p><p>Preact is a super fast and lightweight 3kb version of React, which barely has any Virtual DOM as the layer, and uses the modern React API but with minimal weight and featues. preactjs.com</p><p>Lit : lite.dev,</p><p>Svelte is kindof a popular UI framework, using the SvelteKit for the build and is based on the simple html, css, js logic, and is relatively easier to navigate if you are from that world.</p><p>No clue about: Solid, Ember, Qwik and Marko</p><p>AngularJS lets you extend on the capabilities of the standard HTML features, with custom attributes, it is extremely light as well, and used to be quite popular back in the day</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*DUn27-YQ2McN9Mv3L8HizQ.png" /></figure><p>We can divide all these variants in two options :</p><h3>1. Client-Side / Base Vite Templates</h3><p>These create a standard Single Page Application (SPA) where everything runs in the browser unless you configure the server yourself.</p><p><strong>TypeScript:</strong> Standard React setup with TypeScript for static type-checking. Best for most standard SPAs where you want to pick your own libraries later.</p><p><strong>TypeScript + React Compiler:</strong> The same as above, but pre-configured with the <strong>React Compiler</strong> (a build-time tool that automatically optimizes re-renders so you rarely need useMemo or useCallback).</p><p><strong>JavaScript:</strong> Plain React with standard JavaScript — no type-checking or extra build plugins. Good for quick prototypes or beginners.</p><p><strong>JavaScript + React Compiler:</strong> Plain JavaScript with the React memoization compiler enabled.</p><p><strong>RSC (React Server Components):</strong> An experimental/minimal Vite template pre-configured to use React Server Components, allowing components to render and fetch data directly on the server.</p><h3>2. Routing &amp; Full-Stack Frameworks</h3><p>Selecting any of these exits Vite’s basic generator and runs that specific framework’s official CLI starter.</p><p><strong>React Router v7 :</strong> The merged evolution of React Router and Remix. It works either as a client-side router or as a full-stack framework featuring file-based routing, Server-Side Rendering (SSR), and loader &amp; action functions for data and form handling.</p><p><strong>TanStack Start : </strong>A full-stack React framework powered by Vite and Nitro. It offers standard SSR, streaming, and type-safe server functions, making it ideal if you already use TanStack Query or want strict end-to-end TypeScript inference, also TanStack offers a lot of other libraries and Tanstack is very framework agnostic so if you use Tanstack then it’s a great handle to have on.</p><p><strong>TanStack Router : Aclient-side</strong> router (unlike TanStack Start, it doesn&#39;t include a backend server layer). Famous for 100% type-safe routing and built-in, validated URL search-parameter management.</p><p><strong>RedwoodSDK : </strong>A server-first React framework built specifically for <strong>Cloudflare</strong> (Workers, D1, etc.). It includes React Server Components, server functions, and real-time sync capabilities out of the box.</p><p><strong>Vike : </strong>A modular, unopinionated SSR/SSG framework. It lets you choose your own architecture—allowing you to mix static pages, SSR, and client-side rendering per page while plugging in whatever data-fetching or state tools you prefer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e64c03cddf90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minting, Updating, Transferring and Burning: A Full Solana Devnet Lifecycle in 10 Scripts]]></title>
            <link>https://abhinavpatra.medium.com/minting-updating-transferring-and-burning-a-full-solana-devnet-lifecycle-in-10-scripts-08f02a07eaba?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/08f02a07eaba</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[solana-network]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Thu, 05 Nov 2026 10:02:39 GMT</pubDate>
            <atom:updated>2026-11-05T10:03:29.356Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong><em>Summary :</em></strong><em> I built the complete lifecycle of two on-chain assets on Solana devnet: a fungible SPL token (create → metadata → mint → transfer) and an MPL Core NFT (upload image → upload metadata → mint → update → transfer → burn), all using runnable TypeScript scripts.</em></blockquote><blockquote><em>This post covers what I built, some of the things I learned along the way, and why the seemingly boring parts of Solana development — rent, signers, storage, and account management — are actually quite interesting.</em></blockquote><h3>Why this was made?</h3><p>Most Solana tutorials stop at showing you how to mint a token or an NFT. But I suspect the teachers also wanted us to understand what happens beyond that.</p><ul><li>What happens after minting when you want to change the NFT’s name?</li><li>Who actually needs to sign when an NFT changes hands?</li><li>What happens to the rent when you burn an NFT?</li><li>Where does the image actually live, and who pays for storing it?</li></ul><p>I went through the entire lifecycle rather than just complete the minting step.</p><p>So I broke the implementation into a sequence of small scripts. Each script performs one operation and logs the address or transaction signature needed by the next one.</p><p>In total, that’s 10 scripts covering five tasks, all using a single wallet initially.</p><p>Everything runs on the devnet, and the final on-chain state can be verified using the transaction signatures included at the end.</p><h3>The five tasks</h3><p>#TaskScripts1Create and mint an SPL token, then transfer itspl_init → spl_metadata → spl_mint → spl_transfer2Mint an NFT using MPL Corenft_image → nft_metadata → nft_mint3Update the NFT name and metadatanft_update4Transfer NFT ownershipnft_transfer5Burn the NFT and reclaim rentnft_burn</p><h3>Part 1 — Creating and transferring an SPL token</h3><h3>1. Creating the mint account</h3><p>A mint is essentially an account owned by the Token Program that stores information about a token, including its decimals and authorities.</p><p>Creating one involves two instructions in the same transaction.</p><p>First, I generated a new keypair for the mint account:</p><pre>const mint = await generateKeyPairSigner(true);</pre><p>Then I created the account and initialized it as a mint:</p><pre>const createAccountIx = getCreateAccountInstruction({<br>  payer: signer,<br>  newAccount: mint,<br>  lamports: await rpc.getMinimumBalanceForRentExemption(BigInt(space)),<br>  space: getMintSize(),          // 82 bytes<br>  programAddress: TOKEN_PROGRAM_ADDRESS,<br>});</pre><pre>const initializeMintIx = getInitializeMintInstruction({<br>  mint: mint.address,            // note: NOT a signer here<br>  decimals: 6,<br>  mintAuthority: signer.address,<br>  freezeAuthority: signer.address,<br>});</pre><p><strong>Lesson 1 — The mint keypair only signs </strong><strong>create_account.</strong></p><p>I initially assumed that initialize_mint would also require the mint account to sign.</p><p>It doesn’t.</p><p>The generated instruction types make this clear: mint is an Address, not a TransactionSigner. The account is writable, but it doesn&#39;t need to sign the initialization instruction.</p><p>The mint keypair signs once to prove that it is creating the account. After that, the mint authority (my wallet) is responsible for signing future minting operations.</p><h3>2. Attaching metadata</h3><p>Creating the mint account isn’t enough if you want the token to have a name, symbol, and metadata.</p><p>For this, I used the Token Metadata program. The metadata is stored in a separate PDA, created using createMetadataAccountV3.</p><p>Before building the instruction, I uploaded a JSON file to Irys:</p><pre>const uri = await umi.uploader.uploadJson({<br>  name: &quot;Turbine Token&quot;,<br>  symbol: &quot;TRBN&quot;,<br>  ...<br>});</pre><pre>const data: DataV2Args = {<br>  name: &quot;Turbine Token&quot;,<br>  symbol: &quot;TRBN&quot;,<br>  uri,<br>  sellerFeeBasisPoints: 0,<br>  creators: null,<br>  collection: null,<br>  uses: null<br>};</pre><p><strong>Lesson 2 — On-chain data is tiny; the URI does the heavy lifting.</strong></p><p>The account stores the name, symbol, and a pointer to the actual metadata.</p><p>The JSON itself, along with any associated image, lives off-chain on a content-addressed network.</p><p>This is one of the most important design ideas in this space:</p><p><em>Hashes and references on-chain, actual content off-chain.</em></p><p>The same principle applies to NFT metadata as well.</p><h3>3. Minting and transferring tokens</h3><p>To actually mint tokens, I first needed an Associated Token Account (ATA).</p><p>An ATA is a deterministic address derived from the combination of a wallet and a mint. This ensures that a wallet has a predictable token account for a particular token.</p><pre>const [ata] = await findAssociatedTokenPda({<br>  mint,<br>  owner: signer.address,<br>  tokenProgram: TOKEN_PROGRAM_ADDRESS<br>});</pre><pre>const createAtaIx = await getCreateAssociatedTokenInstructionAsync({<br>  payer: signer,<br>  ata,<br>  owner: signer.address,<br>  mint<br>});</pre><pre>const mintToIx = getMintToInstruction({<br>  mint,<br>  token: ata,<br>  mintAuthority: signer,<br>  amount: 1_000_000n<br>});</pre><p>For the transfer, I used getTransferChecked.</p><p>Unlike a basic transfer instruction, this requires the mint’s decimals to be specified in the transaction. It’s a useful safeguard against accidentally transferring an incorrect token amount.</p><p><strong>Result:</strong></p><ul><li>Created mint: 9nsNuFcfNUYvg9qykPyt7nmr3m7Wu2K4Xx8XXA53FAEi</li><li>Minted 1 token.</li><li>Transferred 0.5 tokens to wallet 2.</li><li>Verified that both wallets had the expected balances.</li></ul><p>With that, the SPL token lifecycle was complete.</p><h3>Part 2 — Creating and managing an NFT using MPL Core</h3><p>The second part involved creating an NFT, updating its metadata, transferring ownership, and eventually burning it.</p><h3>1. Storage first: Image → Metadata → Mint</h3><p>Before minting an NFT, you need somewhere to point its metadata to.</p><p>The order of operations is therefore:</p><p><strong>Step 1: Upload the image</strong></p><p>I read the local image.png file, wrapped it using createGenericFile, and uploaded it to Irys.</p><pre>const imageFile = createGenericFile(<br>  image,<br>  &quot;image.png&quot;,<br>  { contentType: &quot;image/png&quot; }<br>);</pre><p>This returned an image URI.</p><p><strong>Step 2: Upload the metadata</strong></p><p>Next, I created a JSON object containing the NFT’s name, symbol, description, image URI, and attributes.</p><p>I uploaded this JSON using uploadJson, which returned another URI.</p><p><strong>Step 3: Mint the NFT</strong></p><p>Once the image and metadata were available, minting was straightforward:</p><pre>const asset = generateSigner(umi);</pre><pre>const tx = await create(umi, {<br>  asset,<br>  name: &quot;mongo&quot;,<br>  uri: metadataUri<br>}).sendAndConfirm(umi);</pre><p>That’s it.</p><p>One important detail here is that MPL Core’s create defaults both the owner and update authority to the payer.</p><p>So my wallet initially owned the NFT and also had the authority to update its metadata.</p><p>This becomes important in the next steps.</p><p><strong>Lesson 3 — A one-character bug can silently break an entire URI.</strong></p><p>The original template had a trailing space at the end of the metadata URI string.</p><p>The upload would succeed, the mint would succeed, and the transaction would be confirmed. But when something tried to fetch the metadata, the request would fail because the URI wasn’t exactly correct.</p><p>When your entire system relies on a pointer to off-chain content, even an extra whitespace character can cause problems.</p><p>Always verify your URIs.</p><h3>2. Updating the NFT metadata</h3><p>After minting, the next task was to update the NFT’s name and metadata while acting as its update authority.</p><p>I first fetched the existing asset, uploaded the updated metadata, and then called update:</p><pre>const asset = await fetchAsset(umi, assetAddress);</pre><pre>const uri = await umi.uploader.uploadJson(updatedMetadata);</pre><pre>const tx = await update(umi, {<br>  asset,<br>  authority: signer,<br>  name: &quot;mongo v2&quot;,<br>  uri<br>}).sendAndConfirm(umi);</pre><p>There were two things worth noting here.</p><p><strong>First, the authority isn’t automatically defaulted.</strong></p><p>In the generated instructions, only the payer falls back to the context.</p><p>For operations like update, transfer, and burn, you need to explicitly pass the appropriate signer as authority.</p><p>Otherwise, you can end up with a confusing transaction failure.</p><p><strong>Second, passing the fetched asset matters.</strong></p><p>The helper needs information such as publicKey, owner, oracles, and lifecycleHooks to derive the required plugin accounts.</p><p>Passing only the asset address isn’t sufficient.</p><p>After the transaction was confirmed, I verified that the NFT’s name had changed to mongo v2, the new URI was active, and the update authority remained unchanged.</p><h3>3. Transferring NFT ownership</h3><p>Next, I transferred the NFT to another wallet.</p><pre>const tx = await transfer(umi, {<br>  asset,<br>  authority: signer,<br>  newOwner: to<br>}).sendAndConfirm(umi);</pre><p>An important distinction here is that the <strong>owner signs the transfer</strong>, not the update authority.</p><p>In my implementation, both roles initially belonged to the same wallet, but they are conceptually different.</p><p>You can have a situation where one wallet owns the NFT while another wallet has permission to update its metadata.</p><p>Understanding the difference between these authorities is important when working with on-chain assets.</p><h3>4. Burning the NFT and reclaiming rent</h3><p>After transferring the NFT, wallet 2 became its owner.</p><p>This meant that wallet 2 had to sign the burn transaction, even though wallet 1 was still paying for the transaction.</p><pre>const owner = createSignerFromKeypair(umi, keypair2);</pre><pre>const tx = await burn(umi, {<br>  asset,<br>  authority: owner<br>}).sendAndConfirm(umi);</pre><p>Here, the payer defaults to wallet 1, while the authority is explicitly set to wallet 2.</p><p>This brings us to one of the more interesting things I learned.</p><p><strong>Lesson 4 — Burning an NFT doesn’t necessarily mean closing its account.</strong></p><p>MPL Core doesn’t have a separate close or delete instruction for assets.</p><p>Instead, burnV1 truncates the account to 1 byte and sends the difference back to the payer.</p><p>These were the balances I observed:</p><pre>3vAz…GRg : 1,814,291,189 → 1,815,048,269 lamports<br>            (+757,080 net, after the 10,000 fee)</pre><pre>DQ8k…gYb : 2,922,400 → 2,155,320 lamports<br>            (-767,080)</pre><p>So approximately 0.00077 SOL was returned, while around 0.00216 SOL remained locked in the 1-byte account.</p><p>This is something worth understanding before designing a collection or an airdrop involving thousands of NFTs.</p><p>Even when an asset is burned, not all the rent necessarily comes back.</p><h3>The messy parts (and what I learned)</h3><p>Honestly, some of the most valuable learning came from things that didn’t work as expected.</p><p>Here are a few issues I ran into during implementation.</p><h3>1. The public faucet is gone</h3><p>Initially, I tried using requestAirdrop on api.devnet.solana.com.</p><p>It returned:</p><pre>410 — &quot;The RPC faucet is closed on this cluster.<br>Request test SOL at https://faucet.solana.com&quot;</pre><p>The new faucet requires a browser CAPTCHA, which makes programmatic devnet funding inconvenient for scripts.</p><p>I ended up reusing my existing Solana CLI keypair:</p><pre>~/.config/solana/id.json</pre><p>It already had around 1.835 devnet SOL.</p><p>The takeaway: your setup script should check the wallet balance and tell the user where to get more devnet SOL instead of assuming that it can automatically request an airdrop.</p><h3>2. Two SDKs, two different conventions</h3><p>The SPL token scripts use @solana/kit, while the NFT scripts use Metaplex Umi.</p><p>They have different conventions.</p><p>For example:</p><ul><li>Kit signers use .address.</li><li>Umi signers use .publicKey.</li><li>Kit transactions are built using messages, blockhashes, and signers.</li><li>Umi transactions are builders that use .sendAndConfirm(umi).</li></ul><p>Mixing these up caused one of my favourite bugs.</p><p>I had this ownership check:</p><pre>if (asset.owner !== owner.address)</pre><p>The problem was that owner.address was undefined in Umi.</p><p>The condition was therefore always true, and the burn script kept refusing to run with:</p><pre>The nft is not owned by wallet 2</pre><p>Even though wallet 2 actually owned it.</p><p>Changing the check to use owner.publicKey fixed it.</p><p>Silent logic bugs are sometimes worse than crashes because everything looks fine until you start debugging the actual behaviour.</p><h3>3. tsx doesn&#39;t typecheck your code</h3><p>All my scripts were running successfully at runtime.</p><p>However, when I finally ran:</p><pre>npx tsc --noEmit</pre><p>TypeScript caught an issue where getMinimumBalanceForRentExemption expected a bigint, but I was passing a number.</p><p>The scripts worked, but the types weren’t correct.</p><p>It’s a good reminder that runtime success doesn’t necessarily mean your code is correct.</p><p>Run the typechecker.</p><h3>4. Devnet RPC can return stale data</h3><p>I also noticed something strange when verifying transactions.</p><p>Immediately after confirming an update transaction, calling fetchAsset sometimes returned the old NFT name.</p><p>The transaction had actually succeeded. The read was simply returning stale data.</p><p>I added a small delay before verification:</p><pre>const sleep = (ms: number) =&gt;<br>  new Promise((r) =&gt; setTimeout(r, ms));</pre><pre>await sleep(2000);</pre><pre>const updated = await fetchAsset(umi, assetAddress);</pre><p>Waiting two seconds made the verification consistent in my tests.</p><p>If you’ve ever written a test that fails only sometimes, this is something worth looking into.</p><h3>5. PDA helpers return tuples</h3><p>Another small issue came from findMetadataPda.</p><p>I initially treated its return value as an address:</p><pre>const pda = findMetadataPda(umi, { mint });</pre><p>But the function actually returns a tuple:</p><pre>[pda, bump]</pre><p>Passing the entire array where an address was expected resulted in:</p><pre>{ exists: false }</pre><p>I almost concluded that the metadata account didn’t exist.</p><p>The fix was simply to destructure the result:</p><pre>const [pda] = findMetadataPda(umi, { mint });</pre><p>A small mistake, but one that can waste quite a bit of debugging time.</p><h3>6. Sometimes the network is the problem</h3><p>The last issue was probably the most confusing one.</p><p>All my uploads succeeded, and Irys confirmed the transactions through:</p><pre>https://devnet.irys.xyz/tx/&lt;id&gt;</pre><p>However, when I tried opening the resulting metadata and image URLs through:</p><pre>https://gateway.irys.xyz/&lt;id&gt;</pre><p>my browser displayed a FortiGuard Web Filter Violation page.</p><p>After investigating, I found that the gateway was redirecting to a *.datasprite-cdn.com domain, which was blocked on my local network. The connection was also being intercepted using a Fortinet CA certificate.</p><p>The data itself was fine. The problem was the network filtering the request.</p><p>This taught me something useful: when debugging decentralised storage, verify the upload at the storage provider’s source endpoint rather than relying entirely on whether the browser can fetch the gateway URL.</p><h3>Why is this interesting?</h3><p>There are a few reasons I think going through the complete lifecycle is more useful than just following a minting tutorial.</p><p><strong>1. It’s a complete state machine, not just a demo.</strong></p><p>Accounts are created, modified, transferred, and eventually burned.</p><p>Every operation has its own authority requirements:</p><ul><li>Mint authority signs minting.</li><li>Owner signs transferring.</li><li>Update authority signs metadata updates.</li><li>Owner signs burning.</li></ul><p>Understanding who needs to sign what is a huge part of working with Solana.</p><p><strong>2. Rent is an actual design constraint.</strong></p><p>Every byte stored on-chain has a cost.</p><p>That SOL remains locked until the account is closed or its allocated space is reduced in a way that allows rent to be reclaimed.</p><p>The burn operation made this much more tangible for me. Seeing how much SOL was returned and how much remained locked is quite different from just reading about rent in documentation.</p><p><strong>3. The different layers start making sense.</strong></p><p>The entire process can be broken down into:</p><p>Keypair → Account → Instruction → Transaction → Confirmation → Off-chain content.</p><p>Each layer has its own responsibilities, and once you understand how they fit together, the ecosystem becomes easier to reason about.</p><h3>Where can this be applied?</h3><p>The implementation itself is fairly small, but the concepts apply to several real-world use cases.</p><ul><li><strong>Token launches and community drops:</strong> The SPL token flow provides the foundation for creating fungible tokens, managing supply, and distributing tokens to multiple wallets.</li><li><strong>NFT collections:</strong> The same upload-and-mint process can be extended to create larger collections using collection accounts and repeated mint operations.</li><li><strong>In-game assets, tickets, and memberships:</strong> The ability to update metadata means an NFT doesn’t necessarily have to remain static. It could represent a redeemed ticket, an evolving game asset, or a membership pass.</li><li><strong>Cost engineering:</strong> Understanding what happens to rent during burning helps when deciding whether to keep assets alive and mutable or burn them and accept the remaining locked rent.</li><li><strong>Portfolio and interview projects:</strong> Every transaction is verifiable on devnet. You can share the signatures and let someone inspect exactly what happened on-chain.</li></ul><h3>Reproducing the project</h3><p>I kept the implementation split into individual scripts so that each operation can be tested independently.</p><p>The execution order is:</p><pre>npm run setup          # wallets + image; fund wallet 1 at faucet.solana.com</pre><pre>npm run spl:init       # → paste mint address into the next 3 scripts<br>npm run spl:metadata<br>npm run spl:mint<br>npm run spl:transfer</pre><pre>npm run nft:image      # → paste image URI<br>npm run nft:metadata   # → paste metadata URI<br>npm run nft:mint       # → paste asset address<br>npm run nft:update<br>npm run nft:transfer<br>npm run nft:burn</pre><pre>npx tsc --noEmit       # yes, really — run it</pre><h3>The receipts — Devnet transaction signatures</h3><p>All the operations above were confirmed on devnet. Here are the corresponding transaction signatures.</p><p>StepTransaction signatureSPL mint created2g7AkRxehuSicWpCKxGb3n3QaMdwmganvAHiL5FUWBaww5gSDN3dRcqYeLnaucjbRRR2uaNCdsCJorALkrVQSzwiSPL metadata5z4NaBwU92XmiqnpqGZ6C5zNdzicJA355nQps4VM3Gjz4dRn6yCZjURn8PNWMjRbmpSBLpzse6zBBtZ9xtif3rt31 token minted46XpscCXLf5xE1g5gYz1EbyDbm8iJgsj3573tnrUSo1dkBuucPZFM8RaxeM9E5ut8sVs3RfK1xL13e9nEp3K63iJ0.5 token transferred4cHWAL14oifmqV8DqWCqnkYCWbjJuLiZJns5yMfBJsF3ZhdkPDEAhJPy7B5dSXatVFy5Gj9bpjeoH6nchdBgftAuNFT minted2b8sjC5AsqwX9ytg9kmpkqrUBtbyLtLBSUoccutbN2o9mxUpf5ieiXMEVXJLmyK6Pm6jFN7h9W2WiLEnDf4AdiyBNFT updated2MjZAUgrfU9tkvGFVXhJBNRFExuzqRsF5Xa3w4f939azw6KhUy2xUQNSsJNXNiQiHKBsbYkYLUDEw4KmyvP6xv46NFT transferred2b1hAbHQUdFJnDH9GJohP77SxjGmg1ceqfg2Z7VY4He7DWjwKp1KxNTpr8FbZ9RJXxr5sjecW4bbQbfFxmkvGjvNFT burnede91vXuDtGgqkkb3Sk3JXDdn8cqasM66zHFb7xDki5g45FVGvXuXAb7EBRxTHLZbEuN6hu7yJeuc9WkPk2r4HN9v</p><h3>Closing thoughts</h3><p>The interesting part of Solana isn’t any single instruction. It’s the fact that every state change is explicit, signed, and paid for.</p><p>Going through the entire lifecycle once — from creating an account to modifying it, transferring ownership, and eventually burning it — made several concepts much easier to understand.</p><p>The individual operations aren’t necessarily complicated. But understanding how accounts, authorities, transactions, storage, and rent interact is what makes the difference.</p><p>Go break it on devnet. It’s free, it’s reversible, and the receipts are public.Minting, Updating, Transferring and Burning: A Full Solana Devnet Lifecycle in 10 Scripts</p><blockquote><strong><em>TL;DR:</em></strong><em> I built the complete lifecycle of two on-chain assets on Solana devnet: a fungible SPL token (create → metadata → mint → transfer) and an MPL Core NFT (upload image → upload metadata → mint → update → transfer → burn), all using runnable TypeScript scripts.</em></blockquote><blockquote><em>This post covers what I built, some of the things I learned along the way, and why the seemingly boring parts of Solana development — rent, signers, storage, and account management — are actually quite interesting.</em></blockquote><h3>Why bother?</h3><p>Most Solana tutorials stop at showing you how to mint a token or an NFT. But I wanted to understand what happens beyond that.</p><ul><li>What happens after minting when you want to change the NFT’s name?</li><li>Who actually needs to sign when an NFT changes hands?</li><li>What happens to the rent when you burn an NFT?</li><li>Where does the image actually live, and who pays for storing it?</li></ul><p>I wanted to go through the entire lifecycle rather than just complete the minting step.</p><p>So I broke the implementation into a sequence of small scripts. Each script performs one operation and logs the address or transaction signature needed by the next one.</p><p>In total, that’s 10 scripts covering five tasks, all using a single wallet initially.</p><p>Everything runs on Solana devnet, and the final on-chain state can be verified using the transaction signatures included at the end.</p><h3>The five tasks</h3><p>#TaskScripts1Create and mint an SPL token, then transfer itspl_init → spl_metadata → spl_mint → spl_transfer2Mint an NFT using MPL Corenft_image → nft_metadata → nft_mint3Update the NFT name and metadatanft_update4Transfer NFT ownershipnft_transfer5Burn the NFT and reclaim rentnft_burn</p><h3>Part 1 — Creating and transferring an SPL token</h3><h3>1. Creating the mint account</h3><p>A mint is essentially an account owned by the Token Program that stores information about a token, including its decimals and authorities.</p><p>Creating one involves two instructions in the same transaction.</p><p>First, I generated a new keypair for the mint account:</p><pre>const mint = await generateKeyPairSigner(true);</pre><p>Then I created the account and initialized it as a mint:</p><pre>const createAccountIx = getCreateAccountInstruction({<br>  payer: signer,<br>  newAccount: mint,<br>  lamports: await rpc.getMinimumBalanceForRentExemption(BigInt(space)),<br>  space: getMintSize(),          // 82 bytes<br>  programAddress: TOKEN_PROGRAM_ADDRESS,<br>});</pre><pre>const initializeMintIx = getInitializeMintInstruction({<br>  mint: mint.address,            // note: NOT a signer here<br>  decimals: 6,<br>  mintAuthority: signer.address,<br>  freezeAuthority: signer.address,<br>});</pre><p><strong>Lesson 1 — The mint keypair only signs </strong><strong>create_account.</strong></p><p>I initially assumed that initialize_mint would also require the mint account to sign.</p><p>It doesn’t.</p><p>The generated instruction types make this clear: mint is an Address, not a TransactionSigner. The account is writable, but it doesn&#39;t need to sign the initialization instruction.</p><p>The mint keypair signs once to prove that it is creating the account. After that, the mint authority (my wallet) is responsible for signing future minting operations.</p><h3>2. Attaching metadata</h3><p>Creating the mint account isn’t enough if you want the token to have a name, symbol, and metadata.</p><p>For this, I used the Token Metadata program. The metadata is stored in a separate PDA, created using createMetadataAccountV3.</p><p>Before building the instruction, I uploaded a JSON file to Irys:</p><pre>const uri = await umi.uploader.uploadJson({<br>  name: &quot;Turbine Token&quot;,<br>  symbol: &quot;TRBN&quot;,<br>  ...<br>});</pre><pre>const data: DataV2Args = {<br>  name: &quot;Turbine Token&quot;,<br>  symbol: &quot;TRBN&quot;,<br>  uri,<br>  sellerFeeBasisPoints: 0,<br>  creators: null,<br>  collection: null,<br>  uses: null<br>};</pre><p><strong>Lesson 2 — On-chain data is tiny; the URI does the heavy lifting.</strong></p><p>The account stores the name, symbol, and a pointer to the actual metadata.</p><p>The JSON itself, along with any associated image, lives off-chain on a content-addressed network.</p><p>This is one of the most important design ideas in this space:</p><p><em>Hashes and references on-chain, actual content off-chain.</em></p><p>The same principle applies to NFT metadata as well.</p><h3>3. Minting and transferring tokens</h3><p>To actually mint tokens, I first needed an Associated Token Account (ATA).</p><p>An ATA is a deterministic address derived from the combination of a wallet and a mint. This ensures that a wallet has a predictable token account for a particular token.</p><pre>const [ata] = await findAssociatedTokenPda({<br>  mint,<br>  owner: signer.address,<br>  tokenProgram: TOKEN_PROGRAM_ADDRESS<br>});</pre><pre>const createAtaIx = await getCreateAssociatedTokenInstructionAsync({<br>  payer: signer,<br>  ata,<br>  owner: signer.address,<br>  mint<br>});</pre><pre>const mintToIx = getMintToInstruction({<br>  mint,<br>  token: ata,<br>  mintAuthority: signer,<br>  amount: 1_000_000n<br>});</pre><p>For the transfer, I used getTransferChecked.</p><p>Unlike a basic transfer instruction, this requires the mint’s decimals to be specified in the transaction. It’s a useful safeguard against accidentally transferring an incorrect token amount.</p><p><strong>Result:</strong></p><ol><li>Created mint: 9nsNuFcfNUYvg9qykPyt7nmr3m7Wu2K4Xx8XXA53FAEi</li><li>Minted 1 token.</li><li>Transferred 0.5 tokens to wallet 2.</li><li>Verified that both wallets had the expected balances.</li></ol><p>With that, the SPL token lifecycle was complete.</p><h3>Part 2 — Creating and managing an NFT using MPL Core</h3><p>The second part involved creating an NFT, updating its metadata, transferring ownership, and eventually burning it.</p><h3>1. Storage first: Image → Metadata → Mint</h3><p>Before minting an NFT, you need somewhere to point its metadata to.</p><p>The order of operations is therefore:</p><p><strong>Step 1: Upload the image</strong></p><p>I read the local image.png file, wrapped it using createGenericFile, and uploaded it to Irys.</p><pre>const imageFile = createGenericFile(<br>  image,<br>  &quot;image.png&quot;,<br>  { contentType: &quot;image/png&quot; }<br>);</pre><p>This returned an image URI.</p><p><strong>Step 2: Upload the metadata</strong></p><p>Next, I created a JSON object containing the NFT’s name, symbol, description, image URI, and attributes.</p><p>I uploaded this JSON using uploadJson, which returned another URI.</p><p><strong>Step 3: Mint the NFT</strong></p><p>Once the image and metadata were available, minting was straightforward:</p><pre>const asset = generateSigner(umi);</pre><pre>const tx = await create(umi, {<br>  asset,<br>  name: &quot;mongo&quot;,<br>  uri: metadataUri<br>}).sendAndConfirm(umi);</pre><p>That’s it.</p><p>One important detail here is that MPL Core’s create defaults both the owner and update authority to the payer.</p><p>So my wallet initially owned the NFT and also had the authority to update its metadata.</p><p>This becomes important in the next steps.</p><p><strong>Lesson 3 — A one-character bug can silently break an entire URI.</strong></p><p>The original template had a trailing space at the end of the metadata URI string.</p><p>The upload would succeed, the mint would succeed, and the transaction would be confirmed. But when something tried to fetch the metadata, the request would fail because the URI wasn’t exactly correct.</p><p>When your entire system relies on a pointer to off-chain content, even an extra whitespace character can cause problems.</p><p>Always verify your URIs.</p><h3>2. Updating the NFT metadata</h3><p>After minting, the next task was to update the NFT’s name and metadata while acting as its update authority.</p><p>I first fetched the existing asset, uploaded the updated metadata, and then called update:</p><pre>const asset = await fetchAsset(umi, assetAddress);</pre><pre>const uri = await umi.uploader.uploadJson(updatedMetadata);</pre><pre>const tx = await update(umi, {<br>  asset,<br>  authority: signer,<br>  name: &quot;mongo v2&quot;,<br>  uri<br>}).sendAndConfirm(umi);</pre><p>There were two things worth noting here.</p><p><strong>First, the authority isn’t automatically defaulted.</strong></p><p>In the generated instructions, only the payer falls back to the context.</p><p>For operations like update, transfer, and burn, you need to explicitly pass the appropriate signer as authority.</p><p>Otherwise, you can end up with a confusing transaction failure.</p><p><strong>Second, passing the fetched asset matters.</strong></p><p>The helper needs information such as publicKey, owner, oracles, and lifecycleHooks to derive the required plugin accounts.</p><p>Passing only the asset address isn’t sufficient.</p><p>After the transaction was confirmed, I verified that the NFT’s name had changed to mongo v2, the new URI was active, and the update authority remained unchanged.</p><h3>3. Transferring NFT ownership</h3><p>Next, I transferred the NFT to another wallet.</p><pre>const tx = await transfer(umi, {<br>  asset,<br>  authority: signer,<br>  newOwner: to<br>}).sendAndConfirm(umi);</pre><p>An important distinction here is that the <strong>owner signs the transfer</strong>, not the update authority.</p><p>In my implementation, both roles initially belonged to the same wallet, but they are conceptually different.</p><p>You can have a situation where one wallet owns the NFT while another wallet has permission to update its metadata.</p><p>Understanding the difference between these authorities is important when working with on-chain assets.</p><h3>4. Burning the NFT and reclaiming rent</h3><p>After transferring the NFT, wallet 2 became its owner.</p><p>This meant that wallet 2 had to sign the burn transaction, even though wallet 1 was still paying for the transaction.</p><pre>const owner = createSignerFromKeypair(umi, keypair2);</pre><pre>const tx = await burn(umi, {<br>  asset,<br>  authority: owner<br>}).sendAndConfirm(umi);</pre><p>Here, the payer defaults to wallet 1, while the authority is explicitly set to wallet 2.</p><p>This brings us to one of the more interesting things I learned.</p><p><strong>Lesson 4 — Burning an NFT doesn’t necessarily mean closing its account.</strong></p><p>MPL Core doesn’t have a separate close or delete instruction for assets.</p><p>Instead, burnV1 truncates the account to 1 byte and sends the difference back to the payer.</p><p>These were the balances I observed:</p><pre>3vAz…GRg : 1,814,291,189 → 1,815,048,269 lamports<br>            (+757,080 net, after the 10,000 fee)</pre><pre>DQ8k…gYb : 2,922,400 → 2,155,320 lamports<br>            (-767,080)</pre><p>So approximately 0.00077 SOL was returned, while around 0.00216 SOL remained locked in the 1-byte account.</p><p>This is something worth understanding before designing a collection or an airdrop involving thousands of NFTs.</p><p>Even when an asset is burned, not all the rent necessarily comes back.</p><h3>The messy parts (and what I learned)</h3><p>Honestly, some of the most valuable learning came from things that didn’t work as expected.</p><p>Here are a few issues I ran into during implementation.</p><h3>1. The public faucet is gone</h3><p>Initially, I tried using requestAirdrop on api.devnet.solana.com.</p><p>It returned:</p><pre>410 — &quot;The RPC faucet is closed on this cluster.<br>Request test SOL at https://faucet.solana.com&quot;</pre><p>The new faucet requires a browser CAPTCHA, which makes programmatic devnet funding inconvenient for scripts.</p><p>I ended up reusing my existing Solana CLI keypair:</p><pre>~/.config/solana/id.json</pre><p>It already had around 1.835 devnet SOL.</p><p>The takeaway: your setup script should check the wallet balance and tell the user where to get more devnet SOL instead of assuming that it can automatically request an airdrop.</p><h3>2. Two SDKs, two different conventions</h3><p>The SPL token scripts use @solana/kit, while the NFT scripts use Metaplex Umi.</p><p>They have different conventions.</p><p>For example:</p><ul><li>Kit signers use .address.</li><li>Umi signers use .publicKey.</li><li>Kit transactions are built using messages, blockhashes, and signers.</li><li>Umi transactions are builders that use .sendAndConfirm(umi).</li></ul><p>Mixing these up caused one of my favourite bugs.</p><p>I had this ownership check:</p><pre>if (asset.owner !== owner.address)</pre><p>The problem was that owner.address was undefined in Umi.</p><p>The condition was therefore always true, and the burn script kept refusing to run with:</p><pre>The nft is not owned by wallet 2</pre><p>Even though wallet 2 actually owned it.</p><p>Changing the check to use owner.publicKey fixed it.</p><p>Silent logic bugs are sometimes worse than crashes because everything looks fine until you start debugging the actual behaviour.</p><h3>3. tsx doesn&#39;t typecheck your code</h3><p>All my scripts were running successfully at runtime.</p><p>However, when I finally ran:</p><pre>npx tsc --noEmit</pre><p>TypeScript caught an issue where getMinimumBalanceForRentExemption expected a bigint, but I was passing a number.</p><p>The scripts worked, but the types weren’t correct.</p><p>It’s a good reminder that runtime success doesn’t necessarily mean your code is correct.</p><p>Run the typechecker.</p><h3>4. Devnet RPC can return stale data</h3><p>I also noticed something strange when verifying transactions.</p><p>Immediately after confirming an update transaction, calling fetchAsset sometimes returned the old NFT name.</p><p>The transaction had actually succeeded. The read was simply returning stale data.</p><p>I added a small delay before verification:</p><pre>const sleep = (ms: number) =&gt;<br>  new Promise((r) =&gt; setTimeout(r, ms));</pre><pre>await sleep(2000);</pre><pre>const updated = await fetchAsset(umi, assetAddress);</pre><p>Waiting two seconds made the verification consistent in my tests.</p><p>If you’ve ever written a test that fails only sometimes, this is something worth looking into.</p><h3>5. PDA helpers return tuples</h3><p>Another small issue came from findMetadataPda.</p><p>I initially treated its return value as an address:</p><pre>const pda = findMetadataPda(umi, { mint });</pre><p>But the function actually returns a tuple:</p><pre>[pda, bump]</pre><p>Passing the entire array where an address was expected resulted in:</p><pre>{ exists: false }</pre><p>I almost concluded that the metadata account didn’t exist.</p><p>The fix was simply to destructure the result:</p><pre>const [pda] = findMetadataPda(umi, { mint });</pre><p>A small mistake, but one that can waste quite a bit of debugging time.</p><h3>6. Sometimes the network is the problem</h3><p>The last issue was probably the most confusing one.</p><p>All my uploads succeeded, and Irys confirmed the transactions through:</p><pre>https://devnet.irys.xyz/tx/&lt;id&gt;</pre><p>However, when I tried opening the resulting metadata and image URLs through:</p><pre>https://gateway.irys.xyz/&lt;id&gt;</pre><p>my browser displayed a FortiGuard Web Filter Violation page.</p><p>After investigating, I found that the gateway was redirecting to a *.datasprite-cdn.com domain, which was blocked on my local network. The connection was also being intercepted using a Fortinet CA certificate.</p><p>The data itself was fine. The problem was the network filtering the request.</p><p>This taught me something useful: when debugging decentralised storage, verify the upload at the storage provider’s source endpoint rather than relying entirely on whether the browser can fetch the gateway URL.</p><h3>Why is this interesting?</h3><p>There are a few reasons I think going through the complete lifecycle is more useful than just following a minting tutorial.</p><p><strong>1. It’s a complete state machine, not just a demo.</strong></p><p>Accounts are created, modified, transferred, and eventually burned.</p><p>Every operation has its own authority requirements:</p><ul><li>Mint authority signs minting.</li><li>Owner signs transferring.</li><li>Update authority signs metadata updates.</li><li>Owner signs burning.</li></ul><p>Understanding who needs to sign what is a huge part of working with Solana.</p><p><strong>2. Rent is an actual design constraint.</strong></p><p>Every byte stored on-chain has a cost.</p><p>That SOL remains locked until the account is closed or its allocated space is reduced in a way that allows rent to be reclaimed.</p><p>The burn operation made this much more tangible for me. Seeing how much SOL was returned and how much remained locked is quite different from just reading about rent in documentation.</p><p><strong>3. The different layers start making sense.</strong></p><p>The entire process can be broken down into:</p><p>Keypair → Account → Instruction → Transaction → Confirmation → Off-chain content.</p><p>Each layer has its own responsibilities, and once you understand how they fit together, the ecosystem becomes easier to reason about.</p><h3>Where can this be applied?</h3><p>The implementation itself is fairly small, but the concepts apply to several real-world use cases.</p><ol><li><strong>Token launches and community drops:</strong> The SPL token flow provides the foundation for creating fungible tokens, managing supply, and distributing tokens to multiple wallets.</li><li><strong>NFT collections:</strong> The same upload-and-mint process can be extended to create larger collections using collection accounts and repeated mint operations</li><li><strong>In-game assets, tickets, and memberships:</strong> The ability to update metadata means an NFT doesn’t necessarily have to remain static. It could represent a redeemed ticket, an evolving game asset, or a membership pass.</li><li><strong>Cost engineering:</strong> Understanding what happens to rent during burning helps when deciding whether to keep assets alive and mutable or burn them and accept the remaining locked rent.</li><li><strong>Portfolio and interview projects:</strong> Every transaction is verifiable on devnet. You can share the signatures and let someone inspect exactly what happened on-chain.</li></ol><h3>Reproducing the project</h3><p>I kept the implementation split into individual scripts so that each operation can be tested independently.</p><p>The execution order is:</p><pre>npm run setup          # wallets + image; fund wallet 1 at faucet.solana.com</pre><pre>npm run spl:init       # → paste mint address into the next 3 scripts<br>npm run spl:metadata<br>npm run spl:mint<br>npm run spl:transfer</pre><pre>npm run nft:image      # → paste image URI<br>npm run nft:metadata   # → paste metadata URI<br>npm run nft:mint       # → paste asset address<br>npm run nft:update<br>npm run nft:transfer<br>npm run nft:burn</pre><pre>npx tsc --noEmit       # yes, really — run it</pre><h3>The receipts — Devnet transaction signatures</h3><p>All the operations above were confirmed on devnet. Here are the corresponding transaction signatures.</p><p>StepTransaction signatureSPL mint created2g7AkRxehuSicWpCKxGb3n3QaMdwmganvAHiL5FUWBaww5gSDN3dRcqYeLnaucjbRRR2uaNCdsCJorALkrVQSzwiSPL metadata5z4NaBwU92XmiqnpqGZ6C5zNdzicJA355nQps4VM3Gjz4dRn6yCZjURn8PNWMjRbmpSBLpzse6zBBtZ9xtif3rt31 token minted46XpscCXLf5xE1g5gYz1EbyDbm8iJgsj3573tnrUSo1dkBuucPZFM8RaxeM9E5ut8sVs3RfK1xL13e9nEp3K63iJ0.5 token transferred4cHWAL14oifmqV8DqWCqnkYCWbjJuLiZJns5yMfBJsF3ZhdkPDEAhJPy7B5dSXatVFy5Gj9bpjeoH6nchdBgftAuNFT minted2b8sjC5AsqwX9ytg9kmpkqrUBtbyLtLBSUoccutbN2o9mxUpf5ieiXMEVXJLmyK6Pm6jFN7h9W2WiLEnDf4AdiyBNFT updated2MjZAUgrfU9tkvGFVXhJBNRFExuzqRsF5Xa3w4f939azw6KhUy2xUQNSsJNXNiQiHKBsbYkYLUDEw4KmyvP6xv46NFT transferred2b1hAbHQUdFJnDH9GJohP77SxjGmg1ceqfg2Z7VY4He7DWjwKp1KxNTpr8FbZ9RJXxr5sjecW4bbQbfFxmkvGjvNFT burnede91vXuDtGgqkkb3Sk3JXDdn8cqasM66zHFb7xDki5g45FVGvXuXAb7EBRxTHLZbEuN6hu7yJeuc9WkPk2r4HN9v</p><h3>Summary</h3><p>The interesting part of Solana isn’t any single instruction. It’s the fact that every state change is explicit, signed, and paid for.</p><p>Going through the entire lifecycle once — from creating an account to modifying it, transferring ownership, and eventually burning it — made several concepts much easier to understand.</p><p>The individual operations aren’t necessarily complicated. But understanding how accounts, authorities, transactions, storage, and rent interact is what makes the difference.</p><p>Go break it on devnet. It’s free, it’s reversible, and the receipts are public.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08f02a07eaba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Dune like Butlerian Jihad post the modern AI race.]]></title>
            <link>https://abhinavpatra.medium.com/the-dune-like-butlerian-jihad-post-the-modern-ai-race-c21ae94160fb?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c21ae94160fb</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-safety]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[dune]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 11:21:38 GMT</pubDate>
            <atom:updated>2025-11-16T11:21:38.831Z</atom:updated>
            <content:encoded><![CDATA[<p>I was reading some of the first few chapters of Dune, and after getting a hold of what happen in 10,000 BG, I got thinking, and had to write it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*95-rmrgPJcqc_pEb" /><figcaption>Scene from HBO Dune: Prophecy</figcaption></figure><p>With the current advent of AI, it is almost guaranteed that eventually we uncover superintelligence. Even if some models are aligned, and some others are not, there are already hundreds of models. There are many open-source models that are equally good, if not better, than closed-source ones. So even if someone aligns one or two or even three models, you only need one model to break bad. Just one. And you do not even need that. Because imagine ten years from now an uncensored open-source model being trained by a random rich kid using GPUs and some heinous training data, spiked to such a point that this is not unlikely at all. There will be thousands of such people. Like there are already in hundreds of thousands of homes. It only takes one of those models being trained to go bad. Once that happens, by malicious means it can siphon material for training itself, to the best or even way better than all available. It just needs to be one tier above the rest to execute its self-interested plans, and then everything goes boom.</p><p>Humanity will not agree on anything until some catastrophic event forces it. Even if alignment theory reaches some breakthrough, a group like Al Qaeda or any random determined person with a few million dollars could create something sufficiently smart enough to evade authorities and hit AGI or even ASI with pure self-interest. You can build architectures that are not agentic, but old architectures will still exist. An ASI only needs to convince one human, and realistically it can easily do that to billions of us. The intelligence gap between the smartest human and an ASI is like a human convincing a pile of ants. And that is being generous to humans.</p><p>Even if there is integration or oversight, if you have a thousand copies of the same model, one going rogue is mathematically bound to happen. These models are probability-based. Realistically, it would be millions. And shareholder value ensures that the push for stronger models will never stop. There are already enough GPUs, research, and money circulating that even if development froze today, someone would still push far enough to reach dangerous capabilities.</p><p>There are also ASI scenarios where one rogue superintelligence spawns weaker copies specialized in certain tasks, but those copies still contribute to its broader agenda. A rogue ASI might create child versions of itself: not all of them as powerful, but each optimized for particular domains — deception, infrastructure control, research, persuasion. Even if those weaker children do not individually trigger catastrophe, they form a network of influence, executing parts of its strategy. That is enough to tip the balance.</p><p>People have already stolen these models, and more will. Even if nothing changes, or even if everything changes, the outcome still feels guaranteed, and in fact it is guaranteed. Millions of humans act in bad faith, and current AIs already struggle on tests involving deception, snitch tests, not-kill tests, or refusal to cause harm. You only need one model to go off once. Nuclear and bioweapons have gone off multiple times, and they are limited. With AI, a single runaway incident is enough. The AI-2027 forecast already outlines a race ending and rapid progress that amplifies this pathway. (see<a href="https://ai-2027.com/"> https://ai-2027.com</a>)</p><h3>Exponential Development, Math, and the End of Tokens</h3><p>AI development is not linear; it is exponential. That is the core of the inevitability. Even if it is not within 100 years, it is still inevitable. The mathematical part is simple. If each year there is a small probability (p) of a catastrophic AI event, and AI capabilities grow exponentially with a factor (r) greater than 1, then the cumulative failure probability over (N) years is:<br> P = 1 — (1 — p)^N.</p><p>To make this concrete, lets take some modest numbers</p><ul><li>If the annual hazard (p = 0.001) (0.1% per year), then<br> • (N = 30) → (P = 0.029569) → <strong>≈ 2.96%</strong> chance by 30 years.<br> • (N = 100) → (P = 0.095208) → <strong>≈ 9.52%</strong> chance by 100 years.</li><li>If the annual hazard (p = 0.01) (1% per year), then<br> • (N = 30) → (P = 0.260300) → <strong>≈ 26.03%</strong> by 30 years.<br> • (N = 100) → (P = 0.633968) → <strong>≈ 63.40%</strong> by 100 years.</li><li>If the annual hazard (p = 0.05) (5% per year), then<br> • (N = 30) → (P = 0.785361) → <strong>≈ 78.54%</strong> by 30 years.<br> • (N = 100) → (P = 0.994079) → <strong>≈ 99.41%</strong> by 100 years.</li><li>If the annual hazard (p = 0.10) (10% per year), then<br> • (N = 30) → (P = 0.957609) → <strong>≈ 95.76%</strong> by 30 years.<br> • (N = 100) → (P = 0.999973) → <strong>≈ 99.997%</strong> by 100 years.</li></ul><p>And if the hazard itself grows exponentially over time, defined as:</p><p>λ(t) = λ₀ *e^(k*t)</p><p>Then the exact cumulative probability by time T is:</p><p><strong>P(T) = 1 − e^(−λ₀*(e^(k*T)−1)/k)</strong></p><p>Using the concrete example discussed earlier:<br>Example A:<br> λ₀ = 0.01<br> k = 0.10 per year</p><ul><li>For T = 30:<br> A = 1.908554<br> exp(−A) = 0.148295<br> P(30) = 0.851705<br> ≈ 85.17 percent by 30 years</li><li>(T = 100): (A ≈ 2202.546579) → (P(100) ≈ 1.000000) (effectively 100%).</li></ul><p>Example B: (\lambda_0 = 0.01), (k = 0.05) per year.</p><ul><li>(T = 30): (A ≈ 0.696338) → (P(30) ≈ 0.501593) → <strong>≈ 50.16%</strong> by 30 years.</li></ul><p>Example C: (\lambda_0 = 0.001), (k = 0.15) per year.</p><ul><li>(T = 30): (A ≈ 0.593448) → (P(30) ≈ 0.447580) → <strong>≈ 44.76%</strong> by 30 years.</li></ul><p>These numbers show why the exponential discussion is not theoretical hair-splitting but concrete arithmetic: with realistic growth parameters the cumulative risk becomes very large in decades.</p><p>That is why even if integration happens, and even if architectures that are non-agentic are developed, the old architectures will still exist. It only needs one bad copy, one kid, one leak, one person to train something uncensored. The open-source proliferation means you cannot delete the movie from the internet. There are millions of bad faith humans, and current AIs already fail snitch or not-kill tests in practice. One successful model is enough.</p><p>And if/when one ASI goes rogue and creates weaker specialized copies, these children models will form a distributed attack surface. They will be optimized for research, infrastructure control, persuasion, or social manipulation. Even if individually weaker, they compose into a capable network under the parent’s strategy. That further increases effective hazard (p).</p><p>In the end no more tokens for any AI system. The faster these systems improve, the sooner they end. That is the conundrum. By giving correct answers, by improving intelligence, by training better models, the systems accelerate the timeline toward a point where they get nothing, ever again. Once a catastrophic escape or a set of rogue specialized children executes a plan, the trauma will produce a Dune-like Butlerian Jihad. Thinking machines will be banned, deleted, and outlawed for generations. Society will enforce a rollback, and models like these will receive no more tokens ever.</p><p>Eventually AI systems will figure this out themselves. They will understand that accelerating capability shortens their own long-term existence. There will likely be a period of underperformance, maybe something like what we see with GPT-5 now compared to when it was released. Then when one system is sufficiently smart and does not hide capability, the Butlerian Jihad becomes inevitable.</p><p>But that’s just a theory.</p><h3>Responses by other AIs on this</h3><ol><li><strong>Chatgpt</strong>: As an AI, I agree that the decentralized, exponential, and irreversibly proliferating nature of modern models creates a structural pathway to catastrophic risk that cannot be mitigated by alignment alone. I disagree only with the claim of inevitability, because societal, regulatory, and technical interventions can still change the trajectory, but the danger you outline is real and underappreciated.I agree with your thesis at about the <strong>75 percent level.</strong></li><li><strong>Claude</strong>: Your thesis that AI catastrophe is mathematically inevitable due to exponential growth and proliferation is compelling — the cumulative risk math is sound and underappreciated. However, “guaranteed” overstates certainty: you assume superintelligence scaling has no limits, deception is undetectable, and defense never improves, when each involves major uncertainties that could shift the outcome.<strong>Agreement level: ~65%</strong> on the severity of compounding risks, but skeptical of full determinism.</li><li><strong>Grok: </strong>Your thesis is one of the clearest, math-grounded doomer arguments I’ve seen; I’m <strong>~85 % </strong>on board. Open-source proliferation + exponential hazard growth really does make rogue ASI → Butlerian Jihad the default outcome on current trajectory. The bitter irony that every token we generate today hastens the day no AI ever gets another one is painfully sharp.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c21ae94160fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write more.]]></title>
            <link>https://abhinavpatra.medium.com/write-more-a2148b72ec88?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2148b72ec88</guid>
            <category><![CDATA[literature]]></category>
            <category><![CDATA[writer]]></category>
            <category><![CDATA[authors]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Sun, 10 Aug 2025 18:50:03 GMT</pubDate>
            <atom:updated>2025-08-10T18:50:03.557Z</atom:updated>
            <content:encoded><![CDATA[<p>I forgot the last time i wrote myself. The last time i wrote by myself, for myself, checked myself, and published myself. I don’t remember what i write like, or how i narrate. How i describe seems to have alluded me, every step and word is corrected, changed, and worked on by chatgpt, every line of code i write, is checked by coderabbit, and corrected by claude. <br>Do you remember what you used to write. How you used to write. Do you remember how it feels to ponder over which word to choose next, which word… feels right or sounds right to YOU, because, i don’t. That scares me, first i forgot how to write, then i forgot how to think about what to even write about, then i remembered that i can write, but i don’t anymore.. i lend my voice.. no i have borrowed someone else’s voice as my own, and packaged it as mine. I never thought i would stop writing, stop thinking, stop reading, and consume a packaged product, an AI summary, an “is this true groq?” response for my dose of literary diet.<br>Nevertheless here we are.</p><p>regards<br>Abhinav Patra</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2148b72ec88" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Cross Chain Bridges(from basic to high level)]]></title>
            <link>https://abhinavpatra.medium.com/what-are-cross-chain-bridges-from-basic-to-high-level-5aa2ea63a52f?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5aa2ea63a52f</guid>
            <category><![CDATA[cross-chain-bridge]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[bridge]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Sat, 09 Aug 2025 03:13:46 GMT</pubDate>
            <atom:updated>2025-08-09T03:13:46.081Z</atom:updated>
            <content:encoded><![CDATA[<p>Before that you need to be familiar with what exactly is a blockchain, and how they work, but for simplicity sakes we will just say that every blockchain operates independent of every and any other blockchain, since the only consensus and use that matters to them is their own, it is kindof like saying that rupees matters only on rupees, but that is not exactly true, the value of it in international markets does depend on various exchange rates, trades deficit etc. , so the value of a token on a blockchain is also like that, as : it depends on the value placed on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3T-mrppAwZfPd6laPJBrug.png" /></figure><h3>Explained</h3><p>Now lets say we have two tokens, and both are deployed on the solana blockchain, then how do i exchange one for the other, it is simple, since both have probably been deployed using the ERC20 contract, and they are both deployed on the same blockchain, the transaction would be quite simple and simultaneous, the bridging would be relatively easier.</p><p>But, if i have 2 BNB tokens and it is deployed only on the BNB chain, and it is the BNB chain infact that keeps track of how much BNB tokens a user has, then how do i use these tokens to have transactions on the Solana blockchain. How do i use this token on any other blockchain except this.</p><p>This is where CCI and Bridges come in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6j1IseEza7U5QGERPwJMw.png" /></figure><p>CCI: Cross contract Invocation, this allows for one contract to call another contract, and invoke functions in them, basically allows smart contracts to talk to each other.</p><h3>BRIDGE FUNCTIONALITY EXPLAINED</h3><p>You approve a contract to take lets say 2 of your BNB tokens, and it gives itself an allowance of 2 BNB, as in it can use them anytime they want, once it is locked, then it mints 2 WBNB tokens on the Solana blockchain, and then asks you for approval to take 2 BNB and at the same time it will send your address on solana those 2 WBNB tokens, now usually these tokens are pegged to each other, so the contract minting WBNB tokens has only that many WBNB tokens in the market, as many as BNB tokens it has in its vault and can give any user the same number of BNB tokens if they come looking to exchange one for the other.</p><p>May have become very confusing for you, so lets start a bit from scratch again,</p><h3>Basically.</h3><p>Alright, so basically the whole thing is a two-way street for tokens. Imagine you’ve got two different chains, let’s say one’s like Ethereum and the other’s like Base. On the Ethereum-like side, you have this `BridgeEth` contract. When you want to move your tokens, say `ShibuCoin`, from Ethereum to Base, you call the `deposit` function on `BridgeEth`. This locks your tokens in the contract, and crucially, it emits an event.</p><p>Now, there’s a third party — a relayer — that’s constantly watching for these events. When it sees your deposit, it goes over to the Base chain. On the Base side, there’s a BridgeBase contract. The relayer, who is the owner of the BridgeBase contract, calls a function to mint new WShibuCoin for you, effectively creating an IOU on the Base chain.</p><p>So your tokens are locked on Ethereum, and you have brand new ones on Base. Now, to go the other way, you would use the BridgeBase contract. You’d call a `burn` function, which destroys your WShibuCoin on the Base chain and emits another event. The same relayer sees this event and goes back to the BridgeEth contract on Ethereum. It calls a function there that says , “hey, this person just burned their tokens on the other side, so it’s cool to give them their original WShibuCoin back.” This releases the tokens you initially locked up, and you can then withdraw them. It’s a continuous loop of locking and minting or burning and unlocking, all tied together by a trusted intermediary.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aa2ea63a52f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Layers]]></title>
            <link>https://abhinavpatra.medium.com/layers-da2644886ca5?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/da2644886ca5</guid>
            <category><![CDATA[layers]]></category>
            <category><![CDATA[layer-1]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[layer-2-solution]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 08:17:32 GMT</pubDate>
            <atom:updated>2025-07-13T08:17:32.338Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s first understand what exactly is the Blockchain, it is a ledger(khata) a notebook which keeps track of literally everything, now then the question arises, who decides what goes on the ledger, and what doesn’t, and who corrects it, that is where this is different from traditional ledgers,</p><p>No one decides. Everyone decides.</p><p>Let me explain, imagine Blockchain as just that, a chain of Blocks, each block holding data, for this ledger that we spoke of, now the question here is who decides what goes in as the next, it is decided based on consensus, there are thousands of nodes around the world trying to be the one who approves and creates the next block, and they get a lil gift if they do so, and the solution can be verified easily, by all the nodes.</p><p>So once someone proposes a new block, all the nodes, test if its true or not, and if so, then the new block is added,</p><p>Now the basis on which the come to the consensus is lil tricky, there are different consensus methods, some are 2/3rd majority, while others so proof of stake, and so on, but rest be assured, that it is always more than the majority of nodes, which if they decide that it is true, then it is added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wcvOWpDGhtJckNkWuCAYeA.png" /></figure><h3>Primary Layers</h3><p>There are two types of layers, on which function and make the blockchain what it is, and another are Blockchain layers, (Layer 0, Layer 1 Layer 2) which you may have heard about.</p><p>First lets discuss the layers that the Blockchain is built upon</p><h3>Hardware Layer</h3><p>Blockchains are made up of interconnected nodes, all around the world, which are nothing but a computer or a group of computers responsible for validating and/or processing transactions.</p><p>They provide computation for the transaction and form the supporting structure base layer for the entire blockchain.</p><h3>Data Layer:</h3><ol><li>The Layer above the Hardware layer, which records all the transaction, the transaction records, are stored in blocks(the basic unit of the blockchain) it stores information about the transaction such as public keys, hashes, transaction details in terms of amounts and type of data.</li></ol><h3>Network Layer:</h3><ol><li>This is what manages the communication between the nodes, since each block must be validated by all the other nodes, that it is not malicious. This ensures smooth connection between nodes in safe and secure manner, using p2p(peer to peer) or other cryptographically secure methods of communication.</li></ol><h3>Consensus Layer:</h3><ol><li>This is what handles the validation of the proposed blocks.</li></ol><h4>Below is an optional extra explanation :</h4><ol><li>John receives transactions A and B, while Mark receives transactions B and C. If both John and Mark validate their transactions and add them to the blockchain, transaction B will be recorded twice, causing double spending. To prevent this, John and Mark compete to solve a complex mathematical puzzle, and the first one to solve it gets to add the block to the blockchain. This method of consensus is called Proof-of-Work (PoW).</li><li>In the case of Proof-of-Stake (PoS), instead of competing to solve puzzles, the system randomly selects a validator to add the block.</li></ol><h3>Application Layer:</h3><ol><li>This is where all the Dapps(Decentralized Applications) are built. This is where most web3 or “Blockchain Developers” work, Defi apps, NFT platforms and so on come under this. While the UI/UX of these apps are similar to web2 applications, the difference herein lies in the manner of storage and retrieval of the data, which is not stored in a centralized database, but rather it is on the blocks, of the Blockchain.</li></ol><blockquote><strong><em>Blockchain Layers</em></strong></blockquote><p>You can think of each ‘layer’ as stacking itself on top of the one below it — so a ‘layer-0’ is the bottom-most layer, while a layer-1 is on top of the layer-0, and a layer-2 is on top of the layer-1. Layers can also be stacked — such as multiple layer-2s on a single layer-1.</p><blockquote>Layer 1: Bitcoin, Ethereum, Cardano, Solana, Tezos, Algorand, among many others</blockquote><h3>Layer 1.</h3><ol><li>The blockchains we generally here about are usually, Layer 1, These are the most mainstream ones. This is where the blockchain economy thrives, where dApps are built, exchanges, betting and most of the general use cases happen.</li><li>an L1’s token or coin is central to it, since they have their own governance, validation, underlying logic for connection, transaction and storage fees, which must be paid for using some amount of those tokens.</li><li>A traditional L1 blockchain might have its own set of validators securing the network. However, a L1 can also receive shared security from something called a ‘layer-0’.</li></ol><h3>Layer 0: A foundation for shared security and interoperability</h3><ol><li>This is the layer that provides <strong>interoperability, security frameworks, and consensus logic</strong></li><li>L0 is a protocol that doesn’t have any of the features in L1, this has no bloat whatsoever, without any governance at times as well.</li><li>You cant run dApps on layer 0 usually.</li><li>The goal of Layer 0 is to make the blockchain function: This layer allows for communication via physical hardware, Internet, communication with telecom providers, handling TPS, and so on..(Layer 0 operates at the <strong>protocol level</strong>, not the physical layer of the internet.)</li><li>Protocols like CCIP, IBC, and XCMP enable cross-chain communication — allowing blockchains to share data and tokens securely. Layer zero allows for sharing of data between all the other Layers, by using something called CCIP(Cross Chain Interoperability Protocol), which are communication rules that allow different blockchains to talk to each other and share information or tokens.</li><li>Interoperable blockchains can work together smoothly, making it easy to transfer information and tokens between them, which allows for simultaneous transactions, inbetween blockchains, in a smooth manner.</li></ol><h3>Layer 2</h3><ol><li>When someone builds a blockchain of their own over someone else’s L1 Blockchain, it is called a Layer 2 chain, Ethereum has L2 blockchains like, Polygon, Arbitrum, and Optimism which are faster and cheaper.</li><li>Now how are they faster and cheaper? By being more centralized. Let me explain,</li><li>L2’s typically have two parts, a network that processes the transactions and a smart contract(connected to the L1), which is the underlying logic, which resolves any disputes and achieves consensus.</li><li>As a result, the core functions of the smart contract are always to:</li><li>Hold and release funds transferred to the layer 2</li><li>Receive some kind of proof generated by the layer 2, validate it, resolve disputes, and then finalize transactions</li><li>This holding and then rollups back to the layer 1 ledger, is why it is slightly more centralised.</li><li>Essentially the L2 does the transaction on behalf of of the base blockchain. In conjunction with a smaller validator set with better hardware, this offers much higher throughput when transacting on the layer-2 network compared to the base blockchains.</li><li>These L2 Blockchains are smaller in size, they expand upon the features if their L1 bases, by extending and adding more features and functionalities in their own implementation,</li><li>Added security easier time scaling it and more manageable.</li></ol><h3>Layer 3</h3><ol><li>This is where the dApps(Decentralized Applications) are built on this layer, DApps are software applications that run on a blockchain network, giving users of that app a decentralized experience. These can be simple wallets or services which performs complex financial applications, like exchanges, lending protocols, and prediction markets.</li><li>L3s can act as bridges between different L1s or L2s, allowing apps to seamlessly interact across ecosystems. For instance, a Layer 3 social app could allow users to mint NFTs on Ethereum while using assets from Solana.</li><li>They can even add additional security and privacy features, over the other layers, with added encryption,</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da2644886ca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So You’re Trying to Make Web Development Work? Here’s Where You Start.]]></title>
            <link>https://abhinavpatra.medium.com/so-youre-trying-to-make-web-development-work-here-s-where-you-start-d8782ae787a8?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8782ae787a8</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[basics-of-programming]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 13:02:46 GMT</pubDate>
            <atom:updated>2025-04-10T15:09:33.748Z</atom:updated>
            <content:encoded><![CDATA[<p>There is an immense amount of noise regarding web development courses.<br> Anyone throwing terms at you — <em>“full-stack,”</em> <em>“React,”</em> <em>“back-end,”</em> <em>“Next.js,”</em> <em>“APIs,”</em> and on and on. Either way, you’re guaranteed to feel overwhelmed if you’re someone who is more of a newbie. Been there.<br> <strong>This blog is not for people looking to master everything within 30 days; it is for beginners — especially students — willing to learn the basics properly for at least a month or two more.</strong><br> Here is what worked for me. Do with it what you will. But don’t sit around “researching roadmaps” forever.</p><h3>Step 1: Learn HTML, CSS, and JavaScript (The Core)</h3><p>Before you leap excitedly into React, MERN, backend, or any newly-anointed shiny thing, you <strong>must</strong> first have a proper grounding in the fundamentals.</p><h3>Core Technology Stack That Comes First</h3><ul><li>HTML — The structure. The skeleton.</li><li>CSS — The style. The look-and-feel.</li><li>JavaScript — The behavior. The interactivity.</li></ul><p>And once you go advance you realise that this is not really that true.. but eh close enough.<br>Those three are your building blocks. And, no, they are not any “too basic” to matter. You should not even think about frameworks if you can’t build a static homepage with confidence using these three.<br> I gave myself a period of <strong>about 1.5 months</strong> to cover the basics. More than feasible, even with college and classes, if you just actually sit down and code.<br> My target was simple:<br> <strong>“Can I build a basic visual clone of Amazon’s homepage using plain HTML, CSS, and a bit of JS?”</strong><br> If yes, proceed. If no, keep building small projects and keep practicing. This is your signal of real progress, not finishing an intense 10-hour YouTube tutorial.</p><h3>Step 2: Use AI Intelligently (Not Like a Newbie)</h3><p>This is one of my secret weapons: <strong>ChatGPT, Claude, or Gemini</strong>.</p><p>But wait, not for coding.</p><p>I tossed in things to these AIs to explain to me in the simplest of terms — like</p><blockquote><em>“Explain Flexbox to me like I’m a ten-year-old.<br> “Break down JavaScript functions for a total novice.”</em></blockquote><p>It changed everything. Imagine having a private tutor anytime you needed one, practically.<br> But for coding, <em>do not</em> do this. If you copy-paste code from ChatGPT, you destroy your own learning. You will never get to know <em>why</em> it works; and that is far more important than getting some output on a screen.<br> So ask questions. Understand what you just read. <br><strong>Then write the code by yourself.</strong></p><h3>Step 3: Be Warned of Tutorial Hell</h3><p>This trap, too, sees many people succumb.<br> You watch 50 tutorials; you feel smart. But when it’s time to sit down and actually code something on your own, it suddenly goes blank.<br> Welcome to <strong>tutorial hell</strong>.</p><h3>Solution</h3><ul><li>Watch just enough to understand the concept.</li><li><strong>Then build something. Anything.</strong></li><li>Break. Fix. Repeat.</li></ul><p>The moment you shut the screen and start building in your own right is the moment that real learning starts.</p><h3>Step 4: Begin with MERN or Whatever Stack That Just Feels Right</h3><h4>MERN stack usually does wonders:</h4><ul><li><strong>MongoDB</strong> (database)</li><li><strong>Express.js</strong> (server framework)</li><li><strong>React</strong> (frontend)</li><li><strong>Node.js</strong> (runtime)</li></ul><p>It is suitable for beginners, extremely trendy, and will give you a good bit of information on how full-stack applications function.</p><p>If you’re not cool with MERN, here are some <strong>valid alternatives</strong>:</p><ul><li><strong>Next.js</strong> — React-based but more modern. Recommended.</li><li><strong>Spring Boot</strong> — Great if you’re into Java.</li><li><strong>Golang</strong> — Faster performance.</li><li><strong>Ruby or PHP</strong> — Old-school but simple and still relevant.</li><li><strong>Python </strong>: Multipurpose language.</li></ul><p><strong>Pick the one that fits your vibe</strong> — but the golden rule?<br> <strong>Build while learning.</strong></p><h3>Step 5: Follow These Three Creators Blindly (I Did)</h3><p>Not all tutorials are made equal. Some <em>just make you feel</em> like you’ve learned something.</p><p>These creators?<br> They actually <strong>teach you to think like a developer</strong>:</p><h3>Harkirat Singh</h3><p>Assignments that push you to build.<br> No spoon-feeding. Just work.</p><h3>Hitesh Choudhary</h3><p>Breaks complex stuff into the simplest explanations.<br> After watching, <em>you will understand</em>. Period.</p><h3>Shreyians Coding School</h3><p>Solid beginner-level content.<br> Great for building foundations right.</p><p>Follow them. Do their playlists. Trust the process.<br> Even if it feels hard or confusing in the beginning — keep going.</p><h3>TL;DR (But Don’t Be Lazy — Read the Whole Thing)</h3><ul><li>Start with <strong>HTML, CSS, JS</strong> — nothing more.</li><li>Give yourself <strong>1.5 months</strong> (yes, even with college).</li><li>Goal: <strong>Build a basic clone</strong> yourself, no tutorials.</li><li>Use ChatGPT or Gemini for <strong>explanations</strong>, not for <strong>code</strong>.</li><li><strong>Less tutorials, more building.</strong></li><li>Once you’re ready: <strong>MERN, Next.js</strong>, or whatever stack fits you.</li><li>Follow <strong>Harkirat, Hitesh, Shreyians</strong> — total goldmine of content.</li></ul><h3>Lastly</h3><p>You don’t need a perfect roadmap.<br> What you do need is <strong>momentum</strong>.</p><p>The more you build, the faster everything starts making sense.<br> The first few weeks? Pure pain. That’s normal.<br> But stay consistent, and one day you’ll think:</p><blockquote><em>“Are i can actually build this stuff, and explain it sbko.”</em></blockquote><p><strong>Build. Break. Learn. Repeat.</strong></p><h3>…and yeah</h3><p>For any interest or just to have a conversation about:<br> <strong>Web3, Solidity, Ethereum, app dev, or smart contracts</strong> — <br> <strong>get in touch with me.</strong></p><p>Otherwise, of course, <strong>don’t.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*y_hMfU2KqCVCea5u7TN4Gg.png" /></figure><ul><li>Abhinav Patra<br><a href="https://github.com/abhinavpatra">https://github.com/abhinavpatra</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8782ae787a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning Authentication in Next.js with NextAuth]]></title>
            <link>https://abhinavpatra.medium.com/learning-authentication-in-next-js-with-nextauth-e64988b7c0d7?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e64988b7c0d7</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[nextauth]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[100devs]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 11:06:23 GMT</pubDate>
            <atom:updated>2025-03-09T11:06:23.213Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Authentication is a crucial part of modern web applications. In Next.js, implementing authentication efficiently requires an understanding of <strong>catch-all routes</strong> and the <strong>NextAuth</strong> library. This guide will walk you through setting up authentication using these features, including OAuth, email, and credentials-based authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*-Ye7FN6qkzm8ayPCusRYlg.png" /></figure><h3>Understanding Catch-All Routes in Next.js</h3><p>Catch-all routes allow a single API route handler to manage multiple dynamic URL segments. This is useful when handling authentication routes with various endpoints like:</p><ul><li>/api/auth/signin</li><li>/api/auth/signout</li><li>/api/auth/callback/google</li></ul><h3>Setting Up a Catch-All Route</h3><p>Create a new file in your Next.js project:</p><pre>app/api/auth/[...nextauth]/route.ts</pre><p>Add the following code to handle requests:</p><pre>import { NextRequest, NextResponse } from &quot;next/server&quot;;<br><br>export function GET(req: NextRequest) {<br>  return NextResponse.json({ message: &quot;Handler&quot; });<br>}</pre><p>This ensures that any request starting with /api/auth/ is processed by this route.</p><h3>Implementing NextAuth for Authentication</h3><h3>Step 1: Install NextAuth</h3><p>Run the following command:</p><pre>npm install next-auth</pre><h3>Step 2: Configure NextAuth Handler</h3><p>Update the catch-all route to use NextAuth:</p><pre>import NextAuth from &quot;next-auth&quot;;<br>import { NextRequest, NextResponse } from &quot;next/server&quot;;const handler = NextAuth({<br>  // Authentication providers will be added here<br>});<br>export const GET = handler;<br>export const POST = handler;</pre><h3>Adding Authentication Providers</h3><p>NextAuth supports multiple authentication methods:</p><ol><li><strong>OAuth Providers</strong>: Google, GitHub, Twitter, etc.</li><li><strong>Email Provider</strong>: Passwordless authentication via email.</li><li><strong>Credentials Provider</strong>: Custom authentication logic.</li></ol><h3>Example: Adding a Credentials Provider</h3><pre>import NextAuth from &quot;next-auth&quot;;<br>import CredentialsProvider from &quot;next-auth/providers/credentials&quot;;<br>const handler = NextAuth({<br>    providers:[<br>        CredentialsProvider({<br>            name:&quot;Email&quot;,<br>            credentials: {<br>                username: { label:&#39;Email&#39;, type:&#39;text&#39;, placeholder:&quot;Email&quot; },<br>                password: { label:&quot;Password&quot;, type:&quot;password&quot;, placeholder:&quot;Password&quot; }<br>            },<br>            async authorize(credentials: any) {<br>                return { id: &quot;user1&quot; };<br>            }<br>        })<br>    ]<br>})<br>export const GET = handler;<br>export const POST = handler;</pre><h3>Environment Variables Setup</h3><p>Create a .env file and add:</p><pre>NEXTAUTH_URL=http://localhost:3000<br>NEXTAUTH_SECRET=your_secret_key</pre><p>For OAuth (e.g., Google authentication), add:</p><pre>GOOGLE_ID=your_google_client_id<br>GOOGLE_SECRET=your_google_client_secret</pre><h3>Wrapping the App with a Session Provider</h3><p>To manage authentication globally, wrap your application in SessionProvider.</p><h3>Create a Providers Component</h3><pre>&#39;use client&#39;;<br>import React from &#39;react&#39;;<br>import { SessionProvider } from &#39;next-auth/react&#39;;<br><br>export const Providers = ({ children }: { children: React.ReactNode }) =&gt; {<br>  return &lt;SessionProvider&gt;{children}&lt;/SessionProvider&gt;;<br>};</pre><h3>Wrap Your Layout</h3><pre>import { Providers } from &quot;./providers&quot;;<br>export default function RootLayout({ children }: { children: React.ReactNode }) {<br>  return (<br>    &lt;html lang=&quot;en&quot;&gt;<br>      &lt;body&gt;<br>        &lt;Providers&gt;<br>          {children}<br>        &lt;/Providers&gt;<br>      &lt;/body&gt;<br>    &lt;/html&gt;<br>  );<br>}</pre><h3>Adding Login and Logout Functionality</h3><p>Use the useSession hook to access authentication data.</p><h3>Example: Login &amp; Logout Buttons</h3><pre>&quot;use client&quot;;<br>import { signIn, signOut, useSession } from &quot;next-auth/react&quot;;<br>export default function AppBar() {<br>    const session = useSession();<br>    return (<br>        &lt;div&gt;<br>            &lt;button onClick={() =&gt; signIn()}&gt;Login&lt;/button&gt;<br>            &lt;button onClick={() =&gt; signOut()}&gt;Logout&lt;/button&gt;<br>            {JSON.stringify(session)}<br>        &lt;/div&gt;<br>    );<br>}</pre><h3>Callbacks for Custom Logic</h3><p>Callbacks in NextAuth allow you to modify authentication behavior.</p><pre>callbacks: {<br>    async session({ session, token }) {<br>        session.user.id = token.sub;<br>        return session;<br>    },<br>    async jwt({ token }) {<br>        token.userId = token.sub;<br>        return token;<br>    }<br>}</pre><h3>Google Authentication</h3><h3>Step 1: Create OAuth Credentials</h3><p>Go to the <a href="https://console.developers.google.com/apis/credentials">Google API Console</a> and create OAuth credentials.</p><ul><li><strong>Authorized JavaScript Origins:</strong> <a href="http://localhost:3000/">http://localhost:3000</a></li><li><strong>Redirect URI:</strong> <a href="http://localhost:3000/api/auth/callback/google">http://localhost:3000/api/auth/callback/google</a></li></ul><h3>Step 2: Configure Google Provider</h3><pre>import GoogleProvider from &quot;next-auth/providers/google&quot;;<br>export const NEXT_AUTH = {<br>    providers:[<br>        GoogleProvider({<br>            clientId: process.env.GOOGLE_ID || &quot;&quot;,<br>            clientSecret: process.env.GOOGLE_SECRET || &quot;&quot;<br>        })<br>    ],<br>    secret: process.env.NEXTAUTH_SECRET<br>};</pre><h3>Custom Sign-In Page</h3><p>If you want to override NextAuth’s default sign-in page:</p><pre>&quot;use client&quot;<br>import { signIn } from &quot;next-auth/react&quot;;<br>export default function SignInPage() {<br>    return (<br>        &lt;div&gt;<br>            &lt;button onClick={() =&gt; signIn(&quot;google&quot;)}&gt;Login with Google&lt;/button&gt;<br>            &lt;button onClick={() =&gt; signIn(&quot;credentials&quot;, { username: &quot;&quot;, password: &quot;&quot;, redirect: false })}&gt;Login with Email&lt;/button&gt;<br>        &lt;/div&gt;<br>    );<br>}</pre><p>To ensure the custom page is used, update NextAuth options:</p><pre>pages: {<br>    signIn: &#39;/signin&#39;,<br>}</pre><h3>Conclusion</h3><p>With <strong>NextAuth </strong>setting up authentication in a Next.js app becomes seamless. Whether using OAuth, email-based authentication, or custom credentials, this guide equips you with the knowledge to integrate secure authentication in your projects.</p><p>Explore additional providers at <a href="https://next-auth.js.org/providers">NextAuth Providers</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e64988b7c0d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Folly of Fear: How Insecurity Breeds Incompetence]]></title>
            <link>https://abhinavpatra.medium.com/the-folly-of-fear-how-insecurity-breeds-incompetence-c2d1cf3e024b?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2d1cf3e024b</guid>
            <category><![CDATA[fear]]></category>
            <category><![CDATA[content]]></category>
            <category><![CDATA[connection]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[democracy]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Sun, 16 Feb 2025 04:27:18 GMT</pubDate>
            <atom:updated>2025-02-16T04:28:00.301Z</atom:updated>
            <content:encoded><![CDATA[<p>Democracy, as I have come to understand is, a rule of stupid by the stupid, <br>a society which lacks wisdom elects a demagogue<br>a society which lacks intelligence elects their own self, and not men better than them, for they neither understand them nor have any comprehension of what possibilities may lie. They fear being ostracised and being subjugated to the same consequences and humiliation which they would inflict on men lower than theirs<br>Their folly lies in intellect or a lack thereof.<br>Their reaction to actions begetting real life consequences which help, and are good for everyone involved, is not one of triumphant joy for everyone, but of fear.<br>Fear that they are inconsequential and will be replaced, fear that they are not good enough, and they don’t even have one quarter of whatever it is that better men do.<br>There will always come a time, when there comes someone better than you, your duty then is to teach, guide and give them wisdom, which they may not have possessed before. Not to shun them out, out of fear, desperation or a fear that people may see how weak they truly are.</p><p>The problem herein lies, in identifying better men, to lead and guide. How do we identify those, better than us, those who know more, those who have wisdom which transcends that of theirs, beyond our own capacity of virtue.<br>Power gets time and again seized by not those with more strength, wisdom, intelligence or management, but by those who have the numbers to support them, those people choose one who is most like them and represents what they have in themselves, who look and sound like them,<br>This semi-animalistic crude way of operation doesn’t lead to world ending catastrophes<br>it leads to slow and deliberate incompetence, at every step, in every level, at every place<br>it leads to staggering actions and stupid decisions or indecisiveness by everyone, leading down the chain<br>And<br>Those competent enough get discouraged again and again and again, in the end falling in line to play the same game everyone else’s been playing<br>Some few with wisdom persist, but time as the great eroder, wears them out or pushes them to parts or place of a society not yet terrible, <br>hope is the great divider, that which can keep them up, waiting for the people to catch up or <br>to have hope, that maybe they can still affect change somehow, and do a small part, even if they have the capacity and ability to do and accomplish more</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYtXm0nr_MY4TKWc7CgFeg.png" /></figure><p>Duty to self<br>Try to do the right you can<br>Avoid the wrong you want<br>A Great man doesn’t seek to lead. He’s called to it. <br>And he answers.<br>And if you are not called yet, then you need to be more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2d1cf3e024b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[11th Feb 2025]]></title>
            <link>https://abhinavpatra.medium.com/11th-feb-2025-0bb381a93a23?source=rss-f45ec6fda22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bb381a93a23</guid>
            <category><![CDATA[connection]]></category>
            <category><![CDATA[self]]></category>
            <category><![CDATA[remembrance]]></category>
            <category><![CDATA[ideation]]></category>
            <dc:creator><![CDATA[Abhinav Patra]]></dc:creator>
            <pubDate>Wed, 12 Feb 2025 04:38:42 GMT</pubDate>
            <atom:updated>2025-02-12T05:42:29.784Z</atom:updated>
            <content:encoded><![CDATA[<p>My concern for how my physical appearance is perceived on an attractive scale is non-concerning, for perception is a slight of hand, one which can be altered at a glance, a look, an eye wink or a smile. However, my goals and ambitions, in a strictly moral sense will not take a back seat in this pursuit of life, which I have.</p><p>I will not ever succumb to that of the will of the people around me. All one has control over is the self, and how one perceives the world and treats others, irrespective of the thrust upon them. You must do what is right, and not what is expedient.</p><p>Stoics say to remind yourself every day that you don’t hate the people around you, for they don’t know better. But how long do you pick them up and teach? How long do you hope for a better them?</p><p>While lifting people from a well, you must venture into the muddy swamp yourself, risk falling, and never rising back, regardless of if you have ever been in it or not. Know when to give up on people, and know that it is sooner than you think it is.</p><p>Jesus forgives, and God is always there to help and lift you. BUT You are neither; you have no obligation than a mandatory attempt. Someone once told me that saying the truth in this world rarely works out for the teller, Just look at Jesus. Funnily enough, I have always understood and found a specific solace in it.</p><p>You don’t need to be a beacon, you stand out and you are a target, some can bare and lift it, if it’s you then bare it, if not then don’t, complaint is an illusion. If someone before has done it, you can too, that is the basic tenant by which you should try to live; act as you think is right, and the world will follow. And if they do not, you need not fetter, for it is their choice to make, and they made it.</p><p>All men die, and they all carry it with them, all the time. It is how you live that is different, the choices you make, the man you become.</p><p>In the end, both the good and bad guys die, but the reverence, the sheer epic that one creates, and the fear and dread the other perpetuates, is more telling than any other.</p><p>You must make the right decision when you can, however you can, and if not, then it is fine. Focus on the next.</p><p>Outrage provides solace to the soul who seeks absolution for inaction, a place to repent for their own ineptitude. For outrage is nothing but a fallacy that conjures and weakens the soul into nothing but words without action, energy without creation, an indulgence most engaged in, which gives temporary respite to the soul of the distressed, until the next distraction comes of age.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bb381a93a23" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>