<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matthew Revell</title>
    <description>The latest articles on DEV Community by Matthew Revell (@matthewrevell).</description>
    <link>https://dev.to/matthewrevell</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F157525%2Fb47266bf-dccb-4566-b01e-733c103702d5.jpg</url>
      <title>DEV Community: Matthew Revell</title>
      <link>https://dev.to/matthewrevell</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/matthewrevell"/>
    <language>en</language>
    <item>
      <title>Arc 11 Catch-Up: Composing Solana Programs with CPIs</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Thu, 16 Jul 2026 12:46:25 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-11-catch-up-composing-solana-programs-with-cpis-406</link>
      <guid>https://dev.to/100daysofsolana/arc-11-catch-up-composing-solana-programs-with-cpis-406</guid>
      <description>&lt;p&gt;Arc 11 covered Days 71–77 of Epoch 3, and it was all about Cross-Program Invocations.&lt;/p&gt;

&lt;p&gt;In Arc 9, we wrote our first Solana program.&lt;/p&gt;

&lt;p&gt;In Arc 10, we gave that program a more useful state model with Program Derived Addresses.&lt;/p&gt;

&lt;p&gt;But our programs were still mostly working alone.&lt;/p&gt;

&lt;p&gt;They could read and update their own accounts, enforce their own constraints, and respond to instructions sent by a client. They could not directly change state owned by another program or bypass the rules that program enforced.&lt;/p&gt;

&lt;p&gt;That is an important part of Solana’s security model.&lt;/p&gt;

&lt;p&gt;The System Program owns the rules for creating accounts and transferring lamports.&lt;/p&gt;

&lt;p&gt;Token-2022 owns the rules for mints, token accounts, supply, and mint authorities.&lt;/p&gt;

&lt;p&gt;If our program needs one of those capabilities, it calls the program that owns the operation.&lt;/p&gt;

&lt;p&gt;That call is a Cross-Program Invocation, or CPI.&lt;/p&gt;

&lt;p&gt;The Web2 comparison is a service-to-service API call. One service sends a request through another service’s public interface, and the receiving service applies its own rules.&lt;/p&gt;

&lt;p&gt;A CPI works in a similar way, with one important difference: the outer and inner instructions execute as part of the same Solana transaction. If the inner call fails, the state changes made by the outer instruction are rolled back too.&lt;/p&gt;

&lt;p&gt;That combination of clear program boundaries and atomic execution is what makes Solana programs composable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our first CPI called the System Program
&lt;/h2&gt;

&lt;p&gt;The arc began with the smallest useful CPI we could build.&lt;/p&gt;

&lt;p&gt;Our Anchor program accepted a sender, a recipient, and an amount of SOL to transfer.&lt;/p&gt;

&lt;p&gt;But the program did not edit the sender’s balance directly.&lt;/p&gt;

&lt;p&gt;Instead, it called the System Program’s transfer instruction.&lt;/p&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;Accounts on Solana are owned by programs, and the owner program controls how their data may be changed. Our program could not simply reproduce the effect of a System Program transfer by adjusting balances itself.&lt;/p&gt;

&lt;p&gt;It had to ask the System Program to perform the operation.&lt;/p&gt;

&lt;p&gt;Every CPI needs three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the program being called&lt;/li&gt;
&lt;li&gt;the accounts that program expects&lt;/li&gt;
&lt;li&gt;the authority required to approve the action&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the SOL transfer, the called program was the System Program.&lt;/p&gt;

&lt;p&gt;The required accounts were the sender and recipient.&lt;/p&gt;

&lt;p&gt;The authority came from the sender, who had signed the original transaction.&lt;/p&gt;

&lt;p&gt;Our program assembled those pieces and made the inner call. The System Program then applied its own rules and either accepted or rejected the transfer.&lt;/p&gt;

&lt;p&gt;That gave us the basic CPI model we used throughout the arc.&lt;/p&gt;

&lt;p&gt;The caller requests an operation.&lt;/p&gt;

&lt;p&gt;The callee validates the request.&lt;/p&gt;

&lt;p&gt;The callee remains responsible for the state it owns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signer authority can flow into an inner call
&lt;/h2&gt;

&lt;p&gt;The sender in that first exercise was a normal wallet signer.&lt;/p&gt;

&lt;p&gt;The wallet signed the outer transaction sent by the client. When our program called the System Program, that signer privilege was also available to the inner instruction.&lt;/p&gt;

&lt;p&gt;The CPI did not invent new authority.&lt;/p&gt;

&lt;p&gt;It passed along authority that already existed in the transaction.&lt;/p&gt;

&lt;p&gt;The same applies to writable accounts. A program cannot make an account writable during a CPI if the original transaction supplied it as read-only.&lt;/p&gt;

&lt;p&gt;That gives us an important boundary:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A CPI cannot arbitrarily escalate account privileges.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Writable access must already have been granted by the transaction. Signer authority must come either from an existing signer or from a PDA controlled by the calling program.&lt;/p&gt;

&lt;p&gt;That second form of authority became the major step forward later in the arc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Token-2022 followed the same pattern
&lt;/h2&gt;

&lt;p&gt;The next exercise moved from transferring SOL to minting tokens.&lt;/p&gt;

&lt;p&gt;Our program called Token-2022’s &lt;code&gt;mint_to&lt;/code&gt; instruction to increase a mint’s supply and deposit the new tokens into a destination token account.&lt;/p&gt;

&lt;p&gt;The accounts were different, but the CPI model stayed the same.&lt;/p&gt;

&lt;p&gt;The call needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the Token-2022 program&lt;/li&gt;
&lt;li&gt;the mint&lt;/li&gt;
&lt;li&gt;the destination token account&lt;/li&gt;
&lt;li&gt;the mint authority&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The mint authority was still a regular wallet signer, so its signature flowed from the outer transaction into the Token-2022 instruction.&lt;/p&gt;

&lt;p&gt;Token-2022 then applied its own rules.&lt;/p&gt;

&lt;p&gt;It checked that the mint and destination accounts were valid, that the supplied authority matched the mint’s recorded authority, and that the authority had signed.&lt;/p&gt;

&lt;p&gt;Our program did not need to recreate any token logic.&lt;/p&gt;

&lt;p&gt;It only needed to assemble a valid request.&lt;/p&gt;

&lt;p&gt;That is the larger value of learning the CPI pattern.&lt;/p&gt;

&lt;p&gt;Once we understand the combination of program, accounts, and authority, existing Solana programs become building blocks we can call from our own code.&lt;/p&gt;

&lt;p&gt;The System Program already knows how to transfer SOL.&lt;/p&gt;

&lt;p&gt;Token-2022 already knows how to manage token supply.&lt;/p&gt;

&lt;p&gt;Our program can use those capabilities while each called program keeps control of its own rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  A CPI still crosses a real program boundary
&lt;/h2&gt;

&lt;p&gt;Anchor’s CPI helpers can make the interaction look similar to calling a local function.&lt;/p&gt;

&lt;p&gt;But the called program does not simply trust the caller.&lt;/p&gt;

&lt;p&gt;It receives an instruction, examines the supplied accounts, checks their privileges and relationships, and runs its own logic.&lt;/p&gt;

&lt;p&gt;The caller decides what it wants to request.&lt;/p&gt;

&lt;p&gt;The callee decides whether that request is valid.&lt;/p&gt;

&lt;p&gt;For the System Program, that means enforcing the rules for lamport transfers.&lt;/p&gt;

&lt;p&gt;For Token-2022, it means enforcing the rules for mints and token accounts.&lt;/p&gt;

&lt;p&gt;For another Anchor program, it means applying that program’s account constraints and instruction logic.&lt;/p&gt;

&lt;p&gt;The inner program is therefore more than a shared code library.&lt;/p&gt;

&lt;p&gt;It is a separate on-chain authority with its own state and security boundary.&lt;/p&gt;

&lt;p&gt;That is what makes composition useful. Programs can depend on one another without surrendering control of the accounts they own.&lt;/p&gt;

&lt;h2&gt;
  
  
  PDA signing gave the program its own authority
&lt;/h2&gt;

&lt;p&gt;The first two CPIs used wallet signers.&lt;/p&gt;

&lt;p&gt;That gave us a useful baseline: the user signed the outer transaction, and the inner program recognised the same authority.&lt;/p&gt;

&lt;p&gt;The next challenge introduced a different situation.&lt;/p&gt;

&lt;p&gt;We built a per-user SOL vault at a PDA.&lt;/p&gt;

&lt;p&gt;Each user had a predictable vault address derived from the program’s seeds.&lt;/p&gt;

&lt;p&gt;Depositing into the vault was straightforward. The user controlled the source account and signed the transaction, so that authority could flow into the inner transfer.&lt;/p&gt;

&lt;p&gt;Withdrawing from the vault raised a harder question.&lt;/p&gt;

&lt;p&gt;The vault was a PDA.&lt;/p&gt;

&lt;p&gt;It had no private key and could not sign a transaction in the way a wallet could.&lt;/p&gt;

&lt;p&gt;The answer was a PDA-signed CPI.&lt;/p&gt;

&lt;p&gt;When the program made the inner call, it supplied the original seeds and canonical bump used to derive the vault.&lt;/p&gt;

&lt;p&gt;The Solana runtime combined those values with the calling program’s ID and derived the address again.&lt;/p&gt;

&lt;p&gt;If the result matched the vault account, the runtime treated that PDA as a signer for the inner invocation.&lt;/p&gt;

&lt;p&gt;The program never obtained or stored a private key for the PDA.&lt;/p&gt;

&lt;p&gt;It proved authority by reproducing the derivation that created the address.&lt;/p&gt;

&lt;p&gt;That is the core of PDA signing.&lt;/p&gt;

&lt;p&gt;A program can control an on-chain account or asset through a deterministic address, then authorise actions for it only when its own instruction logic allows those actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signer seeds are not secrets
&lt;/h2&gt;

&lt;p&gt;The phrase “signer seeds” can make the seeds sound like passwords.&lt;/p&gt;

&lt;p&gt;They are not.&lt;/p&gt;

&lt;p&gt;Anyone can inspect the program and see the seed scheme. The bump may also be visible in account data or derived again by a client.&lt;/p&gt;

&lt;p&gt;That does not let another user or program impersonate the PDA.&lt;/p&gt;

&lt;p&gt;The program ID is part of the derivation.&lt;/p&gt;

&lt;p&gt;Another program could use the same seed values, but its own program ID would produce a different address.&lt;/p&gt;

&lt;p&gt;The runtime only grants signer privilege when the seeds, bump, calling program ID, and account address all match.&lt;/p&gt;

&lt;p&gt;The security comes from that relationship, along with the program logic that controls when the signer seeds are used.&lt;/p&gt;

&lt;p&gt;This gives a program its own deterministic on-chain identity without introducing another private key that someone has to create, protect, and rotate.&lt;/p&gt;

&lt;p&gt;A PDA can hold SOL, control a token mint, own a token account, or act as an authority for another program.&lt;/p&gt;

&lt;p&gt;The program decides when that authority may be exercised.&lt;/p&gt;

&lt;h2&gt;
  
  
  Programs can call other custom programs
&lt;/h2&gt;

&lt;p&gt;The first exercises called established Solana programs.&lt;/p&gt;

&lt;p&gt;Day 74 took the next step: one custom Anchor program called another.&lt;/p&gt;

&lt;p&gt;The first program owned a tally account and exposed an instruction that incremented it.&lt;/p&gt;

&lt;p&gt;The second program invoked that instruction through a CPI.&lt;/p&gt;

&lt;p&gt;The client sent a transaction to the caller program. The caller then invoked the counter program, which updated the account it owned.&lt;/p&gt;

&lt;p&gt;The client never called the counter instruction directly, but the tally still increased.&lt;/p&gt;

&lt;p&gt;That demonstrated an important boundary.&lt;/p&gt;

&lt;p&gt;The caller program could not edit the counter program’s account itself.&lt;/p&gt;

&lt;p&gt;It had to request the update through the counter program’s public instruction.&lt;/p&gt;

&lt;p&gt;The counter program remained responsible for validating the accounts and deciding whether the update was allowed.&lt;/p&gt;

&lt;p&gt;That is how larger on-chain systems can be assembled from smaller programs.&lt;/p&gt;

&lt;p&gt;One program can provide a focused capability.&lt;/p&gt;

&lt;p&gt;Another can use that capability as part of a wider workflow.&lt;/p&gt;

&lt;p&gt;The callee remains in control of its state, while the caller gains access to its public behaviour.&lt;/p&gt;

&lt;h2&gt;
  
  
  The IDL becomes a contract between programs
&lt;/h2&gt;

&lt;p&gt;To call another Anchor program, the caller needs to understand its public interface.&lt;/p&gt;

&lt;p&gt;It needs to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the program ID&lt;/li&gt;
&lt;li&gt;the available instructions&lt;/li&gt;
&lt;li&gt;the arguments those instructions accept&lt;/li&gt;
&lt;li&gt;the accounts they require&lt;/li&gt;
&lt;li&gt;the account and data types they expose&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anchor describes that interface in an IDL.&lt;/p&gt;

&lt;p&gt;The caller can use the callee’s IDL to generate typed CPI bindings. It does not need to copy or compile the callee’s source code into its own program.&lt;/p&gt;

&lt;p&gt;That is similar to using an API specification to call another service.&lt;/p&gt;

&lt;p&gt;The caller depends on the published contract rather than the internal implementation.&lt;/p&gt;

&lt;p&gt;The callee can refactor its code while keeping callers compatible, provided that its external instruction and account interface remains stable.&lt;/p&gt;

&lt;p&gt;But changes to that interface can break integrations.&lt;/p&gt;

&lt;p&gt;Renaming an instruction, changing its arguments, adding required accounts, or altering an account layout may affect programs and clients that already depend on it.&lt;/p&gt;

&lt;p&gt;Once other programs compose with ours, the IDL is no longer only a development convenience.&lt;/p&gt;

&lt;p&gt;It becomes part of the interface other software expects us to preserve.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole call stack remains atomic
&lt;/h2&gt;

&lt;p&gt;A CPI does not create a separate transaction.&lt;/p&gt;

&lt;p&gt;The inner instruction executes as part of the transaction that called the outer program.&lt;/p&gt;

&lt;p&gt;Consider an instruction that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Updates one of its own accounts.&lt;/li&gt;
&lt;li&gt;Calls Token-2022 to mint tokens.&lt;/li&gt;
&lt;li&gt;Updates another account after the mint succeeds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If Token-2022 rejects the mint, the entire transaction fails.&lt;/p&gt;

&lt;p&gt;The state update performed before the CPI does not remain on-chain.&lt;/p&gt;

&lt;p&gt;There is no partially completed result where the caller records that the operation succeeded but the token mint did not change.&lt;/p&gt;

&lt;p&gt;Everything succeeds together or everything is rolled back.&lt;/p&gt;

&lt;p&gt;Anyone who has written compensation logic or reconciliation jobs for distributed workflows will recognise why that matters.&lt;/p&gt;

&lt;p&gt;It allows a Solana program to combine operations across several programs without having to repair state when one step in the middle fails.&lt;/p&gt;

&lt;p&gt;It also means that an error deep in a chain of CPIs can cause every preceding change in the transaction to be reverted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Breaking CPIs showed where integrations fail
&lt;/h2&gt;

&lt;p&gt;Once the working paths were in place, we deliberately broke them.&lt;/p&gt;

&lt;p&gt;We tested three common categories of failure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;incorrect PDA signer seeds or bump&lt;/li&gt;
&lt;li&gt;missing or incorrect accounts&lt;/li&gt;
&lt;li&gt;the wrong program ID&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each failure exposed a different part of the contract between caller and callee.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrong signer seeds
&lt;/h3&gt;

&lt;p&gt;For a PDA-signed CPI, the runtime derives the PDA again using the supplied seeds, bump, and calling program ID.&lt;/p&gt;

&lt;p&gt;If any of those inputs are wrong, the result does not match the account expected to sign.&lt;/p&gt;

&lt;p&gt;The inner instruction then sees that its required authority is missing.&lt;/p&gt;

&lt;p&gt;A one-byte difference is enough to break the derivation.&lt;/p&gt;

&lt;p&gt;When debugging, the key question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do these exact seeds and this bump derive the exact PDA being supplied as the authority?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If they do not, the runtime cannot grant signer privilege.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrong accounts
&lt;/h3&gt;

&lt;p&gt;Every instruction expects a particular set of accounts.&lt;/p&gt;

&lt;p&gt;Those accounts may need to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;writable&lt;/li&gt;
&lt;li&gt;signers&lt;/li&gt;
&lt;li&gt;owned by a particular program&lt;/li&gt;
&lt;li&gt;derived from particular seeds&lt;/li&gt;
&lt;li&gt;linked through a stored relationship&lt;/li&gt;
&lt;li&gt;associated with a particular mint or authority&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Passing the wrong account often produces an Anchor constraint error.&lt;/p&gt;

&lt;p&gt;Those errors can identify both the account and the validation that failed.&lt;/p&gt;

&lt;p&gt;The callee’s accounts struct is therefore more than setup code.&lt;/p&gt;

&lt;p&gt;It is the contract the caller must satisfy.&lt;/p&gt;

&lt;p&gt;When a CPI fails, comparing the supplied accounts against that contract is often the fastest route to the cause.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrong program ID
&lt;/h3&gt;

&lt;p&gt;The caller must also invoke the correct program.&lt;/p&gt;

&lt;p&gt;Typed program accounts help protect this boundary. Anchor can validate the supplied program account before attempting the CPI and reject an unexpected ID during account validation.&lt;/p&gt;

&lt;p&gt;With a loosely typed program account, that protection may not exist.&lt;/p&gt;

&lt;p&gt;The runtime can invoke the program it was given, even when the instruction data was intended for someone else.&lt;/p&gt;

&lt;p&gt;The error then comes from the unintended program trying to interpret an instruction it does not recognise.&lt;/p&gt;

&lt;p&gt;This is one reason typed accounts are valuable.&lt;/p&gt;

&lt;p&gt;They turn a confusing downstream failure into a clearer validation failure at the program boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transaction logs reveal the call stack
&lt;/h2&gt;

&lt;p&gt;CPI debugging becomes easier when we stop looking only at the final error code.&lt;/p&gt;

&lt;p&gt;The transaction logs show the sequence of execution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the outer program begins&lt;/li&gt;
&lt;li&gt;it reaches the CPI&lt;/li&gt;
&lt;li&gt;the inner program is invoked&lt;/li&gt;
&lt;li&gt;the inner program validates its accounts&lt;/li&gt;
&lt;li&gt;an instruction succeeds or fails&lt;/li&gt;
&lt;li&gt;the result propagates back through the call stack&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That sequence tells us which program was running when the failure occurred.&lt;/p&gt;

&lt;p&gt;Most CPI bugs come from one of two places:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The caller assembled the request incorrectly.&lt;/li&gt;
&lt;li&gt;The callee enforced a rule that the supplied request did not satisfy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Useful questions include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which program produced the error?&lt;/li&gt;
&lt;li&gt;Which inner instruction was being called?&lt;/li&gt;
&lt;li&gt;Did the caller provide every required account?&lt;/li&gt;
&lt;li&gt;Were the signer and writable privileges correct?&lt;/li&gt;
&lt;li&gt;Did the signer seeds derive the expected PDA?&lt;/li&gt;
&lt;li&gt;Did Anchor identify a failed constraint?&lt;/li&gt;
&lt;li&gt;Was the intended program actually invoked?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A CPI failure is usually the on-chain equivalent of an API request that did not match the receiving service’s contract.&lt;/p&gt;

&lt;p&gt;The logs help us find the point where that mismatch occurred.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing the explanation forced us to choose the important part
&lt;/h2&gt;

&lt;p&gt;The final two days moved from implementation to communication.&lt;/p&gt;

&lt;p&gt;CPIs include enough moving parts that it is tempting to explain all of them at once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;program ownership&lt;/li&gt;
&lt;li&gt;nested instructions&lt;/li&gt;
&lt;li&gt;account privileges&lt;/li&gt;
&lt;li&gt;wallet signers&lt;/li&gt;
&lt;li&gt;PDA signing&lt;/li&gt;
&lt;li&gt;IDLs&lt;/li&gt;
&lt;li&gt;atomicity&lt;/li&gt;
&lt;li&gt;transaction logs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That can produce an explanation that is technically complete but hard to follow.&lt;/p&gt;

&lt;p&gt;The challenge instead asked us to choose one clear thesis.&lt;/p&gt;

&lt;p&gt;One possible framing was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A CPI is a function call with a guest list.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The called instruction needs the right program, the right accounts, and the right authority.&lt;/p&gt;

&lt;p&gt;Another focused on the major conceptual jump:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Signer seeds are how a program proves control of its PDA.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The seeds are not secret credentials. They let the runtime reconstruct the PDA under the calling program’s ID and grant it signer privilege for one inner invocation.&lt;/p&gt;

&lt;p&gt;The public explanation needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one clear mental model&lt;/li&gt;
&lt;li&gt;one small example&lt;/li&gt;
&lt;li&gt;the three ingredients of a CPI&lt;/li&gt;
&lt;li&gt;one real error encountered during the week&lt;/li&gt;
&lt;li&gt;evidence from the working program&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That evidence might be passing test output, a GitHub repository, a concise implementation excerpt, or a devnet transaction.&lt;/p&gt;

&lt;p&gt;As in the previous arcs, publishing the work was part of the learning process.&lt;/p&gt;

&lt;p&gt;Explaining where authority comes from, which program owns the operation, and why a broken CPI fails reveals gaps that successful tests alone may not expose.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 11 taught us
&lt;/h2&gt;

&lt;p&gt;Arc 11 moved us from isolated programs to composed systems.&lt;/p&gt;

&lt;p&gt;By the end of the arc, we had seen how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;call the System Program from an Anchor instruction&lt;/li&gt;
&lt;li&gt;transfer SOL through a CPI&lt;/li&gt;
&lt;li&gt;call Token-2022 to mint tokens&lt;/li&gt;
&lt;li&gt;supply the program, accounts, and authority required by a callee&lt;/li&gt;
&lt;li&gt;pass wallet signer authority into an inner instruction&lt;/li&gt;
&lt;li&gt;understand the limits on signer and writable privileges&lt;/li&gt;
&lt;li&gt;authorise an inner call with a PDA&lt;/li&gt;
&lt;li&gt;control on-chain assets without storing a private key&lt;/li&gt;
&lt;li&gt;call one custom Anchor program from another&lt;/li&gt;
&lt;li&gt;use an IDL as the contract between programs&lt;/li&gt;
&lt;li&gt;treat instruction and account changes as compatibility decisions&lt;/li&gt;
&lt;li&gt;break CPIs with incorrect seeds, accounts, and program IDs&lt;/li&gt;
&lt;li&gt;read transaction logs as a record of the program call stack&lt;/li&gt;
&lt;li&gt;explain program composition through a clear, concrete example&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The enduring lesson is that Solana programs are interoperable pieces of infrastructure.&lt;/p&gt;

