<?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 bigjoejs on Medium]]></title>
        <description><![CDATA[Stories by bigjoejs on Medium]]></description>
        <link>https://medium.com/@bigjoefilms0?source=rss-6469021e693f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3Nrc8o0tfHzgzb-keZdp6w.jpeg</url>
            <title>Stories by bigjoejs on Medium</title>
            <link>https://medium.com/@bigjoefilms0?source=rss-6469021e693f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:43:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bigjoefilms0/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[Best Practices in Anchor: Writing Efficient and Maintainable Programs]]></title>
            <link>https://medium.com/@bigjoefilms0/best-practices-in-anchor-writing-efficient-and-maintainable-programs-5763fcc20444?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5763fcc20444</guid>
            <category><![CDATA[anchor]]></category>
            <category><![CDATA[solanas]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[program]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 14:48:43 GMT</pubDate>
            <atom:updated>2026-01-30T14:48:43.515Z</atom:updated>
            <content:encoded><![CDATA[<h3>Best Practices on Solana: Writing Efficient and Maintainable Programs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YZ8U_BBSpWX0jI9x_2QE6Q.png" /></figure><h3>Overview</h3><p>Programs are smart contracts on Solana. They’re basically the engine that processes all kinds of transactions and activities on the network, whether you’re sending tokens, minting NFTs through a Candy Machine, running a simple “hello world” script, or managing DeFi governance systems.</p><p>Solana supports writing on-chain programs using Rust, C, and C++ programming languages. <a href="https://www.anchor-lang.com/">Anchor</a>. It is a framework that accelerates building secure Rust programs on Solana. However, writing high-quality Solana program code is essential to ensure your smart contracts are secure, efficient, and easy to maintain. In this article, we’ll explore in detail the best practices that will help you achieve these goals.</p><h3>1. Enforce Signer Checks on All Authority/Mutable Operations</h3><p>Without signer validation, anyone can modify accounts they don’t own, drain funds, or perform unauthorized state changes.</p><p>Every instruction that mutates state, transfers value, or closes accounts must verify the caller’s authority using Signer&lt;&#39;info&gt;.</p><h3>2. Always Use Typed Anchor Accounts Instead of Raw AccountInfo</h3><p>Raw AccountInfo bypasses Anchor&#39;s security checks for ownership, deserialization, and type safety, enabling type confusion attacks.</p><p>Use Account&lt;&#39;info, T&gt; and Program&lt;&#39;info, T&gt; for automatic validation. Only use UncheckedAccount when necessary and document why with /// CHECK: comments.</p><h3>3. Validate Account Ownership and Data Constraints</h3><p>Missing validation allows buffer overflows, data corruption, and unauthorized access even with correct signer checks.</p><p><strong>The Rule</strong>: Validate input lengths, enforce business logic constraints, track ownership, and calculate account space correctly.</p><h4>4. Use PDAs (Program Derived Addresses) Correctly with Seeds and Bumps</h4><p>Why PDAs create deterministic, program-controlled accounts that cryptographically link users to their data, preventing unauthorized access.</p><p>Derive accounts with `seeds` and `bump`, store the bump, and validate with `has_one` to ensure only rightful owners can access their accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*GKyW2KdgntNzS_sy19iXGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ZcjayXiTgESSI4nq4waZA.png" /></figure><h3>5. Validate All Inputs Rigorously (Amounts, Indices, Timestamps, etc.)</h3><p><strong>Why it matters</strong>: Unchecked inputs cause integer overflow/underflow, array panics, and invalid calculations that drain funds.</p><p><strong>The Rule</strong>: Use checked_*() arithmetic, validate ranges with constants, check array bounds, and verify timestamp ordering.</p><h3>7. Code Reusability</h3><p>Break your code into reusable pieces. Use Cross-Program Invocations (CPIs) to call other programs instead of rebuilding everything from scratch. Extract common logic into separate crates that you can share across projects. Anchor’s derive macros already handle a ton of boilerplate — use them. Think modular instruction handlers, each doing one thing well.</p><h3>8. Comment and Document</h3><p>Write comments that actually help. Explain the weird parts — PDA derivations, complex validations, security assumptions. Use /// for doc comments so cargo doc generates useful documentation. A good README with setup steps and program architecture saves everyone time. Remember: your code gets deployed permanently, so documentation matters.</p><h3>9. Testing</h3><p>Test everything. Unit tests for individual functions, integration tests with Anchor’s test framework for full transactions. Test the happy path, test failures, test edge cases. Verify account states change correctly. Check that PDAs derive properly. Make sure errors are thrown when they should. Use solana-bankrun for faster local testing if you need it.</p><h3>10. Security Audits</h3><p>Get your code audited before mainnet. Use firms that know Solana (OtterSec, Neodyme). Run cargo-audit and clippy. Watch for the usual suspects: missing signer checks, bad account validation, overflow issues, sketchy PDA logic. Fix everything the audit finds, not just the &quot;critical&quot; stuff.</p><h3>11. Upgradeability</h3><p>Solana programs are upgradeable by default through the upgrade authority. Use PDAs for storage so data persists across upgrades. Plan how you’ll migrate data when account structures change. Version your accounts. Test upgrades on devnet first. Use a multisig for the upgrade authority on production programs. When you’re confident everything’s solid, you can make it immutable by setting the authority to None.</p><h3>12. Error Handling</h3><p>Make errors useful. Define custom error types #[error_code] and write clear messages. Use require! macros to validate early and fail fast. Never use unwrap() or panic! In production—return proper Results. Anchor&#39;s account constraints handle validation automatically, so use them.</p><pre>#[error_code]<br>pub enum MyError {<br>    #[msg(&quot;Amount can&#39;t be zero&quot;)]<br>    InvalidAmount,<br>}</pre><h3>13. Compute Unit Management</h3><p>You’ve got compute limits (200k-1.4M CU per transaction). Profile your instructions to see what’s expensive. Use ComputeBudgetInstruction when you need more CU. Simulate transactions before sending to estimate costs. Set reasonable priority fees. If something&#39;s too heavy, split it across multiple transactions.</p><h3>14. Keep It Simple</h3><p>Write straightforward code. One instruction, one job. Don’t over-engineer. Use standard patterns from SPL Token and other established programs. Simple account structures are easier to work with. Clear naming beats clever code. Complex programs are harder to audit and more likely to have bugs. When in doubt, make it simpler.</p><p><strong>Don’t forget:</strong></p><ul><li>Make accounts rent-exempt</li><li>Validate account owners and signers</li><li>Check PDA derivations carefully</li><li>Calculate account space correctly upfront</li></ul><p>If you want to go beyond theory, I’ve put together a repository that dives into <strong>common Solana smart contract vulnerabilities</strong>, why they occur, and how to fix them correctly.</p><p>The goal is simple: help builders develop a strong security mindset by learning from real mistakes, understanding attack vectors, and applying proven mitigation patterns in their own programs.</p><p><a href="https://github.com/bigjoefilms/Solana-program-development-security-best-practices">https://github.com/bigjoefilms/Solana-program-development-security-best-practices</a></p><h3>Conclusion</h3><p>Writing clean, efficient, and maintainable programs is essential for the success and security of your Solana program. By following these best practices in detail, you can reduce the risk of vulnerabilities, lower gas costs, and make your code more understandable to other developers. As Solana’s popularity continues to grow, adhering to these guidelines will keep you at the forefront of blockchain development. Happy coding!</p><h3>I ❤️ Feedback!</h3><p>If you have any feedback or questions on this guide, I’ll love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5763fcc20444" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Journey Through DevRel Uni Cohort 6: Lessons, Challenges, and Growth ]]></title>
            <link>https://medium.com/@bigjoefilms0/my-journey-through-devrel-uni-cohort-6-lessons-challenges-and-growth-085cbd3ffbdc?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/085cbd3ffbdc</guid>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Wed, 25 Dec 2024 03:15:07 GMT</pubDate>
            <atom:updated>2024-12-25T03:15:07.464Z</atom:updated>
            <content:encoded><![CDATA[<p>After years of navigating the ecosystem and experimenting with various developer tools, I often found myself lost. I didn’t know who to turn to when I couldn’t figure out where to start, nor who to thank when a tool worked seamlessly in minutes.</p><p>Who promotes these tools? Who creates the documentation? Who produces those helpful video tutorials that explain complex technologies in simple terms?</p><p>Before this summer, I didn’t have the answer. But thanks to my good friend Saul, a Cohort 5 graduate, I discovered Developer Relations (DevRel) — the team dedicated to empowering developers to implement technology and build groundbreaking applications.</p><h3>Discovering the Importance of DevRel</h3><p>My first hackathon was a game-changer. I struggled to implement the Agglayer Bridge without proper documentation or support, and that frustration sparked a realization: the critical role of DevRel. Their work is often undervalued, yet it is essential for developer success. I vowed to ensure no other developer would have to face the same struggle if I could help it.</p><h3>Starting My DevRel Uni Journey</h3><p>I joined <strong>DevRel Uni</strong> to master the basics of this exciting role. As a technical person, I lacked skills like storytelling, product “selling” to developers, and measuring realistic metrics.</p><p>From the very first class with Bianca, I was amazed by the breadth of DevRel responsibilities. “What doesn’t a DevRel do?” was the question that lingered in my mind. But I also found answers to important questions, like how to measure metrics effectively.</p><h3>Highlights from Each Class 🌟</h3><p><strong>1️⃣ Crafting a 30–60–90 Plan with Bianca</strong><br>For our first homework, we had to imagine joining Arbitrum. I focused on <strong>Stylus</strong>, their flagship product, and created a detailed plan to promote it. The feedback was overwhelming — even Arbitrum’s co-founder and official account engaged with it!</p><p><strong>2️⃣ Mastering Storytelling with Kevin Blanco</strong><br>Storytelling was a challenge for me — I’ve never been a fan of reading or analyzing narratives. But Kevin’s key points helped me craft an engaging story about my first hackathon. In the end, I was proud of the result.</p><p><strong>3️⃣ Developer Education with Coogan Brennan</strong><br>We learned how to educate developers effectively and created five proposals for Arbitrum. The exercise was practical and adaptable to any team’s product.</p><p><strong>4️⃣ Technical Tutorials with Austin Griffith</strong><br>Austin taught us how to create practical examples and implement solutions quickly. For our group homework, Roberto and I developed a tutorial on deploying your first Stylus contract and interacting with it using Scaffold-ETH.</p><p><strong>5️⃣ Video Creation with Olayinka Oshidipe</strong><br>Creating my first video was my biggest challenge. Editing, explaining in English (not my native language), and presenting technical content felt daunting. Inspired by Fireship’s style, I produced a video introduction to Stylus — and I’m proud of the outcome.</p><p><strong>6️⃣ Exploring the DevRel Ecosystem with Francesco Andreoli</strong><br>In the final class, we delved deeper into the DevRel ecosystem. The last exercise was to share our experience in the course — what you’re reading right now.</p><h3>Final Thoughts 💡</h3><p>DevRel Uni is an invaluable course for anyone aiming to pursue a career in Developer Relations or seeking to enhance their team’s workflow. It equips you with essential tools and skills, from storytelling to technical education, to video creation.</p><p>If you’re considering this path, I highly recommend pre-registering for the next cohort.</p><p>Oh, and here’s a fun insight: DevRels agree that <strong>hackathons don’t bring real users</strong> — ironically, that’s what led me to this journey. 😉</p><p>Thank you for reading about my experience at <strong>DevRel Uni Cohort 6</strong>. Feel free to connect with me on <strong>X/Twitter</strong> or <strong>LinkedIn</strong> — let’s keep building together!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=085cbd3ffbdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Compressed Token Minting System with Next.js, Helius API & light Protocol]]></title>
            <link>https://medium.com/@bigjoefilms0/building-a-compressed-token-minting-system-with-next-js-helius-api-light-protocol-3c41b5c05ccb?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c41b5c05ccb</guid>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Fri, 27 Sep 2024 21:37:01 GMT</pubDate>
            <atom:updated>2024-09-27T21:37:01.893Z</atom:updated>
            <content:encoded><![CDATA[<h3>Objectives</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rKVpVCR2MURZkIeN-If7Q.png" /></figure><p>This tutorial will build a front-end application that Mints and Transfers Compressed <strong>Tokens</strong> using the <strong>Helius API</strong> and <strong>Light</strong> <strong>Protocol.</strong> We’ll showcase how to</p><ul><li>Create a compressed token mint.</li><li>Mint tokens to a user’s account.</li><li>Transfer tokens between accounts</li></ul><h3>Prerequisites</h3><ul><li>Helius Endpoint.</li><li>Familiarity with React.</li><li>Experience with Next.js.</li></ul><h3>Overview of Technologies Used</h3><ul><li><a href="https://nextjs.org/"><strong>Next.js</strong></a>: A React framework for building server-side rendered applications.</li><li><a href="https://dashboard.helius.dev/"><strong>Helius API</strong></a>: A comprehensive API for interacting with blockchain data,</li><li><a href="https://vercel.com/login?next=%2Fhelius"><strong>Vercel</strong></a>: A platform for hosting Next.js applications.</li><li><a href="https://tailwindcss.com/"><strong>Tailwind CSS</strong></a>: A utility-first CSS framework for styling.</li></ul><h3>Understanding ZK Compression</h3><p>ZK Compression leverages zero-knowledge proofs to validate state transitions without exposing the underlying data. It does this by grouping multiple accounts into a single, verifiable Merkle root stored on-chain while the underlying data is stored on the ledger. Validity proofs are succinct zero-knowledge proofs used to prove the existence of <em>n</em> number of accounts as leaves within <em>m</em> number of state trees while maintaining a constant 128-byte proof size. These proofs are generated off-chain and verified on-chain, reducing the overall computational burden on Solana. For its prover system, ZK Compression uses <a href="https://docs.rs/groth16-solana/latest/groth16_solana/"><strong>Groth16</strong></a>, a renowned <a href="https://en.wikipedia.org/wiki/Pairing-based_cryptography"><strong>pairing-based</strong></a> zk-SNARK.</p><p>These accounts, however, are not regular Solana accounts. Instead, they are <em>compressed accounts</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*xuALqI0AnTuGJiQN.jpeg" /></figure><p><strong>The following TypeScript SDKs are used to interact with ZK Compression:</strong></p><p>TypeScript SDK ,<a href="https://github.com/Lightprotocol/light-protocol/tree/main/js/stateless.js">@lightprotocol/stateless.js</a></p><p>SDK to intera<a href="https://github.com/Lightprotocol/light-protocol/tree/main/js/stateless.js">ct with compression program</a>s via the ZK Compression RPC API</p><p>TypeSc<a href="https://github.com/Lightprotocol/light-protocol/tree/main/js/compressed-token">ript</a></p><p><a href="https://github.com/Lightprotocol/light-protocol/tree/main/js/compressed-token">@light</a><a href="https://github.com/Lightprotocol/light-protocol/tree/main/js/stateless.js">protocol/compressed-token</a></p><p><a href="https://github.com/Lightprotocol/light-protocol/tree/main/js/stateless.js">SDK to interact with the compressed token progra</a>m</p><h3>UseCases</h3><ul><li><strong>Digital Art Gallery:</strong> A place for artists to showcase and sell their work as digital collectibles. As an Artist, you can mint your pieces as NFTs without worrying about high fees, and collectors can easily buy, trade, or show off their collections.</li><li><strong>Loyalty Points:</strong> Think of a reward system where customers earn purchase tokens. These tokens can then be used to get discounts or special offers. It’s like a digital version of those old stamp cards, but cooler and more versatile!</li><li><strong>In-Game Items:</strong> For gamers, you could create a marketplace where they can buy, sell, or trade in-game items like skins, weapons, or outfits. These digital items are minted as NFTs, so players truly own them and can use them across different games.</li><li><strong>Digital Certificates:</strong> Create a platform for issuing digital certificates for courses, awards, or achievements. These certificates are tamper-proof and can be easily shared or verified.</li></ul><h3>Setting up the Project</h3><h3>API Key Setup</h3><p>To obtain a Helius API key, visit <a href="https://dashboard.helius.dev/"><strong>Helius Developer Portal</strong></a>. Here’s how to get started:</p><ol><li>Create an account using a Solana wallet, Google account, or GitHub account.</li><li>Once logged in, you’ll be prompted to create an API key.</li><li>Store this key securely, as we will be using this to make our API call<a href="http://dev.helius.xyz/">s.</a></li><li>Ensure to securely store this key, as it will be used for making API calls throughout this tutorial.</li></ol><h3>Helius RPCS:</h3><p>To mint an create and mint Compressed tokens we need to communicate with the blockchain, right? So, RPC nodes let you connect to the Solana cluster to read data and send transactions to the Blockchain. However, Solana’s scale presents challenges such as costly, slow RPC nodes, unreliable data streaming, and cryptic on-chain transactions. That’s where Helius comes in! We call it the RPC trilemma — Cost, reliability, and Performance. Acing every factor of the trilemma has made us amongst the most efficient, most generous, most reliable, AND within the top 1% of the highest performance in the entire ecosystem. So obviously, we use Helius.</p><h3>Building the Next.js Application</h3><p>Now that we’ve gone through some primary stuff, it’s ‘wibbly wobbly timey wimey’ time. Let’s get started.</p><h3>Step 1: Setting Up Your Next.js Project</h3><p><strong>Create a New Next.js App with Tailwind and Install the dependencies</strong></p><pre>npx create-next-app@latest compressed-token  --typescript --eslint</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jara3S0n3964YilM.png" /></figure><p>This will allow us to use Tailwind CSS for styling and also the new <a href="https://nextjs.org/docs/app"><strong>App router</strong></a>.</p><pre>cd compressed-token</pre><p><strong>Install the dependencies</strong></p><pre>npm install --save \<br>    @lightprotocol/stateless.js \<br>    @lightprotocol/compressed-token \<br>    @solana/web3.js \</pre><h3>Step 2: Breakdown of the Minting Process</h3><h4>1. Airdropping SOL to Payer’s Account</h4><p>To interact with the Solana blockchain, the payer account must have enough SOL to pay for transaction fees. The function connection.requestAirdrop will send 10 SOL to the payer account:</p><pre>await confirmTx(<br>  connection,<br>  await connection.requestAirdrop(payer.publicKey, 10e9)<br>);</pre><h4>2. Creating a Compressed Token Mint</h4><p>Next, we create a compressed mint using the payer’s public key:</p><pre>const { mint, transactionSignature } = await createMint(<br>  connection,<br>  payer,<br>  payer.publicKey,<br>  9 // Number of decimals<br>);</pre><h4>4. Transferring Tokens to Recipient</h4><p>Finally, we transfer 700 million tokens from the payer to the recipient:</p><pre>const transferTxId = await transfer(<br>  connection,<br>  payer,<br>  mint,<br>  7e8, // Amount to transfer<br>  payer,<br>  tokenRecipient.publicKey<br>);</pre><h4>Imports and Initial Setup</h4><pre>&#39;use client&#39;;<br>import { useState } from &#39;react&#39;;<br>import {<br>  Rpc,<br>  confirmTx,<br>  createRpc,<br>} from &#39;@lightprotocol/stateless.js&#39;;<br>import { createMint, mintTo, transfer } from &#39;@lightprotocol/compressed-token&#39;;<br>import { Keypair } from &#39;@solana/web3.js&#39;;</pre><h4>2. RPC Endpoint Configuration</h4><pre>RPC_ENDPOINT = &#39;https://devnet.helius-rpc.com/?api-key=YOUR_API_KEY&#39;;<br>const COMPRESSION_RPC_ENDPOINT = RPC_ENDPOINT;</pre><pre>// Generate keypairs for the payer and the recipient<br>const payer = Keypair.generate();<br>const tokenRecipient = Keypair.generate();</pre><ul><li><strong>RPC_ENDPOINT</strong>: This is the endpoint for connecting to the Solana Devnet via the Helius RPC service. You need to replace YOUR_API_KEY with your actual Helius API key.</li><li><strong>Keypair Generation</strong>: Two new key pairs are created: one for the payer (who will mint the tokens) and one for the recipient (who will receive the tokens).</li></ul><h3>Step 3: Setting Up the Page</h3><p>In the pages/index.tsx file, we’ll import the necessary libraries from Light Protocol, Solana and react .</p><pre>&#39;use client&#39;;</pre><pre>import { useState } from &#39;react&#39;;<br>import { Rpc, confirmTx, createRpc } from &#39;@lightprotocol/stateless.js&#39;;<br>import { createMint, mintTo, transfer } from &#39;@lightprotocol/compressed-token&#39;;<br>import { Keypair } from &#39;@solana/web3.js&#39;;</pre><pre>const RPC_ENDPOINT = &#39;https://devnet.helius-rpc.com/?api-key=YOUR_API_KEY&#39;;<br>const COMPRESSION_RPC_ENDPOINT = RPC_ENDPOINT;</pre><pre>// Generate keypairs for the payer and the recipient<br>const payer = Keypair.generate();<br>const tokenRecipient = Keypair.generate();</pre><pre>const connection: Rpc = createRpc(RPC_ENDPOINT, COMPRESSION_RPC_ENDPOINT);</pre><pre>export default function Home() {<br>  const [log, setLog] = useState&lt;string&gt;(&#39;&#39;); // To store logs<br>  const [loading, setLoading] = useState&lt;boolean&gt;(false); // To handle button state</pre><pre>  const handleMinting = async () =&gt; {<br>    setLoading(true);<br>    setLog(&#39;Starting minting process...\n&#39;);</pre><pre>    try {<br>      // Step 1: Airdrop lamports to the payer&#39;s account to pay transaction fees<br>      setLog((prev) =&gt; prev + &#39;Requesting airdrop for payer...\n&#39;);<br>      await confirmTx(<br>        connection,<br>        await connection.requestAirdrop(payer.publicKey, 10e9) // Airdrop 10 SOL<br>      );<br>      setLog((prev) =&gt; prev + `Airdropped 10 SOL to ${payer.publicKey.toString()}\n`);</pre><pre>      // Airdrop some lamports to the tokenRecipient as well<br>      setLog((prev) =&gt; prev + &#39;Requesting airdrop for recipient...\n&#39;);<br>      await confirmTx(<br>        connection,<br>        await connection.requestAirdrop(tokenRecipient.publicKey, 1e6) // Airdrop a small amount<br>      );<br>      setLog((prev) =&gt; prev + `Airdropped lamports to recipient: ${tokenRecipient.publicKey.toString()}\n`);</pre><pre>      // Step 2: Create a compressed token mint<br>      setLog((prev) =&gt; prev + &#39;Creating mint...\n&#39;);<br>      const { mint, transactionSignature } = await createMint(<br>        connection,<br>        payer,<br>        payer.publicKey,<br>        9 // Number of decimals<br>      );<br>      setLog((prev) =&gt; prev + `Mint created! Transaction: ${transactionSignature}\n`);</pre><pre>      // Step 3: Mint tokens to the payer&#39;s account<br>      setLog((prev) =&gt; prev + &#39;Minting tokens to payer...\n&#39;);<br>      const mintToTxId = await mintTo(<br>        connection,<br>        payer,<br>        mint,<br>        payer.publicKey, // Destination is payer&#39;s account<br>        payer,<br>        1e9 // Amount (1 billion units)<br>      );<br>      setLog((prev) =&gt; prev + `Minted tokens to ${payer.publicKey.toString()}! Transaction: ${mintToTxId}\n`);</pre><pre>      // Step 4: Transfer some tokens to the recipient<br>      setLog((prev) =&gt; prev + &#39;Transferring tokens to recipient...\n&#39;);<br>      const transferTxId = await transfer(<br>        connection,<br>        payer,<br>        mint,<br>        7e8, // Transfer 700 million tokens<br>        payer,<br>        tokenRecipient.publicKey<br>      );<br>      setLog((prev) =&gt; prev + `Transferred tokens to ${tokenRecipient.publicKey.toString()}! Transaction: ${transferTxId}\n`);<br>    } catch (error: any) {<br>      setLog((prev) =&gt; prev + `Error: ${error.message}\n`);<br>    }</pre><pre>    setLoading(false);<br>  };</pre><pre>  return (<br>    &lt;div className=&quot;h-screen flex items-center justify-center&quot;&gt;<br>      &lt;div className=&quot;p-8 text-center flex flex-col items-center justify-center bg-white shadow-lg rounded-lg&quot;&gt;<br>        &lt;h1 className=&quot;text-4xl font-bold mb-6&quot;&gt;Solana Token Minting System&lt;/h1&gt;<br>        &lt;button<br>          onClick={handleMinting}<br>          disabled={loading}<br>          className={`px-6 py-3 text-white rounded-lg transition-colors duration-300 ${<br>            loading ? &#39;bg-gray-400 cursor-not-allowed&#39; : &#39;bg-red-600 hover:bg-red-700&#39;<br>          }`}<br>        &gt;<br>          {loading ? &#39;Processing...&#39; : &#39;Start Minting&#39;}<br>        &lt;/button&gt;<br>        &lt;pre className=&quot;mt-6 p-4 bg-gray-100 rounded-lg text-left text-black max-h-64 overflow-y-scroll w-full&quot;&gt;<br>          {log}<br>        &lt;/pre&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Step 4: Testing the Application</h3><p><strong>Testing Locally</strong>:</p><p>Run your Next.js app:</p><pre>npm run dev</pre><p>Click on the Start Minting Button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FkgeCpFQLY_LyKjL.png" /></figure><p>You should see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-lpbgt-ZNdSxJ5M7.png" /></figure><p>What actually happens</p><ol><li><strong>Airdrop SOL to Accounts</strong>: The payer and recipient receive SOL to cover transaction fees. This step prepares the accounts to perform operations on the Solana blockchain.</li><li><strong>Create Compressed Token Mint</strong>: A compressed token mint is created, which is more efficient in terms of storage and costs compared to regular tokens. This process mints a new compressed token on Solana.</li><li><strong>Mint Compressed Tokens</strong>: A specified amount of the newly created compressed tokens are minted to the payer’s account.</li><li><strong>Transfer Compressed Tokens</strong>: A portion of the compressed tokens is then transferred from the payer’s account to the recipient’s account.</li></ol><p>Each transaction is tracked with a unique ID, confirming the successful creation, minting, and transfer of the compressed tokens on Solana.</p><p><strong>Open Explorer</strong>, and see the transaction and the new tokens in the recipient’s account!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MGsLnfK36-3AXe-A.png" /></figure><h3>Conclusion</h3><p>Congratulations on finishing this tutorial! We hope that you found it informative. The Helius API is a very powerful and speedy tool that provides developers with a way to interact with the Solana blockchain more easily and efficiently. This application It handles wallet Keypair generation, transaction requests, mint creation, token minting, and transfers, along with a simple user interface for interaction and feedback.</p><p>Feel free to ask if you have more questions or need clarification on any specific parts!</p><p>You can find the complete code here: <a href="https://github.com/bigjoefilms/helius-token">https://github.com/bigjoefilms/helius-token</a></p><h3>Further Learning Resources</h3><p>To deepen your understanding of Next.js, Solana blockchain, and API integration, explore these resources:</p><ul><li><a href="https://nextjs.org/docs"><strong>Next.js Documentation</strong></a></li><li><a href="https://docs.solana.com/developing/clients/javascript-api"><strong>Solana Web3.js Library</strong></a></li><li><a href="https://tailwindcss.com/"><strong>Tailwind CSS Official Site</strong></a></li><li><a href="https://docs.helius.dev/"><strong>Helius Documentation</strong></a></li><li><a href="https://www.zkcompression.com/introduction/intro-to-development"><strong>Zk Compression</strong></a></li></ul><p>This guide provides a solid foundation for building blockchain-based applications with Next.js and interacting with the Solana blockchain</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c41b5c05ccb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[User guide / Tutorial on using a Solana wallet]]></title>
            <link>https://medium.com/@bigjoefilms0/user-guide-tutorial-on-using-a-solana-wallet-bca0640e3020?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bca0640e3020</guid>
            <category><![CDATA[superteamdao]]></category>
            <category><![CDATA[solana-network]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Sun, 21 Jan 2024 21:59:39 GMT</pubDate>
            <atom:updated>2024-01-21T21:59:39.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92nN_4TcjR-nb0CaKfSnCQ.png" /></figure><h3>Solana Wallet Guide</h3><p>This comprehensive tutorial is designed to assist users in understanding and utilizing various Solana wallet options for sending, receiving, and engaging with SOL tokens on the Solana blockchain.</p><h3>What is a Wallet ?</h3><p>A crypto wallet is a device or application that stores a collection of keys and can be used to send, receive, and track ownership of cryptocurrencies. Wallets can take many forms. A wallet might be a directory or file in your computer’s file system, a piece of paper, or a specialized device called a <em>hardware wallet</em>. There are also various smartphone apps and computer programs that provide a user-friendly way to create and manage wallets.</p><h3>The Keypair</h3><p>Consists of a securely generated private key and its corresponding cryptographically-derived public key. Together, the private key and its associated public key form what is commonly referred to as a keypair. Within a wallet, a collection of one or more keypairs is stored, and the wallet facilitates interactions with these keypairs.</p><h3>The Public key</h3><p>Often abbreviated as Public-key, serves as the wallet’s receiving address or simply its address. This address can be openly shared and displayed. When someone intends to send cryptocurrency to a wallet, they require the wallet’s receiving address. While the address may be used to view certain information about the wallet, such as its balance, it does not grant the ability to alter the wallet or withdraw any tokens, depending on the blockchain’s implementation.</p><h3>The Private key</h3><p>This is crucial for digitally signing transactions, enabling the transfer of cryptocurrencies to another address, or making modifications to the wallet. It is imperative to keep the private key confidential, as access to it allows someone to withdraw all tokens held within the wallet. Losing the private key results in the permanent loss of any tokens sent to the wallet’s address.</p><p>Various wallet solutions offer distinct approaches to key-pair security, interaction with key-pairs, and the signing of transactions for token use or spending. These solutions vary in user-friendliness and the security measures employed for storing and backing up private keys. Solana supports multiple wallet types, allowing users to choose the optimal balance between security and convenience.</p><p>To receive SOL tokens on the Solana blockchain, the first step is to create a wallet.</p><h3>Exploring Different Types of Wallets for Solana</h3><p>There are various types of wallets available. Each type has its advantages and considerations in terms of security, accessibility, and convenience</p><h3>Hardware Wallets</h3><p>Hardware wallets are physical devices designed specifically for securely storing cryptocurrencies like Solana.</p><h3>Software Wallets</h3><p>Software wallets, also known as digital wallets, are applications that you can install on your computer or mobile device</p><h3>Web-Based Wallets</h3><p>Web-based wallets operate through a web browser and provide an accessible way to manage your Solana funds without the need for downloads or installations.</p><h3>Paper Wallets</h3><p>Paper wallets offer a unique approach to storing cryptocurrencies like Solana by generating a physical copy of both your public address and private key on paper. This method provides an offline storage solution that is highly resistant to cyber threats since it’s not connected to the internet at all times.</p><p>Explore a variety of browser and mobile app-based wallets that offer support for Solana on the Solana Ecosystem page (<a href="https://solana.com/ecosystem/explore?categories=wallet">https://solana.com/ecosystem/explore?categories=wallet</a>). Determine the most suitable option for your needs.</p><p>For users with advanced proficiency or developers, command-line wallets may be the preferred choice. This is because new features on the Solana blockchain are consistently introduced and supported on the command line before integration into third-party solutions.</p><h3>Connect to the Solana Network</h3><p>Now that you have created your new wallet, it’s time to connect it to the Solana network. Click on the network dropdown menu in Phantom and select “Custom RPC.” In the RPC URL field, enter “<a href="https://api.mainnet-beta.solana.com/">https://api.mainnet-beta.solana.com</a>” as the custom network URL. Once done, save these settings.</p><h3>1. Download the Phantom wallet</h3><ul><li>Desktop: Visit Phantom’s <a href="https://phantom.app/download">download page</a> and select your browser. Follow the steps to add the Phantom wallet extension to your browser. After installing, Phantom will open in a new tab.</li><li>Mobile: Visit the same download page and select the app store for your device (iOS/Android). Follow the steps to download and install the application.</li></ul><p><em>Note: As always, make sure you are installing the OFFICIAL browser extension. A great way to be sure is to always download the latest versions directly linked from the Phantom.app web page.</em></p><h3>2. Create a new wallet</h3><ul><li>Desktop: Visit Phantom’s download page <a href="https://phantom.app/download">https://phantom.app/download</a>. Follow the steps to add the Phantom Wallet extension to your browser. After installing, Phantom will open in a new tab.</li><li>Mobile: Visit the same download page and select the app store for your device (iOS/Android). Follow the steps to download and install the application.</li></ul><p>Once you have the Phantom extension installed, open it and click on “Create a Wallet” to begin the process of creating your new Solana wallet. You will be prompted to set a strong password for your wallet. Make sure to choose a password that is unique and secure.</p><p>When you are done you will see something like this if you need a step-by-step tutorial you can check out this article <a href="https://phantom.app/learn/guides/how-to-create-a-new-wallet">Click here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzjTUQBmxARoAa_QXLO6mA.png" /></figure><h3>Backup Your Seed Phrase</h3><p>After creating your new wallet, the phantom will provide you with a seed phrase consisting of twelve random words. It is crucial to write down this seed phrase and keep it in a safe place. This seed phrase acts as the backup for your wallet and can be used to restore access to your funds if you ever lose or forget your password.</p><h3>Test Your Wallet</h3><p>Before fully diving into the world of Solana, it’s always a good idea to test your wallet by sending a small amount of SOL tokens to it. You can ask a friend or use a <a href="https://blockgeeks.com/guides/best-cryptocurrency-exchanges/">cryptocurrency exchange</a> to send a small amount of SOL tokens to your wallet address. This will ensure that your wallet is set up correctly and you can receive funds without any issues.</p><p>Congratulations! You have successfully set up your own Solana wallet using Phantom.</p><h3>Lower Transaction Fees</h3><p>Solana wallets also offer the advantage of lower transaction fees compared to some other blockchain networks. Solana’s high-performance architecture enables fast and cost-effective transactions, making it an attractive choice for users who want to minimize fees.</p><h3>Understand the importance of your secret recovery phrase</h3><p>This phrase is vital for accessing your wallet’s funds. Losing this phrase means losing access to your wallet and its funds. Phantom never has access to your Secret Recovery Phrase, and Phantom team members will never ask for it.</p><h3>Best Practices for Securing Your Solana Wallet:</h3><ol><li><strong>Use a Strong Password:</strong> When creating your Solana wallet, employ a strong and unique password that includes a mix of uppercase and lowercase letters, numbers, and special characters. This helps deter unauthorized access by making it more challenging for hackers to guess.</li><li><strong>Enable Two-Factor Authentication (2FA):</strong> Add an extra layer of security by enabling two-factor authentication (2FA). This requires providing an additional piece of information, such as a unique code sent to your mobile device or email, along with your password.</li><li><strong>Keep Your Software Up-to-Date:</strong> Regularly update your Solana wallet software to address vulnerabilities promptly. Enable automatic updates if possible or manually check for updates to ensure you have the latest bug fixes and security patches.</li><li><strong>Be Cautious of Phishing Attempts:</strong> Stay vigilant against phishing attempts through various channels. Verify the authenticity of senders, be cautious when entering passphrases on unfamiliar websites, double-check URLs, and consider using anti-phishing extensions on your web browser.</li><li><strong>Backup Your Wallet:</strong> Protect against loss or theft by regularly backing up your Solana wallet. Utilize the provided backup phrase, a series of words, and store it securely offline. Avoid digital storage and sharing with others.</li><li><strong>Use Hardware Wallets:</strong> Consider using a hardware wallet like Ledger or Trezor for added security. These physical devices store private keys offline, minimizing the risk of hacking attempts.</li><li><strong>Regularly Check Your Transactions:</strong> Stay vigilant by regularly reviewing the transaction history associated with your Solana wallet. Detect and address any suspicious activity promptly to enhance overall security.</li></ol><h3>Conclusion</h3><p>In conclusion, you’ve now gained a comprehensive understanding of Solana wallets and their potential to elevate your decentralized finance experience. Our journey covered the exploration of various wallet types, the setup process, and security measures.</p><p>With this newfound knowledge, it’s time to put it into action. Select the Solana wallet that best suits your needs and preferences, whether it’s a hardware wallet for heightened security or a mobile wallet for convenient on-the-go access. Embark on a journey to explore the myriad possibilities Solana presents — from engaging in staking activities to immersing yourself in the dynamic realm of NFTs. Embrace this exciting frontier in blockchain technology and seize the opportunities that Solana brings to the table!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bca0640e3020" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revolutionizing Digital Collectibles: The Unprecedented Rise of cNFTs on Solana]]></title>
            <link>https://medium.com/@bigjoefilms0/revolutionizing-digital-collectibles-the-unprecedented-rise-of-cnfts-on-solana-d9e86d69a6e4?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9e86d69a6e4</guid>
            <category><![CDATA[solanas]]></category>
            <category><![CDATA[cnft]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 21:08:43 GMT</pubDate>
            <atom:updated>2023-12-13T21:08:43.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*aYZ_PojnOoBDVGfcqOtofA.jpeg" /></figure><h3>Introduction</h3><p>The emergence of compressed Non-Fungible Tokens (cNFTs) on the Solana blockchain marks a revolutionary shift in the digital collectibles landscape. These tokens transcend traditional limitations, moving beyond mere profile pictures (PFPs) to encompass art, music, games, and more. This exploration delves into the state of cNFT adoption on Solana, dissecting its influence on diverse use cases, technological advancements, community dynamics, and adoption metrics.</p><h3>Innovative Use Cases Redefining Boundaries</h3><p>DRiP: An Evolving Artistic Hub DRiP breaks conventional barriers by enabling artists to craft dynamic, evolving pieces. This platform fosters a unique connection between creators and collectors, enhancing engagement and infusing each piece with unpredictability, offering a singular experience.</p><p><strong>Solarplex:</strong> Art Integrated within Tokens Solarplex pioneers embedding art directly into tokens, ensuring seamless, immersive experiences sans external dependencies. This innovation allows users to possess and interact with the artwork within the token, fostering a symbiotic relationship between collector and creation.</p><p><strong>Dialect:</strong> Transforming Acquisition into Engaging Games Dialect introduces claim games, reshaping the act of acquiring cNFTs into an interactive community experience. This innovation not only distributes tokens but also cultivates vibrant cNFT communities through gamification.</p><h3>Empowering Tools Enabling Innovation</h3><p><strong>Underdog Protocol:</strong> Democratizing Creation Underdog Protocol empowers developers with robust infrastructure to create and deploy dynamic cNFTs. Its user-friendly approach democratizes cNFT creation, nurturing a community of innovators within the space.</p><p><strong>TipLink Pro:</strong> Redefining Distribution Accessibility TipLink Pro restructures collectibles distribution, making cNFTs accessible at scale. By lowering entry barriers, this tool fuels creativity, enabling creators to share their work with a wider audience, fostering an expansive ecosystem of collectibles.</p><h3>Quantifying cNFT Adoption Metrics</h3><p>Weekly cNFT Creation Rates Solana consistently witnesses a surge in new cNFT creations, indicating sustained interest and community activity.</p><p>User Base Growth and Accessibility Expanding unique user numbers alongside manageable costs signify cNFT adoption extending beyond niche groups.</p><p>Marketplace Activity and Economic Impact A thriving marketplace and substantial royalties reflect the financial incentives driving the cNFT ecosystem.</p><h3>Dynamic Communities and Interactive Dynamics</h3><p>Engaging Community Dynamics Dynamic cNFT features foster active engagement, creating collaborative communities passionate about pushing creative boundaries.</p><p>Contrasting Legacy NFT Communities Unlike static collections, cNFT communities thrive on interactive experiences, fostering camaraderie and excitement.</p><h3>Technological Innovations Powering cNFT Compression</h3><p>The Essence of Compression Compressed NFTs leverage innovative algorithms to reduce data size while maintaining integrity, enabling cost efficiency and broader use cases.</p><h3>The Impact of cNFTs on Solana’s Growth</h3><p>In conclusion, cNFTs are poised to be a driving force behind Solana’s product growth and user adoption. The compression technology, coupled with innovative use cases and community-driven dynamics, positions Solana as a frontrunner in the digital collectibles space. The virtuous cycle of experimentation, success, and expansion propelled by the affordability and accessibility of cNFTs will continue to draw in creators, developers, and collectors, further solidifying Solana’s position as a hub for dynamic and compressed non-fungible tokens. As cNFT adoption continues to soar, the Solana ecosystem evolves into a playground of creativity, where the possibilities are as boundless as the imagination itself.</p><h3>References</h3><ul><li>TipLink Pro: <a href="https://x.com/TipLinkOfficial/status/1725206997707133208?s=20">TipLink Pro</a></li><li>Underdog Protocol: <a href="https://www.underdogprotocol.com/">Underdog Protocol</a></li><li>DRiP Creators: <a href="https://drip.haus/discover">DRiP Creators</a></li><li>Solana Burning Man: <a href="https://x.com/kiryl_sol/status/1703858206320013427?s=20">Solana Burning Man</a></li><li>DRiP Tracker by Kiryl: <a href="https://x.com/kiryl_sol/status/1723777942612766866?s=20">DRiP Tracker</a></li><li>Picoplay: <a href="https://picoplay.fun/">Picoplay</a></li><li>Messari Q3 Report: <a href="https://messari.io/report/state-of-solana-q3-2023">Messari Q3 Report</a></li><li>Top Ledger Analytics: <a href="https://x.com/ledger_top/status/1703078010528968898?s=20">Top Ledger Analytics</a></li><li>Solarplex Embedded Art: <a href="https://x.com/solarplex_xyz/status/1729286462489645454?s=20">Solarplex Embedded Art</a></li><li>Dialect Claim Games: <a href="https://x.com/saydialect/status/1662114315678392320?s=20">Dialect Claim Games</a></li><li>TipLink Free Collectibles at Scale: <a href="https://x.com/TipLinkOfficial/status/1689352573155946496?s=20">TipLink Free Collectibles</a></li><li>Technical Explainer by Helius: <a href="https://www.helius.dev/blog/solana-nft-compression#compression-background">Technical Explainer</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9e86d69a6e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empowering Solana Development with Address Lookup Tables (ALTs) and Lookup Tables (LUTs)]]></title>
            <link>https://medium.com/@bigjoefilms0/empowering-solana-development-with-address-lookup-tables-alts-and-lookup-tables-luts-eb826a2a732d?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb826a2a732d</guid>
            <category><![CDATA[solana-blockchain]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Sat, 04 Nov 2023 09:47:51 GMT</pubDate>
            <atom:updated>2023-11-04T09:55:02.425Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>Solana, the blockchain platform known for its speed and scalability, has become a favorite among developers. To harness Solana’s full potential, developers need to optimize their code. In this advanced tutorial, we’ll dive deep into Address Lookup Tables (ALTs) and Lookup Tables (LUTs) and how they empower Solana developers to efficiently manage and process numerous addresses in a single transaction.</p><p><strong>Understanding ALTs and LUTs</strong></p><p>Address Lookup Tables, commonly referred to as “<em>lookup tables</em>” or “<em>ALTs</em>” for short, allow developers to create a collection of related addresses to efficiently load more addresses in a single transaction.</p><p>Address Lookup Tables (ALTs) and Lookup Tables (LUTs) are specialized data structures that help Solana developers handle large collections of addresses efficiently. These tables serve as maps, making it easy to access and manipulate data associated with these addresses. ALTs and LUTs are essential tools for Solana developers because they can significantly improve the efficiency of their applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kEyzQBdEa7lHSAoZ1kzFdQ.png" /></figure><p><strong>The Benefits and Use Case of ALTs and LUTs</strong></p><ol><li><strong>Unrivaled Efficiency:</strong> In Solana, dealing with a large number of addresses individually can be resource-intensive and time-consuming. ALTs and LUTs provide a streamlined approach, significantly reducing execution time.</li><li><strong>Simplified Code</strong>: ALTs and LUTs simplify your codebase by eliminating the need for complex iterations for numerous addresses. This results in more maintainable and error-resistant applications.</li><li><strong>Reduced Transaction Costs:</strong> Solana transactions come with associated costs, including fees. ALTs and LUTs reduce the number of instructions in a transaction, potentially leading to reduced fees and more cost-effective decentralized applications (dApps).</li><li><strong>Data Integrity:</strong> By centralizing address data within ALTs and LUTs, developers can improve data integrity and consistency. It becomes easier to enforce data validation and business rules.</li><li><strong>Decentralized Applications (dApps):</strong> In the context of blockchain-based decentralized applications (dApps), efficient address management is crucial. ALTs and LUTs make it easier to manage user wallets, tokens, and other assets associated with addresses.</li><li><strong>DeFi and Finance:</strong> In the DeFi (Decentralized Finance) space, efficient address management is critical for tasks such as asset staking, swapping, and lending. ALTs and LUTs can optimize these processes.</li><li><strong>Token Management:</strong> ALTs and LUTs can be used for token management, allowing developers to efficiently handle a large number of token holders and their balances within a single transaction.</li><li><strong>Scalability:</strong> As blockchain networks grow, efficient address management becomes essential for maintaining scalability. ALTs and LUTs help in scaling applications without sacrificing performance.</li></ol><p><strong>Practical Use Case:</strong> Efficient User Wallet Management</p><p>Let’s explore a practical scenario where ALTs and LUTs can be invaluable: the management of multiple-user wallets in a decentralized application. Consider a DeFi project where users can stake, swap, and provide liquidity using Solana tokens. Each user has their own wallet, and their interactions are recorded on the blockchain. Managing thousands of user wallets efficiently is a challenge without ALTs and LUTs.</p><p>Step 1: Setting Up Your Solana Project</p><p>Begin by setting up your Solana project. Ensure that you have Solana CLI and Rust installed:</p><pre>$ mkdir solana-wallet-manager<br>$ cd solana-wallet-manager<br>$ solana init<br>$ solana config set --url http://localhost:8899<br>$ solana-test-validator</pre><p>Step 2: Creating the ALT and LUT</p><p>Now, let’s create two critical data structures: UserAddressLookupTable and UserDataLookupTable to manage user addresses and their associated data efficiently. These tables will be crucial in our DeFi project.</p><pre>pub struct UserAddressLookupTable {<br>    table: Account,<br>}</pre><pre>pub struct UserDataLookupTable {<br>    table: Account,<br>}</pre><p>We will use these data structures to efficiently manage user addresses and data in our project.</p><p>Step 3: Interacting with ALTs and LUTs</p><p>Within your Solana smart contract code, you can leverage these tables to efficiently manage user addresses and data. Here’s an example of how to store user address and data:</p><pre>let user_address_lookup = UserAddressLookupTable::create(&amp;user_address_lookup_account);<br>let user_data_lookup = UserDataLookupTable::create(&amp;user_data_lookup_account);</pre><pre>// Storing user address<br>let user_id = Pubkey::new_unique();<br>let user_address = Pubkey::new_unique();<br>user_address_lookup.set_user_address(user_id, user_address);</pre><pre>// Storing user data<br>let user_data = UserData::new(...);<br>user_data_lookup.set_user_data(user_id, user_data);</pre><p>By employing ALTs and LUTs, you’ve streamlined the management of user wallets, significantly improving the efficiency of your DeFi application.</p><p><strong>Exploring the GitHub Repository</strong></p><p>To enhance the learning experience, I created a GitHub repository with an example codebase that includes the ALTs and LUTs implementation. This repository is a valuable resource for Solana developers who want to dive deeper into the code and understand how ALTs and LUTs work in practice.</p><p>HERE</p><p><a href="https://github.com/bigjoefilms/-Address-Lookup-Tables.git">bigjoefilms/-Address-Lookup-Tables</a></p><p><strong>Conclusion</strong></p><p>Address Lookup Tables (ALTs) and Lookup Tables (LUTs) are essential tools for Solana developers seeking to efficiently manage and process extensive collections of addresses. These tables simplify complex tasks, reduce transaction costs, and ultimately optimize your Solana projects, delivering exceptional user experiences. With ALTs and LUTs, you can supercharge your Solana development and take full advantage of this high-performance blockchain platform. Happy coding!</p><p>Feedback and Reproducibility</p><p>I welcome your feedback on this guide. Is it understandable and detailed enough? If you have suggestions for improvement or need further clarification, please let us know. I am committed to providing valuable resources to the Solana developer community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb826a2a732d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run unit-testing for smart contracts with Hardhat]]></title>
            <link>https://medium.com/@bigjoefilms0/how-to-run-unit-testing-for-smart-contracts-with-hardhat-26cbf59637a2?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/26cbf59637a2</guid>
            <category><![CDATA[unit-test-tools]]></category>
            <category><![CDATA[hard-hat]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Wed, 01 Mar 2023 08:40:27 GMT</pubDate>
            <atom:updated>2023-03-01T09:26:49.142Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://hardhat.org/">HardHat</a> is one of the biggest development tools used for smart contract development.</p><p>Hardhat is <strong>a development environment for Ethereum software</strong>. It consists of different components for editing, compiling, debugging, and deploying your smart contracts and dApps, all of which work together to create a complete development environment.</p><p>In this <strong>article,</strong> we’ll cover the fundamentals of using Hardhat to unit test a Solidity smart contract. Testing is one of the most important parts of smart contract development, so let’s jump right in! We will be setting up some simple tests on a contract.sol smart contract and covering some of the different aspects of Solidity testing using JavaScript.</p><h3>Hardhat Project Structure Setup</h3><ol><li>In a directory of your choice, run npm init -y</li><li>Run npm install --save-dev hardhat</li><li>Run npx hardhat and you will get the following UI on your terminal:</li></ol><pre>npx hardhat</pre><p><em>Note: if you have yarn installed along with npm, you may get errors such as </em><em>npm ERR! could not determine executable to run. In this case, you can do </em><em>yarn add hardhat.</em></p><p>Choose the option <strong><em>Create a JavaScript project</em></strong>. Say yes to everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/0*XDQ-8JE7MtRwN-jT.png" /></figure><p>You will then get a few more options such as if you want to create a .gitignore and install some dependencies like in the following image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WureyRTPrOj-99Oj.png" /></figure><ol><li><strong>Select yes to all of these options!</strong></li></ol><p>It might take a minute or two to install everything!</p><p>Go ahead and install these other dependencies just in case it didn’t do it automatically.</p><pre>npm install --save-dev chai @nomiclabs/hardhat-ethers ethers @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-chai-matchers</pre><p>Your project should now contain the following:</p><ul><li>Files: node_modules, package.json, hardhat.config.js, package-lock.json, README.md</li><li>Folders: scripts, contracts, test</li></ul><p>And since we’ll be using Chai and Ethers while testing, we need to add them as well. We also need to add Hardhat-waffle at the top of the config file.</p><pre>require(&quot;@nomiclabs/hardhat-waffle&quot;);</pre><p>When you run HardHat, it looks for everything in the hardhat.config.js , it can even run with a bare one. In it, you can define the networks, tasks, and plugins that you’ll use. You hardhat.config.js should look like this</p><pre>require(&quot;@nomiclabs/hardhat-waffle&quot;);<br><br>/**<br> * @type import(&#39;hardhat/config&#39;).HardhatUserConfig<br> */<br>module.exports = {<br>    solidity: &quot;0.8.17&quot;,<br>};Testing a Smart Contract<br></pre><h3>Testing a Smart Contract</h3><p>The first thing we need to do before we can test creates a simple smart contract. Create a folder called contracts and inside it, create a smart contract. I will call mine contract.sol .</p><p><em>paste this into </em><em>contract.sol:</em></p><pre>pragma solidity ^0.8.18;<br><br>contract Contract {<br>    function add(uint256 x, uint256 y) public pure returns (uint256){<br>        return x + y;<br>    }<br>    <br>    function subtract(uint256 x, uint256 y) public pure returns (uint256){<br>        return x - y;<br>    }<br><br>    function multiply(uint256 x, uint256 y) public pure returns (uint256){<br>        return x * y;<br>    }<br>}</pre><p>It has three functions that we can easily test. You can create more complex functions if you’d like to test those, but for this article, I will keep it simple.</p><p>With this little contract, we can compile it by running npx hardhat compile . It will take a while and create some new files that we won’t have to worry about right now.</p><p><em>Make sure to match the Solidity version in the config file and the Solidity file.</em></p><h3>Creating tests</h3><p>We need to create a new folder called test , in which we will create a Test.js file that will use Chai and Ethers to test our simple smart contract.</p><p><em>paste this into </em><em>Test.js:</em></p><pre>const { expect } = require(&quot;chai&quot;);<br><br>describe(&quot;Test contract&quot;, function () {<br>    it(&quot;Addition should work&quot;, async function () {<br>        // Create the smart contract object to test from<br>        const [owner] = await ethers.getSigners();<br>        const TestContract = await ethers.getContractFactory(&quot;Contract&quot;);<br>        const contract = await TestContract.deploy();<br><br>        // Get output from functions<br>        const additionTest = await contract.add(6, 6);<br>        const subtractionTest = await contract.subtract(6, 6);<br>        const multiplicationTest = await contract.mutiply(6, 6);<br>        expect(additionTest).to.equal(12);<br>        expect(subtractionTest).to.equal(0);<br>        expect(multiplicationTest).to.equal(36);<br>    });<br>});</pre><p>To make sure everything is working, run:</p><pre>npx hardhat compile</pre><p>Then run:</p><pre>npx hardhat test</pre><p>You should see something like this:</p><p>The final two lines inside the test check if the result is equal to our expected result, in this case, we expect 6 + 6 = 12 , 6 — 6 = 0 and 6 — 6 = 36Which is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*VnFKu-KsPbfOnITaUijJLQ.png" /></figure><p>Our test was completed without any failure. But we probably want to update our Test.js a bit. If we write a few more tests we don’t want to have to deploy the smart contract each time, we can use beforeEach it to make it a bit prettier.</p><pre>const { expect } = require(&quot;chai&quot;);<br><br>describe(&quot;Test contract&quot;, function () {<br>    let contract;<br>    let owner;<br>//<br>    beforeEach(async function () {<br>        // Create the smart contract object to test from<br>        [owner] = await ethers.getSigners();<br>        const TestContract = await ethers.getContractFactory(&quot;Contract&quot;);<br>        contract = await TestContract.deploy();<br>    });<br>//<br><br>    it(&quot;Addition should work&quot;, async function () {<br>        // Get output from functions<br>        const additionTest = await contract.add(6, 6);<br>        const subtractionTest = await contract.subtract(6, 6);<br>        const multiplicationTest = await contract.subtract(6, 6);<br>        expect(additionTest).to.equal(12);<br>        expect(subtractionTest).to.equal(0);<br>        expect(multiplicationTest).to.equal(36);<br>    <br>    });<br>});</pre><p>We now have our contract made before each test automatically instead of having to repeat those three lines each and every time.</p><h3>Reasons for this tutorial</h3><p>To provide a step-by-step guide on how to write and run unit tests for smart contracts using Hardhat, which can be a complex process for developers new to smart contract development. Overall, the tutorial could be written to help developers improve the quality and reliability of their smart contract code and to provide guidance on using a powerful tool like Hardhat for smart contract development.</p><h3>Conclusion</h3><p>That was the very basics of testing smart contracts using HardHat. If you want to read more you can check out the official docs <a href="https://hardhat.org/tutorial/testing-contracts.html">here</a>. Always make sure to test immutable smart contracts thoroughly before deploying.</p><p><strong>Thank you so much for reading and have an excellent day.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26cbf59637a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UML version and Modeling tools and software]]></title>
            <link>https://medium.com/@bigjoefilms0/uml-version-and-modeling-tools-and-software-8abc1561b8d?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8abc1561b8d</guid>
            <category><![CDATA[uml-diagrams]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Sun, 11 Dec 2022 00:55:40 GMT</pubDate>
            <atom:updated>2022-12-11T00:56:40.206Z</atom:updated>
            <content:encoded><![CDATA[<p>Unified Modeling Language has different versions varying from version 1.1 – 2.5</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0OjX8BoRMJUH8P3aVYowg.jpeg" /></figure><p><strong>WHY use UML?: </strong>UML is used for modeling the object-oriented designing of the software system using diagrams(majorly geometric in nature and symbols). The usage of a UML diagram for representing the system to be designed has major benefits,</p><ul><li>identifying the different objects and users involved in the system</li><li>visualizing the interactions not only between the objects but also with the users involved in the system</li><li>defining the processes and also the structure of the system</li><li>improve quality, and reduce costs</li><li>decrease time-to-market duration</li><li>ensure everyone involved in the project stays in sync and is always on the same page. Makes easier to maintain clear communication between the teams as the project progresses.</li></ul><p>Before starting with the UML, we need to understand the <strong>Conceptual Model</strong>, which is required in UML. The conceptual model has a great bunch of different kinds of concepts. Before going to model a system, it is necessary to explore the entities and relationships between them.</p><p>There are some essential concepts of the object-oriented model, which are very important to learn and understand for UML.</p><p>These concepts are as follows:</p><p><strong>CLASS:</strong> The Real-world is made up of so many things such as people, animals, trees, etc. These things can be grouped and can be further defined as a class. In other words, a class can be introduced as a blueprint of an object. Many similar products and items stored in a group are known as a class. In other languages, class plays a vital role like java.</p><p><strong>OBJECT:</strong> Objects are described by classes. Objects can be anything around us like a person, a tree, etc. An object can be used to decompose a system into smaller units, which can be helpful to enhance the modularity of the system. An object is also an instance of the class.</p><p><strong>INHERITANCE:</strong> In this concept, there are two main entities like child class and parent class. The child class inherits the properties and features of the parent class. A parent class can have zero or more child classes. The child-parent relationship can also be represented in a hierarchical structure that provides ease of understanding to everyone.</p><p><strong>ABSTRACTION:</strong> Abstraction is a mechanism to hide essential information from the public and explore only the less important details of a particular topic to the public or users. Abstraction hides some part of data from the user and displays it into another part of the data.</p><p><strong>POLYMORPHISM:</strong> In simple words, “more than one form.” Various objects can respond to the same information in different ways, enabling objects to interact with one another without knowing their type. Polymorphism provides the facility to exist in more than one form.</p><p><strong>ENCAPSULATION:</strong> In this mechanism, data is bound up together and keeps it as a single unit or component, and this data must be abstract from the outside world.</p><p>The version to use must be the most recent update<strong> <em>version</em> 2.5</strong> of the Unified Modelling Language because it contains all the recent updates and addition</p><p><strong>UML Design Tools/Software</strong></p><p>There are so many UML Tools out there for example -</p><h3>1. <a href="https://www.lucidchart.com/pages/">Lucidchart</a></h3><p>Many developers’ go-to diagramming tool, Lucidchart provides a suite of simple tools. Lucidchart works in real-time across many platforms thanks to its code being HTML 5-based. Lucidchart integrates with Confluence, and also with MS Team, Slack, and G Suite. Lucidchart handles anything from complex system diagrams to mind maps. Lucidchart has fans among less-technical development team members because of its easy drag-and-drop user interface.</p><p>Lucidchart input type:</p><ul><li>Drag-and-drop</li></ul><p>UML diagram types where lucidchart shines:</p><ul><li>Class diagrams</li><li>Sequence diagrams</li><li>Activity diagrams</li></ul><h3><a href="https://www.edrawmax.com/">2. EdrawMax</a></h3><p>Edrawmax will please users familiar with Microsoft products. EdrawMax’s user interface looks like Microsoft Word. Many users turn to EdrawMax when they need to export UMLs to other formats. Edrawmax exports to many file formats, including PDF, HTML, PPT, and Microsoft Word. EdrawMax comes with many templates and ready-made symbols. The final UML diagrams lack some of the sophistication of some competitors<em>.</em></p><p>Input type:</p><ul><li>Drag-and-drop</li></ul><p>UML diagram types that EdrawMax does well:</p><ul><li>Interaction overview diagrams</li><li>package diagrams</li><li>component diagrams</li></ul><h3><a href="https://www.gleek.io/">3. Gleek.io</a></h3><p>Gleek.io creates several types of UML diagrams: sequence diagrams, class diagrams, and object diagrams. Teams also use Gleek.io to create org charts, flowcharts, mind maps, and many other diagrams. As power users and developers know, using the keyboard proves much faster than using a mouse. Because Gleek.io relies on keyboard commands, developers work faster than they do with drag-and-drop diagramming programs. And Gleek.io has syntax help available right in the diagramming window should you get stuck.</p><p>Gleek input type:</p><ul><li>Keyboard, not drag-and-drop</li></ul><p>UML diagram Gleek.io does best:</p><ul><li>sequence diagrams</li><li>class diagrams</li><li>object diagrams</li></ul><h3>4. <a href="https://www.diagrams.net/">Diagrams.net</a></h3><p>Diagrams.net (formerly <em>draw</em>.<em>io</em>) offers a simple drag-and-drop interface for flowcharts and graphs, but also works for UML as well. Diagrams.net works well for a wide variety of tasks, but may not have enough specialized functions for some users. If you seek a drag-and-drop UML solution, draw.io costs a bit less than Lucidchart and offers the same ease of use for general users.</p><p>Input type:</p><ul><li>Drag-and-drop</li></ul><p>UML diagram types that diagrams.net specializes in:</p><ul><li>Case diagrams</li><li>Sequence diagrams</li><li>Activity diagrams</li></ul><p><strong>Based </strong>on use and personal thought the most preferred Uml design tool to use is LUCID CHART because Lucidchart <strong>offers easy-to-use collaboration tools</strong> that can improve the way your in-house and remote teams work together with features such as real-time co-authoring, in-editor chat, shape-specific comments, and collaborative cursors (<em>Lucidchart have much more eye-pleasing diagrams)</em>.</p><p>Got any questions or additions? Please let me know.</p><p>Thank you for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8abc1561b8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is ChatGPT(AI) the new Google?]]></title>
            <link>https://medium.com/@bigjoefilms0/is-chatgpt-ai-the-new-google-a83444aa245d?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a83444aa245d</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Sun, 11 Dec 2022 00:13:22 GMT</pubDate>
            <atom:updated>2022-12-11T00:15:07.475Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGVK5EdCKj9z77uSXfBWUw.jpeg" /></figure><p>ChatGPT is blowing up. Twitter is <a href="https://www.nytimes.com/2022/12/05/technology/chatgpt-ai-twitter.html">inundated with screenshots</a> of the app, coding sites like Stack Overflow are already <a href="https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned">banning answers produced with it</a>, and over <a href="https://indianexpress.com/article/technology/tech-news-technology/openai-chatgpt-crosses-1-million-users-ceo-says-they-might-have-to-monetise-this-8306997/">1 million people</a> have played with it. It’s a sensation.</p><p>As a professional AI researcher, I wouldn’t have called that. ChatGPT is trained specifically to act as a chat bot, but fundamentally it’s using the same GPT-3 technology that’s been available for over two years now.</p><p>What ChatGPT 3 demonstrates — moreso than impressive technology — is the crucial role that access plays in making breakthroughs truly usable. By packaging GPT-3 in a way that normal people can use, OpenAI has finally made people sit up and realize the incredible power of today’s AI.</p><p>This is nothing new; we think of Thomas Edison as the inventor of the lightbulb, not because he actually invented it, but because he successfully brought it to market and turned it into something that normal people could understand.</p><p>That will be a trend in the AI industry going forward; the companies that make using AI as easy as possible will be the ones that thrive.</p><h3>The Importance of Use Cases</h3><p>Most of today’s impressive AI systems are built on massive language models. These language models are trained on, essentially, all of the text humans have created over the last 6,000+ years.</p><p>GPT-3 ate <a href="https://syntheticengineers.com/2022/11/09/key-status-about-openais-gpt-3/">8 billion pages of text, almost every book ever published, and all of Wikipedia</a>. It spat out an AI system that exhibits properties of general intelligence and can do everything from <a href="https://syntheticengineers.com/2022/10/06/i-asked-gpt-3-to-write-a-sea-shanty-about-bidens-inauguration/">writing sea shanties</a> to solving coding problems.</p><p>None of that is new. I started beta testing GPT-3 in 2020, and the fundamentals of the system have been around for much longer than that.</p><p>Interestingly, tools like GPT-3 have been baked into all kinds of apps without anyone really knowing. Many of the AI writing assistants that writers here on this platform either fawn over or scream about are just fancy wrappers around GPT-3.</p><p>Likewise, lots of utilitarian text on the Internet — think summaries of a restaurant’s menu or little blurbs about what you’ll find in a new city — are already written by AI systems like GPT-3. You’ve probably consumed text written by GPT-3 and not even known about it.</p><h3>The Power of Access</h3><p>So why is ChatGPT such a sensation if the technology behind it has been out for a while?</p><p>It’s because ChatGPT makes that technology <strong>incredibly accessible</strong>. The chatbot is free to use, and every day people can <a href="https://openai.com/blog/chatgpt/">sign up and interact with it as if they’re texting a friend.</a> It’s not that ChatGPT does anything fundamentally new. It just does it in a way that normal people can access and thus be blown away by.</p><p>Allowing for that level of accessibility is not easy. OpenAI’s Sam Altman <a href="https://twitter.com/elonmusk/status/1599669552081960960">shared on Twitter</a> that opening up ChatGPT to the general public resulted in some eye-watering computing costs.</p><p>Each chat sent to the system reportedly costs “low digit cents” to process. If 1 million people are using the system, <strong>OpenAI is probably sinking several hundred thousand dollars a day into keeping ChatGPT operating, with no immediate business case.</strong></p><p>Academic researchers and the other people who’ve made the fundamental breakthroughs behind technologies like GPT-3 simply couldn’t afford that. Without the resources to put into making the technology accessible, the tech can’t make it out into the real world.</p><h3>Looking Backwards</h3><p>That dynamic has existed for a long time. The history of science is littered with situations where a researcher developed a breakthrough idea, only to be shoved aside by the entrepreneur or visionary who made that idea easily accessible to the public.</p><p>We think of Thomas Edison as the inventor of the lightbulb. But really, it was inventors like Vasilij Petrov, Thomas Wright, and Joseph Swan who <a href="https://www.research.unipd.it/bitstream/11577/3164116/5/21%20LightElectric.pdf">made the first lightbulb</a>s. Edison’s genius was in electrifying public buildings, building <a href="https://www.fi.edu/history-resources/edisons-lightbulb">power plants</a> and wiring, and otherwise making the technology visible and accessible to everyday people.</p><p>Edison probably lost a ton of money pulling off dramatic stunts, like <a href="http://www.shoppbs.pbs.org/wgbh/amex/edison/filmmore/description.html#:~:text=At%203pm%20on%20September%204,promised%2C%22%20the%20inventor%20said.">building a full power plant</a> just to light the home of wealthy financier JP Morgan, the New York Stock Exchange, and several newspapers’ headquarters.</p><p>But once people saw the advantage of electric lights, they needed them for their own homes. By making the technology accessible and easily visible — even at a great personal cost — Edison had unlocked a market for it that proved wildly profitable.</p><p>In the AI space, something similar is now brewing. ChatGPT shows that developing breakthrough technology won’t lead to cultural change if that technology is restricted to the lab or even to the high-powered servers of B2B clients.</p><p>For technology, as groundbreaking as AI to make it out into the real world, it has to engage the imaginations of everyday people. People need to play with it directly — and see its revolutionary power — before the tech will truly impact the world.</p><p>As the field continues to evolve, it will be the companies who continue to make the technology widely accessible — even at tremendous cost — that will ultimately succeed.</p><p>OpenAI had better get used to those eye-watering compute fees. They’re building a revolution, and revolutions are expensive.</p><p>Got any questions or additions? Please let me know.</p><p>Thank you for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a83444aa245d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[var, let, and const Differences in Javascript]]></title>
            <link>https://medium.com/@bigjoefilms0/var-let-and-const-differences-in-javascript-4f677100178e?source=rss-6469021e693f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f677100178e</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[bigjoejs]]></dc:creator>
            <pubDate>Sun, 04 Dec 2022 01:04:20 GMT</pubDate>
            <atom:updated>2022-12-04T01:43:09.206Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>One</strong> of the features that came with ES6 is the addition of let and const, which can be used for variable declaration. The question is, what makes them different from good ol&#39; var which we&#39;ve been using? If you are still not clear about this, then this article is for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rhG1icQl1jokCHZBsF1JPQ.jpeg" /></figure><p>In this article, we’ll discuss var, let and const with respect to their scope, use, and hoisting. As you read, take note of the differences between them that I&#39;ll point out.</p><h3>Var</h3><p>Before the advent of ES6, var declarations ruled. There are issues associated with variables declared with var, though. That is why it was necessary for new ways to declare variables to emerge. First, let&#39;s get to understand var more before we discuss those issues.</p><h3>Scope of var</h3><p><strong>Scope</strong> essentially means where these variables are available for use. var declarations are globally scoped or function/locally scoped.</p><p>The scope is global when a var variable is declared outside a function. This means that any variable that is declared with var outside a function block is available for use in the whole window.</p><p>var is function scoped when it is declared within a function. This means that it is available and can be accessed only within that function.</p><p>To understand further, look at the example below.</p><pre>var greeter = &quot;hey hi&quot;;<br>    <br>    function newFunction() {<br>        var hello = &quot;hello&quot;;<br>    }</pre><p>Here, greeter is globally scoped because it exists outside a function while hello is function scoped. So we cannot access the variable hello outside of a function. So if we do this:</p><pre>var tester = &quot;hey hi&quot;;<br>    <br>    function newFunction() {<br>        var hello = &quot;hello&quot;;<br>    }<br>    console.log(hello); // error: hello is not defined</pre><p>We’ll get an error which is as a result of hello not being available outside the function.</p><h3>var variables can be re-declared and updated</h3><p>This means that we can do this within the same scope and won’t get an error.</p><pre>var greeter = &quot;hey hi&quot;;<br>    var greeter = &quot;say Hello instead&quot;;</pre><p>and this also</p><pre>var greeter = &quot;hey hi&quot;;<br>    greeter = &quot;say Hello instead&quot;;</pre><h3>Hoisting of var</h3><p>Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. This means that if we do this:</p><pre>console.log (greeter);<br>    var greeter = &quot;say hello&quot;</pre><p>it is interpreted as this:</p><pre>var greeter;<br>    console.log(greeter); // greeter is undefined<br>    greeter = &quot;say hello&quot;</pre><p>So var variables are hoisted to the top of their scope and initialized with a value of undefined.</p><h3>Problem with var</h3><p>There’s a weakness that comes with var. I&#39;ll use the example below to explain:</p><pre>var greeter = &quot;hey hi&quot;;<br>    var times = 4;</pre><pre>    if (times &gt; 3) {<br>        var greeter = &quot;say Hello instead&quot;; <br>    }<br>    <br>    console.log(greeter) // &quot;say Hello instead&quot;</pre><p>So, since times &gt; 3 returns true, greeter is redefined to &quot;say Hello instead&quot;. While this is not a problem if you knowingly want greeter to be redefined, it becomes a problem when you do not realize that a variable greeter has already been defined before.</p><p>If you have used greeter in other parts of your code, you might be surprised at the output you might get. This will likely cause a lot of bugs in your code. This is why let and const are necessary.</p><h3>Let</h3><p>let is now preferred for variable declaration. It&#39;s no surprise as it comes as an improvement to var declarations. It also solves the problem with var that we just covered. Let&#39;s consider why this is so.</p><h3>let is block scoped</h3><p>A block is a chunk of code bounded by {}. A block lives in curly braces. Anything within curly braces is a block.</p><p>So a variable declared in a block with let is only available for use within that block. Let me explain this with an example:</p><pre>let greeting = &quot;say Hi&quot;;<br>   let times = 4;</pre><pre>   if (times &gt; 3) {<br>        let hello = &quot;say Hello instead&quot;;<br>        console.log(hello);// &quot;say Hello instead&quot;<br>    }<br>   console.log(hello) // hello is not defined</pre><p>We see that using hello outside its block (the curly braces where it was defined) returns an error. This is because let variables are block scoped .</p><h3>let can be updated but not re-declared.</h3><p>Just like var, a variable declared with let can be updated within its scope. Unlike var, a let variable cannot be re-declared within its scope. So while this will work:</p><pre>let greeting = &quot;say Hi&quot;;<br>    greeting = &quot;say Hello instead&quot;;</pre><p>this will return an error:</p><pre>let greeting = &quot;say Hi&quot;;<br>    let greeting = &quot;say Hello instead&quot;; // error: Identifier &#39;greeting&#39; has already been declared</pre><p>However, if the same variable is defined in different scopes, there will be no error:</p><pre>let greeting = &quot;say Hi&quot;;<br>    if (true) {<br>        let greeting = &quot;say Hello instead&quot;;<br>        console.log(greeting); // &quot;say Hello instead&quot;<br>    }<br>    console.log(greeting); // &quot;say Hi&quot;</pre><p>Why is there no error? This is because both instances are treated as different variables since they have different scopes.</p><p>This fact makes let a better choice than var. When using let, you don&#39;t have to bother if you have used a name for a variable before as a variable exists only within its scope.</p><p>Also, since a variable cannot be declared more than once within a scope, then the problem discussed earlier that occurs with var does not happen.</p><h3>Hoisting of let</h3><p>Just like var, let declarations are hoisted to the top. Unlike var which is initialized as undefined, the let keyword is not initialized. So if you try to use a let variable before declaration, you&#39;ll get a Reference Error.</p><h3>Const</h3><p>Variables declared with the const maintain constant values. const declarations share some similarities with let declarations.</p><h3>const declarations are block scoped</h3><p>Like let declarations, const declarations can only be accessed within the block they were declared.</p><h3>const cannot be updated or re-declared</h3><p>This means that the value of a variable declared with const remains the same within its scope. It cannot be updated or re-declared. So if we declare a variable with const, we can neither do this:</p><pre>const greeting = &quot;say Hi&quot;;<br>    greeting = &quot;say Hello instead&quot;;// error: Assignment to constant variable.</pre><p>nor this:</p><pre>const greeting = &quot;say Hi&quot;;<br>    const greeting = &quot;say Hello instead&quot;;// error: Identifier &#39;greeting&#39; has already been declared</pre><p>Every const declaration, therefore, must be initialized at the time of declaration.</p><p>This behavior is somehow different when it comes to objects declared with const. While a const object cannot be updated, the properties of this objects can be updated. Therefore, if we declare a const object as this:</p><pre>const greeting = {<br>        message: &quot;say Hi&quot;,<br>        times: 4<br>    }</pre><p>while we cannot do this:</p><pre>greeting = {<br>        words: &quot;Hello&quot;,<br>        number: &quot;five&quot;<br>    } // error:  Assignment to constant variable.</pre><p>we can do this:</p><pre>greeting.message = &quot;say Hello instead&quot;;</pre><p>This will update the value of greeting.message without returning errors.</p><h3>Hoisting of const</h3><p>Just like let, const declarations are hoisted to the top but are not initialized.</p><p><strong>So just in case you missed the differences, here they are:</strong></p><ul><li>var variables can be updated and re-declared within its scope; let variables can be updated but not re-declared; const variables can neither be updated nor re-declared.</li><li>They are all hoisted to the top of their scope. But while var variables are initialized with undefined, let and const variables are not initialized.</li><li>While var and let can be declared without being initialized, const and must be initialized during declaration.</li></ul><p>Got any questions or additions? Please let me know.</p><p>Thank you for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f677100178e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>