&lt;p&gt;A program that needs to transfer SOL can call the System Program.&lt;/p&gt;

&lt;p&gt;A program that needs to mint tokens can call Token-2022.&lt;/p&gt;

&lt;p&gt;A program that needs behaviour exposed by another custom program can call that program through its public instruction interface.&lt;/p&gt;

&lt;p&gt;Each callee keeps control of its accounts and applies its own authorisation rules.&lt;/p&gt;

&lt;p&gt;The caller gains the capability without copying the implementation or bypassing the program that owns the state.&lt;/p&gt;

&lt;p&gt;That is what CPIs make possible:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solana programs can combine trusted on-chain capabilities into one atomic transaction.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Revisit the Arc 11 challenges
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Day 71:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f137c-fad9-d4c3-1645-e60101686d4b" rel="noopener noreferrer"&gt;Call the System Program from your own program to transfer SOL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 72:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f1411-f45c-f3ea-c369-7d3fccce3e9e" rel="noopener noreferrer"&gt;Use a CPI to mint tokens through Token-2022&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 73:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f1439-7cef-b445-1226-94ae3bfd1656" rel="noopener noreferrer"&gt;Build a PDA-controlled SOL vault and sign a CPI with seeds&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 74:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f17eb-4a8d-1431-746a-0b2e037b6c31" rel="noopener noreferrer"&gt;Call one custom Anchor program from another through its IDL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 75:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f1806-4c0d-27a9-66f4-599a3c4c4f79" rel="noopener noreferrer"&gt;Break working CPIs and debug signer, account, and program errors&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 76:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f1826-6ce3-acfb-f786-2f34571083f4" rel="noopener noreferrer"&gt;Write a clear public explanation of how Cross-Program Invocations work&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 77:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f1835-8e6d-27d6-4264-d40d141c8257" rel="noopener noreferrer"&gt;Share your composed program with code, tests, and on-chain evidence&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>learning</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Arc 10 Catch-Up: Designing Solana State with PDAs</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Thu, 16 Jul 2026 11:18:42 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-10-catch-up-designing-solana-state-with-pdas-44if</link>
      <guid>https://dev.to/100daysofsolana/arc-10-catch-up-designing-solana-state-with-pdas-44if</guid>
      <description>&lt;p&gt;Arc 10 covered Days 64–70 of Epoch 3, and it was all about Program Derived Addresses.&lt;/p&gt;

&lt;p&gt;Arc 9 gave us our first Solana program.&lt;/p&gt;

&lt;p&gt;We built a counter, stored its state in an account, restricted updates to the correct authority, and used LiteSVM to prove those rules worked.&lt;/p&gt;

&lt;p&gt;But the counter account had a limitation.&lt;/p&gt;

&lt;p&gt;It used a randomly generated keypair for its address.&lt;/p&gt;

&lt;p&gt;That is manageable in a small exercise. The client creates the account, keeps hold of its public key, and passes that address back whenever it wants to increment the counter.&lt;/p&gt;

&lt;p&gt;It becomes awkward once we want one counter per user.&lt;/p&gt;

&lt;p&gt;Where do we store all those addresses? How does a user find their counter from another device? How does the program know that the account it received is the correct counter for that wallet?&lt;/p&gt;

&lt;p&gt;Arc 10 answered those questions with Program Derived Addresses, or PDAs.&lt;/p&gt;

&lt;p&gt;A PDA gives a Solana program a predictable way to create and locate state. Its address comes from the program ID and a set of seeds chosen by the program. For our counter, that meant deriving an address from the word &lt;code&gt;counter&lt;/code&gt; and the user's public key.&lt;/p&gt;

&lt;p&gt;The same inputs always produce the same address. Different users produce different addresses.&lt;/p&gt;

&lt;p&gt;That makes PDA design part of both the program's state model and its security model.&lt;/p&gt;

&lt;h2&gt;
  
  
  A PDA gives program state a predictable address
&lt;/h2&gt;

&lt;p&gt;Before Arc 10, our client created the counter account using a fresh keypair.&lt;/p&gt;

&lt;p&gt;That gave the account a unique address, but there was no relationship between the address and what the account represented.&lt;/p&gt;

&lt;p&gt;The address did not tell us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which program used the account&lt;/li&gt;
&lt;li&gt;which user owned the counter&lt;/li&gt;
&lt;li&gt;whether it was the correct counter for a particular instruction&lt;/li&gt;
&lt;li&gt;how to find it again without saving the address somewhere&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PDAs solve this by deriving an address from known inputs.&lt;/p&gt;

&lt;p&gt;In JavaScript, we can derive one using &lt;code&gt;findProgramAddressSync&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;counterPda&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bump&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;PublicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findProgramAddressSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="nx"&gt;programId&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The inputs here are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the program ID&lt;/li&gt;
&lt;li&gt;the seed &lt;code&gt;counter&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;a bump value found during derivation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Given those same inputs, we get the same PDA every time.&lt;/p&gt;

&lt;p&gt;That is the first important property: determinism.&lt;/p&gt;

&lt;p&gt;We can close the script, run it again tomorrow, and derive the same address without storing it in a database or configuration file.&lt;/p&gt;

&lt;p&gt;The second important property is that every byte matters.&lt;/p&gt;

&lt;p&gt;Changing the seed from &lt;code&gt;counter&lt;/code&gt; to &lt;code&gt;alice&lt;/code&gt; produces a completely different address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;alicePda&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;PublicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findProgramAddressSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;alice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="nx"&gt;programId&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing it again to &lt;code&gt;bob&lt;/code&gt; produces another:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;bobPda&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;PublicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findProgramAddressSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bob&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
  &lt;span class="nx"&gt;programId&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restoring the original seed gives us the original PDA again.&lt;/p&gt;

&lt;p&gt;That small experiment made the model tangible.&lt;/p&gt;

&lt;p&gt;A PDA is a deterministic address calculated from program-specific inputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  A PDA has no private key
&lt;/h2&gt;

&lt;p&gt;There is another important difference between a PDA and an ordinary wallet address.&lt;/p&gt;

&lt;p&gt;A normal Solana keypair contains a public key and a private key. The private key can sign transactions on behalf of the public key.&lt;/p&gt;

&lt;p&gt;A PDA is deliberately derived so that it falls outside the ed25519 curve used for Solana keypairs.&lt;/p&gt;

&lt;p&gt;That means there is no corresponding private key.&lt;/p&gt;

&lt;p&gt;Nobody can generate a secret key for the PDA and sign as it directly.&lt;/p&gt;

&lt;p&gt;Instead, the program associated with the PDA can authorise actions for it by supplying the same seeds and bump used to derive it.&lt;/p&gt;

&lt;p&gt;This is especially useful when a program needs to control assets or call another program through a Cross-Program Invocation. The PDA can act as an authority without requiring someone to store and protect another private key.&lt;/p&gt;

&lt;p&gt;We did not need all of that capability for our counter, but the underlying rule matters:&lt;/p&gt;

&lt;p&gt;The program controls the derivation logic, and the derivation logic determines which address the program recognises.&lt;/p&gt;

&lt;h2&gt;
  
  
  A PDA is an address before it is an account
&lt;/h2&gt;

&lt;p&gt;One easy mistake is to talk about deriving a PDA as though we have created an account.&lt;/p&gt;

&lt;p&gt;We have not.&lt;/p&gt;

&lt;p&gt;Derivation only calculates an address.&lt;/p&gt;

&lt;p&gt;We can derive a PDA that has never held any data, lamports, tokens, or executable code. Until an instruction creates an account at that address, there is nothing there to fetch.&lt;/p&gt;

&lt;p&gt;That gives us two separate steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Derive the address.&lt;/li&gt;
&lt;li&gt;Initialise an account at that address.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Anchor helps us combine those steps when the account is first created.&lt;/p&gt;

&lt;p&gt;But the distinction is useful when debugging.&lt;/p&gt;

&lt;p&gt;If we derive the correct PDA and &lt;code&gt;getAccountInfo&lt;/code&gt; returns &lt;code&gt;null&lt;/code&gt;, that does not necessarily mean the derivation failed. It may simply mean the account has not been initialised yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the user creates one counter per wallet
&lt;/h2&gt;

&lt;p&gt;The fixed seed &lt;code&gt;[b"counter"]&lt;/code&gt; gives us one address for the entire program.&lt;/p&gt;

&lt;p&gt;That could be useful for a global account, but it cannot give every user their own counter.&lt;/p&gt;

&lt;p&gt;To do that, we added the user's public key to the seed list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="n"&gt;seeds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"counter"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="nf"&gt;.key&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.as_ref&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the PDA depends on both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the fixed namespace &lt;code&gt;counter&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;the public key of the user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wallet A gets an address derived from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"counter" + wallet A public key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wallet B gets an address derived from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"counter" + wallet B public key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the public keys differ, the resulting PDAs differ.&lt;/p&gt;

&lt;p&gt;That gives us a predictable one-counter-per-wallet model.&lt;/p&gt;

&lt;p&gt;The client does not need to create a random keypair for the counter.&lt;/p&gt;

&lt;p&gt;It does not need to store the counter address in local storage.&lt;/p&gt;

&lt;p&gt;It does not need to query a registry to discover which account belongs to the user.&lt;/p&gt;

&lt;p&gt;It can derive the address again whenever it needs it.&lt;/p&gt;

&lt;p&gt;In Web2 terms, it is similar to locating a row using a known composite key. The program defines the namespace, the wallet identifies the user, and the combination identifies the state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anchor can create the account at the derived address
&lt;/h2&gt;

&lt;p&gt;We expressed that seed scheme inside our Anchor accounts struct:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[derive(Accounts)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;InitializeCounter&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;#[account(&lt;/span&gt;
        &lt;span class="nd"&gt;init,&lt;/span&gt;
        &lt;span class="nd"&gt;payer&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;user,&lt;/span&gt;
        &lt;span class="nd"&gt;space&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="nd"&gt;Counter::INIT_SPACE,&lt;/span&gt;
        &lt;span class="nd"&gt;seeds&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"counter"&lt;/span&gt;&lt;span class="nd"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;user&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="nd"&gt;key()&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="nd"&gt;as_ref()]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;bump&lt;/span&gt;
    &lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="nd"&gt;#[account(mut)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Signer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;system_program&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Program&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Several constraints work together here.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;init&lt;/code&gt; tells Anchor to create the account.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;payer = user&lt;/code&gt; says the user will fund the account's rent-exempt lamport deposit.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;space = 8 + Counter::INIT_SPACE&lt;/code&gt; allocates enough storage for the account.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;seeds&lt;/code&gt; declares how the PDA should be derived.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bump&lt;/code&gt; tells Anchor to find and use the canonical bump for that derivation.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;space&lt;/code&gt; value deserves a moment of attention. With &lt;code&gt;InitSpace&lt;/code&gt;, Anchor calculates the size of the account's fields for us, but the allocation still needs an extra eight bytes for Anchor's account discriminator. The discriminator identifies which Anchor account type the data belongs to, and it helps prevent one account type from being deserialised as another simply because its bytes happen to have a compatible shape. Getting this wrong can stop the account from initialising or leave too little space for its data.&lt;/p&gt;

&lt;p&gt;The account itself stores the user, the count, and the bump:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account]&lt;/span&gt;
&lt;span class="nd"&gt;#[derive(InitSpace)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Pubkey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;bump&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The initialisation handler can then populate those fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;initialize_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;InitializeCounter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="py"&gt;.accounts.counter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="py"&gt;.accounts.user&lt;/span&gt;&lt;span class="nf"&gt;.key&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.bump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="py"&gt;.bumps.counter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anchor has already checked the account address and created the account before this handler runs.&lt;/p&gt;

&lt;p&gt;The handler only needs to write the initial state.&lt;/p&gt;

&lt;p&gt;That follows the same pattern we saw in Arc 9:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the accounts struct describes the required accounts and validates them&lt;/li&gt;
&lt;li&gt;the handler performs the instruction's state change&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The bump completes the derivation
&lt;/h2&gt;

&lt;p&gt;The bump can feel mysterious when we first encounter it.&lt;/p&gt;

&lt;p&gt;Solana needs PDAs to be off the ed25519 curve so that no private key exists for them.&lt;/p&gt;

&lt;p&gt;The derivation process starts with the program ID and the seeds, then tries bump values until it finds an address that satisfies that requirement.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;findProgramAddressSync&lt;/code&gt; returns both results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;counterPda&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bump&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;PublicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findProgramAddressSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBuffer&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="nx"&gt;programId&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anchor normally handles this search for us.&lt;/p&gt;

&lt;p&gt;When we write a bare &lt;code&gt;bump&lt;/code&gt; during initialisation, Anchor runs the search, finds the canonical bump, and makes it available through &lt;code&gt;ctx.bumps.counter&lt;/code&gt; so we can store it in the account.&lt;/p&gt;

&lt;p&gt;That stored value is why later instructions use a different form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="n"&gt;bump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.bump&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells Anchor: do not run the search again. Take the stored bump, perform a single derivation with it, and check the result against the supplied account.&lt;/p&gt;

&lt;p&gt;The search loop costs compute units, and it would otherwise run on every instruction that touches the account. Storing the bump once at initialisation and reusing it turns that repeated search into a single calculation.&lt;/p&gt;

&lt;p&gt;So the bump is part of how Solana finds a valid off-curve address, and storing it is a small optimisation the program pays for once and benefits from on every subsequent instruction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seeds are validation rules
&lt;/h2&gt;

&lt;p&gt;At first, PDAs can look like an address-generation convenience.&lt;/p&gt;

&lt;p&gt;They save the client from keeping track of random account addresses.&lt;/p&gt;

&lt;p&gt;That is useful, but it is only half of the story.&lt;/p&gt;

&lt;p&gt;The same seeds also let Anchor verify that an instruction received the correct account.&lt;/p&gt;

&lt;p&gt;Our increment instruction used the counter's PDA constraints again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[derive(Accounts)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;#[account(&lt;/span&gt;
        &lt;span class="nd"&gt;mut,&lt;/span&gt;
        &lt;span class="nd"&gt;seeds&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"counter"&lt;/span&gt;&lt;span class="nd"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;user&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="nd"&gt;key()&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="nd"&gt;as_ref()]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;bump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.bump&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;has_one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;
    &lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Signer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before the handler runs, Anchor can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the user's public key.&lt;/li&gt;
&lt;li&gt;Combine it with the &lt;code&gt;counter&lt;/code&gt; seed.&lt;/li&gt;
&lt;li&gt;Re-derive the expected PDA.&lt;/li&gt;
&lt;li&gt;Compare that address with the supplied counter account.&lt;/li&gt;
&lt;li&gt;Check that the account's stored &lt;code&gt;user&lt;/code&gt; field matches the signer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If any of those checks fail, the transaction is rejected before the instruction changes state.&lt;/p&gt;

&lt;p&gt;Strictly speaking, the seed constraint alone already binds this counter to the signer, because the signer's public key is part of the derivation. The &lt;code&gt;has_one = user&lt;/code&gt; check overlaps with it here, acting as defence in depth. Where &lt;code&gt;has_one&lt;/code&gt; really earns its keep is when the seeds do not include the related key, and the stored relationship is the only thing tying the account to a signer. We will see that shortly with the config account.&lt;/p&gt;

&lt;p&gt;Either way, the program does not need to repeat address checks inside every handler.&lt;/p&gt;

&lt;p&gt;The account constraints declare the invariant once:&lt;/p&gt;

&lt;p&gt;This instruction accepts the counter derived for this user, and that counter must record the same user internally.&lt;/p&gt;

&lt;p&gt;The handler can then remain focused on the state change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="py"&gt;.accounts.counter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;
        &lt;span class="py"&gt;.count&lt;/span&gt;
        &lt;span class="nf"&gt;.checked_add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.ok_or&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;ProgramError&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;ArithmeticOverflow&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The seed constraint proves we received the expected address.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;has_one&lt;/code&gt; constraint proves the account data records the expected relationship.&lt;/p&gt;

&lt;p&gt;Together, they protect the counter from substitution.&lt;/p&gt;

&lt;h2&gt;
  
  
  A spoofing attempt showed the security boundary
&lt;/h2&gt;

&lt;p&gt;We tested those constraints by deliberately passing the wrong account.&lt;/p&gt;

&lt;p&gt;Wallet A had its own counter PDA.&lt;/p&gt;

&lt;p&gt;Wallet B had a different counter PDA.&lt;/p&gt;

&lt;p&gt;Then Wallet A called &lt;code&gt;increment&lt;/code&gt; while supplying Wallet B's counter account.&lt;/p&gt;

&lt;p&gt;Without PDA validation, the program might have accepted any account with the right data shape.&lt;/p&gt;

&lt;p&gt;With the seed constraint in place, Anchor derived the counter address expected for Wallet A and compared it with the supplied address.&lt;/p&gt;

&lt;p&gt;They did not match.&lt;/p&gt;

&lt;p&gt;The instruction failed before the handler executed.&lt;/p&gt;

&lt;p&gt;That test made the security role of PDAs much clearer.&lt;/p&gt;

&lt;p&gt;The PDA is not secure merely because its address looks unusual. The protection comes from the program declaring the correct derivation and validating that derivation whenever the account is used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Global state needs a different seed scheme
&lt;/h2&gt;

&lt;p&gt;The per-user counter gave each wallet its own state.&lt;/p&gt;

&lt;p&gt;Real applications often need another category of state: information that applies to the whole program.&lt;/p&gt;

&lt;p&gt;For that, we added a configuration PDA:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="n"&gt;seeds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"config"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because this derivation does not include a user public key, every caller derives the same address.&lt;/p&gt;

&lt;p&gt;That makes it suitable for singleton state.&lt;/p&gt;

&lt;p&gt;Our config account stored fields such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account]&lt;/span&gt;
&lt;span class="nd"&gt;#[derive(InitSpace)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Config&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Pubkey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;paused&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;total_counters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;bump&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the program had two kinds of state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one global configuration account&lt;/li&gt;
&lt;li&gt;one counter account per user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The config account could hold program-wide policy.&lt;/p&gt;

&lt;p&gt;The counter account could hold user-specific data.&lt;/p&gt;

&lt;p&gt;The two can also meet in a single instruction. Our &lt;code&gt;initialize_counter&lt;/code&gt; handler incremented &lt;code&gt;config.total_counters&lt;/code&gt; alongside creating the user's counter, so one transaction touched both the global account and the per-user account. That pattern, one instruction updating global and scoped state together, appears constantly in real programs.&lt;/p&gt;

&lt;p&gt;A program might have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one global marketplace configuration&lt;/li&gt;
&lt;li&gt;one position per trader&lt;/li&gt;
&lt;li&gt;one vault per token mint&lt;/li&gt;
&lt;li&gt;one profile per wallet&lt;/li&gt;
&lt;li&gt;one pool account per asset pair&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The seed scheme tells us which state is shared and which state is scoped to a particular entity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Constraints let us express relationships and business rules
&lt;/h2&gt;

&lt;p&gt;As the program gained more state, Anchor constraints became its main validation language.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account(&lt;/span&gt;
    &lt;span class="nd"&gt;seeds&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"config"&lt;/span&gt;&lt;span class="nd"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="py"&gt;.bump&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;has_one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Signer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;has_one = admin&lt;/code&gt; checks that the public key stored in &lt;code&gt;config.admin&lt;/code&gt; matches the signer passed as &lt;code&gt;admin&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Notice that the config seeds contain no user key, so the derivation alone cannot tell us who is allowed to administer the account. The stored &lt;code&gt;admin&lt;/code&gt; field is the only link, and &lt;code&gt;has_one&lt;/code&gt; is what enforces it. This is the case where &lt;code&gt;has_one&lt;/code&gt; is doing essential work rather than doubling up on the seed check.&lt;/p&gt;

&lt;p&gt;If the counter accounts are rows keyed by user ID, the config account is the settings table: one row, program-wide, with a recorded owner. And &lt;code&gt;has_one&lt;/code&gt; behaves much like a foreign-key check, verifying that a stored reference actually points at the account the instruction received. The difference from a Web2 database is that these checks execute on-chain, as part of every transaction.&lt;/p&gt;

&lt;p&gt;We could also enforce the pause rule directly on the account. To do that, the increment instruction's accounts struct gains the config account alongside the counter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account(&lt;/span&gt;
    &lt;span class="nd"&gt;seeds&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"config"&lt;/span&gt;&lt;span class="nd"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="py"&gt;.bump&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;constraint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="py"&gt;.paused&lt;/span&gt;
&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Config&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the config account is now part of the instruction's required accounts, its constraints run during account validation, and an increment fails while the program is paused.&lt;/p&gt;

&lt;p&gt;The handler does not need to contain a separate conditional:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="py"&gt;.paused&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nd"&gt;err!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;CounterError&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;ProgramPaused&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That does not mean every business rule belongs in an account constraint. Some rules are clearer inside the handler.&lt;/p&gt;

&lt;p&gt;But Arc 10 showed how much of the program's structure can be expressed declaratively:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;seeds&lt;/code&gt; identifies the expected PDA&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bump&lt;/code&gt; completes its derivation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;has_one&lt;/code&gt; checks a stored relationship&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;constraint&lt;/code&gt; applies a custom condition&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mut&lt;/code&gt; marks accounts whose state may change&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Signer&lt;/code&gt; proves that the required wallet authorised the transaction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These constraints run before the handler.&lt;/p&gt;

&lt;p&gt;The instruction only reaches its state-changing logic after the required accounts and relationships have been validated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Singleton initialisation needs an explicit governance decision
&lt;/h2&gt;

&lt;p&gt;Our exercise allowed the first caller of &lt;code&gt;init_config&lt;/code&gt; to become the administrator.&lt;/p&gt;

&lt;p&gt;That kept the initialisation code approachable and let us focus on PDAs and constraints.&lt;/p&gt;

&lt;p&gt;It should not be copied into a production program without considering the consequences.&lt;/p&gt;

&lt;p&gt;If anyone can initialise the singleton config account, then whoever reaches it first may become the program administrator.&lt;/p&gt;

&lt;p&gt;A production deployment should define who is allowed to perform that initial setup.&lt;/p&gt;

&lt;p&gt;Depending on the program, that authority might be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a known deployment wallet&lt;/li&gt;
&lt;li&gt;the program's upgrade authority&lt;/li&gt;
&lt;li&gt;a multisig&lt;/li&gt;
&lt;li&gt;an existing governance account&lt;/li&gt;
&lt;li&gt;another PDA with its own initialisation rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The correct design depends on how the program will be governed.&lt;/p&gt;

&lt;p&gt;The important lesson is that a singleton PDA gives us one canonical address. It does not decide who should be allowed to create or control the account at that address.&lt;/p&gt;

&lt;p&gt;That decision still belongs to the program.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing an account completes the state lifecycle
&lt;/h2&gt;

&lt;p&gt;Creating an account costs lamports.&lt;/p&gt;

&lt;p&gt;The payer deposits enough lamports to make the account rent-exempt, and those lamports remain attached to the account while it exists.&lt;/p&gt;

&lt;p&gt;When the state is no longer needed, the program can close the account and return those lamports.&lt;/p&gt;

&lt;p&gt;We added a &lt;code&gt;close_counter&lt;/code&gt; instruction using Anchor's &lt;code&gt;close&lt;/code&gt; constraint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[derive(Accounts)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;CloseCounter&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;#[account(&lt;/span&gt;
        &lt;span class="nd"&gt;mut,&lt;/span&gt;
        &lt;span class="nd"&gt;seeds&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"counter"&lt;/span&gt;&lt;span class="nd"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;user&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="nd"&gt;key()&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="nd"&gt;as_ref()]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;bump&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.bump&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;has_one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;close&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;
    &lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="nd"&gt;#[account(mut)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Signer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The familiar constraints still protect the account.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;seeds&lt;/code&gt; and &lt;code&gt;bump&lt;/code&gt; verify that this is the user's canonical counter PDA.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;has_one = user&lt;/code&gt; checks the ownership relationship stored inside the account.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;close = user&lt;/code&gt; tells Anchor where to send the account's remaining lamports.&lt;/p&gt;

&lt;p&gt;The handler itself can be empty:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;close_counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;_ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;CloseCounter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the instruction completes, Anchor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;transfers the account's lamports to the user&lt;/li&gt;
&lt;li&gt;invalidates the account data&lt;/li&gt;
&lt;li&gt;leaves no live account at that PDA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can still derive the same address later because the derivation inputs have not changed.&lt;/p&gt;

&lt;p&gt;But fetching the account will show that it no longer exists.&lt;/p&gt;

&lt;p&gt;That makes closing a PDA-backed account feel different from deleting a row in a normal database. We are releasing on-chain storage and returning its refundable deposit.&lt;/p&gt;

&lt;p&gt;It also shows the full lifecycle of program state:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Derive the address.&lt;/li&gt;
&lt;li&gt;Initialise the account.&lt;/li&gt;
&lt;li&gt;Read and mutate its data.&lt;/li&gt;
&lt;li&gt;Enforce who may use it.&lt;/li&gt;
&lt;li&gt;Close it when it is no longer needed.&lt;/li&gt;
&lt;li&gt;Recover the lamports that funded it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Seed design defines the state namespace
&lt;/h2&gt;

&lt;p&gt;The experimentation day made us change the seeds and observe the consequences.&lt;/p&gt;

&lt;p&gt;First, we derived counters for two users using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"counter"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="nf"&gt;.key&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.as_ref&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two wallets produced two different addresses.&lt;/p&gt;

&lt;p&gt;That is the behaviour we wanted.&lt;/p&gt;

&lt;p&gt;Then we removed the user public key and derived both counters from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;b"counter"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both wallets now produced the same address.&lt;/p&gt;

&lt;p&gt;There was no cryptographic collision. The derivation worked exactly as designed.&lt;/p&gt;

&lt;p&gt;The problem was our design.&lt;/p&gt;

&lt;p&gt;We had asked the program for one global &lt;code&gt;counter&lt;/code&gt; address, then tried to use it as though every user had their own.&lt;/p&gt;

&lt;p&gt;Only the first account could be initialised there. The second user would attempt to initialise an address that was already occupied.&lt;/p&gt;

&lt;p&gt;This is one of the most important lessons from the arc.&lt;/p&gt;

&lt;p&gt;Seed design determines the namespace of the program's state.&lt;/p&gt;

&lt;p&gt;Including a user public key creates user-scoped state.&lt;/p&gt;

&lt;p&gt;Including a mint creates mint-scoped state.&lt;/p&gt;

&lt;p&gt;Including two asset addresses could create one account per pair.&lt;/p&gt;

&lt;p&gt;Using only a fixed seed creates a singleton.&lt;/p&gt;

&lt;p&gt;The program will follow the scheme exactly, even when the scheme does not match the application we intended to build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Almost identical seeds are still different seeds
&lt;/h2&gt;

&lt;p&gt;We also tried small changes to the seed bytes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;counter
counters
Counter
counter\0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each produced a different PDA.&lt;/p&gt;

&lt;p&gt;Those values may look related to a person, but the derivation process does not interpret their meaning.&lt;/p&gt;

&lt;p&gt;It only sees bytes.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uppercase and lowercase values differ&lt;/li&gt;
&lt;li&gt;singular and plural values differ&lt;/li&gt;
&lt;li&gt;invisible terminators or extra bytes matter&lt;/li&gt;
&lt;li&gt;changing seed order changes the result&lt;/li&gt;
&lt;li&gt;changing the program ID changes the result&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes seed conventions worth planning.&lt;/p&gt;

&lt;p&gt;Once a program is deployed and accounts have been created, changing a seed can make the new version derive different addresses from the accounts that already exist.&lt;/p&gt;

&lt;p&gt;The old state is still on-chain, but the updated program may no longer look for it at the same address.&lt;/p&gt;

&lt;p&gt;So seeds should be treated as part of the program's persistent interface, rather than temporary labels we can rename without consequences.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing the explanation exposed the gaps
&lt;/h2&gt;

&lt;p&gt;The last two days moved away from program code.&lt;/p&gt;

&lt;p&gt;First, we wrote a long-form explanation of PDAs.&lt;/p&gt;

&lt;p&gt;That meant describing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;why random account keypairs become inconvenient&lt;/li&gt;
&lt;li&gt;how seeds and program IDs produce deterministic addresses&lt;/li&gt;
&lt;li&gt;what the bump does&lt;/li&gt;
&lt;li&gt;why PDAs have no private keys&lt;/li&gt;
&lt;li&gt;why deriving an address does not create an account&lt;/li&gt;
&lt;li&gt;how Anchor validates PDA constraints&lt;/li&gt;
&lt;li&gt;how seed design affects ownership and account scope&lt;/li&gt;
&lt;li&gt;how PDA-backed accounts can be closed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then we turned that explanation into a shorter social post or thread.&lt;/p&gt;

&lt;p&gt;The public version needed a useful example and some evidence from the work: code, test output, terminal output, or an Explorer screenshot.&lt;/p&gt;

&lt;p&gt;That final step matters because PDAs can feel clear while we are following an exercise and become much harder to explain without the scaffolding.&lt;/p&gt;

&lt;p&gt;Writing the model in plain language forces us to answer the questions that code alone can hide.&lt;/p&gt;

&lt;p&gt;Why is the address predictable?&lt;/p&gt;

&lt;p&gt;Why can nobody hold its private key?&lt;/p&gt;

&lt;p&gt;Why does adding a wallet public key produce one account per user?&lt;/p&gt;

&lt;p&gt;Why does a seed constraint prevent account substitution?&lt;/p&gt;

&lt;p&gt;Why does the address remain derivable after the account is closed?&lt;/p&gt;

&lt;p&gt;If we cannot answer those questions clearly, we probably need another pass through the experiment.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 10 taught us
&lt;/h2&gt;

&lt;p&gt;Arc 10 turned account addresses into part of the program design.&lt;/p&gt;

&lt;p&gt;By the end of the arc, we had seen how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;derive a PDA from a program ID, seeds, and a bump&lt;/li&gt;
&lt;li&gt;verify that the same inputs always produce the same address&lt;/li&gt;
&lt;li&gt;create one state account per user&lt;/li&gt;
&lt;li&gt;initialise an Anchor account at a PDA&lt;/li&gt;
&lt;li&gt;distinguish a derived address from an initialised account&lt;/li&gt;
&lt;li&gt;use &lt;code&gt;seeds&lt;/code&gt; and &lt;code&gt;bump&lt;/code&gt; to validate an account&lt;/li&gt;
&lt;li&gt;store the bump once and reuse it to save compute&lt;/li&gt;
&lt;li&gt;use &lt;code&gt;has_one&lt;/code&gt; to bind stored state to a signer&lt;/li&gt;
&lt;li&gt;combine global configuration with per-user state&lt;/li&gt;
&lt;li&gt;enforce a pause rule before the handler runs&lt;/li&gt;
&lt;li&gt;close an account and reclaim its lamports&lt;/li&gt;
&lt;li&gt;test account-substitution attempts&lt;/li&gt;
&lt;li&gt;observe how incomplete seed schemes create logical address conflicts&lt;/li&gt;
&lt;li&gt;explain PDA design in public&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The counter still performed the same basic job as it did in Arc 9.&lt;/p&gt;

&lt;p&gt;It initialised a number, stored an owner, and allowed that number to be incremented.&lt;/p&gt;

&lt;p&gt;But the surrounding design became much more useful.&lt;/p&gt;

&lt;p&gt;Each wallet could find its counter without saving a random address.&lt;/p&gt;

&lt;p&gt;The program could prove that the supplied counter belonged in that user's namespace.&lt;/p&gt;

&lt;p&gt;Global policy lived at one predictable config address.&lt;/p&gt;

&lt;p&gt;User state lived at a different predictable address for every wallet.&lt;/p&gt;

&lt;p&gt;And when the state was no longer needed, the user could close it and recover the lamports used to create it.&lt;/p&gt;

&lt;p&gt;That is the lasting lesson from Arc 10.&lt;/p&gt;

&lt;p&gt;PDA design is state-model design.&lt;/p&gt;

&lt;p&gt;The seeds decide what state exists, how many instances can exist, what each instance belongs to, and how the program can locate and validate it later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Revisit the Arc 10 challenges
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Day 64:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019eefab-9ea1-8eb3-2534-15e1ae96435d" rel="noopener noreferrer"&gt;Derive your first Program Derived Address and see how seeds change the result&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Day 65:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019eefe7-365e-7146-2928-4ce4f6270721" rel="noopener noreferrer"&gt;Replace random counter keypairs with one predictable PDA per user&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Day 66:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ef011-f8d2-14bc-753f-f67456e0039c" rel="noopener noreferrer"&gt;Add a global configuration PDA and enforce admin and pause rules&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Day 67:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ef02b-7b80-7dc2-e9b7-8a0875c844b1" rel="noopener noreferrer"&gt;Close a user's counter and return its rent-exempt lamports&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Day 68:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ef03d-6aed-7a5e-bc15-fb93f3992732" rel="noopener noreferrer"&gt;Break the seed scheme and test whether account spoofing succeeds&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Day 69:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f0424-79a6-431c-f492-9aa6ced5f3ac" rel="noopener noreferrer"&gt;Write a long-form explanation of how PDAs shape program state&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Day 70:&lt;/strong&gt; &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019f04a8-8ebc-44f2-ec7d-d3e642ec1d97" rel="noopener noreferrer"&gt;Turn your PDA explanation into a public post with evidence from your work&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>learning</category>
      <category>web3</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Welcome to Epoch 4: Shipping and Exploring</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 13 Jul 2026 13:34:40 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/welcome-to-epoch-4-shipping-and-exploring-1080</link>
      <guid>https://dev.to/100daysofsolana/welcome-to-epoch-4-shipping-and-exploring-1080</guid>
      <description>&lt;p&gt;Arc 13 of 100 Days of Solana starts today and it opens Epoch 4: Ship and Explore.&lt;/p&gt;

&lt;p&gt;Every tutorial has the same ending. The program builds, the tests pass, it runs on devnet, and the article stops. Which is a strange place to stop, because that's exactly where a Web2 developer would say the interesting part begins: the production deploy.&lt;/p&gt;

&lt;p&gt;Arc 13 is seven days on that part.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mainnet is not just another cluster
&lt;/h2&gt;

&lt;p&gt;On devnet, everything is free and nothing is permanent. Airdropped SOL, throwaway deploys, program addresses nobody will ever call. It's staging, and it behaves like staging.&lt;/p&gt;

&lt;p&gt;Mainnet-beta changes four things at once. The deploy costs real SOL — program accounts are rent-exempt, and for a non-trivial Anchor program that's a real (if modest) amount of money. The program address becomes public infrastructure: anyone can find it, read it, and call it. Whoever holds the upgrade authority can replace the program's code entirely, which makes that keypair equivalent to root credentials on a production box. And there's no access control at the network level — strangers can send transactions to your program the moment it lands.&lt;/p&gt;

&lt;p&gt;None of this is scary if you've run production systems before. It's the same discipline — deploy intentionally, control who holds the keys, publish a contract for integrators, handle failure states in front of users — wearing different names.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Rosetta Stone
&lt;/h2&gt;

&lt;p&gt;If you know the Web2 column, Arc 13 teaches you the Solana column:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Web2&lt;/th&gt;
&lt;th&gt;Solana&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Staging → production&lt;/td&gt;
&lt;td&gt;Devnet → mainnet-beta&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Release artifact&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;anchor build&lt;/code&gt; output (the &lt;code&gt;.so&lt;/code&gt; file)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production deploy rights&lt;/td&gt;
&lt;td&gt;Upgrade authority&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Branch protection / required reviewers&lt;/td&gt;
&lt;td&gt;Multisig upgrade authority&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenAPI / GraphQL schema&lt;/td&gt;
&lt;td&gt;IDL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generated typed SDK&lt;/td&gt;
&lt;td&gt;Codama client&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Sign in with Google"&lt;/td&gt;
&lt;td&gt;Wallet Standard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Public changelog / release page&lt;/td&gt;
&lt;td&gt;Explorer link&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The one that surprises most people is the IDL. Solana programs don't self-describe the way a REST API with an OpenAPI spec does — unless you publish the IDL, at which point other developers can generate typed clients, inspect your instructions, and integrate without reading your source. Publishing it is the difference between a deployed program and a usable one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The seven days
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Day 85&lt;/strong&gt; — Deploy an Anchor program to mainnet-beta. The staging-to-production promotion, done deliberately rather than by accident.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 86&lt;/strong&gt; — Decide who is allowed to upgrade the program. Keep the authority, transfer it to a multisig, or burn it entirely — each is a real product decision with real trade-offs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 87&lt;/strong&gt; — Publish the IDL and generate a typed client, so other developers can call the program without guessing at byte layouts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 88&lt;/strong&gt; — Connect a wallet from the frontend and send a transaction. This is where a human finally meets the program.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 89&lt;/strong&gt; — Write useful messages for failed transactions. Wallet errors are production UX, not an edge case to be polished later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 90&lt;/strong&gt; — Write a production launch checklist. The artifact future-you actually needs at 11pm before the next deploy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 91&lt;/strong&gt; — Launch publicly, with an explorer link. A deploy isn't done until someone else can verify it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What you'll have at the end
&lt;/h2&gt;

&lt;p&gt;A program on mainnet-beta, a frontend that talks to it, and a public launch post backed by a verifiable on-chain receipt. Not "I completed a course" — "here's my program ID, go look."&lt;/p&gt;

&lt;p&gt;That receipt matters more than it might seem. In Web2, a side project claim is just a claim unless it's deployed somewhere. On Solana, the explorer link is proof: the deploy transaction, the upgrade authority, the program's activity, all publicly inspectable. It's the strongest possible artifact for a portfolio or a launch post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Joining
&lt;/h2&gt;

&lt;p&gt;Interested but not started yet? No problem. You can learn the fundamentals at your own pace with our previous 84 challenges!&lt;/p&gt;

&lt;p&gt;Start here: &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;https://mlh.link/solana-100&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>learning</category>
    </item>
    <item>
      <title>Epoch 2 content creator challenge</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Fri, 26 Jun 2026 11:22:47 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/epoch-2-content-creator-challenge-5e88</link>
      <guid>https://dev.to/100daysofsolana/epoch-2-content-creator-challenge-5e88</guid>
      <description>&lt;p&gt;In Epoch 2 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt;, we moved from getting to grips with the fundamentals to creating our own on-chain assets.&lt;/p&gt;

&lt;p&gt;That gave us a lot to work with: tokens, mints, metadata, authorities, extensions, and the choices developers make when they create an asset on Solana.&lt;/p&gt;

&lt;p&gt;And this challenge is all about seeing those ideas explained clearly for developers coming from Web2.&lt;/p&gt;

&lt;h2&gt;
  
  
  The prize categories
&lt;/h2&gt;

&lt;p&gt;For the Epoch 2 Content Challenge, we’re awarding prizes in two categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Best DEV post&lt;/li&gt;
&lt;li&gt;Best YouTube video&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To enter, you’ll need to have completed at least five Epoch 2 challenges. Missed a few? No problem. You can catch up now and still take part.&lt;/p&gt;

&lt;p&gt;Your post or video should use something from Epoch 2 to help Web2 developers understand Solana. That might mean explaining tokens through a Web2 comparison, showing how NFT metadata works, walking through a Token-2022 extension, or using something you built during the challenges to make an unfamiliar idea easier to grasp.&lt;/p&gt;

&lt;p&gt;This shouldn’t just be a diary of what you completed. The goal is to create something useful for developers who are Solana-curious but mostly coming from a Web2 background.&lt;/p&gt;

&lt;p&gt;There are a couple of other rules, too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your entry will also need to reach at least 50 views.&lt;/li&gt;
&lt;li&gt;Entries must be submitted by the end of Sunday, July 5.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When your post or video is live, submit it &lt;a href="https://forms.gle/TtHBb5KhrcUeQKc3A" rel="noopener noreferrer"&gt;using this form&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We'll announce the winners on DEV the week after the challenge closes!&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>writing</category>
    </item>
    <item>
      <title>Arc 9 Catch-Up: Writing Your First Solana Program</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Wed, 24 Jun 2026 12:49:27 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/-arc-9-catch-up-writing-your-first-solana-program-12nl</link>
      <guid>https://dev.to/100daysofsolana/-arc-9-catch-up-writing-your-first-solana-program-12nl</guid>
      <description>&lt;p&gt;With Arc 9 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt;, we enter the third big phase — or Epoch, as we call them — of the learning program.&lt;/p&gt;

&lt;p&gt;And we make a pretty big shift.&lt;/p&gt;

&lt;p&gt;Up until now, we have been getting hands-on with Solana mostly through JavaScript. We have created wallets, sent transactions, minted tokens, configured Token-2022 extensions, and inspected on-chain state from the client side.&lt;/p&gt;

&lt;p&gt;Arc 9 changes the angle.&lt;/p&gt;

&lt;p&gt;Rust is the native language of Solana programs, and this arc is our first step into writing Solana logic ourselves.&lt;/p&gt;

&lt;p&gt;The program we built was deliberately simple: a counter.&lt;/p&gt;

&lt;p&gt;Initialize it. Store who owns it. Increment it. Reject anyone else who tries.&lt;/p&gt;

&lt;p&gt;This was a great way to learn a little about the shape of Solana program dev:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;instructions as program entry points&lt;/li&gt;
&lt;li&gt;accounts as state&lt;/li&gt;
&lt;li&gt;account constraints as guardrails&lt;/li&gt;
&lt;li&gt;tests that prove both success and failure paths&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, let's get into the details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anchor gives us a framework for Solana programs
&lt;/h2&gt;

&lt;p&gt;In Web2, we use frameworks like Next.js, Ruby on Rails, Django, and .NET.&lt;/p&gt;

&lt;p&gt;The principal Solana equivalent is &lt;a href="https://www.anchor-lang.com/docs" rel="noopener noreferrer"&gt;Anchor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Like its Web2 equivalents, Anchor gives us a project structure, a way to define instructions, a way to describe the accounts each instruction needs, and a testing setup that makes local development much more approachable.&lt;/p&gt;

&lt;p&gt;And that really helps when we're taking our first steps with Rust development for Solana. We don't need to be learning low-level details at this stage. Instead, we are trying to get a working program in place, understand its shape, and build enough confidence to change it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A counter is enough to learn the shape
&lt;/h2&gt;

&lt;p&gt;The first program we built was a counter because it gives us just enough state and behavior to make the Solana program model visible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create an account&lt;/li&gt;
&lt;li&gt;store some data in it&lt;/li&gt;
&lt;li&gt;update that data later&lt;/li&gt;
&lt;li&gt;restrict who is allowed to update it&lt;/li&gt;
&lt;li&gt;write tests that prove those rules work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The program starts with an &lt;code&gt;initialize&lt;/code&gt; instruction.&lt;/p&gt;

&lt;p&gt;That instruction creates a new counter account, stores the wallet that created it as the authority, and sets the count to zero.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Initialize&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="py"&gt;.accounts.counter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.authority&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="py"&gt;.accounts.authority&lt;/span&gt;&lt;span class="nf"&gt;.key&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even if you're brand new to Rust, you can probably get the idea of what's happening here.&lt;/p&gt;

&lt;p&gt;We get the counter account from &lt;code&gt;ctx.accounts.counter&lt;/code&gt;, store the authority's public key, set the count to &lt;code&gt;0&lt;/code&gt;, and return &lt;code&gt;Ok(())&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But there is a lot happening around that small handler.&lt;/p&gt;

&lt;p&gt;That setup lives in the accounts struct.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[derive(Accounts)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Initialize&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;#[account(init,&lt;/span&gt; &lt;span class="nd"&gt;payer&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;authority,&lt;/span&gt; &lt;span class="nd"&gt;space&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="nd"&gt;Counter::INIT_SPACE)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="nd"&gt;#[account(mut)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;authority&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Signer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;system_program&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Program&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is one of the first big Anchor lessons.&lt;/p&gt;

&lt;p&gt;The instruction handler tells us what the program does.&lt;/p&gt;

&lt;p&gt;The accounts struct tells us what accounts the instruction needs, what permissions they need, and what checks Anchor should run before the handler executes.&lt;/p&gt;

&lt;p&gt;In this case, it says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create a new &lt;code&gt;counter&lt;/code&gt; account&lt;/li&gt;
&lt;li&gt;use &lt;code&gt;authority&lt;/code&gt; to pay for it&lt;/li&gt;
&lt;li&gt;make sure &lt;code&gt;authority&lt;/code&gt; signed the transaction&lt;/li&gt;
&lt;li&gt;allocate enough space for the account data&lt;/li&gt;
&lt;li&gt;use the System Program to create the account&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The handler is short because the accounts struct is doing a lot of the setup work.&lt;/p&gt;

&lt;p&gt;That is the shape we keep coming back to in Arc 9: instruction logic in one place, account requirements in another.&lt;/p&gt;

&lt;h2&gt;
  
  
  The account is the program's state
&lt;/h2&gt;

&lt;p&gt;The counter data itself lives in a custom account.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account]&lt;/span&gt;
&lt;span class="nd"&gt;#[derive(InitSpace)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;authority&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Pubkey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the first bit that feels different if you are coming from normal web development.&lt;/p&gt;

&lt;p&gt;In a Web2 app, you might expect this state to live in a database row. You might have a &lt;code&gt;counters&lt;/code&gt; table with an &lt;code&gt;owner_id&lt;/code&gt; column and a &lt;code&gt;count&lt;/code&gt; column.&lt;/p&gt;

&lt;p&gt;In this program, the state lives in a Solana account.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;count&lt;/code&gt; field stores the number.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;authority&lt;/code&gt; field stores the wallet that is allowed to update it.&lt;/p&gt;

&lt;p&gt;That second field is what makes the example useful. Without it, anyone could increment the counter. With it, the program has a rule it can check later.&lt;/p&gt;

&lt;p&gt;So even though the counter is simple, it already has the ingredients of a real program:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stored state&lt;/li&gt;
&lt;li&gt;ownership&lt;/li&gt;
&lt;li&gt;an update path&lt;/li&gt;
&lt;li&gt;a rule about who is allowed to use that path&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Incrementing the counter introduces authorization
&lt;/h2&gt;

&lt;p&gt;Once the counter exists, the next step is to update it.&lt;/p&gt;

&lt;p&gt;That happens through an &lt;code&gt;increment&lt;/code&gt; instruction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="py"&gt;.accounts.counter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="py"&gt;.count&lt;/span&gt;
        &lt;span class="nf"&gt;.checked_add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;.ok_or&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;ProgramError&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;ArithmeticOverflow&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, the handler itself is easy enough to follow.&lt;/p&gt;

&lt;p&gt;It gets the counter account, adds one to the count, and returns &lt;code&gt;Ok(())&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;checked_add(1)&lt;/code&gt; part is worth noticing. Rather than adding blindly, it checks for overflow and returns an error if the number cannot safely be increased.&lt;/p&gt;

&lt;p&gt;But the more important part of this instruction is not the arithmetic.&lt;/p&gt;

&lt;p&gt;It is the account constraint.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[derive(Accounts)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;#[account(mut,&lt;/span&gt; &lt;span class="nd"&gt;has_one&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;authority)]&lt;/span&gt;
    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;authority&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Signer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key line is this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account(mut,&lt;/span&gt; &lt;span class="nd"&gt;has_one&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;authority)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;mut&lt;/code&gt; says the counter account can be changed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;has_one = authority&lt;/code&gt; says the &lt;code&gt;authority&lt;/code&gt; field stored in the counter account must match the wallet signing this instruction.&lt;/p&gt;

&lt;p&gt;That is the rule that stops one wallet from incrementing someone else's counter.&lt;/p&gt;

&lt;p&gt;In a web app, we might write that as an authorization check inside a controller or route handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if counter.owner_id != current_user.id:
    reject the request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Anchor, that rule is declared on the account instead.&lt;/p&gt;

&lt;p&gt;So the instruction has two parts working together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the handler says what happens when the instruction is allowed to run&lt;/li&gt;
&lt;li&gt;the accounts struct says what must be true before it runs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why this tiny counter example is useful. It is not just changing a number. It is changing a number only when the right signer is present.&lt;/p&gt;

&lt;h2&gt;
  
  
  LiteSVM makes the tests feel like normal development
&lt;/h2&gt;

&lt;p&gt;Once we had &lt;code&gt;initialize&lt;/code&gt; and &lt;code&gt;increment&lt;/code&gt;, we needed to prove they worked together.&lt;/p&gt;

&lt;p&gt;That is where LiteSVM came in.&lt;/p&gt;

&lt;p&gt;LiteSVM lets us run the program locally in an in-process Solana environment. We do not need to deploy to devnet, request SOL, wait for confirmations, or debug against a remote cluster.&lt;/p&gt;

&lt;p&gt;For this arc, that was exactly what we needed.&lt;/p&gt;

&lt;p&gt;We could build the program, run the tests, change the code, and run the tests again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;anchor build
cargo &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; counter &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--nocapture&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first useful test followed the happy path:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create a local Solana test environment&lt;/li&gt;
&lt;li&gt;load the compiled counter program&lt;/li&gt;
&lt;li&gt;create a counter account&lt;/li&gt;
&lt;li&gt;call &lt;code&gt;initialize&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;call &lt;code&gt;increment&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;read the counter account back&lt;/li&gt;
&lt;li&gt;check that the count is now &lt;code&gt;1&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That test matters because it is not just calling a Rust function directly.&lt;/p&gt;

&lt;p&gt;It sends transactions to the program.&lt;/p&gt;

&lt;p&gt;The program receives accounts.&lt;/p&gt;

&lt;p&gt;The account data changes.&lt;/p&gt;

&lt;p&gt;Then the test reads the account back and checks what actually happened.&lt;/p&gt;

&lt;p&gt;So even though the test runs locally, it still teaches the right execution model.&lt;/p&gt;

&lt;p&gt;That is the main value of LiteSVM here: it gives us a fast feedback loop without pretending that Solana programs work like ordinary local functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The happy path is not enough
&lt;/h2&gt;

&lt;p&gt;At this point, the program worked.&lt;/p&gt;

&lt;p&gt;We could initialize a counter. We could increment it. We could read the account back and check that the count was &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That is a good start, but it only proves the program works when everything is used correctly.&lt;/p&gt;

&lt;p&gt;It does not prove the program refuses to do the wrong thing.&lt;/p&gt;

&lt;p&gt;That matters because Solana programs are public. Anyone can call them. Anyone can try different accounts, different signers, and different transaction shapes.&lt;/p&gt;

&lt;p&gt;So the next test was more interesting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;wallet A creates the counter&lt;/li&gt;
&lt;li&gt;wallet B tries to increment it&lt;/li&gt;
&lt;li&gt;the program rejects the transaction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That test proves the authority rule is actually doing something.&lt;/p&gt;

&lt;p&gt;The important line was still this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account(mut,&lt;/span&gt; &lt;span class="nd"&gt;has_one&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;authority)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The happy-path test proves the right wallet can increment the counter.&lt;/p&gt;

&lt;p&gt;The failure test proves the wrong wallet cannot.&lt;/p&gt;

&lt;p&gt;Without that second test, we could remove &lt;code&gt;has_one = authority&lt;/code&gt; and the happy-path test would still pass.&lt;/p&gt;

&lt;p&gt;That is the trap Arc 9 was trying to show us.&lt;/p&gt;

&lt;p&gt;A green test suite is not enough if it only checks the path where everything goes right.&lt;/p&gt;

&lt;h2&gt;
  
  
  Breaking the program proved the tests mattered
&lt;/h2&gt;

&lt;p&gt;The best part of the arc was breaking the program on purpose.&lt;/p&gt;

&lt;p&gt;That might sound strange, but it is a useful habit.&lt;/p&gt;

&lt;p&gt;Once the tests were passing, we made small changes that should have broken the program, then checked whether the tests caught them.&lt;/p&gt;

&lt;p&gt;First, we removed the authorization rule.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[account(mut)]&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the counter was still mutable, but Anchor was no longer checking that the signer matched the stored authority.&lt;/p&gt;

&lt;p&gt;That is exactly the kind of bug the wrong-wallet test should catch.&lt;/p&gt;

&lt;p&gt;And it did.&lt;/p&gt;

&lt;p&gt;Then we changed the arithmetic so the counter added &lt;code&gt;2&lt;/code&gt; instead of &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The transaction still succeeded. Nothing crashed. But the stored value was wrong, so the happy-path assertion caught it.&lt;/p&gt;

&lt;p&gt;That is a different kind of bug.&lt;/p&gt;

&lt;p&gt;The program runs, but writes the wrong state.&lt;/p&gt;

&lt;p&gt;Finally, we broke initialization by not storing the authority.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;initialize&lt;/code&gt; instruction still looked like it worked. The account was created. The count was set to zero.&lt;/p&gt;

&lt;p&gt;But the next instruction failed, because the program later tried to check an authority value that had never been stored correctly.&lt;/p&gt;

&lt;p&gt;That was probably the most useful debugging lesson in the arc.&lt;/p&gt;

&lt;p&gt;In Solana programs, one instruction might write state and another instruction might validate that state later.&lt;/p&gt;

&lt;p&gt;So the error does not always appear where the bug was introduced.&lt;/p&gt;

&lt;p&gt;Sometimes you have to work backwards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which account failed validation?&lt;/li&gt;
&lt;li&gt;which field was wrong?&lt;/li&gt;
&lt;li&gt;which instruction wrote that field?&lt;/li&gt;
&lt;li&gt;what did the account actually store?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The counter example was small, but the lesson scales.&lt;/p&gt;

&lt;p&gt;If you can understand that pattern here, you are better prepared for real programs later.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 9 taught us
&lt;/h2&gt;

&lt;p&gt;Arc 9 was not really about building a counter.&lt;/p&gt;

&lt;p&gt;The counter was just the smallest useful program for learning the shape of Anchor development.&lt;/p&gt;

&lt;p&gt;By the end of the arc, we had seen how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scaffold a Solana program with Anchor&lt;/li&gt;
&lt;li&gt;write instructions in Rust&lt;/li&gt;
&lt;li&gt;create and store data in an account&lt;/li&gt;
&lt;li&gt;use an accounts struct to describe what an instruction needs&lt;/li&gt;
&lt;li&gt;protect state with an authority rule&lt;/li&gt;
&lt;li&gt;test real transactions locally with LiteSVM&lt;/li&gt;
&lt;li&gt;write both happy-path and failure-path tests&lt;/li&gt;
&lt;li&gt;break the program on purpose to prove the tests were meaningful&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a meaningful shift from the earlier arcs.&lt;/p&gt;

&lt;p&gt;Before this, we were mostly using Solana from the outside. We were creating wallets, sending transactions, minting tokens, configuring extensions, and inspecting what existing programs did.&lt;/p&gt;

&lt;p&gt;In Arc 9, we started writing the program logic ourselves.&lt;/p&gt;

&lt;p&gt;The next limitation is addressability.&lt;/p&gt;

&lt;p&gt;In this arc, the counter account used a fresh keypair address. That works for a first program, but it means the client has to remember where each user's counter lives.&lt;/p&gt;

&lt;p&gt;Most real Solana programs need a more predictable way to find program-owned state.&lt;/p&gt;

&lt;p&gt;That is where Program Derived Addresses come in.&lt;/p&gt;

&lt;p&gt;So Arc 9 gives us the foundation: write a program, store state, enforce a rule, and test it properly.&lt;/p&gt;

&lt;p&gt;The next arc builds on that by making the account address itself part of the program design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Revisit the Arc 9 challenges
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ecbff-efdb-8cee-beac-ee5b63da7d40" rel="noopener noreferrer"&gt;Day 57: Install Anchor and scaffold your first program&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ecfb9-01f7-d84a-d1cf-371f82e38bff" rel="noopener noreferrer"&gt;Day 58: Add state and write your first LiteSVM test&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ed017-1cee-5914-4ebb-6b11bee30f51" rel="noopener noreferrer"&gt;Day 59: Add an increment instruction and test both calls end to end&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ed035-9f27-0707-4e7a-f9b7b0fde822" rel="noopener noreferrer"&gt;Day 60: Add failure tests so green checks actually mean something&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ed03c-f8bd-8c41-6a87-4cccbfe5312b" rel="noopener noreferrer"&gt;Day 61: Break your program on purpose and watch the tests catch it&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ed046-5f60-0285-0ccc-f4417061a2a3" rel="noopener noreferrer"&gt;Day 62: Write the post that proves you understand your first Anchor program&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ed04c-b375-c55d-55cd-ae40182ad292" rel="noopener noreferrer"&gt;Day 63: Turn your counter program into a post that lands&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>100daysofsolana</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>learning</category>
    </item>
    <item>
      <title>Learn Solana the Fast Way</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 22 Jun 2026 11:32:02 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/learn-solana-the-fast-way-4kg4</link>
      <guid>https://dev.to/100daysofsolana/learn-solana-the-fast-way-4kg4</guid>
      <description>&lt;p&gt;As a web or mobile developer, Web3 can seem harder to get to grips with than it really is.&lt;/p&gt;

&lt;p&gt;Part of the problem is the vocabulary. Wallets, accounts, mints, programs, signers, authorities, transactions. It can sound as though everything you already know has been replaced by a completely different model.&lt;/p&gt;

&lt;p&gt;But many Solana concepts have useful parallels with traditional development.&lt;/p&gt;

&lt;p&gt;A transaction is not exactly an API request. A program is not exactly a backend service. A token mint is not exactly a database table. But those comparisons are close enough to give you a way in.&lt;/p&gt;

&lt;p&gt;Once you have those bridges, Solana starts to feel less like a wall of jargon and more like another development environment with its own rules, constraints, and patterns.&lt;/p&gt;

&lt;p&gt;That is the fast way to learn it: build small things, connect each new idea to something familiar, and let the mental model grow from there.&lt;/p&gt;

&lt;p&gt;In this post, we’ll use familiar Web2 ideas as bridges into the Solana model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Identity and authentication&lt;/strong&gt; → wallets, keypairs, and signatures&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API calls and commands&lt;/strong&gt; → transactions and instructions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database records and stored state&lt;/strong&gt; → accounts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asset definitions and balances&lt;/strong&gt; → tokens, mints, and token accounts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Media files and metadata records&lt;/strong&gt; → NFT metadata&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Middleware and business rules&lt;/strong&gt; → Token-2022 extensions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend logic and tests&lt;/strong&gt; → programs and Anchor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiemc217zbl5qucaudnow.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiemc217zbl5qucaudnow.jpg" alt="Matching Web2 concepts to Web3" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For each one, we’ll explain the Web2 idea first, map it to the Solana concept, then point you to a small challenge where you can try it yourself.&lt;/p&gt;

&lt;p&gt;You can read this as a quick map of Solana, but it works better if you pick one section and do the linked challenge.&lt;/p&gt;

&lt;p&gt;Each challenge is part of 100 Days of Solana. Sign up, complete the task, and submit your work so your progress counts.&lt;/p&gt;

&lt;p&gt;The goal is not to recreate the whole curriculum in one post.&lt;/p&gt;

&lt;p&gt;The goal is to give you enough practical understanding that Solana starts to make sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Identity and authentication: wallets, keypairs, and signatures
&lt;/h2&gt;

&lt;p&gt;In a traditional web or mobile app, identity usually starts with a user account.&lt;/p&gt;

&lt;p&gt;Someone signs up with an email address, a password, a social login, or a passkey. Your application stores a user record, manages sessions, and decides what that user is allowed to do.&lt;/p&gt;

&lt;p&gt;Solana starts from a different place.&lt;/p&gt;

&lt;p&gt;Your wallet is not a user account in the usual Web2 sense. It is a cryptographic identity. More specifically, it is controlled by a keypair: a public key that acts like an address, and a private key that proves you are allowed to sign actions for that address.&lt;/p&gt;

&lt;p&gt;The closest Web2 parallel is probably SSH keys or API keys.&lt;/p&gt;

&lt;p&gt;If you have used SSH keys with GitHub, the idea is familiar: your public key identifies you, and your private key lets you prove that you are really the person allowed to act as that identity.&lt;/p&gt;

&lt;p&gt;On Solana, that proof happens through signatures.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu39jlhui4kbb49obbm2c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu39jlhui4kbb49obbm2c.jpg" alt="Illustration representing the idea of a transaction authorized by a key" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you send a transaction, your wallet signs it. That signature tells the network: “The holder of this private key authorized this action.”&lt;/p&gt;

&lt;p&gt;That is why wallets matter so much. They are not just where tokens live. They are how users approve actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019daa0b-8aaa-b52d-6765-3cb47e97e0ba" rel="noopener noreferrer"&gt;Create your devnet wallet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll create a wallet, request devnet SOL, and check your balance.&lt;/p&gt;

&lt;p&gt;The point is not to understand every detail of wallet security yet. The point is to make the first idea concrete:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Solana wallet is an identity that can sign actions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you’re done, submit your result through 100 Days of Solana.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. API calls and commands: transactions and instructions
&lt;/h2&gt;

&lt;p&gt;In Web2, when your frontend wants something to happen, it usually sends an API request.&lt;/p&gt;

&lt;p&gt;That request might create a user, submit a payment, update a profile, or trigger some backend logic.&lt;/p&gt;

&lt;p&gt;Solana transactions are not the same as API requests, but the comparison is useful.&lt;/p&gt;

&lt;p&gt;A transaction is a signed message sent to the network. Inside that transaction are one or more instructions. Each instruction tells a Solana program what work to perform.&lt;/p&gt;

&lt;p&gt;So the rough mapping is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the transaction is the package being submitted&lt;/li&gt;
&lt;li&gt;the instruction is the command inside it&lt;/li&gt;
&lt;li&gt;the program is the code that runs&lt;/li&gt;
&lt;li&gt;the accounts are the state the program reads or writes&lt;/li&gt;
&lt;li&gt;the signer is the identity authorizing the action&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why Solana transactions can feel strange at first. They are not just “send money from A to B”. They can contain several instructions that run together.&lt;/p&gt;

&lt;p&gt;For example, a transaction might create an account and then initialize it. Or it might approve an action and then perform a transfer. If one required part fails, the whole transaction fails.&lt;/p&gt;

&lt;p&gt;That gives Solana transactions an important property: they can represent a complete unit of work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019df771-2eb8-957d-a0a3-23de7f655409" rel="noopener noreferrer"&gt;Send and inspect a devnet transaction&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll send a real transaction on devnet, inspect what happened, and connect the abstract idea of “instructions” to something you can actually see.&lt;/p&gt;

&lt;p&gt;The key idea is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A transaction is not just movement of data. It is a signed bundle of instructions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Submit your completed challenge so your progress is visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Database records and stored state: accounts
&lt;/h2&gt;

&lt;p&gt;In Web2, you are used to applications storing state in databases.&lt;/p&gt;

&lt;p&gt;A user has a row. An order has a row. A payment has a row. Your backend reads and writes that data when something happens.&lt;/p&gt;

&lt;p&gt;Solana also stores state, but the model is different.&lt;/p&gt;

&lt;p&gt;State lives in accounts.&lt;/p&gt;

&lt;p&gt;That word can be confusing because “account” sounds like “user account”. On Solana, an account is more general than that. It is a place where data can live.&lt;/p&gt;

&lt;p&gt;An account might hold SOL. It might hold token data. It might store configuration for a program. It might represent part of your application’s state.&lt;/p&gt;

&lt;p&gt;A useful Web2 comparison is a database record, but with an important difference: Solana programs do not secretly reach into their own private database. The accounts a program needs are passed into the transaction.&lt;/p&gt;

&lt;p&gt;That means the transaction says not only what you want to do, but also which pieces of state the program is allowed to read or write.&lt;/p&gt;

&lt;p&gt;This is one of the biggest shifts in the Solana mental model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr924mlojghwqy5pzyd3v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr924mlojghwqy5pzyd3v.jpg" alt="Solana accounts shown as state containers passed into an on-chain program." width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are not calling a backend endpoint that then queries whatever it wants from a database. You are sending an instruction to a program and explicitly providing the accounts involved.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019e166e-5a4c-44fc-5568-aa0bf3f491f7" rel="noopener noreferrer"&gt;Inspect a Solana account&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll look at a real account and identify its address, owner, and data.&lt;/p&gt;

&lt;p&gt;The point is to stop thinking of “account” as only meaning “user account” and start thinking of it as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A place where on-chain state lives.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Asset definitions and balances: tokens, mints, and token accounts
&lt;/h2&gt;

&lt;p&gt;In Web2, if you were building a system with credits, points, tickets, or balances, you might start with a few database tables.&lt;/p&gt;

&lt;p&gt;One table might define the asset:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name&lt;/li&gt;
&lt;li&gt;symbol&lt;/li&gt;
&lt;li&gt;decimal precision&lt;/li&gt;
&lt;li&gt;total supply rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another table might track balances:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user ID&lt;/li&gt;
&lt;li&gt;asset ID&lt;/li&gt;
&lt;li&gt;amount&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Solana tokens use a similar separation, but the terms are different.&lt;/p&gt;

&lt;p&gt;A mint defines the token.&lt;/p&gt;

&lt;p&gt;A token account holds a balance of that token for a particular owner.&lt;/p&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;The mint is not your personal balance. It is the source of truth for the token itself: its identity, decimals, supply, and authorities.&lt;/p&gt;

&lt;p&gt;A token account is where an owner’s balance of that specific token lives.&lt;/p&gt;

&lt;p&gt;So if Alice and Bob both hold the same token, they do not share one balance field on the mint. They each have token accounts connected to that mint.&lt;/p&gt;

&lt;p&gt;This is one of the fastest ways to make Solana feel less abstract. Once you create a mint, mint supply, create token accounts, and transfer tokens, you have used several of Solana’s core ideas together.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;This idea takes two short challenges to see end to end.&lt;/p&gt;

&lt;p&gt;First, &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019e3b40-0aaf-110f-9cbd-29dc2abee2dd" rel="noopener noreferrer"&gt;create your first token&lt;/a&gt;. You’ll create a mint, create a token account, and mint supply into it.&lt;/p&gt;

&lt;p&gt;Then &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019e4a57-072c-e8e7-14bd-1a3500378031" rel="noopener noreferrer"&gt;put it to work&lt;/a&gt;. You’ll create a token with built-in transfer rules, send it between wallets, and watch the mint and token accounts update.&lt;/p&gt;

&lt;p&gt;As you do it, keep this model in mind:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The mint defines the asset. Token accounts hold balances.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you submit this one, you have more than a screenshot. You have proof that you understand one of Solana’s core building blocks.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Media files and metadata records: NFT metadata
&lt;/h2&gt;

&lt;p&gt;In Web2, you rarely store everything directly in one database field.&lt;/p&gt;

&lt;p&gt;If you are building a product catalogue, a media app, or a user profile system, you often split things up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the database stores IDs, names, references, and structured fields&lt;/li&gt;
&lt;li&gt;media files live in object storage or a CDN&lt;/li&gt;
&lt;li&gt;the frontend combines those pieces into something users can see&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NFTs use a similar split.&lt;/p&gt;

&lt;p&gt;The token itself gives you the scarce asset: usually a mint with supply of one and zero decimals. But that alone does not tell a wallet what to display.&lt;/p&gt;

&lt;p&gt;For that, you need metadata.&lt;/p&gt;

&lt;p&gt;Metadata gives clients human-readable information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name&lt;/li&gt;
&lt;li&gt;symbol&lt;/li&gt;
&lt;li&gt;description&lt;/li&gt;
&lt;li&gt;image&lt;/li&gt;
&lt;li&gt;attributes&lt;/li&gt;
&lt;li&gt;collection information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of that information may live on-chain. Some may point to off-chain JSON or media files. The exact mechanics vary depending on the token standard and tooling, but the broad idea is familiar:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The on-chain asset provides ownership and identity. Metadata helps apps understand what the asset represents.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is why NFTs are worth learning even if you are not especially interested in NFT markets. They teach you how Solana combines ownership, metadata, clients, and off-chain content.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019e87d6-0876-e1d2-51ad-f2bb9c8f9f03" rel="noopener noreferrer"&gt;Add metadata to an asset&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll connect an on-chain asset to human-readable metadata and see how wallets know what to display.&lt;/p&gt;

&lt;p&gt;Look for the split between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what lives on-chain&lt;/li&gt;
&lt;li&gt;what points off-chain&lt;/li&gt;
&lt;li&gt;what the wallet or client chooses to show&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to understand this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A token becomes meaningful to users when apps can connect it to metadata.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Middleware and business rules: Token-2022 extensions
&lt;/h2&gt;

&lt;p&gt;In Web2, business rules usually live in your application.&lt;/p&gt;

&lt;p&gt;If you want to charge a fee on every payment, you write that logic in your backend. If you want to prevent a user from transferring something, you add a rule to your application. If you want a balance to grow over time, you might run a scheduled job or calculate the value when the user views it.&lt;/p&gt;

&lt;p&gt;That model works, but it depends on your application being the place where the rule is enforced.&lt;/p&gt;

&lt;p&gt;Token-2022 changes that.&lt;/p&gt;

&lt;p&gt;With Token-2022, some behaviors can be configured directly on the token mint itself. The rule is not just wrapped around the asset by your app. It becomes part of how the asset works.&lt;/p&gt;

&lt;p&gt;For example, a token can be configured to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;charge a fee when it transfers&lt;/li&gt;
&lt;li&gt;accrue interest in the displayed UI amount&lt;/li&gt;
&lt;li&gt;refuse to transfer at all&lt;/li&gt;
&lt;li&gt;require additional checks before movement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Web2 bridge is middleware, but with an important twist.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmvwhpu3r43fbzdloc7pj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmvwhpu3r43fbzdloc7pj.jpg" alt="A token shown with built-in rule modules representing Token-2022 extensions." width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a web app, middleware sits in the request path. It runs because traffic passes through your server.&lt;/p&gt;

&lt;p&gt;With Token-2022, the middleware-like behavior is inside the asset. The token program enforces it whenever the token is used.&lt;/p&gt;

&lt;p&gt;A wallet cannot simply forget to apply the fee. A marketplace cannot route around the rule by calling a different endpoint. The behavior is configured on-chain and enforced by the token program.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ea7f3-231d-10ff-6d6d-664fe7ee2cce" rel="noopener noreferrer"&gt;Create a fee-bearing token&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll configure a Token-2022 mint with a transfer fee, send the token, and see that the rule is enforced by the token program rather than by application code.&lt;/p&gt;

&lt;p&gt;As you work through it, answer three questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;where is the fee configured?&lt;/li&gt;
&lt;li&gt;what happens when the token is transferred?&lt;/li&gt;
&lt;li&gt;who enforces the rule?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key idea is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token-2022 lets you put certain business rules into the asset itself, not just into the app around it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Submit this one if you want a good “aha” moment from the challenge. It is one of the clearest examples of Solana doing something differently from a traditional app stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Backend logic and tests: programs and Anchor
&lt;/h2&gt;

&lt;p&gt;In Web2, your backend is where application logic usually lives.&lt;/p&gt;

&lt;p&gt;It validates input, checks permissions, updates state, triggers side effects, and returns results. You might write tests to prove that the logic works and that failure cases are handled correctly.&lt;/p&gt;

&lt;p&gt;On Solana, that logic lives in programs.&lt;/p&gt;

&lt;p&gt;A program is deployed code that runs on-chain. Users and clients interact with it by sending transactions containing instructions.&lt;/p&gt;

&lt;p&gt;Anchor is a framework that makes it easier to write Solana programs in Rust.&lt;/p&gt;

&lt;p&gt;The rough Web2 bridge is backend logic deployed to a shared runtime. That comparison is not perfect, because Solana programs work with explicitly provided accounts rather than a private database connection. But it is close enough to help you begin.&lt;/p&gt;

&lt;p&gt;With Anchor, you define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the instructions your program supports&lt;/li&gt;
&lt;li&gt;the accounts each instruction expects&lt;/li&gt;
&lt;li&gt;the rules those accounts must satisfy&lt;/li&gt;
&lt;li&gt;the handler logic that runs&lt;/li&gt;
&lt;li&gt;tests that prove the behavior works&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simple counter program is a good starting point. It teaches the basic flow without too much business logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;initialize a counter account&lt;/li&gt;
&lt;li&gt;increment the counter&lt;/li&gt;
&lt;li&gt;test that the value changed&lt;/li&gt;
&lt;li&gt;test that invalid actions fail&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is where the Solana model starts to come together. Wallets sign transactions. Transactions contain instructions. Instructions call programs. Programs read and write accounts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;This one builds up over two short challenges.&lt;/p&gt;

&lt;p&gt;First, &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ecbff-efdb-8cee-beac-ee5b63da7d40" rel="noopener noreferrer"&gt;build and test an Anchor counter program&lt;/a&gt;. You’ll scaffold the program, initialize a counter, increment it, and write tests that prove your on-chain logic behaves the way you expect.&lt;/p&gt;

&lt;p&gt;Then &lt;a href="https://www.mlh.com/events/100-days-of-solana/challenges/019ed035-9f27-0707-4e7a-f9b7b0fde822" rel="noopener noreferrer"&gt;make the tests earn their keep&lt;/a&gt;. You’ll add failure tests, then deliberately break the program and confirm the test suite catches it.&lt;/p&gt;

&lt;p&gt;The goal is to understand this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Solana program is where your application logic runs, and Anchor gives you a practical structure for writing and testing it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a strong challenge to submit because it shows real progress: you are no longer only using Solana from the outside. You are starting to write logic that runs on-chain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep going with 100 Days of Solana
&lt;/h2&gt;

&lt;p&gt;You do not need to understand all of Solana before you start building.&lt;/p&gt;

&lt;p&gt;In fact, trying to learn everything upfront is usually the slowest path.&lt;/p&gt;

&lt;p&gt;The faster route is to build small things that make each concept real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create a wallet&lt;/li&gt;
&lt;li&gt;send a transaction&lt;/li&gt;
&lt;li&gt;inspect an account&lt;/li&gt;
&lt;li&gt;mint a token&lt;/li&gt;
&lt;li&gt;add metadata&lt;/li&gt;
&lt;li&gt;try a Token-2022 extension&lt;/li&gt;
&lt;li&gt;run an Anchor program&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each one gives you a piece of the model.&lt;/p&gt;

&lt;p&gt;The challenges above are taken from &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt;, a practical challenge series for developers who want to learn Solana by building.&lt;/p&gt;

&lt;p&gt;Sounds good? Great, &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;get started and learn Solana today &amp;gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>learning</category>
    </item>
    <item>
      <title>Arc 8 Catch-Up: Middleware Inside the Token</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 15 Jun 2026 15:16:14 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-8-catch-up-middleware-inside-the-token-4fe8</link>
      <guid>https://dev.to/100daysofsolana/arc-8-catch-up-middleware-inside-the-token-4fe8</guid>
      <description>&lt;p&gt;Arc 8 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt; was about Token-2022.&lt;/p&gt;

&lt;p&gt;That might sound odd at first, because Token-2022 had already shown up in the previous arcs.&lt;/p&gt;

&lt;p&gt;Arc 6 used token extensions to explore fees, interest, frozen accounts, and revocable credentials. Arc 7 used Token Extensions to build NFTs from the same token primitives.&lt;/p&gt;

&lt;p&gt;Arc 8 made the model explicit.&lt;/p&gt;

&lt;p&gt;The whole arc hangs off one idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Token extensions are like middleware that lives inside the asset.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Web2 developers, that is the shift worth noticing.&lt;/p&gt;

&lt;p&gt;In a normal app, rules usually sit around the asset. You write backend code. You add middleware. You call a payment processor. You run a cron job. You trust every integration to go through the right path.&lt;/p&gt;

&lt;p&gt;With Token-2022, some of those rules can live on the mint itself.&lt;/p&gt;

&lt;p&gt;That changes the shape of the system.&lt;/p&gt;

&lt;p&gt;A token is no longer just a balance that moves between accounts. It can be a balance with transfer fees, interest display, transfer restrictions, or other behavior attached.&lt;/p&gt;

&lt;p&gt;The middleware is not next to the token.&lt;/p&gt;

&lt;p&gt;It is part of the token.&lt;/p&gt;

&lt;h2&gt;
  
  
  Token rules should not depend on every app remembering them
&lt;/h2&gt;

&lt;p&gt;Most Web2 developers have built systems where rules sit outside the thing being moved.&lt;/p&gt;

&lt;p&gt;A marketplace might charge a platform fee.&lt;br&gt;&lt;br&gt;
A fintech app might show yield.&lt;br&gt;&lt;br&gt;
A loyalty system might prevent points from being transferred.&lt;br&gt;&lt;br&gt;
A membership product might issue a badge that cannot be sold.  &lt;/p&gt;

&lt;p&gt;Usually, the rule lives somewhere in your application.&lt;/p&gt;

&lt;p&gt;You might write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;calculateFee()
applyInterest()
rejectTransfer()
checkMembershipStatus()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That works as long as every relevant path uses the same logic.&lt;/p&gt;

&lt;p&gt;But that is the weak point.&lt;/p&gt;

&lt;p&gt;One backend service might apply the fee. Another script might forget it. An integration partner might call the wrong endpoint. An admin tool might bypass the normal flow. A scheduled job might fail. A frontend might display one thing while the ledger stores another.&lt;/p&gt;

&lt;p&gt;Token-2022 takes a different approach.&lt;/p&gt;

&lt;p&gt;When the extension is configured on the mint, the Token-2022 program enforces the behavior consistently. Every wallet, CLI, dApp, and program that interacts with the token has to deal with the same rule.&lt;/p&gt;

&lt;p&gt;That is why the middleware analogy is useful, but only if you take it one step further.&lt;/p&gt;

&lt;p&gt;This is not middleware sitting in your app stack.&lt;/p&gt;

&lt;p&gt;It is middleware baked into the asset.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transfer fees are enforced by the mint
&lt;/h2&gt;

&lt;p&gt;Arc 8 started with a fee-bearing token.&lt;/p&gt;

&lt;p&gt;The exercise was simple: create a mint under the Token-2022 program, add a transfer fee configuration, mint some supply, and inspect the result.&lt;/p&gt;

&lt;p&gt;The important part was not the percentage.&lt;/p&gt;

&lt;p&gt;It was where the rule lived.&lt;/p&gt;

&lt;p&gt;The transfer fee was not a line of backend code. It was not a webhook. It was not a checkout rule. It was not a convention that wallets were expected to follow voluntarily.&lt;/p&gt;

&lt;p&gt;The fee configuration lived on the mint.&lt;/p&gt;

&lt;p&gt;That means the token itself carried the rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When this token moves, apply this fee.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Web2 developers, the contrast is familiar.&lt;/p&gt;

&lt;p&gt;If you charge a fee through Stripe, you usually build fee logic around the payment flow. You decide how much to collect, when to collect it, how to reconcile it, and which integrations are allowed to move value.&lt;/p&gt;

&lt;p&gt;With Token-2022, the fee rule is part of the asset’s behavior. The transfer goes through the token program, and the token program applies the rule.&lt;/p&gt;

&lt;p&gt;That is a meaningful difference.&lt;/p&gt;

&lt;p&gt;You are not trusting every app to remember the fee. You are configuring a token that cannot move without the fee logic being considered.&lt;/p&gt;

&lt;p&gt;That is the first big Arc 8 lesson:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The rule travels with the token.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The fee lifecycle is transfer, withhold, withdraw
&lt;/h2&gt;

&lt;p&gt;Creating a fee-bearing mint is only the first part.&lt;/p&gt;

&lt;p&gt;Arc 8 then put the token in motion and followed the fee lifecycle end to end:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;transfer → withhold → withdraw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That lifecycle matters because transfer fees do not behave like a normal payment processor settlement flow.&lt;/p&gt;

&lt;p&gt;When a fee-bearing token is transferred, the recipient does not simply receive the full amount and then send a fee somewhere else.&lt;/p&gt;

&lt;p&gt;Instead, the fee is withheld in the recipient’s token account.&lt;/p&gt;

&lt;p&gt;For example, with a 1% transfer fee, a transfer of 1,000 tokens gives the recipient 990 spendable tokens. The remaining 10 are recorded as withheld tokens on the recipient’s token account.&lt;/p&gt;

&lt;p&gt;Those withheld tokens are not spendable by the recipient. They sit there until the withdraw authority collects them.&lt;/p&gt;

&lt;p&gt;That is a very different mental model from a Web2 marketplace fee.&lt;/p&gt;

&lt;p&gt;In a normal app, you might have a payment ledger, a treasury balance, a settlement job, a reconciliation process, and a dashboard showing fees owed.&lt;/p&gt;

&lt;p&gt;Here, the withheld amount is visible in the token account itself. The fee authority can later withdraw it using the Token-2022 program.&lt;/p&gt;

&lt;p&gt;The important thing is what you did not build.&lt;/p&gt;

&lt;p&gt;No custom program.&lt;br&gt;&lt;br&gt;
No payment processor flow.&lt;br&gt;&lt;br&gt;
No webhook.&lt;br&gt;&lt;br&gt;
No cron job.&lt;br&gt;&lt;br&gt;
No separate fee table.  &lt;/p&gt;

&lt;p&gt;The protocol enforced the fee and stored the withheld amount.&lt;/p&gt;

&lt;p&gt;That is the kind of concrete behavior that makes Token-2022 easier to understand. It is not an abstract extension system. It is a rule you can observe on devnet.&lt;/p&gt;
&lt;h2&gt;
  
  
  Composability means extensions share the same mint
&lt;/h2&gt;

&lt;p&gt;Arc 8 then combined transfer fees with interest-bearing behavior.&lt;/p&gt;

&lt;p&gt;This is where the middleware analogy becomes more powerful.&lt;/p&gt;

&lt;p&gt;A token can have more than one rule.&lt;/p&gt;

&lt;p&gt;The mint can say:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Charge a fee when tokens move.
Display balances with interest over time.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those behaviors are different, but they can coexist on the same mint.&lt;/p&gt;

&lt;p&gt;That matters because Web2 developers often expect separate systems for separate behaviors.&lt;/p&gt;

&lt;p&gt;A fee might belong to a payments service.&lt;br&gt;&lt;br&gt;
Interest might belong to a financial calculation service.&lt;br&gt;&lt;br&gt;
Metadata might belong to an asset database.&lt;br&gt;&lt;br&gt;
Restrictions might belong to an access control system.  &lt;/p&gt;

&lt;p&gt;Token-2022 lets those behaviors be configured as extensions on one mint.&lt;/p&gt;

&lt;p&gt;The technical reason is that extensions are stored as structured data on the account. The mint has enough space allocated for the extensions, and the Token-2022 program knows how to read and enforce them.&lt;/p&gt;

&lt;p&gt;But the product lesson is simpler:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A token can be configured with multiple behaviors at once.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fee and interest example also made an important distinction clear.&lt;/p&gt;

&lt;p&gt;The transfer fee works on the raw token amount. It moves real token units and withholds part of the transfer.&lt;/p&gt;

&lt;p&gt;Interest-bearing behavior affects the displayed amount. It does not continuously mint new tokens in the background. The raw balance does not change every second. The UI amount is computed from the stored amount, rate, and elapsed time.&lt;/p&gt;

&lt;p&gt;That is why the two features can coexist cleanly.&lt;/p&gt;

&lt;p&gt;The fee changes what happens during transfer.&lt;br&gt;&lt;br&gt;
The interest extension changes how the balance is interpreted when read.  &lt;/p&gt;

&lt;p&gt;Those are different layers of behavior on the same asset.&lt;/p&gt;
&lt;h2&gt;
  
  
  Interest is a view, not a background job
&lt;/h2&gt;

&lt;p&gt;The interest-bearing extension is one of the easiest places for Web2 instincts to mislead you.&lt;/p&gt;

&lt;p&gt;In a conventional app, if a balance grows, you usually assume something wrote a new value somewhere.&lt;/p&gt;

&lt;p&gt;A scheduled job updated the balance.&lt;br&gt;&lt;br&gt;
A database row changed.&lt;br&gt;&lt;br&gt;
A ledger entry was added.&lt;br&gt;&lt;br&gt;
A batch process applied interest overnight.  &lt;/p&gt;

&lt;p&gt;Token-2022 does not need to work that way.&lt;/p&gt;

&lt;p&gt;With the interest-bearing extension, the raw token amount stays the same unless an actual token instruction changes it. What changes is the displayed amount.&lt;/p&gt;

&lt;p&gt;The program can calculate the UI amount based on the interest rate and time elapsed.&lt;/p&gt;

&lt;p&gt;That is why Arc 8 deliberately used a high rate on devnet. At realistic rates, the change over a short challenge window would be too small to notice. A dramatic rate makes the model visible.&lt;/p&gt;

&lt;p&gt;The lesson is not “high yield tokens are good.”&lt;/p&gt;

&lt;p&gt;The lesson is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Display can be computed from state without constantly rewriting state.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Web2 developers, that is a useful mental shift.&lt;/p&gt;

&lt;p&gt;The token account stores raw units. The extension changes how those units are displayed. If you assume “displayed balance increased” means “new tokens were minted,” you will misunderstand what the program is doing.&lt;/p&gt;

&lt;p&gt;Arc 8 forced that distinction into the open.&lt;/p&gt;
&lt;h2&gt;
  
  
  Reading mint configuration is part of building
&lt;/h2&gt;

&lt;p&gt;One of the most useful Arc 8 exercises was not creating another mint.&lt;/p&gt;

&lt;p&gt;It was auditing the mints already created.&lt;/p&gt;

&lt;p&gt;That matters because Token-2022 configuration is public state. You can inspect a mint and see which extensions it uses. You can read the fee configuration. You can see whether interest-bearing behavior exists. You can check whether a token is non-transferable.&lt;/p&gt;

&lt;p&gt;That is the Solana version of inspecting a production schema.&lt;/p&gt;

&lt;p&gt;In Web2, the rules of a system are often scattered across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;application code&lt;/li&gt;
&lt;li&gt;database migrations&lt;/li&gt;
&lt;li&gt;environment variables&lt;/li&gt;
&lt;li&gt;payment processor settings&lt;/li&gt;
&lt;li&gt;admin dashboards&lt;/li&gt;
&lt;li&gt;scheduled jobs&lt;/li&gt;
&lt;li&gt;private documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Solana, much of the token’s behavior is visible in the mint account.&lt;/p&gt;

&lt;p&gt;That does not mean the whole application is transparent. But it does mean the token’s configuration can be read by anyone.&lt;/p&gt;

&lt;p&gt;That is part of the Token-2022 pitch.&lt;/p&gt;

&lt;p&gt;The behavior is public.&lt;br&gt;&lt;br&gt;
The configuration is verifiable.&lt;br&gt;&lt;br&gt;
The rules cannot be silently swapped inside a private backend.  &lt;/p&gt;

&lt;p&gt;That is also why auditing matters.&lt;/p&gt;

&lt;p&gt;You should not just create a mint and trust that you typed the command correctly. You should read it back. Check the extensions. Check the authorities. Check the raw configuration. Explain what each extension does in plain English.&lt;/p&gt;

&lt;p&gt;That last part is important.&lt;/p&gt;

&lt;p&gt;If you cannot describe the behavior without looking it up, you probably do not understand the asset yet.&lt;/p&gt;
&lt;h2&gt;
  
  
  Non-transferable tokens are useful because they fail
&lt;/h2&gt;

&lt;p&gt;Arc 8 ended the build sequence with a token that refuses to move.&lt;/p&gt;

&lt;p&gt;That might sound strange because tokens usually imply transferability. Money moves. Points move. Assets move.&lt;/p&gt;

&lt;p&gt;But not every token-like thing should be transferable.&lt;/p&gt;

&lt;p&gt;A course certificate should not be sellable.&lt;br&gt;&lt;br&gt;
A membership badge might need to stay with the person who earned it.&lt;br&gt;&lt;br&gt;
A compliance credential might need to remain attached to one wallet.&lt;br&gt;&lt;br&gt;
A proof-of-attendance token might lose meaning if it can be traded.  &lt;/p&gt;

&lt;p&gt;The non-transferable extension lets the mint encode that rule.&lt;/p&gt;

&lt;p&gt;The challenge deliberately tried to break it. Create the token. Mint it. Create a recipient account. Attempt a transfer.&lt;/p&gt;

&lt;p&gt;The transfer fails.&lt;/p&gt;

&lt;p&gt;That failure is the feature.&lt;/p&gt;

&lt;p&gt;In a Web2 app, you might prevent transferability through an API check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if token.non_transferable:
    reject transfer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But that depends on every path using the same API.&lt;/p&gt;

&lt;p&gt;With Token-2022, the token program itself rejects the transfer. The rule is part of the mint’s behavior, and any client interacting with the program has to respect it.&lt;/p&gt;

&lt;p&gt;That makes non-transferable tokens different from fees and interest.&lt;/p&gt;

&lt;p&gt;Fees and interest are still money-like features. They affect value movement and balance display.&lt;/p&gt;

&lt;p&gt;Non-transferability changes the category of the asset. The token starts to look less like currency and more like identity, membership, status, or proof.&lt;/p&gt;

&lt;p&gt;Same mint model. Same token accounts. Same CLI.&lt;/p&gt;

&lt;p&gt;Different product meaning.&lt;/p&gt;

&lt;p&gt;That is why the failed transfer matters so much. It proves the extension is not just descriptive metadata. It changes what the token can do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Token-2022 is configuration, but not casual configuration
&lt;/h2&gt;

&lt;p&gt;A tempting takeaway from Arc 8 would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Token-2022 lets you add features with flags.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is true, but incomplete.&lt;/p&gt;

&lt;p&gt;The better takeaway is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Token-2022 lets you design token behavior through mint configuration.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;Extensions feel easy because they can be created from the CLI. But they are not throwaway settings. They shape what the asset is, who can use it, and how every integration will experience it.&lt;/p&gt;

&lt;p&gt;A fee-bearing token is different from a normal token.&lt;/p&gt;

&lt;p&gt;An interest-bearing token is different from a normal token.&lt;/p&gt;

&lt;p&gt;A non-transferable token is very different from a normal token.&lt;/p&gt;

&lt;p&gt;Once those behaviors are on the mint, they are part of the asset’s design.&lt;/p&gt;

&lt;p&gt;That brings Arc 8 back to the product questions underneath the technical work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Should every transfer charge a fee?
Who can withdraw withheld fees?
Should balances display with interest?
Should this asset be transferable at all?
Which authorities control the rules?
Will wallets and integrations understand these extensions?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those are not just CLI questions.&lt;/p&gt;

&lt;p&gt;They are product, governance, and integration questions.&lt;/p&gt;

&lt;p&gt;Token-2022 gives you reusable building blocks, but you still have to choose the right ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing turns extensions into patterns
&lt;/h2&gt;

&lt;p&gt;Arc 8 ended by turning the week into a public post and social thread.&lt;/p&gt;

&lt;p&gt;That fits the arc well because Token-2022 is easy to explain badly.&lt;/p&gt;

&lt;p&gt;You can list extensions all day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;transfer fees&lt;/li&gt;
&lt;li&gt;interest-bearing&lt;/li&gt;
&lt;li&gt;non-transferable&lt;/li&gt;
&lt;li&gt;default account state&lt;/li&gt;
&lt;li&gt;permanent delegate&lt;/li&gt;
&lt;li&gt;confidential transfers&lt;/li&gt;
&lt;li&gt;memo transfer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But a list is not a mental model.&lt;/p&gt;

&lt;p&gt;A useful post needs to show the pattern.&lt;/p&gt;

&lt;p&gt;For Arc 8, the pattern was a trilogy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A token that charges a fee.
A token that charges a fee and displays interest.
A token that refuses to move.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is much more memorable than “I tried some Token-2022 extensions.”&lt;/p&gt;

&lt;p&gt;It shows the range of what extensions can do.&lt;/p&gt;

&lt;p&gt;One changes transfer economics.&lt;br&gt;&lt;br&gt;
One composes transfer economics with display behavior.&lt;br&gt;&lt;br&gt;
One changes whether transfer is allowed at all.  &lt;/p&gt;

&lt;p&gt;That is the story.&lt;/p&gt;

&lt;p&gt;The best write-up would include what actually happened on devnet: the fee being withheld, the interest-adjusted UI amount changing without a transaction, and the failed transfer error from the non-transferable token.&lt;/p&gt;

&lt;p&gt;Those details matter because they prove the learning.&lt;/p&gt;

&lt;p&gt;Not:&lt;/p&gt;

&lt;p&gt;“I learned Token-2022.”&lt;/p&gt;

&lt;p&gt;More like:&lt;/p&gt;

&lt;p&gt;“I created a token that charged a transfer fee, watched the fee sit as a withheld amount on the recipient account, stacked interest on the same mint, then built a token that refused to transfer at all.”&lt;/p&gt;

&lt;p&gt;That is useful developer storytelling.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 8 sets up
&lt;/h2&gt;

&lt;p&gt;Strip Arc 8 back to its core and the main ideas are clear:&lt;/p&gt;

&lt;p&gt;Token-2022 lets token behavior live on the mint. Transfer fees are enforced by the token program. Fees follow a visible lifecycle: transfer, withhold, withdraw. Interest-bearing behavior changes displayed amounts without constantly rewriting raw balances. Extensions can compose on the same mint. Mint configuration is public and inspectable. Non-transferable tokens show that extensions are not only about money; they can turn tokens into identity, credential, or membership objects.&lt;/p&gt;

&lt;p&gt;That is the real shift.&lt;/p&gt;

&lt;p&gt;Arc 5 taught us to create and manage tokens.&lt;/p&gt;

&lt;p&gt;Arc 6 taught us to design token behavior with extensions.&lt;/p&gt;

&lt;p&gt;Arc 7 showed that NFTs are built from the same token primitives.&lt;/p&gt;

&lt;p&gt;Arc 8 pulled the model together: Token-2022 is the extension system that makes many of those behaviors possible without custom on-chain programs.&lt;/p&gt;

&lt;p&gt;From here, the question becomes more practical:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do you choose the right token behavior for the product you are building?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the mindset to carry forward.&lt;/p&gt;

&lt;p&gt;Use this post as the map, revisit the Arc 8 challenges when you want the hands-on version, and remember the central lesson: with Token-2022, the rule does not sit beside the asset. The rule can live inside the asset.&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>learning</category>
    </item>
    <item>
      <title>Arc 7 Catch-Up: Building NFTs from First Principles</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 15 Jun 2026 14:28:59 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-7-catch-up-building-nfts-from-first-principles-5ae3</link>
      <guid>https://dev.to/100daysofsolana/arc-7-catch-up-building-nfts-from-first-principles-5ae3</guid>
      <description>&lt;p&gt;Arc 7 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt; was about building NFTs from first principles.&lt;/p&gt;

&lt;p&gt;Instead of starting with marketplaces, profile pictures, or NFT culture, the arc stripped the model back to the underlying token mechanics: supply, decimals, mint authority, metadata, collections, and provenance.&lt;/p&gt;

&lt;p&gt;After Arc 6, we already knew that Token-2022 can turn tokens into programmable objects with rules: interest, fees, frozen accounts, credentials, revocation, and metadata.&lt;/p&gt;

&lt;p&gt;Arc 7 took that model into NFTs.&lt;/p&gt;

&lt;p&gt;But the useful surprise was that NFTs are not a completely separate world.&lt;/p&gt;

&lt;p&gt;The whole arc hangs off one idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A Solana NFT is built from the same token primitives you already know.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Web2 developers, that is the shift worth noticing.&lt;/p&gt;

&lt;p&gt;An NFT is not magic. It is not “a JPEG on the blockchain.” It is not a special category of database record maintained by some mysterious NFT system.&lt;/p&gt;

&lt;p&gt;At its simplest, an NFT is a token mint with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;supply locked at one&lt;/li&gt;
&lt;li&gt;zero decimals&lt;/li&gt;
&lt;li&gt;mint authority disabled&lt;/li&gt;
&lt;li&gt;metadata attached&lt;/li&gt;
&lt;li&gt;optional collection membership&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the foundation Arc 7 built up, one layer at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  NFTs are not separate from tokens
&lt;/h2&gt;

&lt;p&gt;Arc 7 started by stripping the NFT model down to its smallest useful form.&lt;/p&gt;

&lt;p&gt;Before metadata, images, attributes, marketplaces, or collections, an NFT is just a token that cannot be split and cannot be duplicated.&lt;/p&gt;

&lt;p&gt;That means two choices matter immediately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;decimals = 0
supply = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero decimals means the token cannot be divided into fractions. You cannot own 0.5 of it.&lt;/p&gt;

&lt;p&gt;Supply of one means there is only one unit.&lt;/p&gt;

&lt;p&gt;But supply of one is not enough by itself. If the mint authority still exists, someone could mint another unit later.&lt;/p&gt;

&lt;p&gt;So the final step is to disable the mint authority.&lt;/p&gt;

&lt;p&gt;That is the moment the token becomes meaningfully non-fungible. The network can see that the supply is one, the decimals are zero, and no authority remains that can create a second copy.&lt;/p&gt;

&lt;p&gt;For Web2 developers, a useful comparison is a unique database row with a primary key.&lt;/p&gt;

&lt;p&gt;But the analogy only goes so far.&lt;/p&gt;

&lt;p&gt;In a normal database, the application owner can usually edit the row, clone it, delete it, or change the surrounding rules. On Solana, once the mint authority is disabled, the supply constraint is enforced by the token program.&lt;/p&gt;

&lt;p&gt;The uniqueness is not a UI convention. It is not a marketplace promise. It is part of the token state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metadata turns a token into something recognizable
&lt;/h2&gt;

&lt;p&gt;The first NFT in Arc 7 was intentionally plain.&lt;/p&gt;

&lt;p&gt;It had no name, no image, no creator story, no attributes, and no collection. It was non-fungible, but not especially meaningful to a human.&lt;/p&gt;

&lt;p&gt;That is where metadata comes in.&lt;/p&gt;

&lt;p&gt;Arc 7 used Token-2022 metadata to give the NFT a name, symbol, and URI. The URI pointed to an off-chain JSON file containing richer information such as the description, image, and attributes.&lt;/p&gt;

&lt;p&gt;That gives us a two-layer model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;On-chain:
mint, supply, decimals, authority, name, symbol, URI

Off-chain:
image, description, attributes, richer display data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That split matters.&lt;/p&gt;

&lt;p&gt;The expensive, consensus-critical parts live on-chain. The heavier display information usually lives off-chain. Wallets and explorers follow the pointer: read the mint, get the URI, fetch the JSON, render the asset.&lt;/p&gt;

&lt;p&gt;For Web2 developers, this is familiar once you stop treating the NFT as mysterious.&lt;/p&gt;

&lt;p&gt;The on-chain metadata is like the core record. The URI is like a foreign key or external reference. The JSON is like the richer document the UI uses to render the page.&lt;/p&gt;

&lt;p&gt;The important difference is that the ownership, supply, and core metadata live on a shared network rather than inside one application database.&lt;/p&gt;

&lt;p&gt;Arc 7 also made an important historical point. In older Solana NFT workflows, metadata often lived in a separate Metaplex Token Metadata account next to the mint. In this arc, Token Extensions put metadata directly on the mint account itself.&lt;/p&gt;

&lt;p&gt;That is why the exercise was useful. It showed the foundation before introducing convenience tooling.&lt;/p&gt;

&lt;h2&gt;
  
  
  An NFT collection is an on-chain relationship
&lt;/h2&gt;

&lt;p&gt;Once the arc had created a single NFT, the next step was collections.&lt;/p&gt;

&lt;p&gt;In Web2 terms, this is easy to understand.&lt;/p&gt;

&lt;p&gt;A product belongs to a catalog.&lt;br&gt;
A ticket belongs to an event.&lt;br&gt;
A badge belongs to an award program.&lt;br&gt;
A collectible belongs to a set.&lt;/p&gt;

&lt;p&gt;In a database, you might model that with a foreign key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nft.collection_id = collection.id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arc 7 built the Solana equivalent using Token-2022 group and member extensions.&lt;/p&gt;

&lt;p&gt;Strictly speaking, there are four related pieces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GroupPointer&lt;/code&gt;, which points a collection mint at the account that stores group data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TokenGroup&lt;/code&gt;, which stores the group data itself&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GroupMemberPointer&lt;/code&gt;, which points an NFT mint at the account that stores member data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TokenGroupMember&lt;/code&gt;, which stores the member’s group address and member number&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the arc, those pointers point back to the mint accounts themselves, so the group and member data live directly on the relevant mints.&lt;/p&gt;

&lt;p&gt;That is why it is fair to talk about a collection mint and member mints, but the underlying model is a little more precise than “one group extension and one member extension.”&lt;/p&gt;

&lt;p&gt;The collection mint represents the group. Each member NFT stores membership data that links it to that group.&lt;/p&gt;

&lt;p&gt;The important part is that this relationship is not just a label in a marketplace database. It is data stored on-chain and readable by wallets, explorers, and programs.&lt;/p&gt;

&lt;p&gt;The arc’s useful mental model was simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;collection mint = the group
member mint = the individual NFT
member data = the link back to the group
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the NFT version of a foreign key relationship.&lt;/p&gt;

&lt;p&gt;But there is an extra trust step. A pointer by itself is not proof. A malicious mint can point at something it should not. So a client should not stop at “this member says it belongs to this collection.”&lt;/p&gt;

&lt;p&gt;It needs to resolve the pointer and verify that the relationship is internally consistent.&lt;/p&gt;

&lt;p&gt;That means checking that the member identifies the collection, and that the account being pointed to actually identifies the mint back.&lt;/p&gt;

&lt;p&gt;And the creation step matters too. Initializing a group member is not just something any random token creator can do unilaterally. The collection’s authority has to authorize membership.&lt;/p&gt;

&lt;p&gt;That is the stronger provenance claim: the collection relationship is not just stored on-chain; it is created through an authorized on-chain action.&lt;/p&gt;

&lt;p&gt;As with Arc 6, the schema decisions matter. A mint must be created with the right extensions. You cannot casually retrofit yesterday’s NFT into a collection if it was not created with the member structure it needs.&lt;/p&gt;

&lt;p&gt;That constraint can feel annoying, but it is also part of what makes the structure verifiable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Provenance is something you can inspect
&lt;/h2&gt;

&lt;p&gt;One of the most valuable Arc 7 exercises was not creating another asset.&lt;/p&gt;

&lt;p&gt;It was auditing the collection.&lt;/p&gt;

&lt;p&gt;That matters because NFT language often gets vague. Provenance, authenticity, ownership, rarity, official collections — these terms can become marketing fog very quickly.&lt;/p&gt;

&lt;p&gt;Arc 7 made the idea concrete.&lt;/p&gt;

&lt;p&gt;You inspect the collection mint.&lt;br&gt;
You inspect the member NFT.&lt;br&gt;
You check the member data.&lt;br&gt;
You verify that the collection relationship resolves correctly.&lt;/p&gt;

&lt;p&gt;That last step matters.&lt;/p&gt;

&lt;p&gt;A one-way check is not enough. It is not sufficient to say:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This NFT points to collection C.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A safer check is closer to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This NFT points to member data.
That member data names this NFT mint.
That member data names collection C.
The group data for collection C names collection C.
The membership was created under the collection’s authority.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is what makes the relationship more than vibes.&lt;/p&gt;

&lt;p&gt;The collection claim is not true merely because a website says so. It is not true merely because a field contains a familiar collection address. It is true when the on-chain relationship resolves correctly and the collection authority has authorized that membership.&lt;/p&gt;

&lt;p&gt;For Web2 developers, this is like checking that a foreign key resolves correctly and that the row was created by a service with permission to write to that table.&lt;/p&gt;

&lt;p&gt;The difference is that the database is public, shared, and inspectable by anyone.&lt;/p&gt;

&lt;p&gt;That is a big part of the NFT value proposition when you remove the hype.&lt;/p&gt;

&lt;p&gt;The asset can carry enough information for independent verification, but only if clients verify the relationship properly. Pointers are useful because they let accounts reference each other. They are dangerous if treated as proof on their own.&lt;/p&gt;

&lt;p&gt;That is also why the CLI work matters.&lt;/p&gt;

&lt;p&gt;It is tempting to think of NFTs through wallets, marketplaces, and images. But the more useful developer habit is to read the underlying state.&lt;/p&gt;

&lt;p&gt;What is the supply?&lt;br&gt;
What are the decimals?&lt;br&gt;
Is the mint authority disabled?&lt;br&gt;
Is metadata present?&lt;br&gt;
What URI is stored?&lt;br&gt;
Is there group member data?&lt;br&gt;
Does it name the expected collection?&lt;br&gt;
Does the pointed-to data name this mint back?&lt;br&gt;
Was the membership authorized by the collection authority?&lt;/p&gt;

&lt;p&gt;That is how NFTs stop feeling like magic.&lt;/p&gt;
&lt;h2&gt;
  
  
  Mutability is a design choice
&lt;/h2&gt;

&lt;p&gt;Arc 7 then moved from creation to mutation.&lt;/p&gt;

&lt;p&gt;Because the creator still held the metadata update authority, they could rename the NFT, add a custom field, remove that field, or point the URI at a new JSON file.&lt;/p&gt;

&lt;p&gt;That is an important lesson because “on-chain” does not always mean “unchangeable.”&lt;/p&gt;

&lt;p&gt;Some parts of the NFT were locked. The supply was one. The decimals were zero. The mint authority had been disabled.&lt;/p&gt;

&lt;p&gt;But the metadata could still change while the update authority existed.&lt;/p&gt;

&lt;p&gt;That is not automatically good or bad. It is a design choice.&lt;/p&gt;

&lt;p&gt;A game asset might need metadata updates as it levels up.&lt;br&gt;
A ticket might need status changes.&lt;br&gt;
A credential might need expiry data.&lt;br&gt;
A dynamic collectible might intentionally evolve over time.&lt;/p&gt;

&lt;p&gt;But for other assets, mutability might undermine trust.&lt;/p&gt;

&lt;p&gt;If someone buys an NFT because of its image, description, or attributes, they care about whether those things can change later. If a collection promises permanence, the update authority becomes part of the trust model.&lt;/p&gt;

&lt;p&gt;Arc 7 also showed a practical split between on-chain and off-chain updates.&lt;/p&gt;

&lt;p&gt;Changing the on-chain name or URI can happen quickly. Changing the image behind the URI depends on off-chain hosting and caching. Wallets and explorers may continue showing an old image for a while, even after the metadata has changed.&lt;/p&gt;

&lt;p&gt;That is a useful reminder: NFTs are not purely on-chain objects.&lt;/p&gt;

&lt;p&gt;They are hybrids.&lt;/p&gt;

&lt;p&gt;The token, ownership, supply, and metadata pointer can live on-chain. The image and richer media often live somewhere else.&lt;/p&gt;

&lt;p&gt;So the storage decision matters. A temporary GitHub Gist is fine for devnet learning. A serious project needs to think harder about durable storage: Arweave is designed for pay-once permanent storage, while IPFS content remains available only while someone continues to pin or serve it.&lt;/p&gt;
&lt;h2&gt;
  
  
  NFTs are records with ownership, display, and history
&lt;/h2&gt;

&lt;p&gt;The practical Web2 bridge for Arc 7 was not “NFTs are images.”&lt;/p&gt;

&lt;p&gt;A better bridge is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NFTs are unique records with ownership, display metadata, and provenance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That framing is much more useful.&lt;/p&gt;

&lt;p&gt;A normal application might have unique records everywhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;event tickets&lt;/li&gt;
&lt;li&gt;certificates&lt;/li&gt;
&lt;li&gt;software licenses&lt;/li&gt;
&lt;li&gt;game items&lt;/li&gt;
&lt;li&gt;collectible cards&lt;/li&gt;
&lt;li&gt;access passes&lt;/li&gt;
&lt;li&gt;membership badges&lt;/li&gt;
&lt;li&gt;digital art editions&lt;/li&gt;
&lt;li&gt;proof-of-attendance records&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Web2, those records usually live inside one company’s database. Ownership and transfer rules are whatever that application says they are.&lt;/p&gt;

&lt;p&gt;On Solana, the unique record can be represented as a token mint. Ownership can be held by a wallet. Supply can be locked. Metadata can be attached. Collection membership can be verified.&lt;/p&gt;

&lt;p&gt;That does not mean every unique record should be an NFT.&lt;/p&gt;

&lt;p&gt;It does mean the NFT model is easier to reason about once you stop starting with the JPEG.&lt;/p&gt;

&lt;p&gt;Start with the record.&lt;/p&gt;

&lt;p&gt;Then ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Should this record be unique?
Should ownership be visible?
Should it be transferable?
Should it belong to a collection?
Should its metadata be mutable?
Should the media be permanent?
Who should hold the update authority?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those are product questions, not just blockchain questions.&lt;/p&gt;

&lt;p&gt;That is the thread connecting Arc 7 back to Arc 6.&lt;/p&gt;

&lt;p&gt;Token design is product design. NFT design is product design too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing forces the model to become simple
&lt;/h2&gt;

&lt;p&gt;Arc 7 ended, like the earlier arcs, by writing and sharing.&lt;/p&gt;

&lt;p&gt;That matters because NFTs are surrounded by baggage. People bring assumptions from marketplaces, profile pictures, speculation, scams, and culture wars.&lt;/p&gt;

&lt;p&gt;A useful developer write-up has to cut through that.&lt;/p&gt;

&lt;p&gt;The best post from this arc would not start with “NFTs are back” or “NFTs are dead.” It would explain what was actually built:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I created a token with supply 1 and zero decimals.
I disabled the mint authority.
I added metadata.
I pointed the metadata at a JSON file.
I created a collection mint.
I linked member NFTs to the collection.
I inspected the on-chain relationship.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is enough.&lt;/p&gt;

&lt;p&gt;The point is not to defend NFTs as a category. The point is to understand the technical model.&lt;/p&gt;

&lt;p&gt;A good write-up might focus on one concrete surprise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an NFT is just a token mint with specific constraints&lt;/li&gt;
&lt;li&gt;metadata can live directly on the mint with Token Extensions&lt;/li&gt;
&lt;li&gt;collection membership can be verified on-chain&lt;/li&gt;
&lt;li&gt;provenance is an authorized relationship, not just a marketplace claim&lt;/li&gt;
&lt;li&gt;metadata can be mutable if the update authority remains active&lt;/li&gt;
&lt;li&gt;off-chain media is only as durable as the place it is hosted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That kind of explanation is useful because it gives the next Web2 developer a handle on the system.&lt;/p&gt;

&lt;p&gt;Not hype.&lt;/p&gt;

&lt;p&gt;A model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 7 sets up
&lt;/h2&gt;

&lt;p&gt;Strip Arc 7 back to its core and the main ideas are clear:&lt;/p&gt;

&lt;p&gt;A Solana NFT is built from token primitives. Non-fungibility comes from zero decimals, supply of one, and disabled mint authority. Metadata makes the asset recognizable. Off-chain JSON gives wallets and explorers richer display information. Collections are on-chain relationships between group and member data. Provenance is stronger than a pointer: the member relationship must be authorized by the collection authority and verified in both directions so pointer spoofing does not masquerade as legitimacy. Metadata mutability depends on who controls the update authority.&lt;/p&gt;

&lt;p&gt;That is the real shift.&lt;/p&gt;

&lt;p&gt;Arc 5 taught us to create and manage tokens.&lt;/p&gt;

&lt;p&gt;Arc 6 taught us to design token behavior with extensions.&lt;/p&gt;

&lt;p&gt;Arc 7 showed that NFTs are not a separate technology stack. They are the same token model, shaped into unique digital assets with metadata and provenance.&lt;/p&gt;

&lt;p&gt;From here, the question becomes more practical:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do these assets interact with real programs, wallets, apps, and users?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is where the next arc can take the model beyond minting and inspection, and into more realistic application behavior.&lt;/p&gt;

&lt;p&gt;Use this post as the map, revisit the Arc 7 challenges when you want the hands-on version, and carry the NFT mental model into what comes next.&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>learning</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>Arc 6 Catch-Up: Designing Tokens That Enforce Rules</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 15 Jun 2026 13:46:26 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-6-catch-up-designing-tokens-that-enforce-rules-3ffk</link>
      <guid>https://dev.to/100daysofsolana/arc-6-catch-up-designing-tokens-that-enforce-rules-3ffk</guid>
      <description>&lt;p&gt;Arc 6 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt; was about designing tokens that enforce rules.&lt;/p&gt;

&lt;p&gt;Arc 5 introduced the basics: mints, token accounts, metadata, transfer fees, and non-transferable tokens. Arc 6 pushed that further by asking a more interesting question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What if the token could carry more of the product logic itself?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That was the real theme of the week.&lt;/p&gt;

&lt;p&gt;Using Token-2022 on devnet, we explored interest-bearing tokens, multi-extension mints, frozen accounts, revocable credentials, and the trade-offs that come with adding more behavior to an asset.&lt;/p&gt;

&lt;p&gt;The whole arc hangs off one idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Token extensions let you compose asset behavior without writing your own on-chain program.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Web2 developers, that is the shift worth noticing.&lt;/p&gt;

&lt;p&gt;In a normal app, rules like interest, fees, access control, and revocation usually live in backend services, database jobs, middleware, or admin tooling.&lt;/p&gt;

&lt;p&gt;With Token-2022, some of those rules can live in the token itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extensions are asset features, not app features
&lt;/h2&gt;

&lt;p&gt;Most Web2 products have some kind of internal value system.&lt;/p&gt;

&lt;p&gt;A fintech app might offer yield. A marketplace might charge transaction fees. A learning platform might issue certificates. A SaaS product might gate access based on plan status. A compliance-heavy product might freeze or restrict accounts.&lt;/p&gt;

&lt;p&gt;Normally, those rules live in the application.&lt;/p&gt;

&lt;p&gt;Your backend calculates interest. Your payments layer applies fees. Your database stores membership status. Your admin dashboard revokes credentials. Your API checks whether a user is allowed to transfer, redeem, or access something.&lt;/p&gt;

&lt;p&gt;Token extensions move some of that logic into shared token infrastructure.&lt;/p&gt;

&lt;p&gt;That does not mean every app should become a token app. It means that, when a token is the right primitive, the rules do not have to be reinvented from scratch. You can use audited, reusable building blocks that every client and integration has to respect.&lt;/p&gt;

&lt;p&gt;That is the big idea behind Token-2022.&lt;/p&gt;

&lt;p&gt;The token is no longer just a number in a balance bucket. It can have behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interest-bearing tokens make display different from storage
&lt;/h2&gt;

&lt;p&gt;Arc 6 started with the interest-bearing extension.&lt;/p&gt;

&lt;p&gt;The exercise looked simple: create a token with a 5% interest rate, mint 1,000 tokens, then compare the raw balance with the displayed amount.&lt;/p&gt;

&lt;p&gt;The surprising part is that the ledger balance does not keep changing in the background.&lt;/p&gt;

&lt;p&gt;There is no cron job waking up every minute to update every account. There is no backend service recalculating balances and writing new rows. The token stores the rate and timing information. Readers calculate the interest-adjusted display amount when they need it.&lt;/p&gt;

&lt;p&gt;In Web2 terms, it is like a savings account APY where the displayed balance can grow without the underlying ledger entry being rewritten constantly.&lt;/p&gt;

&lt;p&gt;That is a subtle but important distinction.&lt;/p&gt;

&lt;p&gt;The raw on-chain amount is still the raw amount. The interest-bearing extension changes how that amount is interpreted.&lt;/p&gt;

&lt;p&gt;That is why the arc deliberately made the rate dramatic later. At 5%, the difference is easy to miss. At 150%, you can watch the displayed amount climb much faster and see the model more clearly.&lt;/p&gt;

&lt;p&gt;The lesson was not “make wild APY tokens.” The lesson was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Some token behavior is computed by readers, not stored as repeated balance updates.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is a useful mental model to carry into more advanced token work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extensions can be composed
&lt;/h2&gt;

&lt;p&gt;The next step was combining multiple extensions in one mint.&lt;/p&gt;

&lt;p&gt;Arc 6 created a token with three behaviors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;metadata, so the token had a name, symbol, and URI&lt;/li&gt;
&lt;li&gt;transfer fees, so transfers automatically withheld a percentage&lt;/li&gt;
&lt;li&gt;interest, so displayed balances could grow over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where Token-2022 starts to feel different from the original SPL Token Program.&lt;/p&gt;

&lt;p&gt;You are not just creating a token and then building everything else around it. You are deciding which behaviors the token itself should support.&lt;/p&gt;

&lt;p&gt;In Web2 terms, this is closer to designing the schema and rules for a financial product before launch. You decide what the product is allowed to do, what fields it needs, which authorities exist, and which operations should be enforced by the platform.&lt;/p&gt;

&lt;p&gt;The important catch is that extensions are configured up front.&lt;/p&gt;

&lt;p&gt;You cannot casually bolt them on later after the mint already exists. That makes token design feel more like database schema design or API contract design than UI configuration.&lt;/p&gt;

&lt;p&gt;You should think before you mint.&lt;/p&gt;

&lt;p&gt;The other lesson was that extensions operate independently. Transfer fee logic and interest logic can both exist on the same token, but they are not the same feature. One affects what happens during transfer. The other affects how balances are displayed over time.&lt;/p&gt;

&lt;p&gt;Composability is powerful, but it does not remove the need to understand each part.&lt;/p&gt;

&lt;h2&gt;
  
  
  Access control can live at the token level
&lt;/h2&gt;

&lt;p&gt;Arc 6 also introduced the default frozen account state.&lt;/p&gt;

&lt;p&gt;That sounds abstract, but the product pattern is familiar.&lt;/p&gt;

&lt;p&gt;Some assets should not be freely usable by default. Stablecoins, security tokens, regulated assets, compliance-gated products, and permissioned marketplaces all need some version of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This account exists, but it is not allowed to move yet.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Web2, that rule might live in your backend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if user.kyc_status !== "approved":
    reject transfer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a default-frozen Token-2022 mint, new token accounts start frozen. Transfers and mints fail until the right authority thaws the account.&lt;/p&gt;

&lt;p&gt;That is a very different trust model.&lt;/p&gt;

&lt;p&gt;You are not relying on every frontend, integration, script, or API route to remember the compliance check. The token program enforces the state. If the account is frozen, the transfer does not go through.&lt;/p&gt;

&lt;p&gt;That was the core lesson of the frozen-account exercise: the failure is useful. It proves the rule is enforced below the application layer.&lt;/p&gt;

&lt;p&gt;The pattern is not “add KYC UI.” The pattern is “make unauthorized movement impossible at the token level.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Credentials need different rules from currencies
&lt;/h2&gt;

&lt;p&gt;Arc 6 then moved from financial rules to identity and credentials.&lt;/p&gt;

&lt;p&gt;The revocable credential token combined two extensions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;non-transferable&lt;/strong&gt;, so the holder could not sell or transfer the credential&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;permanent delegate&lt;/strong&gt;, so the issuer could burn it from the holder’s account if it needed to be revoked&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That combination is a good example of why token design is not one-size-fits-all.&lt;/p&gt;

&lt;p&gt;A currency wants liquidity. A marketplace asset may want fees. A certificate wants the opposite of transferability. Its value depends on being attached to the right holder.&lt;/p&gt;

&lt;p&gt;A bootcamp certificate, professional license, compliance credential, or membership badge is only meaningful if the person who earned it is the person holding it.&lt;/p&gt;

&lt;p&gt;So non-transferability makes sense.&lt;/p&gt;

&lt;p&gt;But credentials also need revocation. A license can expire. A badge can be issued by mistake. A qualification can be withdrawn. A membership can be canceled.&lt;/p&gt;

&lt;p&gt;That is where permanent delegate fits. It gives an authority the ability to burn from a holder’s account without needing that holder to sign the burn transaction.&lt;/p&gt;

&lt;p&gt;That may sound harsh until you map it to Web2.&lt;/p&gt;

&lt;p&gt;If your company issues a certificate, you probably expect the issuer to be able to revoke it. The difference is that, on Solana, that power is expressed through token behavior rather than a private database update.&lt;/p&gt;

&lt;p&gt;This is where Arc 6 became less about “tokens as money” and more about “tokens as stateful credentials.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading configurations matters as much as creating them
&lt;/h2&gt;

&lt;p&gt;One of the most useful parts of the arc was not creating a new token at all.&lt;/p&gt;

&lt;p&gt;It was inspecting the tokens we had already made.&lt;/p&gt;

&lt;p&gt;Arc 6 asked us to compare the mints from the week and read their configurations back out: interest rate authority, transfer fee settings, metadata, freeze authority, default account state, data size, and rent-exempt cost.&lt;/p&gt;

&lt;p&gt;That matters because on-chain configuration is not something you should treat as write-only.&lt;/p&gt;

&lt;p&gt;If you are building seriously, you need to be able to answer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which extensions does this mint use?
Who controls the authorities?
Can those authorities change?
How large is the account?
How much rent-exempt balance does it need?
What rules will every holder be subject to?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the token equivalent of inspecting a production database schema or reviewing cloud infrastructure before launch.&lt;/p&gt;

&lt;p&gt;You do not just create it and hope. You read it back. You compare it. You verify what the chain actually stores.&lt;/p&gt;

&lt;p&gt;Arc 6 also made one trade-off visible: extensions are not free. More extensions mean more account data, and more account data means higher rent-exempt cost.&lt;/p&gt;

&lt;p&gt;That is not necessarily a problem. It is just part of the design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Token design is product design
&lt;/h2&gt;

&lt;p&gt;The throughline of Arc 6 was judgment.&lt;/p&gt;

&lt;p&gt;Interest-bearing tokens, transfer fees, frozen accounts, non-transferable credentials, and permanent delegates are all useful, but not universally useful.&lt;/p&gt;

&lt;p&gt;Each one answers a different product question:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Should the displayed balance grow over time?
Should each transfer withhold a fee?
Should new accounts start locked?
Should this asset be transferable?
Should the issuer be able to revoke it?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those are not just technical choices. They are product choices.&lt;/p&gt;

&lt;p&gt;The mistake is to start with the extension and then hunt for a use case. The better move is to start with the product rule and ask whether a Token-2022 extension already enforces it.&lt;/p&gt;

&lt;p&gt;That is why Arc 6 was a natural follow-up to Arc 5.&lt;/p&gt;

&lt;p&gt;Arc 5 taught the basic token lifecycle. Arc 6 taught that token behavior can be composed.&lt;/p&gt;

&lt;p&gt;Not every app needs custom program code immediately. Sometimes the right answer is to use the token program that already exists, configure it correctly, and understand the trade-offs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing and sharing made the combinations clearer
&lt;/h2&gt;

&lt;p&gt;Arc 6 ended by turning the week into a public explanation.&lt;/p&gt;

&lt;p&gt;That matters because token extensions are easy to list but harder to understand in combination.&lt;/p&gt;

&lt;p&gt;Writing forces the useful question:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which extension combination solves which real product problem?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Interest alone is one pattern. Fees plus metadata is another. Default frozen accounts are a compliance pattern. Non-transferable plus permanent delegate is a credential pattern.&lt;/p&gt;

&lt;p&gt;A good write-up does not need to explain every command. It needs to explain the shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here is the Web2 problem.
Here is the token extension combination.
Here is what happened on devnet.
Here is what surprised me.
Here is where this pattern might fit.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is how learning becomes useful to someone else.&lt;/p&gt;

&lt;p&gt;The sharing prompt continued that idea: lead with the problem, show concrete takeaways, include the link, and use the community as a conversation rather than a broadcast channel.&lt;/p&gt;

&lt;p&gt;That is especially important in an arc like this. The value is not just “I created another token.” It is “I matched a real-world rule to a token-level feature and proved it works.”&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 6 sets up
&lt;/h2&gt;

&lt;p&gt;Strip Arc 6 back to its core and the main ideas are clear:&lt;/p&gt;

&lt;p&gt;Token-2022 extensions let you add behavior to tokens without writing custom on-chain program code. Interest can affect displayed balances without constantly rewriting ledger balances. Multiple extensions can live on one mint, but they must be planned up front. Frozen accounts support access control. Non-transferable tokens plus permanent delegates support revocable credentials. Reading token configuration back from the chain is part of building responsibly.&lt;/p&gt;

&lt;p&gt;That is the real shift.&lt;/p&gt;

&lt;p&gt;Arc 5 taught us to create and manage tokens.&lt;/p&gt;

&lt;p&gt;Arc 6 taught us to design token behavior.&lt;/p&gt;

&lt;p&gt;From here, the question becomes more practical:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do these tokens interact with real programs on-chain?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is where the next arc goes: taking the token model beyond the CLI and into program-driven interactions.&lt;/p&gt;

&lt;p&gt;Use this post as the map, revisit the Arc 6 challenges when you want the hands-on version, and carry the extension model into what comes next.&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>learning</category>
      <category>web3</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Arc 5 Catch-Up: Solana Token Fundamentals Explained for Web2 Developers</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 08 Jun 2026 12:21:27 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-5-catch-up-solana-token-fundamentals-explained-for-web2-developers-3hfn</link>
      <guid>https://dev.to/100daysofsolana/arc-5-catch-up-solana-token-fundamentals-explained-for-web2-developers-3hfn</guid>
      <description>&lt;p&gt;Arc 5 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt; opened Epoch 2 by moving from foundation work into programmable assets.&lt;/p&gt;

&lt;p&gt;Epoch 1 gave us the basics: wallets, reads, transactions, accounts, and raw on-chain data. Arc 5 put those ideas to work on one of Solana’s most important primitives: tokens.&lt;/p&gt;

&lt;p&gt;The arc theme was &lt;strong&gt;Token Fundamentals&lt;/strong&gt;. The Web2 bridge was incentive systems: reward points, marketplace credits, loyalty balances, badges, fees, and transfer rules.&lt;/p&gt;

&lt;p&gt;The whole arc hangs off one idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On Solana, a token is not just a balance. It is a set of rules enforced by a shared on-chain program.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the big shift for Web2 developers.&lt;/p&gt;

&lt;p&gt;In a normal app, token-like systems often live in your database and your backend logic. You design tables, write endpoints, check permissions, prevent double-spends, calculate fees, and decide which transfers are allowed.&lt;/p&gt;

&lt;p&gt;On Solana, much of that machinery already exists in audited token programs. Arc 5 was about learning to use those programs before trying to invent your own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tokens are incentive systems with stronger guarantees
&lt;/h2&gt;

&lt;p&gt;If you have built Web2 products, you have probably seen token-like systems already.&lt;/p&gt;

&lt;p&gt;A marketplace might have seller credits. A learning platform might have completion badges. A game might have in-app currency. A SaaS product might track usage credits. A community might issue reputation points or membership status.&lt;/p&gt;

&lt;p&gt;Those systems usually depend on application code.&lt;/p&gt;

&lt;p&gt;Your backend decides who has what. Your database stores the balances. Your API enforces the rules. If you want transfer fees, you write the fee logic. If you want a badge that cannot be transferred, you add checks in your application.&lt;/p&gt;

&lt;p&gt;That works, but the rules live in your system.&lt;/p&gt;

&lt;p&gt;Solana changes the shape of that design. With the SPL Token Program and Token-2022, many token rules can be enforced at the program level. That means clients, scripts, and other programs have to follow the same rules.&lt;/p&gt;

&lt;p&gt;That is what made Arc 5 interesting. We were not just creating balances. We were exploring what happens when economic rules become part of the asset itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  A mint defines the token
&lt;/h2&gt;

&lt;p&gt;The first token in Arc 5 was deliberately simple.&lt;/p&gt;

&lt;p&gt;Using the &lt;code&gt;spl-token&lt;/code&gt; CLI on devnet, we created a token, created an account to hold it, minted 100 units, and inspected the result.&lt;/p&gt;

&lt;p&gt;That sounds straightforward, but it introduces the most important token distinction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A mint defines the token. A token account holds someone’s balance of that token.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are coming from Web2, the mint is a little like the currency definition or product catalog entry. It says what the token is: its supply, decimals, and mint authority.&lt;/p&gt;

&lt;p&gt;A token account is more like an individual balance bucket. It says how many of that token a particular owner holds.&lt;/p&gt;

&lt;p&gt;That distinction matters because you do not receive tokens directly “into a wallet” in the way newcomers often imagine. For each token type, a wallet needs a token account to hold that specific token.&lt;/p&gt;

&lt;p&gt;A wallet is more like a filing cabinet. Each token account is a folder inside it.&lt;/p&gt;

&lt;p&gt;That is the first Solana token model to carry forward:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Mint account: what the token is.&lt;br&gt;
Token account: who holds how much of it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once that clicks, token balances stop feeling like magic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Token-2022 makes the token itself more expressive
&lt;/h2&gt;

&lt;p&gt;Arc 5 then moved from the original SPL Token Program to Token-2022, also known as the Token Extensions Program.&lt;/p&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;The original SPL Token Program gives you the classic token basics: create a mint, create token accounts, mint supply, transfer, burn, inspect balances.&lt;/p&gt;

&lt;p&gt;Token-2022 keeps that familiar foundation but adds extensions: metadata, transfer fees, non-transferable tokens, and other features that would otherwise require more custom infrastructure.&lt;/p&gt;

&lt;p&gt;In Arc 5, the first Token-2022 step was a branded token.&lt;/p&gt;

&lt;p&gt;We created a mint with metadata enabled, set decimals, and wrote a name, symbol, and URI directly onto the mint.&lt;/p&gt;

&lt;p&gt;That is important because metadata gives a token identity. Without it, a token is mostly an address and some numbers. With it, the token becomes recognizable: name, symbol, and a pointer to more information.&lt;/p&gt;

&lt;p&gt;For Web2 developers, this is like moving from “database row with an ID” to “product with a name, SKU, description, and image.”&lt;/p&gt;

&lt;p&gt;The technical difference is that the identity lives with the token infrastructure, not just in an off-chain app database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Associated Token Accounts are the default balance bucket
&lt;/h2&gt;

&lt;p&gt;Arc 5 also introduced Associated Token Accounts, or ATAs.&lt;/p&gt;

&lt;p&gt;An ATA is a deterministic token account derived from a wallet address and a mint address. In plain English:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For this wallet and this token, there is a predictable default account that holds the balance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is useful because it avoids the chaos of every wallet having arbitrary token accounts everywhere.&lt;/p&gt;

&lt;p&gt;In Web2 terms, imagine if every user/product pair had a predictable balance record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;balance = getBalance(userId, tokenId)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You do not have to guess where the balance should live. You can derive it.&lt;/p&gt;

&lt;p&gt;That is why ATAs show up constantly in Solana token work. They are the standard place to look when asking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How much of this token does this wallet hold?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arc 5 used ATAs early because they are not an advanced detail. They are part of the everyday token model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transfer fees move marketplace logic into the token program
&lt;/h2&gt;

&lt;p&gt;The most commercially familiar extension in Arc 5 was transfer fees.&lt;/p&gt;

&lt;p&gt;In a Web2 marketplace, a payment or transaction fee usually lives in backend code. Someone transfers value, your system calculates a percentage, applies a cap, updates balances, and records the fee.&lt;/p&gt;

&lt;p&gt;With Token-2022 transfer fees, that rule can live in the token itself.&lt;/p&gt;

&lt;p&gt;In Arc 5, we created a token with a transfer fee. When tokens moved, a percentage was withheld automatically in the recipient’s token account. The recipient could not spend those withheld tokens. The fee authority could later collect them.&lt;/p&gt;

&lt;p&gt;That is the important part:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The fee is enforced by the token program, not by a UI convention or backend middleware.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That changes the trust model. A different client, script, or integration cannot simply “forget” to charge the fee. The rule is part of the token’s transfer behavior.&lt;/p&gt;

&lt;p&gt;There was also a very real developer gotcha: decimals.&lt;/p&gt;

&lt;p&gt;Transfer fee maximums are specified in base units, not display units. If your token has decimals, the number you type may not mean what you think it means. That kind of detail bites everyone eventually, and Arc 5 surfaced it early.&lt;/p&gt;

&lt;p&gt;The broader lesson is simple: token economics are product design, but the implementation is exact. Percentages, caps, decimals, authorities, and units all matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Non-transferable tokens are useful because they fail
&lt;/h2&gt;

&lt;p&gt;Arc 5 also explored non-transferable tokens, sometimes described as soulbound tokens.&lt;/p&gt;

&lt;p&gt;The exercise was intentionally odd: create a non-transferable token, mint it, then try to transfer it and watch the transfer fail.&lt;/p&gt;

&lt;p&gt;That failure was the point.&lt;/p&gt;

&lt;p&gt;A normal token is valuable partly because it can move. A non-transferable token is valuable because it cannot.&lt;/p&gt;

&lt;p&gt;That makes sense for things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;verified badges&lt;/li&gt;
&lt;li&gt;course-completion certificates&lt;/li&gt;
&lt;li&gt;membership credentials&lt;/li&gt;
&lt;li&gt;KYC or compliance status&lt;/li&gt;
&lt;li&gt;reputation markers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In those cases, transferability would undermine the meaning of the token. A certificate is not useful if someone else can buy it from you. A verified badge loses value if it can be traded.&lt;/p&gt;

&lt;p&gt;The key lesson was that the restriction is enforced by the token program.&lt;/p&gt;

&lt;p&gt;You are not relying on your frontend to hide a transfer button. You are not relying on an API route to reject the request. The token itself cannot be transferred under the rules of the program.&lt;/p&gt;

&lt;p&gt;But it can still be burned.&lt;/p&gt;

&lt;p&gt;That distinction matters. Non-transferable does not mean indestructible. It means the holder cannot transfer it to someone else. Burning still lets supply be reduced or credentials be revoked, depending on how the system is designed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lifecycle is the skill
&lt;/h2&gt;

&lt;p&gt;Arc 5 was not only about individual token features. It also reinforced a repeatable lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create → configure → mint → transfer → collect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That pattern showed up again and again.&lt;/p&gt;

&lt;p&gt;Create the mint. Configure its rules. Create the account that will hold the token. Mint supply. Transfer some tokens. Inspect what happened. Collect withheld fees if the extension uses them.&lt;/p&gt;

&lt;p&gt;That repetition matters because token work can feel fiddly at first.&lt;/p&gt;

&lt;p&gt;There are mints and token accounts. Original SPL Token and Token-2022. Display units and base units. Metadata and authorities. Transfer fees and withheld balances. Non-transferable rules and burn behavior.&lt;/p&gt;

&lt;p&gt;The way through that complexity is not to memorize every flag. It is to recognize the lifecycle.&lt;/p&gt;

&lt;p&gt;Once you can see where you are in the lifecycle, the commands start to make more sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building in public is part of the work
&lt;/h2&gt;

&lt;p&gt;Arc 5 ended, like the earlier arcs, by writing and sharing.&lt;/p&gt;

&lt;p&gt;But this week had more to show.&lt;/p&gt;

&lt;p&gt;By the end of the arc, we had created tokens, branded them, minted supply, applied fees, collected withheld tokens, and tested transfer restrictions. That is a proper artifact, not just a learning note.&lt;/p&gt;

&lt;p&gt;The writing prompt asked us to explain what clicked: why Token-2022 matters, why protocol-enforced rules are different from app-level checks, and what surprised us about token design.&lt;/p&gt;

&lt;p&gt;The sharing prompt pushed us to show one concrete moment: the first mint, metadata on Explorer, fees collected by the program, or a rejected non-transferable transfer.&lt;/p&gt;

&lt;p&gt;That is good developer storytelling because it gives people proof.&lt;/p&gt;

&lt;p&gt;Not “I learned tokens.”&lt;/p&gt;

&lt;p&gt;More like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I created a Token-2022 mint with metadata.
I transferred it.
The program withheld the fee.
Here is the Explorer screenshot.
Here is what surprised me.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is much more useful to the next person trying to understand the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 5 sets up
&lt;/h2&gt;

&lt;p&gt;Strip Arc 5 back to its core and the main ideas are clear:&lt;/p&gt;

&lt;p&gt;A mint defines a token. Token accounts hold balances. Associated Token Accounts give wallets a predictable balance account for each token. Token-2022 adds extensions such as metadata, transfer fees, and non-transferable behavior. Those extensions move rules that often live in Web2 backend code into shared on-chain programs.&lt;/p&gt;

&lt;p&gt;That is the real shift.&lt;/p&gt;

&lt;p&gt;In Web2, token-like systems often depend on your app enforcing the rules.&lt;/p&gt;

&lt;p&gt;On Solana, token programs can enforce many of those rules directly.&lt;/p&gt;

&lt;p&gt;That is what makes tokens such a useful first step after the foundation epoch. They take identity, accounts, transactions, and state, then combine them into something you can actually design with: incentives, fees, credentials, rewards, and asset behavior.&lt;/p&gt;

&lt;p&gt;Arc 5 opened Epoch 2 by showing that tokens are not just things you hold. They are programmable assets with rules.&lt;/p&gt;

&lt;p&gt;Use this post as the map, revisit the Arc 5 challenges when you want the hands-on version, and carry the token model into the next arc.&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>learning</category>
    </item>
    <item>
      <title>Arc 4 Catch-Up: Solana’s Account Model Explained for Web2 Developer</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 08 Jun 2026 12:06:13 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-4-catch-up-solanas-account-model-explained-for-web2-developer-1hh4</link>
      <guid>https://dev.to/100daysofsolana/arc-4-catch-up-solanas-account-model-explained-for-web2-developer-1hh4</guid>
      <description>&lt;p&gt;Arc 4 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt; was about the Solana account model: what state actually looks like on-chain, who can change it, and how developers read and decode it.&lt;/p&gt;

&lt;p&gt;Arc 3 gave us the transaction model. We learned that transactions are how Solana changes state.&lt;/p&gt;

&lt;p&gt;Arc 4 asked the next question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Where does that state live?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On Solana, the answer is accounts.&lt;/p&gt;

&lt;p&gt;That sounds simple, but it is one of the biggest mental model shifts in the whole foundation epoch. A Solana account is not just a wallet. It is not just a user profile. It is not just a row in a database.&lt;/p&gt;

&lt;p&gt;On Solana, almost everything is an account: wallets, programs, token mints, token accounts, sysvars, and application state.&lt;/p&gt;

&lt;p&gt;The whole arc hangs off one idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On Solana, accounts are the containers that hold state, code, ownership, and balance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once that clicks, the rest of Solana starts to fit together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accounts are where state lives
&lt;/h2&gt;

&lt;p&gt;In a Web2 app, state usually lives in places you control.&lt;/p&gt;

&lt;p&gt;User data might be in Postgres. Files might be in object storage. sessions might be in Redis. App code runs on your servers or serverless functions. Access control often lives in middleware, business logic, row-level security, or API permissions.&lt;/p&gt;

&lt;p&gt;Solana rearranges that picture.&lt;/p&gt;

&lt;p&gt;State lives in accounts. Programs are accounts too. Wallets are accounts. Token data is stored in accounts. Even bits of cluster state are exposed through special accounts.&lt;/p&gt;

&lt;p&gt;That is what people mean when they say “everything is an account.”&lt;/p&gt;

&lt;p&gt;It does not mean every account behaves the same way. A wallet account, a token mint, and an executable program account do different jobs. But they share the same basic structure, and that shared structure is what Arc 4 unpacked.&lt;/p&gt;

&lt;p&gt;A Solana account has five core fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;lamports&lt;/strong&gt;: how much SOL the account holds&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;data&lt;/strong&gt;: the bytes stored in the account&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;owner&lt;/strong&gt;: the program allowed to modify the account’s data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;executable&lt;/strong&gt;: whether the account contains runnable program code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rentEpoch&lt;/strong&gt;: a legacy rent-related field&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the foundation. Different accounts become meaningful because those fields are set differently.&lt;/p&gt;

&lt;h2&gt;
  
  
  The owner field is the security model
&lt;/h2&gt;

&lt;p&gt;For Web2 developers, the &lt;code&gt;owner&lt;/code&gt; field is one of the most important ideas to get right.&lt;/p&gt;

&lt;p&gt;It does not mean “the human who owns this account.”&lt;/p&gt;

&lt;p&gt;It means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which program is allowed to change this account’s data?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That makes &lt;code&gt;owner&lt;/code&gt; much closer to a low-level access-control rule than a user-facing ownership label.&lt;/p&gt;

&lt;p&gt;In a Web2 app, you might enforce permissions in your API layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Can this user update this row?
Can this service write to this bucket?
Can this job mutate this record?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Solana, the runtime enforces a stricter version of that idea. Only the owning program can modify an account’s data. If a token account is owned by the Token Program, your random application code cannot just rewrite it. If your program owns a data account, then your program defines how that data can change.&lt;/p&gt;

&lt;p&gt;That is why the account model matters so much.&lt;/p&gt;

&lt;p&gt;Transactions may carry the instructions, but accounts define the state those instructions act on. The &lt;code&gt;owner&lt;/code&gt; field helps decide which program has authority over that state.&lt;/p&gt;

&lt;p&gt;That is not middleware. It is part of the runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Programs are accounts too
&lt;/h2&gt;

&lt;p&gt;One of the more useful realizations in Arc 4 was that programs are not magical things floating somewhere outside the account model.&lt;/p&gt;

&lt;p&gt;Programs are accounts.&lt;/p&gt;

&lt;p&gt;The difference is that program accounts have &lt;code&gt;executable: true&lt;/code&gt;. Their data contains compiled program code, and their owner is a loader program rather than the System Program.&lt;/p&gt;

&lt;p&gt;That is a strange idea at first, but there is a useful Web2 analogy:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The code and the data are separate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A web server might run application code, then read and write rows in a database. On Solana, a program account contains executable code, while separate data accounts hold the state that program works with.&lt;/p&gt;

&lt;p&gt;That separation becomes crucial later.&lt;/p&gt;

&lt;p&gt;When you write Solana programs, you are not usually storing mutable state inside the program itself. You are writing code that receives accounts, checks them, reads their data, and changes the accounts it is allowed to change.&lt;/p&gt;

&lt;p&gt;So Arc 4 quietly set up one of the most important Solana development habits:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Think in accounts, not objects.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your program logic is only half the story. The accounts passed into that program are the other half.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading an account is like opening a file
&lt;/h2&gt;

&lt;p&gt;Arc 4 started with inspection.&lt;/p&gt;

&lt;p&gt;Using the Solana CLI, we looked at a normal wallet account, the SPL Token Program, and the System Program side by side. That made the shared structure visible.&lt;/p&gt;

&lt;p&gt;The Web2 analogy here is not perfect, but it helps:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reading a Solana account is a bit like opening a file or inspecting a database row.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can see its balance. You can see whether it has data. You can see who owns it. You can see whether it is executable.&lt;/p&gt;

&lt;p&gt;But unlike a normal database row, account data often starts as raw bytes. The network can give you the bytes, but it does not automatically know how you want to interpret them.&lt;/p&gt;

&lt;p&gt;That is where account decoding comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Raw bytes are where this gets real
&lt;/h2&gt;

&lt;p&gt;Arc 4 was the most “under the hood” week of Epoch 1, and the account decoding work was the reason.&lt;/p&gt;

&lt;p&gt;At first, an account’s &lt;code&gt;data&lt;/code&gt; field can look like base64 gibberish. That is not because it is meaningless. It is because you are looking at serialized bytes.&lt;/p&gt;

&lt;p&gt;The challenge was to decode those bytes and prove that the same account data could be understood in three ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;with a typed decoder from &lt;code&gt;@solana-program/token&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;manually, byte by byte, using &lt;code&gt;DataView&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;through the RPC’s &lt;code&gt;jsonParsed&lt;/code&gt; encoding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is not just busywork. It is the moment where “on-chain data” stops being abstract.&lt;/p&gt;

&lt;p&gt;If you have ever parsed a binary file format, decoded a network packet, or mapped bytes into a struct, this is the same kind of work. The data is there. Your job is to know its layout.&lt;/p&gt;

&lt;p&gt;Arc 4 introduced several ideas that will keep coming back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Borsh serialization&lt;/strong&gt;: how structured data becomes bytes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;little-endian numbers&lt;/strong&gt;: a common source of decoding bugs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;base64&lt;/strong&gt;: how RPC often returns account data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;hex&lt;/strong&gt;: useful for debugging raw bytes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;base58&lt;/strong&gt;: how Solana addresses are displayed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was the hardest part of the arc, but it was also the most transferable.&lt;/p&gt;

&lt;p&gt;If you can decode account data, you are no longer limited to what a block explorer chooses to show you. You can inspect state yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The System Program is the account clerk
&lt;/h2&gt;

&lt;p&gt;Arc 4 also took us one layer deeper into the system itself.&lt;/p&gt;

&lt;p&gt;The System Program is one of the native programs that makes Solana work. A useful way to think about it is as the clerk that creates and labels accounts.&lt;/p&gt;

&lt;p&gt;It can create accounts. It can assign ownership. It can allocate space. It handles basic SOL transfers.&lt;/p&gt;

&lt;p&gt;That makes it feel a little like part of an operating system. Not your application logic, but the lower-level machinery that makes files, processes, permissions, and memory possible.&lt;/p&gt;

&lt;p&gt;Sysvar accounts are another useful piece of that system layer. They expose read-only cluster state, such as clock or rent information, through accounts.&lt;/p&gt;

&lt;p&gt;A rough Web2 analogy would be &lt;code&gt;/proc&lt;/code&gt; on Linux: system information exposed as readable data.&lt;/p&gt;

&lt;p&gt;Again, the analogy is not exact. But it helps place the idea. Solana’s account model is not only for application state. It is also how the system exposes information about itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block explorers are blockchain DevTools
&lt;/h2&gt;

&lt;p&gt;After decoding account data by hand, Arc 4 stepped back and looked at Explorer again.&lt;/p&gt;

&lt;p&gt;That was useful because block explorers are not just places to paste transaction signatures. They are the debugging surface for a public blockchain.&lt;/p&gt;

&lt;p&gt;Solana Explorer, Solscan, and similar tools are basically UI wrappers around public chain data. They show accounts, transactions, owners, program logs, balances, token data, and instruction details.&lt;/p&gt;

&lt;p&gt;If you are used to browser DevTools, database consoles, or log dashboards, this is the role explorers play.&lt;/p&gt;

&lt;p&gt;They help you answer questions like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What account am I looking at?
Who owns it?
Is it executable?
What data does it hold?
Which transaction changed it?
What logs were emitted?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reading explorers fluently is a real Solana development skill. It lets you move between your code, RPC calls, transaction signatures, and on-chain state without guessing.&lt;/p&gt;

&lt;p&gt;Arc 4 made that explicit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing helps the model settle
&lt;/h2&gt;

&lt;p&gt;Arc 4 ended the same way the earlier arcs did: by writing and sharing.&lt;/p&gt;

&lt;p&gt;That matters especially for this arc because the account model is not something you fully absorb by reading one definition. It takes a few passes.&lt;/p&gt;

&lt;p&gt;You inspect an account. You compare it with another one. You decode bytes. You look at a program. You notice that the same five fields keep showing up. Then you try to explain it to someone else.&lt;/p&gt;

&lt;p&gt;That is when the model starts to stick.&lt;/p&gt;

&lt;p&gt;Writing about the account model forces useful questions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What does owner really mean?
How is a program also an account?
Where does state live?
Why is account data raw bytes?
What does rent-exempt storage mean?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those questions are exactly the point.&lt;/p&gt;

&lt;p&gt;The goal is not polished certainty. The goal is a clearer map.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 4 sets up
&lt;/h2&gt;

&lt;p&gt;Arc 4 closed Epoch 1 by giving us the data model underneath everything else.&lt;/p&gt;

&lt;p&gt;Strip it back to the core ideas:&lt;/p&gt;

&lt;p&gt;Accounts are where Solana state lives. Every account has the same basic fields. The &lt;code&gt;owner&lt;/code&gt; field controls who can change account data. Programs are executable accounts. Application state lives in separate data accounts. Raw account data is bytes, and decoding those bytes is a core developer skill.&lt;/p&gt;

&lt;p&gt;That brings the foundation epoch together.&lt;/p&gt;

&lt;p&gt;Arc 1 gave us identity: keys, wallets, addresses, and devnet SOL.&lt;/p&gt;

&lt;p&gt;Arc 2 gave us reads: RPC calls, balances, transaction history, and public blockchain data.&lt;/p&gt;

&lt;p&gt;Arc 3 gave us writes: signed transactions, confirmation, and failure modes.&lt;/p&gt;

&lt;p&gt;Arc 4 gave us state: accounts, ownership, executable programs, raw data, and decoding.&lt;/p&gt;

&lt;p&gt;From here, the next step is natural.&lt;/p&gt;

&lt;p&gt;Once you understand identity, reads, writes, and state, you are ready to build with the programs that own and modify those accounts.&lt;/p&gt;

&lt;p&gt;Use this post as the map, revisit the Arc 4 challenges when you want the hands-on version, and carry the account model into what comes next.&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>learning</category>
    </item>
    <item>
      <title>Arc 2 Catch-Up: Reading Solana Like a Public Database</title>
      <dc:creator>Matthew Revell</dc:creator>
      <pubDate>Mon, 08 Jun 2026 11:59:40 +0000</pubDate>
      <link>https://dev.to/100daysofsolana/arc-2-catch-up-reading-solana-like-a-public-database-cn2</link>
      <guid>https://dev.to/100daysofsolana/arc-2-catch-up-reading-solana-like-a-public-database-cn2</guid>
      <description>&lt;p&gt;Arc 2 of &lt;a href="https://mlh.link/solana-100" rel="noopener noreferrer"&gt;100 Days of Solana&lt;/a&gt; was about learning to read from the blockchain.&lt;/p&gt;

&lt;p&gt;In Arc 1, we created wallets, worked with addresses, got devnet SOL, and started building the basic identity layer we need to interact with Solana. Arc 2 shifted the focus from identity to information.&lt;/p&gt;

&lt;p&gt;What can you read from Solana? How do you ask for it? What comes back? And how is that different from fetching data from a normal Web2 API or querying a database?&lt;/p&gt;

&lt;p&gt;The whole arc hangs off one useful mental model:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Solana is a massive public database where every table is readable and every query is free.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is not a perfect technical description, but it is a useful starting point. If you are coming from Web2, Arc 2 is where Solana starts to feel less like an abstract blockchain and more like a data source you can inspect, query, and build interfaces around.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading from Solana feels familiar
&lt;/h2&gt;

&lt;p&gt;Reading from Solana is the easy part to map onto Web2.&lt;/p&gt;

&lt;p&gt;You ask for a wallet balance. You fetch recent transactions for an address. You inspect account data. The network answers.&lt;/p&gt;

&lt;p&gt;That shape feels familiar if you have ever called a REST API, queried a database, or built a dashboard around backend data.&lt;/p&gt;

&lt;p&gt;In Arc 2, the first read was deliberately small: use &lt;code&gt;@solana/kit&lt;/code&gt;, connect to devnet, and call &lt;code&gt;getBalance&lt;/code&gt; for a wallet address.&lt;/p&gt;

&lt;p&gt;That one call teaches more than it first appears to.&lt;/p&gt;

&lt;p&gt;There is no user session. No API key. No private dashboard. No auth header. The address is public, the balance is public, and the network can return it directly.&lt;/p&gt;

&lt;p&gt;That is the first shift:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On Solana, public data is public by default.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For Web2 developers, that can feel backwards. In most application databases, data starts private. You expose it through APIs, auth rules, dashboards, and permissions. On Solana, a lot of the base data is already out in the open. The job of your application is often not to unlock access, but to make public data understandable and useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  A wallet balance is just the first query
&lt;/h2&gt;

&lt;p&gt;Once you can fetch a balance, the next step is obvious: fetch activity.&lt;/p&gt;

&lt;p&gt;Arc 2 moved from &lt;code&gt;getBalance&lt;/code&gt; to recent transaction history. Using &lt;code&gt;getSignaturesForAddress&lt;/code&gt;, we queried the most recent transactions for an address and displayed the signature, slot, timestamp, and status.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;getBalance&lt;/code&gt; is like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /users/:id/balance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then recent transactions feel more like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /users/:id/transactions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pattern is familiar. The data is not.&lt;/p&gt;

&lt;p&gt;A transaction signature is not just a random ID. It is the identifier you can use to look up what happened. A slot is not quite a timestamp; it is Solana’s way of ordering batches of work over time. A block time gives you a familiar Unix timestamp when one is available.&lt;/p&gt;

&lt;p&gt;This is where Solana starts to feel like a database with its own vocabulary.&lt;/p&gt;

&lt;p&gt;You can query it. You can display the result. You can build UI around it. But the records you get back are blockchain records, not rows from your own application database.&lt;/p&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;You are not asking your backend, “What did this user do in my app?” You are asking the network, “What activity is visible for this address?”&lt;/p&gt;

&lt;h2&gt;
  
  
  A dashboard turns reads into something useful
&lt;/h2&gt;

&lt;p&gt;The first two reads happened in scripts. That is a good way to learn the API, but it is not how most users experience software.&lt;/p&gt;

&lt;p&gt;So Arc 2 moved the same read patterns into a small browser dashboard.&lt;/p&gt;

&lt;p&gt;The dashboard took an address, fetched its balance, pulled recent transactions, and displayed the results in a simple web interface. Same Solana calls. Different surface.&lt;/p&gt;

&lt;p&gt;That is a useful moment because it shows how normal this can feel.&lt;/p&gt;

&lt;p&gt;You are still doing familiar frontend work: input fields, loading states, error handling, formatted output. The Solana-specific part is the data source.&lt;/p&gt;

&lt;p&gt;A read-only dashboard is also a good early blockchain app because the risk is low. You are not signing anything. You are not moving funds. You are not changing state. You are just helping someone understand public data.&lt;/p&gt;

&lt;p&gt;That makes Arc 2 a good bridge for Web2 developers. You can use existing frontend instincts while slowly replacing “my backend API” with “the Solana RPC endpoint.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Accounts are not tables, but the database analogy helps
&lt;/h2&gt;

&lt;p&gt;The conceptual center of Arc 2 was the comparison between Solana accounts and Web2 databases.&lt;/p&gt;

&lt;p&gt;The database analogy helps because it gives you a place to start. Solana stores state. You can read that state. Programs interact with that state. Accounts have owners. Data has structure.&lt;/p&gt;

&lt;p&gt;But the analogy breaks quickly.&lt;/p&gt;

&lt;p&gt;In a normal database, you might expect tables, schemas, indexes, joins, private rows, server-side filtering, and application middleware enforcing access control.&lt;/p&gt;

&lt;p&gt;Solana does not work like that.&lt;/p&gt;

&lt;p&gt;On Solana, everything is an account: wallets, programs, token accounts, program-owned data. Accounts do not query each other. There are no joins. You usually assemble what you need off-chain by making RPC calls, reading account data, and interpreting the results in your app.&lt;/p&gt;

&lt;p&gt;That is a major shift.&lt;/p&gt;

&lt;p&gt;In Web2, the database often sits behind your application. Your server decides what to query, what to hide, what to join, and what to return.&lt;/p&gt;

&lt;p&gt;On Solana, the data is public, the runtime enforces ownership and write rules, and your application often becomes the layer that makes raw public state usable.&lt;/p&gt;

&lt;p&gt;That is why “Solana is a public database” is helpful, but incomplete. It is not Postgres with a blockchain logo. It is a shared state layer with different rules about visibility, ownership, storage, and writes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Storage has a price tag
&lt;/h2&gt;

&lt;p&gt;Arc 2 also introduced a detail Web2 developers do not usually think about directly: storage cost.&lt;/p&gt;

&lt;p&gt;In most Web2 apps, storage cost is real, but abstracted. You pay a cloud bill. Your database grows. Maybe you worry about indexes, backups, or object storage. But individual records do not usually arrive with an obvious upfront storage deposit.&lt;/p&gt;

&lt;p&gt;Solana makes storage more explicit.&lt;/p&gt;

&lt;p&gt;Accounts need enough lamports to be rent-exempt. That deposit depends on the amount of data the account stores, and it can be returned if the account is closed.&lt;/p&gt;

&lt;p&gt;That is a very different mental model from “just insert another row.”&lt;/p&gt;

&lt;p&gt;It means storage is not just a backend implementation detail. It is part of the application model. If your app needs on-chain state, someone has to pay for the account space that holds it.&lt;/p&gt;

&lt;p&gt;Arc 2 did not require us to build with that model yet, but it planted the idea early: on Solana, reading is free, but storing state is not invisible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Devnet and mainnet are separate worlds
&lt;/h2&gt;

&lt;p&gt;Arc 2 also made the network environment visible.&lt;/p&gt;

&lt;p&gt;In Web2, developers are used to staging and production. Same code, different database. Same API shape, different base URL. Different data, different risk.&lt;/p&gt;

&lt;p&gt;Solana has a similar idea with devnet and mainnet.&lt;/p&gt;

&lt;p&gt;The RPC calls can look identical. The address can be the same. But the network you query changes everything.&lt;/p&gt;

&lt;p&gt;A wallet might have devnet SOL and no mainnet SOL. It might have activity on one network and no history on the other. Devnet is not a sandboxed view of mainnet. It is a separate environment with separate data.&lt;/p&gt;

&lt;p&gt;That is a useful Web2 bridge:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Changing networks is like pointing the same app at a different database.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The code shape stays familiar. The data source changes. The consequences change too.&lt;/p&gt;

&lt;p&gt;Devnet is where you can experiment freely. Mainnet is where the real assets and real history live.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing turns learning into understanding
&lt;/h2&gt;

&lt;p&gt;Arc 2 ended by stepping away from the code and asking us to explain what we had learned.&lt;/p&gt;

&lt;p&gt;That was not filler. Writing is part of the learning loop.&lt;/p&gt;

&lt;p&gt;When you try to explain Solana accounts, RPC calls, devnet, public data, or transaction history to someone else, you quickly find the gaps in your own understanding. The rough edges become visible. The parts that felt “sort of clear” either sharpen or fall apart.&lt;/p&gt;

&lt;p&gt;That is valuable.&lt;/p&gt;

&lt;p&gt;A good technical learning journey is not just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;read docs → copy code → move on
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is closer to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try something → build something → explain it → share it → notice what still feels unclear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arc 2 followed that pattern. We read on-chain data, turned it into a browser dashboard, compared it against Web2 databases, wrote about what clicked, and shared the work publicly.&lt;/p&gt;

&lt;p&gt;That turns a week of exercises into something more durable.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Arc 2 sets up
&lt;/h2&gt;

&lt;p&gt;Strip Arc 2 back to its core and the main ideas are clear:&lt;/p&gt;

&lt;p&gt;Solana data is public by default. You read it through RPC calls. Wallet balances, transaction history, programs, and data all live in accounts. Devnet and mainnet are separate environments. Reading is free, but storing state has a cost.&lt;/p&gt;

&lt;p&gt;That gives us the bridge into Arc 3.&lt;/p&gt;

&lt;p&gt;Once you understand how to read from Solana, the next question is obvious:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do you change it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On Solana, the answer is transactions.&lt;/p&gt;

&lt;p&gt;Arc 3 picks up there: signed requests to change on-chain state, SOL transfers, transaction anatomy, confirmation, failure modes, and the write path developers use to interact with the network.&lt;/p&gt;

&lt;p&gt;Use this post as the map, revisit the Arc 2 challenges when you want the hands-on version, and jump into Arc 3 with the read model already in place.&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
