<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Lab Eleven - fuelling ambitious web3 projects on the Solana blockchain.]]></title><description><![CDATA[Lab Eleven invests engineering and delivery horsepower to fuel ambitious web3 projects on the Solana blockchain.]]></description><link>https://blog.labeleven.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1653000464110/pU46Y9NSR.png</url><title>Lab Eleven - fuelling ambitious web3 projects on the Solana blockchain.</title><link>https://blog.labeleven.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 13:12:06 GMT</lastBuildDate><atom:link href="https://blog.labeleven.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Solana Transactions with Better Call Sol]]></title><description><![CDATA[https://youtu.be/z4TzkuKLWAA
 
Transcript
Intro
Hey, this is Sohrab, head of engineering for Lab Eleven.
Today, I want to go through the basics of Solana transactions and I will be using Better Call Sol as a visual aid.
You can find me on Twitter by ...]]></description><link>https://blog.labeleven.dev/solana-transactions-with-better-call-sol</link><guid isPermaLink="true">https://blog.labeleven.dev/solana-transactions-with-better-call-sol</guid><category><![CDATA[Solana]]></category><category><![CDATA[educational ]]></category><category><![CDATA[transactions]]></category><dc:creator><![CDATA[Sohrab]]></dc:creator><pubDate>Tue, 07 Mar 2023 21:53:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1678318246297/9d9a0813-98ba-4982-8e50-b9db754829e6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/z4TzkuKLWAA">https://youtu.be/z4TzkuKLWAA</a></div>
<p> </p>
<h2 id="heading-transcript">Transcript</h2>
<h3 id="heading-intro">Intro</h3>
<p>Hey, this is Sohrab, head of engineering for Lab Eleven.</p>
<p>Today, I want to go through the basics of Solana transactions and I will be using <em>Better Call Sol</em> as a visual aid.</p>
<p>You can find me on <a target="_blank" href="https://twitter.com/sohrabwashere">Twitter</a> by clicking this little laptop icon at the bottom of <a target="_blank" href="http://bettercallsol.dev">bettercallsol.dev</a>.</p>
<p>This is going to be at the beginner level so treat it as a starting point, not a comprehensive guide. I will leave some references in the video description if you like to explore things further.</p>
<p>Let’s get started.</p>
<h3 id="heading-overview">Overview</h3>
<p>To perform any action on-chain, you need to submit a <strong>transaction</strong> to a Solana cluster.<br />A <strong>cluster</strong> is basically any group of Solana validators that share the same genesis block.</p>
<p>There are 3 major clusters in the Solana ecosystem:</p>
<ol>
<li><p>Mainnet or <strong>Mainnet-beta</strong>, to be more precise, is “the real” cluster, where money is real.</p>
</li>
<li><p>Then there is <strong>Testnet</strong>, primarily used by the validators to try out new versions and test things out</p>
</li>
<li><p>And finally, there is <strong>Devnet</strong>, which is for developers to test out their Solana programs and Dapps.</p>
</li>
</ol>
<p>As a beginner, Devnet is where we will be spending most of our time.</p>
<p>When a <strong>validator</strong> is elected as leader, it looks at the pending transactions and picks a subset to execute.</p>
<p>But we don't submit transactions directly to the validators. Instead, we submit them to <strong>RPC servers</strong>, and those servers forward them to the validators.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678224142307/581b32ba-25dd-4632-832d-54ec1c4d3394.png" alt class="image--center mx-auto" /></p>
<p>These URLs that use to communicate with Solana, are actually these RPC endpoints.</p>
<p><em>Better Call Sol</em> is already populated with the public RPC endpoints that Solana Labs maintains. These endpoints are good for basic testing but once you build a Dapp, you would want to sign up for a third-party RPC provider that gives you some reliability and performance guarantees. You can add those custom RPC endpoints in the settings.</p>
<p>By the way, RPC (or Remote Procedure Call) is a protocol for running commands on a remote server. In this case, the command is communicated over HTTPS in a JSON format. You can see examples of these if you got to the RPC JSON API specs in the Solana docs.</p>
<p>As you can see, transactions are encoded as a base58 or preferably as a base64 string and sent to the RPC endpoint.</p>
<p>A transaction, itself, is made up of one or more <strong>instructions</strong>. In <em>Better Call Sol</em>, each instruction is indicated with a purple box.</p>
<p>An instruction essentially tells a validator to invoke an on-chain program.</p>
<p>The instruction is made up of 3 parts:</p>
<ol>
<li><p>The address of the <strong>program</strong> that is being invoked</p>
</li>
<li><p>The other <strong>Solana accounts</strong> that are read or written to</p>
</li>
<li><p>And finally, the <strong>instruction data</strong> or the parameters to be provided to the program</p>
</li>
</ol>
<p>Both the program and the accounts are specified using their public key. Each account on Solana is associated with an <strong>Ed25519 keypair</strong>.</p>
<p>The <strong>public key</strong> of the keypair is used as the address and the <strong>private key</strong> is kept... well... private and is used for signing transactions.</p>
<p>When we supply accounts to an instruction, we need to indicate whether they will be used as read-only or if we are planning to write to them.</p>
<p>Declaring these upfront helps Solana to schedule the transactions. For example, if multiple transactions only read an account, then those transactions can be executed in parallel. But if an account is written by multiple transactions, then each transaction has to be processed sequentially, where it would lock the account, write to it and release the lock for the next transaction.</p>
<p>Accounts can also be signers. This is handy when we need to give permission to a transaction to update an account and we need to prove we have authority over that account. We prove this by signing the transaction with the private key for that account, which proves we own the keypair for that account.</p>
<p>When it comes to instruction data, under the hood, we are providing a byte array to the program. As long as both we, the client, and the on-chain program have agreed on what this byte array represents, we can use it to provide additional arguments to the instruction.</p>
<p>For example, if the program expects a UTF-8 encoded string to come through, then we just need to make sure that's what we are sending it.</p>
<p>Raw binary data is good but for more complex interactions, the programs tend to define a schema for how they expect the instruction data to be laid out.</p>
<p>Two of the most popular ways of defining these schemas or layouts include:</p>
<ul>
<li><p><strong>Buffer layout</strong>, which you will find in various SPL programs, and</p>
</li>
<li><p><strong>Borsh</strong>, which is prevalent in Anchor programs</p>
</li>
</ul>
<p>Btw SPL stands for <strong>Solana Program Library</strong> and is basically a set of programs, developed by Solana Labs, to streamline some standard operations like creating tokens, token swaps, etc. Think of SPL programs as the standard lib of Solana.</p>
<p>The agreed-upon layouts normally consist of one or more fields of predefined types. During the encoding of a transaction, the value of each field is encoded into bytes and laid out one after another to make up the instruction data.</p>
<h3 id="heading-setup">Setup</h3>
<p>Now Let's look at executing some transactions and see what happens.</p>
<p>To send a transaction, we need to pay a <strong>transaction fee</strong>. This fee is paid to the validator to reimburse them for executing the transaction.</p>
<p>We pay the fee in <strong>SOLs</strong>, the native currency of Solana, and we do so from our wallet. A wallet is just yet another Solana account that we have the keypair for.</p>
<p>We sign transactions with our wallet keypair to give the validator permission to deduct the transaction fee from our SOL balance in that account.</p>
<p>We can generate a wallet using the Solana CLI but in this case, since we're in the browser, we will be using a wallet browser extension.</p>
<p>Here you can see a few popular Solana wallets. I will be using the Phantom wallet for this example.</p>
<blockquote>
<p>By the way, please always make sure to use a throw-away wallet when you are dealing with a Dapp that you have never used or may not trust. It’s always better to be safe.</p>
</blockquote>
<p>Since we are going to be mostly working in Devnet, we need to also switch the wallet to Devnet.</p>
<p>And since it is going to be paying for transactions we need to fund the wallet with some SOLs.</p>
<p>Here is a little trick: copy the wallet public key into a random account field in <em>Better Call SOL</em>. As long as you are in Devnet or Testnet, the tool gives you the opportunity to <strong>airdrop</strong> some SOLs into that wallet.</p>
<p>It costs very little to send a transaction so 1 SOL should be plenty.</p>
<p>Please note that Solana has placed some restrictions on the number of SOLs you can airdrop so don't go overboard with it.</p>
<p>The airdrop itself is actually a Solana transaction as well. Which you can view in a Solana explorer.</p>
<p><strong>Solana explorers</strong> are platforms that parse on-chain transactions and give you a human-readable view of what happened on-chain. Here you can see that 1 SOL was transferred to our wallet.</p>
<p>Once the transaction is confirmed by the chain, you should see that your wallet balance has been updated with 1 SOL.</p>
<h3 id="heading-memo-transaction-simulate">Memo Transaction: Simulate</h3>
<p>We're finally ready to run a transaction. Let's start with the most basic transaction that you can run on the chain: a <strong>memo</strong></p>
<p>When you load an example into <em>Better Call Sol</em>, it will come with some annotations to help you understand the transaction better. But that's what I'm here for so let's collapse those for more screen real estate.</p>
<p>Memo program is an SPL program that essentially lets you attach a memo to a transaction, by logging whatever you provide to it as instruction data.</p>
<p>As you can see, the program address is populated for us. This instruction takes no accounts since it does not need to read or write to any Solana accounts. And the program expects the instruction data to be provided as a UTF-8 string.</p>
<p>Now we can send this transaction to the chain and see what happens. But at times, especially in mainnet, you want to first <strong>simulate</strong> the transaction.</p>
<p>Given the deterministic nature of Solana transactions, you can ask an RPC server to simulate what happens if we run the transaction. The simulation is usually pretty close to the real thing, down to the program logs that may be generated.</p>
<p>This does not cost any transaction fees so it is a risk-free way of ensuring the transaction will work before sending it through. It also helps reduce the traffic in the cluster as fewer buggy transactions will make it through.</p>
<p>Let's try simulating this transaction first.</p>
<p>So it looks like this transaction will likely be successful and here are the log entries that the program will produce if the transaction is run.</p>
<p>The memo program essentially just logs any instruction data that we send it so you can see that would happen here.</p>
<p>The simulation also identifies which <strong>slot</strong> was used for the simulation. A slot is the period of time that a given validator is the leader and going to produce a block. It only lasts a few seconds and then the next slot starts with a new leader.</p>
<p>You can also see how many CUs or <strong>Compute Units</strong> will be consumed by running this transaction. Each transaction is budgeted for 200,000 compute units. This can be increased by paying more transaction fees. But for our purposes, the default is enough.</p>
<p>One interesting point is that printing a single line of program logs has consumed about 3% of the compute budget. Logging is quite expensive on Solana so please keep that in mind when you start creating your own on-chain programs.</p>
<h3 id="heading-memo-transaction-send">Memo Transaction: Send</h3>
<p>I think we are ready to send this transaction for real. So let's do that.</p>
<p>Before the transaction is sent, your wallet extension prompts you to "approve" the transaction. This essentially signs the transaction with your wallet keypair, authorising the validator to deduct the transaction fees. You can see this described as "network fees" in this wallet.</p>
<p>Once you approve the transaction, it is sent to the chain. And then <em>Better Call Sol</em> starts to poll the chain to monitor whether the transaction is being confirmed or not.</p>
<p>A transaction goes through a few different states till it is finalised. First, it is <strong>submitted</strong> to the RPC provider, who in turn submits it to the cluster. Then a validator picks up the transaction and <strong>processes</strong> it. It broadcasts the block, that contains our transactions (amongst others) to all other validators so they can confirm it. Once a majority of the validators have <strong>confirmed</strong> the block, the transaction is considered confirmed. There is one final commitment where enough other blocks are built on top of our block, which makes it impossible for a fork to discard our transaction. In other words, the transaction is <strong>finalised</strong> at that point.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678171814208/8628f1c2-d0d4-465d-b877-f029b8b47731.png" alt class="image--center mx-auto" /></p>
<p>When we submit a transaction to the cluster, we generate a <strong>transaction signature</strong>. This signature is a unique identifier for the transaction, which we can use to look it up after the fact.</p>
<p>Transaction signatures are also Ed25519 signatures that encode the transaction payload including the instructions. That is kinda handy because if you, by accident, double-submit the same transaction, the cluster can easily dedup that for you.</p>
<p>Another way that we prevent double-spending is by providing a <strong>recent blockhash</strong> when we send the transaction. We query the chain for a recently finalised block and include its identifier or hash in the transaction header.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678171859617/15ab6e74-d8ee-4398-8c60-f5ca736c3935.png" alt class="image--center mx-auto" /></p>
<p>If for any reason, the transaction doesn’t get picked up by the validator till much later, the validator checks how old this blockhash is. If too many blocks have been produced since when we submitted the transaction, then the transaction is too old and the validator will simply discard it.</p>
<p>This means that we can confidently re-submit the same transaction after the blockhash expires, knowing that if the old transaction was stuck somewhere and gets picked up by a validator, it won’t be processed.</p>
<h3 id="heading-transfer-sols-transaction">Transfer SOLs Transaction</h3>
<p>This was a relatively simple transaction. Let’s try something slightly more complex.</p>
<p>This time, we send a transaction that again consists of a single instruction. It will transfer some SOLs from one account to another.</p>
<p>For this, we need to use the <strong>system program</strong>. The system program is a <strong>native program</strong> to Solana blockchain, whose address you can see in the program field.</p>
<p>A transfer instruction takes two accounts: 1) the sender of funds, and 2) the receiver of funds.</p>
<p>Btw these account labels are provided for readability in <em>Better Call Sol</em>. They are not sent as part of the transaction. Solana distinguishes between accounts, purely based on the order they have been defined.</p>
<p>Both accounts are marked as writable since the balance of both accounts will change as a result of this instruction. The amount to be transferred will be deducted from the first one and added to the balance of the second one.</p>
<p>The first account has to sign the transaction to indicate that it agrees for the funds to be removed from its balance.</p>
<p>On Solana, there is no consent when receiving funds and tokens so the second account does NOT have to sign this transaction.</p>
<p>We will use our connected wallet as the sender of funds. <em>Better Call Sol</em> already knows this so you can just ask it to auto-fill the public key of your wallet in the first account field.</p>
<p>Remember that you can airdrop more SOLs using the airdrop button if you need to. Here, I don’t need to.</p>
<p>The second account is an arbitrary account I have created for this example.</p>
<p>Moving down to the instruction data, we can see that a buffer layout structure is expected.</p>
<p>System Program has 13 or so different operations implemented within a single program. So we need to identify which of those operations we intend to invoke.</p>
<p>The third operation, or index 2 in the 0-indexed list, is the transfer operation that we are after. So this is set for the first field in the instruction data.</p>
<p>We also need to provide the amount of funds we like to transfer. The amount is described in <strong>lamports</strong> and stored in a 64-bit unsigned integer. A billion lamports are equal to 1 SOL. Here we have decided to transfer 100,000 lamports across.</p>
<p>Ok, we are now ready to send this transaction.</p>
<p>This time the wallet indicates that some fund transfer is about to take place, besides the usual network fees.</p>
<p>Once we sign the transaction by approving it in our wallet, it is sent to the cluster and we wait for the results.</p>
<p>System program is invoked a lot as part of transactions so they tend not to log much so as not to consume transaction budgets.</p>
<p>But you can switch to looking at the account balances to see what exactly happened.</p>
<p>Here both the transaction fee and 100,000 lamports were deducted from the first account and 100,000 lamports were added to the second account’s balance.</p>
<p>You should be able to see this by opening each account in the Solana explorer as well.</p>
<h3 id="heading-create-account-transaction">Create Account Transaction</h3>
<p>Now let’s step things up by doing another type of transaction. This time, we like to create a Solana account on-chain.</p>
<p>Create Account is yet another operation in the System program so we have filled in the system program public key. Also, it is the first operation so you will note the index 0 in the first instruction data field.</p>
<p>When an account is created on-chain, we pay <strong>rent</strong> for that account. The rent is the fee we pay validators for keeping the account and its content around.</p>
<p>At the start of each <strong>epoch</strong>, the rent due is deducted from account balances. This rent is calculated based on the size of the account.</p>
<p>The convention is to deposit 2 years' worth of rent in an account. Once we do that, the account becomes <strong>rent-exempt</strong>. In other words, the validators no longer will charge rent on that account.</p>
<p>So in this instruction, we need to indicate the account that will be paying the rent for our new account. In this case, we will use our wallet to pay for that so let’s auto-fill our wallet’s public key for the first account.</p>
<p>As mentioned previously, each account in Solana is associated with a keypair. So in order to create a new account, we need to create a new keypair and then use the private key of that keypair to sign for this transaction.</p>
<p>Again, we can simply use the auto-fill to achieve this. The new public key of our keypair becomes the address for the new account we will create.</p>
<p>As expected both accounts need to sign for this transaction and they will be both written to.</p>
<p>Coming down to the instruction data, we can see that this operation takes 3 fields, besides the instruction indicator.</p>
<p>They are in order:</p>
<ul>
<li><p>The amount of lamports we will deposit in the new account.</p>
<ul>
<li>Here I have chosen an amount that is larger than the rent-exempt amount required</li>
</ul>
</li>
<li><p>The amount of space, in bytes, that this account will have</p>
</li>
<li><p>And finally, which account will be set as the owner of this account</p>
</li>
</ul>
<p>Account <strong>ownership</strong> can be a confusing concept in Solana. The owner of an account is the only one that can modify that account, for example, change its balance or data content. Ownership is typically set to a program that will be responsible for actually updating the account.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678171836641/65d50876-f4e9-44d5-afb4-2ff48603227e.png" alt class="image--center mx-auto" /></p>
<p>In this case, setting the owner to the system program makes sense, since we will be using the system program operations such as transfer SOL to interact with this account anyway.</p>
<p>This is different from the <strong>authority</strong> on the account. Previously, we generated a keypair for this account, which is how we prove we have authority over the account by signing future transactions with it.</p>
<p>The authority gives us the ability to <em>request</em> changes to be made to the account. But System Program is the one actually making changes. And before it does so, it makes sure that we have authority over the account.</p>
<p>Anyway, let’s send this transaction to Devnet.</p>
<p>Once the transaction is confirmed, we can look at the account that we just created.</p>
<p>As expected, it has the balance we paid for from our wallet and it has 64 bytes in size. The owner is also set to the System program.</p>
<p>You also note that this is not an executable account. This is called a <strong>data account</strong> and it is used to normally hold data, in this case, 64 bytes worth of data.</p>
<p>Solana programs are stateless so these data accounts are how the state is persisted across transactions.</p>
<h3 id="heading-outro">Outro</h3>
<p>Ok, I think we leave things here. I have shown you some basic ways of composing Solana transactions using <em>Better Call Sol</em>. Now it is your turn to go to <a target="_blank" href="http://bettercallsol.dev">bettercallsol.dev</a> and try out some transactions of your own.</p>
<p>I hope you found this video useful. Please let me know on YouTube or Twitter if you want to see more content like this and I’ll see if I can be bothered.</p>
<p>Thank you for watching.</p>
<h2 id="heading-references">References</h2>
<ul>
<li><p><a target="_blank" href="https://docs.solana.com/terminology">Solana Docs: Terminology</a></p>
</li>
<li><p><a target="_blank" href="https://docs.solana.com/clusters">Solana Docs: Solana Clusters</a></p>
</li>
<li><p><a target="_blank" href="https://docs.solana.com/api/http">Solana Docs: JSON RPC API</a></p>
</li>
<li><p><a target="_blank" href="https://solanacookbook.com/core-concepts/transactions.html">Solana Cookbook: Core Concepts: Transactions</a></p>
</li>
<li><p><a target="_blank" href="https://solanacookbook.com/core-concepts/accounts.html">Solana Cookbook: Core Concepts: Accounts</a></p>
</li>
<li><p><a target="_blank" href="https://spl.solana.com/">Solana Program Library</a></p>
</li>
<li><p><a target="_blank" href="https://docs.solana.com/developing/runtime-facilities/programs">Solana Docs: Native Programs</a></p>
</li>
<li><p><a target="_blank" href="https://docs.solana.com/developing/intro/transaction_fees">Solana Docs: Transaction Fees</a></p>
</li>
<li><p><a target="_blank" href="https://docs.solana.com/developing/transaction_confirmation">Solana Docs: Transaction Confirmation</a></p>
</li>
<li><p><a target="_blank" href="https://docs.solana.com/cluster/commitments">Solana Docs: Commitment Status</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Microblog: Debug logging in Anchor and Solana]]></title><description><![CDATA[Logging can be expensive for programs deployed to Solana or logs may contain sensitive information that should not be available during the normal operation of a program. 
In these scenarios, we miss having different log levels, as we are used to with...]]></description><link>https://blog.labeleven.dev/microblog-debug-logging-in-anchor-and-solana</link><guid isPermaLink="true">https://blog.labeleven.dev/microblog-debug-logging-in-anchor-and-solana</guid><category><![CDATA[Solana]]></category><category><![CDATA[Rust]]></category><category><![CDATA[anchor]]></category><category><![CDATA[Web3]]></category><category><![CDATA[Cargo]]></category><dc:creator><![CDATA[Sohrab]]></dc:creator><pubDate>Mon, 27 Jun 2022 22:20:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/TiJPOuJ5n3A/upload/v1656369255426/AtCoHtkLg.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Logging can be expensive for programs deployed to Solana or logs may contain sensitive information that should not be available during the normal operation of a program. </p>
<p>In these scenarios, we miss having different log levels, as we are used to with other application frameworks.  In this micro-post, we will implement this feature for both Anchor and plain Solana applications.</p>
<p>We will try to keep things simple: introduce a macro that includes or omits logs based on a Cargo feature.</p>
<h2 id="heading-anchor">Anchor</h2>
<p>The <code>debug</code> macro, for Anchor programs, is implemented as below:</p>
<pre><code class="lang-rust"><span class="hljs-meta">#[macro_export]</span>
<span class="hljs-built_in">macro_rules!</span> debug {
    ($($rest:tt)*) =&gt; {
        <span class="hljs-meta">#[cfg(feature=<span class="hljs-meta-string">"verbose"</span>)]</span>
        anchor_lang::prelude::msg!($($rest)*)
    };
}
</code></pre>
<p>The macro checks for the <code>verbose</code> Cargo feature and includes the logging statement if it is enabled.</p>
<p>For this to work, you will need to declare a <code>verbose</code> feature in the program's <code>Cargo.toml</code>:</p>
<pre><code class="lang-toml"><span class="hljs-section">[features]</span>
...
<span class="hljs-attr">verbose</span> = []
...
</code></pre>
<p>Now you can use this feature in your code:</p>
<pre><code class="lang-rust">debug!(<span class="hljs-string">"some super detailed info"</span>);
debug!(<span class="hljs-string">"the secret is {}"</span>, secret);
</code></pre>
<p>We can build binaries with or without debug logging using the following Anchor commands:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># with debug logging</span>
anchor build -- --features verbose
<span class="hljs-comment"># without debug logging</span>
anchor build
</code></pre>
<p>Unfortunately, both <code>anchor build</code> and <code>anchor test</code> run Cargo builds with <code>--release</code> flag so we have to be explicit about enabling the feature.</p>
<h2 id="heading-solana">Solana</h2>
<p>The differences are minimal between Anchor and non-Anchor versions. </p>
<p>The <code>debug</code> macro is defined as below:</p>
<pre><code class="lang-rust"><span class="hljs-meta">#[macro_export]</span>
<span class="hljs-built_in">macro_rules!</span> debug {
    ($($rest:tt)*) =&gt; {
        <span class="hljs-meta">#[cfg(debug_assertions)]</span>
        solana_program::msg!($($rest)*)
    };
}
</code></pre>
<p>Here we use the standard <code>debug_assertions</code> conditional compilation instead. This removes the need for defining custom features and can be controlled by the standard Cargo profiles.</p>
<p>And <code>cargo</code> commands are used for the build:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># with debug logging</span>
cargo build
<span class="hljs-comment"># without debug logging</span>
cargo build --release
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Anatomy of Solana Program Invocations using Anchor]]></title><description><![CDATA[This article has been written with Anchor v0.24.x in mind. We will endeavour to keep this information updated as things evolve.

Anchor framework is quickly becoming the de facto approach to building Solana on-chain programs. Its abstractions offer s...]]></description><link>https://blog.labeleven.dev/anatomy-of-solana-program-invocations-using-anchor</link><guid isPermaLink="true">https://blog.labeleven.dev/anatomy-of-solana-program-invocations-using-anchor</guid><category><![CDATA[Solana]]></category><category><![CDATA[Rust]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Web3]]></category><dc:creator><![CDATA[Sohrab]]></dc:creator><pubDate>Mon, 27 Jun 2022 21:19:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709620758370/15671a8e-b314-4450-80c2-cd2618b09f4e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>This article has been written with Anchor <strong>v0.24.x</strong> in mind. We will endeavour to keep this information updated as things evolve.</p>
</blockquote>
<p><a target="_blank" href="https://github.com/coral-xyz/anchor">Anchor framework</a> is quickly becoming the de facto approach to building Solana on-chain programs. Its abstractions offer security and ergonomics that a typical Solana developer may miss while <em>chewing glass</em>.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://github.com/coral-xyz/anchor">https://github.com/coral-xyz/anchor</a></div>
<p>Programs are called either by clients off-chain or by other programs on-chain, i.e. <a target="_blank" href="https://docs.solana.com/developing/programming-model/calling-between-programs#cross-program-invocations">Cross-Program Invocations (CPIs)</a>. This unlocks composability, the key to building sophisticated solutions from small battle-tested building blocks. </p>
<p>Anchor simplifies how programs receive invocations or invoke others. One can simply read through <a target="_blank" href="https://book.anchor-lang.com/">the book</a> and learn how to <em>use</em> these features; however, it is less obvious how it all hangs together. </p>
<p>Abstractions are great for productivity but to reach an expert level in any framework, it is essential to understand what happens <em>under the hood</em>. This post will serve as the proverbial popping up the hood and having a poke around.</p>
<hr />
<h2 id="heading-invoking-a-program">Invoking a Program</h2>
<p>Each <em>instruction</em>, in a <em>transaction</em> submitted to Solana Runtime, is made up of a <code>program_id</code>, an <code>accounts</code> array and an <code>instruction_data</code> byte array. The Runtime invokes the given program, passing in the accounts and instruction data as input.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653027688478/DdDHbV1G8.png" alt="Anatomy of a Solana transaction" class="image--center mx-auto" /></p>
<p>This makes sense if we look at what a standard Solana program's entry point looks like:</p>
<pre><code class="lang-rust">entrypoint!(process_instruction);

<span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">process_instruction</span></span>(
    program_id: &amp;Pubkey,
    accounts: &amp;[AccountInfo],
    instruction_data: &amp;[<span class="hljs-built_in">u8</span>],
) -&gt; ProgramResult {
    <span class="hljs-comment">// TODO check program_id</span>
    <span class="hljs-comment">// TODO determine which method to call</span>
    <span class="hljs-comment">// TODO deserialise instruction_data</span>
    <span class="hljs-comment">// TODO deserialise accounts</span>
    <span class="hljs-comment">// TODO validate accounts</span>
    <span class="hljs-comment">// TODO map accounts into an ergonomic struct</span>
    <span class="hljs-comment">// TODO perform business function</span>
    <span class="hljs-comment">// TODO map errors if needed</span>
}
</code></pre>
<p>Things get more complicated once we have to implement the body of this function. I have suggested some actions that a typical program may take with the help of some TODOs. A lot to needs to be built and it has to be done for each and every program you write.</p>
<p>This is where Anchor comes in, picking up all that slack. Check out this Anchor program, which we will use as an example for the rest of this post:</p>
<pre><code class="lang-rust">declare_id!(<span class="hljs-string">"Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"</span>);

<span class="hljs-meta">#[program]</span>
<span class="hljs-keyword">pub</span> <span class="hljs-keyword">mod</span> hello_world {
    <span class="hljs-keyword">use</span> super::*;

    <span class="hljs-keyword">pub</span> <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">do_something</span></span>&lt;<span class="hljs-symbol">'info</span>&gt;(
        ctx: Context&lt;DoSomething&lt;<span class="hljs-symbol">'info</span>&gt;&gt;, 
        x: <span class="hljs-built_in">u8</span>
    ) -&gt; <span class="hljs-built_in">Result</span>&lt;()&gt; {
        ...
    }

    <span class="hljs-keyword">pub</span> <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">do_another_thing</span></span>&lt;<span class="hljs-symbol">'info</span>&gt;(
        ctx: Context&lt;DoAnotherThing&lt;<span class="hljs-symbol">'info</span>&gt;&gt;,
    ) -&gt; <span class="hljs-built_in">Result</span>&lt;()&gt; {
        ...
    }
}

<span class="hljs-meta">#[derive(Accounts)]</span>
<span class="hljs-keyword">pub</span> <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">DoSomething</span></span>&lt;<span class="hljs-symbol">'info</span>&gt; {
    account: Account&lt;<span class="hljs-symbol">'info</span>, TokenAccount&gt;,
    token_program: Program&lt;<span class="hljs-symbol">'info</span>, Token&gt;,
    rent: Sysvar&lt;<span class="hljs-symbol">'info</span>, Rent&gt;,
}

<span class="hljs-meta">#[derive(Accounts)]</span>
<span class="hljs-keyword">pub</span> <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">DoAnotherThing</span></span>&lt;<span class="hljs-symbol">'info</span>&gt; {
    ...
}
</code></pre>
<p>This program defines two different entry points to the program. There are corresponding structs for all the input accounts and <code>do_something()</code> even receives an argument <code>x</code>.</p>
<p>It may not look like it but this Anchor program is implementing all those TODOs I mentioned earlier.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653027758068/FVjYNgjAG.png" alt="Solana program vs Anchor program" class="image--center mx-auto" /></p>
<p>The Anchor program specifies the program's ID to help to ensure that the program binary is only run at the given address. This is checked as soon as the instruction arrives at the program. I would have preferred if the ID was specified in the config, rather than the code, but here we are.</p>
<p>Another interesting difference with the Solana program is how Anchor allows you to define multiple methods within the program. Anchor achieves this by encoding each method's signature into a unique SHA256 hash and storing it at the first 8 bytes of <code>instruction_data</code>. </p>
<p>So when a new instruction arrives at the entry point, the program compares the hash to each method signature and dispatches the instruction to the relevant method.</p>
<blockquote>
<p>ℹ️ Anchor also supports a fallback method, for cases where the incoming instruction does not match any of the defined methods. Simply create a new method <em>without</em> the <code>Context</code> argument and it will be designated as the fallback one.</p>
</blockquote>
<p>Once the instruction is routed to the correct method, the provided <code>accounts</code> and <code>instruction_data</code> arrays are deserialised and passed as the <code>Context</code> and the arguments accordingly. </p>
<p>Again, the first 8 bytes of each provided account are used to distinguish it from others and map correctly into the struct.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653027795788/VglQFjQMj.png" alt="Anchor serialisation" /></p>
<p>Helpfully, Anchor also performs further checks based on the provided account types and constraints to protect against incorrect and/or malicious input. Some of these include whether an account is a token account or is associated with an expected mint.</p>
<h2 id="heading-cross-program-invocation">Cross-Program Invocation</h2>
<p>Now that we understand how a program receives instructions, let's see what it takes to invoke from another program.</p>
<p>If we were to invoke the above Anchor program in plain Solana, we would do something similar to below:</p>
<pre><code class="lang-rust"><span class="hljs-comment">// prepare instruction data</span>
<span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">DoSomething</span></span> {
    x: <span class="hljs-built_in">u8</span>,
}
<span class="hljs-keyword">let</span> instruction_data: <span class="hljs-built_in">Vec</span>&lt;<span class="hljs-built_in">u8</span>&gt; = sighash_of_the_method();
instruction_data.append(BorshSerialize.try_to_vec(DoSomething { x: <span class="hljs-number">2</span> }));

<span class="hljs-keyword">let</span> accounts = <span class="hljs-built_in">vec!</span>[
    AccountMeta::new(*token_account, <span class="hljs-literal">false</span>),
    AccountMeta::new_readonly(*signer, <span class="hljs-literal">true</span>),
    AccountMeta::new_readonly(*rent, <span class="hljs-literal">false</span>),
];

<span class="hljs-comment">// prepare account infos</span>
<span class="hljs-keyword">let</span> account_infos = <span class="hljs-built_in">vec!</span>[
    token_account.info.clone(),
    signer.info.clone(),
    rent.info.clone(),
];

<span class="hljs-comment">// prepare the instruction</span>
<span class="hljs-keyword">let</span> instruction = solana_program::instruction::Instruction {
    program_id: *program_id,
    accounts,
    instruction_data,
};

<span class="hljs-comment">// invoke the program, providing the instruction</span>
solana_program::program::invoke_signed(
   &amp;instruction, 
   &amp;account_infos, 
   signer_seeds
)?
</code></pre>
<p>Predictably, we create an instruction, made up of the program ID, an array of accounts and an instruction data byte array. This instruction is then signed and submitted to the Runtime, along with the list of accounts.</p>
<p>You may note that we also need to pack the instructions data as a byte array, remembering to include the corresponding method hash at the beginning.</p>
<p>Over in Anchor land, things seem much simpler:</p>
<pre><code class="lang-rust"><span class="hljs-keyword">let</span> accounts = hello_world::cpi::accounts::DoSomething {
    account: ..., 
    token_program: ..., 
    rent: ...,
}

<span class="hljs-keyword">let</span> context = CpiContext::new(program_id, accounts);
hello_world::cpi::do_something(context, x);
</code></pre>
<p>This is because Anchor macros generate a lot of the boiler-plate for us.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653027831156/ptdv525ue.png" alt="Solana CPI vs Anchor CPI" /></p>
<p>Among those are:</p>
<ul>
<li><code>hello_world::cpi::accounts::DoSomething</code> that normalises our Account structs into <code>AccountInfo</code> types so they can be plugged into the CPI call</li>
<li><code>hello_world::cpi:do_something()</code>, which essentially performs the same steps as seen in our plain Solana CPI call</li>
<li><code>CpiContext</code> that knows how to convert our accounts to <code>AccountMeta</code> or <code>AccountInfo</code>, as required</li>
</ul>
<hr />
<p>That concludes this quick deep-dive into Solana and Anchor program invocation. It goes without saying that this is a small part of what Anchor can do for us. To achieve that next level of proficiency and self-sufficiency, it is worthwhile to dig into each of these features. </p>
<p>Watch this space for more posts about that!</p>
]]></content:encoded></item><item><title><![CDATA[Kick-Start Solana Programming with Anchor]]></title><description><![CDATA[Jumping into Solana programming can seem somewhat daunting. These tips and pointers should help you along with your exciting new chapter.
Local Development
The book already calls out the required software for building Anchor programs. 
I highly recom...]]></description><link>https://blog.labeleven.dev/kick-start-solana-programming-with-anchor</link><guid isPermaLink="true">https://blog.labeleven.dev/kick-start-solana-programming-with-anchor</guid><category><![CDATA[Solana]]></category><category><![CDATA[Rust]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Web3]]></category><dc:creator><![CDATA[Sohrab]]></dc:creator><pubDate>Wed, 22 Jun 2022 11:41:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709620874977/3f3aa893-40e3-4cf6-b21c-0301cc7c5826.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Jumping into <a target="_blank" href="https://solana.com">Solana</a> programming can seem somewhat daunting. These tips and pointers should help you along with your exciting new chapter.</p>
<h2 id="heading-local-development">Local Development</h2>
<p><a target="_blank" href="https://book.anchor-lang.com/getting_started/installation.html">The book</a> already calls out the required software for building Anchor programs. </p>
<p>I highly recommend Linux, macOS or Windows Subsystem for Linux v2 (WSL2) as the development environments.</p>
<p>For IDE, <a target="_blank" href="https://code.visualstudio.com/">Visual Studio Code</a> provides the optimal development experience at the best price (free!). Here are my suggestions for VS Code extensions to install:</p>
<ul>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer">rust-analyzer</a>: full support for Rust programming. I would avoid the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=rust-lang.rust">RLS extension</a> as it has been deprecated in favour of the rust-analyzer and has not received an update in a few years.</li>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb">CodeLLDB</a>: for debugging Rust programs. For those brave souls with a pure (non-WSL) Windows development environment, you may want to look at the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools">C/C++ extension</a> instead.</li>
</ul>
<p>TypeScript support comes out of the box. Some other nice-to-have extensions include <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=bungcip.better-toml">Better TOML</a>, <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode">Prettier</a> and <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl">Remote - WSL</a> (mandatory if working on WSL2).</p>
<blockquote>
<p>I should note if you are more comfortable with the JetBrains extended universe, <a target="_blank" href="https://plugins.jetbrains.com/plugin/8182-rust">Rust support</a> can be installed into your IDE as well. However, to enable Rust debugging, you will need CLion or other paid variants with Native Debugging Support. </p>
<p>If you are after an IntelliJ IDE that has both Rust and TypeScript support, you are limited to the paid IntelliJ IDEA Ultimate.</p>
</blockquote>
<h3 id="heading-vs-code-workspace-for-mono-repos">VS Code Workspace for Mono-Repos</h3>
<p>Anchor projects are made up of a Cargo workspace, as specified in the root <code>Cargo.toml</code> file, and one or more programs in their own Cargo crates, as specified in <code>programs/*/Cargo.toml</code>.</p>
<p>rust-analyzer currently only supports one Cargo workspace per VS Code workspace by default. You may face errors like the below if you open a mono-repo with multiple Anchor projects in it.</p>
<pre><code class="lang-text">[ERROR rust_analyzer] failed to find any projects in [AbsPathBuf("...")]
[ERROR rust_analyzer::lsp_utils] rust-analyzer failed to discover workspace
</code></pre>
<p>The recommended way to get around this is to turn off the project auto-discovery of the plugin and specify each Anchor project manually.  This can be done in <code>.vscode/settings.json</code> of your VS Code workspace:</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"rust-analyzer.linkedProjects"</span>: [
    <span class="hljs-string">"an_anchor_project/Cargo.toml"</span>, 
    <span class="hljs-string">"another_anchor_project/Cargo.toml"</span>
  ]
}
</code></pre>
<h2 id="heading-learning-rust">Learning Rust</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.rust-lang.org/">https://www.rust-lang.org/</a></div>
<p>Rust programming can be one of the bigger hurdles when moving into the Solana ecosystem, especially if you do not have a system programming background.</p>
<p>Everyone learns differently so I cannot possibly recommend <em>one</em> efficient way to get upskilled. But here are some tips:</p>
<ul>
<li>For those that learn by reading, the <a target="_blank" href="https://doc.rust-lang.org/book/">Rust book</a> is indispensable.</li>
<li>For those that learn by doing, <a target="_blank" href="https://doc.rust-lang.org/rust-by-example/">Rust by Example</a> can be the way to go.</li>
<li>For those that learn by watching, you are spoiled for choice: there are plenty of YouTube videos and courses on educational sites, such as Udemy.</li>
</ul>
<p>I personally find the first two options more effective. As someone who knows a few programming languages already, I can skip and skim through chapters and only learn what I do not already know.</p>
<p>Regardless of how you learn, you do not need to learn every aspect of Rust to be a Solana developer (though I highly recommend learning as much as you can - Rust is a great language!). Here are some topics to focus on:</p>
<ul>
<li>Basics of the language: variables, data types, functions, control flow, etc.</li>
<li>Basics of cargo: crates, modules, command line, etc.</li>
<li>Ownership, references and borrowing</li>
<li>Structs and implementations</li>
<li>Common collections, e.g. vectors</li>
<li>Enums and pattern matching</li>
<li>Error handling</li>
<li>Generic types, traits and lifetimes</li>
<li>Smart pointers, especially <code>Box&lt;&gt;</code> </li>
<li>Basics of Macros</li>
</ul>
<p>Here are some topics that are either not applicable or you will not need at the beginner or even intermediate level:</p>
<ul>
<li>I/O: filesystem or network</li>
<li>Fearless concurrency: threads, process, futures, sync/send, etc.</li>
<li>Developing macros</li>
<li>OS-specific libraries</li>
<li>Unsafe Rust</li>
</ul>
<h2 id="heading-learning-anchor">Learning Anchor</h2>
<blockquote>
<p>Anchor documentation is evolving rapidly and is actively being updated. Please keep that in mind when reading this section.</p>
</blockquote>
<p><em>Anchor framework</em> is a good on-ramp onto Solana development since it provides a few safety nets and ergonomics that you may miss otherwise.</p>
<p>A quick search will bring up a raft of tutorials written by the community. Most of them cover the basics well. The only thing to watch out for is the date when the tutorial was published. Some of the older ones may no longer be valid.</p>
<p>The <a target="_blank" href="https://book.anchor-lang.com/">Anchor book</a> itself is a good starting place that covers topics in a mix of theory and practice. It is missing some topics and could use a few runs of edit but otherwise, it is great.</p>
<p>I personally learn more from fully working examples so Anchor GitHub repo is the place to spend time in:</p>
<ul>
<li>The <a target="_blank" href="https://github.com/coral-xyz/anchor/tree/master/examples"><code>examples</code> folder</a> contains the accompanied code for the tutorials of the now deprecated <a target="_blank" href="https://coral-xyz.github.io/anchor/tutorials/tutorial-0.html">original documentation</a>.</li>
<li>More substantial examples can be found in the <a target="_blank" href="https://github.com/coral-xyz/anchor/tree/master/tests"><code>tests</code> folder</a>, covering a wide range of topics.</li>
</ul>
<blockquote>
<p>The tests are set up differently than normal Anchor projects. If you want to run them locally, consult the repo's GitHub Actions for hints.</p>
</blockquote>
<p>So far, we haven't spoken much about learning Solana itself. There is a lot to learn there, that will require its own post. But in the meanwhile, I would at the minimum recommend getting your head around the basics via either their <a target="_blank" href="https://docs.solana.com/">official docs</a> or the <a target="_blank" href="https://solanacookbook.com/">cookbook</a>.</p>
<h2 id="heading-community">Community</h2>
<p>As is the case with any other project in this space, the community is motivated for the projects to succeed so there is plenty of support available.</p>
<p><a target="_blank" href="https://t.co/b2pUWmcmxq">Anchor Discord</a> is quite active and both users and contributors are more than happy to help each other out. Following <a target="_blank" href="https://twitter.com/anchorlang">Anchor on Twitter</a> can also be worthwhile to keep on top of the latest updates.</p>
<p>Solana has recently achieved <a target="_blank" href="https://area51.stackexchange.com/proposals/126615/solana">sufficient commitment</a> for a StackOverflow site so hopefully soon, there will also be a specialised Q&amp;A site to make community support even smoother!</p>
]]></content:encoded></item><item><title><![CDATA[Why Solana?]]></title><description><![CDATA[We’ve written about why we’re getting behind the web3 movement, and our ambition to become the world’s best Solana delivery partner. Like any startup, success depends on focus, and our focus is Solana. But the question remains - why are we putting al...]]></description><link>https://blog.labeleven.dev/why-solana</link><guid isPermaLink="true">https://blog.labeleven.dev/why-solana</guid><category><![CDATA[Solana]]></category><category><![CDATA[Web3]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Yamen Sader]]></dc:creator><pubDate>Sun, 22 May 2022 06:55:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1653263035653/6U1B-XIey.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We’ve written about <a target="_blank" href="https://blog.labeleven.dev/road-to-the-lab">why we’re getting behind the web3 movement</a>, and our ambition to become <a target="_blank" href="https://blog.labeleven.dev/so-what-is-this-lab-eleven-thing-all-about">the world’s best Solana delivery partner</a>. Like any startup, success depends on focus, and our focus is Solana. But the question remains - why are we putting all our eggs in the Solana basket?</p>
<h2 id="heading-table-stakes">Table stakes</h2>
<p>Blockchain has the power to be a disruptive technology, but it cannot possibly reach its potential if it cannot deliver <em>experiences</em> that are virtually indistinguishable from what we are used to today. </p>
<p>We can’t have all the goodness of web3 unless it <em>feels</em> like web2.</p>
<p>Above all else, this means that any blockchain technology that seeks mass adoption must be <strong>fast</strong> and <strong>cheap</strong>. All other attributes are subservient <em>if</em> the goal is for meaningful, broad impact and adoption - and for us, it is.</p>
<p>Solana’s been a victim of its own success with recent congestion issues, but there’s no denying it is both fast and cheap. In fact, Solana is currently <strong>the most used blockchain in the world</strong> - it regularly does 25M to 50M transactions per day, at an average of &gt;1,000 transactions per second (<a target="_blank" href="https://pro.solana.fm/statistics">https://pro.solana.fm/statistics</a>). And it is currently <strong>the cheapest blockchain in the world</strong>, each of those 25M+ transactions costing only 0.025c each (<em>0.000005 SOL @ $50 USD per SOL as of 21 May 2022</em>).</p>
<p>But this is merely table stakes, and there are other chains that make different trade offs to Solana and have the potential to be both <em>fast enough</em> and <em>cheap enough.</em> This includes Avalanche, NEAR, Cosmos / Tendermint and the various Ethereum L2 scaling solutions.</p>
<p>So given that, why Solana above these other options?</p>
<h2 id="heading-designed-for-scale">Designed for scale</h2>
<p>In traditional databases, there are two characteristics to achieving scale in both reads and writes. </p>
<ol>
<li><strong>Vertical scalability</strong> (scaling up ⇑) characterises throughput on a <em>single machine</em>, and </li>
<li><strong>Horizontal scalability</strong> (scaling out ⇔) characterises throughput that can be achieved in a <em>cluster of machines</em>.</li>
</ol>
<p>Vertical scalability hit its upper limits sooner, as there are physical limits to what can be done on a single machine. Horizontal scalability provides more headroom, but must make some tradeoffs to allow machines to operate in a clustered environment.</p>
<p>More often than not, this means introducing a degree of <strong>sharding</strong> which breaks the database into smaller sections that can operate somewhat independently, especially on write loads. However, sharding is not a decision to be made lightly. Once sharded, the database is no longer a logical whole, and transactions cannot cross the sharding boundary.</p>
<p>Blockchains are logically very similar. There’s a natural limit to how much throughput they can handle before the single blockchain needs to split into logical shards, and then has to deal with the sharding tradeoff.</p>
<p>Sharding is the main strategy for managing speed and cost in all fast and cheap chains:</p>
<ul>
<li><strong>Ethereum</strong> shard chains are its path to scalability, expected to ship sometime in the next few years</li>
<li><strong>Ethereum L2s</strong> are a form of sharding with particularly high costs for crossing between the L2 and L1 boundary</li>
<li><strong>Avalanche</strong> has sharding with its <em>subnet</em> concept</li>
<li><strong>Cosmos / Tendermint</strong> uses sharding by promoting independent chains with interchain communication (IBC)</li>
<li><strong>NEARs</strong> path beyond 800-1000 TPS requires sharding with Nightshade</li>
</ul>
<p>It might seem that sharding is necessary to achieve high speed at low cost. Well, not for Solana.</p>
<p>Solana has been designed from the ground up to maximise the throughput of the chain <strong>without requiring any sharding</strong>. In fact, the design is such that Solana’s cluster throughput is expected to converge on the throughput of any single node. Furthermore, the throughput of any single node is expected to increase over time as hardware improves.</p>
<p>This goal of maximising the vertical scalability of the chain without requiring sharding infuses every part of Solana’s design. For example:</p>
<ul>
<li>The ‘proof of history’ cryptographic clock allows a degree of ‘synchronisation without communication’ across the cluster, enabling semi-autonomous and parallelised operation</li>
<li>Nodes communicate using a specialised streaming block propagation protocol that significantly reduces overhead of gossiping and downtime between switching leaders</li>
<li>A runtime engine and programming model that separates state from computation and allows for massively parallel processing <em>and</em> increased program safety</li>
</ul>
<p>Solana has achieved in excess of 70,000 transactions per second (TPS) in test clusters, with theoretical limits of 710,000 TPS. In the real world, we have already seen speeds of over 2,500 TPS regularly with peaks over 5,000 TPS.</p>
<p>It is our firm belief that these types of core design decisions are nearly impossible to retrofit if not considered upfront. Vertical scaling is <strong>very hard</strong>. </p>
<blockquote>
<p>Complex software is harder to ship then hardware. This is why it’s critical to design up front as much around Moores law as possible.  It’s nearly impossible to shoehorn multicore scalability after.</p>
<p><a target="_blank" href="https://twitter.com/aeyakovenko/status/1537132460114427905?s=20&amp;t=apS90ctrL5hrvRwFyGdq-g">Anatoly Yakovenko</a></p>
</blockquote>
<p>By contrast, horizontal scalability via sharding is <strong>always possible</strong>. Perhaps the growth of blockchain far exceeds even Solana’s capabilities in future, and some form of sharding may subsequently be needed. </p>
<p>By delaying this question, Solana maximises the creative surface area that web3 can address, and allows developers to treat everything as ‘one chain’. As the dust settles on a web3 future, Solana will be best positioned for its next phase of scaling design.</p>
<h2 id="heading-affordable-always">Affordable always</h2>
<p>A Solana transaction currently has a fixed cost of 0.000005 SOL, which translates to 0.025c at today’s prices. This makes it the cheapest blockchain by a long way.</p>
<p>A month ago that would have been the end of the story.</p>
<p>However, in recent months this strength of Solana’s has become its vulnerability. The low cost of transactions has created an economic incentive to <strong>spam</strong>. That is, in cases where the potential reward (eg an NFT mint) far exceeds the cost (thousands of spam transactions), spam becomes inevitable. Unfortunately, this spam has had a negative impact on Solana’s ability to process transactions. This is being alleviated in two ways:</p>
<ol>
<li>Through the introduction of networking improvements to allow congestion control at the networking level, and </li>
<li>The introduction of a <strong>local demand driven fee</strong> in ‘hotspots’</li>
</ol>
<blockquote>
<p>For deeper coverage of the underlying challenges and their solution, I <strong>highly</strong> recommend <a target="_blank" href="https://twitter.com/oraprotocol/status/1529499132720820225?s=20&amp;t=LYtKld638r6jLoRcV8085w">this tweet thread</a></p>
</blockquote>
<p>Demand driven fees are used in most blockchains. How is Solana different then? How can it keep the costs of these fees low?</p>
<p>In other blockchains, the fee is dictated by <strong>global demand</strong> on the chain. When demand is high for one thing (eg an NFT mint), the cost use the chain is high for everyone temporarily. If global demand becomes high all the time (eg the chain becomes popular in general), then the fees for everyone become high forever.</p>
<p>In Solana, the fee market being introduced is based on <strong>local demand</strong>. That is, when demand is high for one thing (eg an NFT mint), the cost to submit a transaction for <strong>that one thing</strong> will become temporarily high. The cost to use the chain for everything else will remain low and fixed. </p>
<p>Solana is able to do this because its underlying runtime requires state and computation to be separated, and allows computation that uses different state to be run in parallel. By creating fee markets based on areas of ‘state contention’, it avoids having a single global fee market dominated by the most demanding use case.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653202244137/ksKDy2Rim.png" alt="Solana vs Ethereum fee markets" /></p>
<p>This means that over time the cost to use other chains will be driven by the use cases with the highest economic reward, locking out significant potential usage.</p>
<p>Solana will be able to segregate demand by use case, enabling both high value and low value transactions to co-exist, without impacting each other adversely.</p>
<h2 id="heading-minimal-impact">Minimal impact</h2>
<p>An under-appreciated aspect of having a chain that is fast and cheap is that it is inherently <strong>efficient</strong>. Solana’s design and innovation means that it’s profitable to run a validator even when transactions pay only fractions of a cent. This implies that the total compute power needed to process transactions must necessarily be under some threshold to allow the network to exist.</p>
<p>This is confirmed by the excellent <a target="_blank" href="https://solana.com/news/solanas-energy-use-report-march-2022">Solana Energy Usage Report</a>: <strong>a single Solana transaction uses less energy than three Google searches.</strong></p>
<p>As energy usage is a <em>very common</em> criticism of blockchains, some comparisons to popular chains here is relevant. This amount of energy usage is:</p>
<ul>
<li>2,500,000 times less than a single Bitcoin transaction</li>
<li>250,000 times less than an Ethereum transaction with its current Proof of Work model</li>
<li>45 times less than the expected usage of an Ethereum transaction when it moves to a Proof of Stake model</li>
</ul>
<p>We believe that sustainability must be a central concern if a blockchain is to have the <em>right impact</em> on our world. Lab Eleven could not in good conscience support a technology that had a material negative impact on our world. We are very proud of both Solana’s footprint and its commitment to tracking and transparency.</p>
<h2 id="heading-developer-momentum">Developer momentum</h2>
<p>Separate to Solana’s operational characteristics, Solana’s <strong>developer momentum</strong> is unmatched. </p>
<p>From the <strong>excellent</strong> <a target="_blank" href="https://medium.com/electric-capital/electric-capital-developer-report-2021-f37874efea6d">Electrical Capital Developer Report</a>, some key items stand out.</p>
<p>Solana has had a <strong>4.9x year increase of developers from Dec 2020 to Dec 2021</strong> - the largest of any chain, and putting it behind only Cosmos and Ethereum in terms of absolute numbers of developers:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653202165217/9CxQI5dmZ.png" alt="Solana developer growth Dec 2020 to Dec 2021" /></p>
<p>There’s no denying Ethereum’s early entry in the market has resulted in the largest number of total developers. However, when normalised for days since first commit, Solana is growing faster in terms of number of developers than Ethereum:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653202205730/tiAUTldq4.png" alt="Solana developer growth by days since first commit" /></p>
<p>This assessment is consistent with what we’re seeing in terms of real world community participation. The latest Ignition hackathon had 550 projects submitted by over 7,000 participants - an increase of over 760% from Solana’s first hackathon only several years earlier!</p>
<p>What is most impressive, is that Solana has managed to achieve all of the above momentum without <em>any</em> Ethereum compatibility layer. </p>
<p>The vast majority of other chains look to bootstrap initial developers by providing a pathway for existing Ethereum developers to enter their ecosystem. Often this comes in the form of a compatibility layer with Ethereum, allowing existing apps to be more or less ‘copy and pasted’ into the new chain.</p>
<p>This speaks to the inherent pull of Solana’s design - that developers were willing to <a target="_blank" href="https://www.theblockcrypto.com/post/123515/solana-labs-ceo-part-of-our-culture-is-to-eat-glass">eat glass</a> and be early adopters because no other chain offers the types of characteristics and future that Solana does.</p>
<p>We believe that this momentum and pull will only continue:</p>
<ul>
<li>Solana’s development and test tooling is still reasonably primitive, and will only improve over time (and at Lab Eleven we are committed to contributing to this improvement).</li>
<li>Solana network performance will continue to improve, with flow on effects to overall user experience and therefore potential use cases.</li>
<li>Rust <a target="_blank" href="https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted">continues to be the most loved programming language in the world</a> (for 6 years running!), providing a steady stream of experienced systems programmers ready to dive into the world of web3.</li>
</ul>
<p>Betting on Solana is betting on the best and most committed developers in the world, which is a bet we make happily!</p>
<h2 id="heading-the-future-is-bright">The future is bright</h2>
<p>Solana’s future is very bright indeed. Beyond being fast and cheap, it is designed for the scale of web3’s ambitions, focused on remaining affordable for all, determined to minimise its environmental impact, and is making a lasting impression on developers.</p>
<p>We believe it is best positioned to usher in the new web3 era.</p>
<p>That’s why we are betting the farm on Solana. We are committed to being generous citizens of this amazing technology and community, and are looking forward to being part of bringing its potential to the masses.</p>
]]></content:encoded></item><item><title><![CDATA[So what is this Lab Eleven thing all about?]]></title><description><![CDATA[Agreed. It’s a bit of a weird name and it’s hard to pronounce to be honest. Lab Eleven. It twists the tongue rather than rolls off it. Still, it’s different, and hopefully so are we!
My co-founder Yamen Sader described his journey on the Road to the ...]]></description><link>https://blog.labeleven.dev/so-what-is-this-lab-eleven-thing-all-about</link><guid isPermaLink="true">https://blog.labeleven.dev/so-what-is-this-lab-eleven-thing-all-about</guid><category><![CDATA[Web3]]></category><category><![CDATA[crypto]]></category><category><![CDATA[Solana]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Ben Wylie]]></dc:creator><pubDate>Fri, 20 May 2022 00:08:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1653027871134/zsZb3QSAO.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Agreed. It’s a bit of a weird name and it’s hard to pronounce to be honest. <em>Lab Eleven</em>. It twists the tongue rather than rolls off it. Still, it’s different, and hopefully so are we!</p>
<p>My co-founder Yamen Sader described his journey on the <a target="_blank" href="https://blog.labeleven.dev/road-to-the-lab">Road to the Lab</a>. Dipping his toe in the blockchain world led to a journey of learning, exploration and an intense desire to build. </p>
<p>As his colleague and friend for over 20 years, I watched curiously over his shoulder as I wrangled an engineering practice as a Partner in a Big Four consultancy (which I loved). Yamen’s curiosity was contagious. I felt compelled to take a deep breath and actually try and learn what this blockchain thing is all about. #olddognewtrick</p>
<p>Despite being a fairly technical chap, it had been somewhat convenient for me to dismiss blockchain. I had similar pre-conceptions and pre-fabricated responses. The alternative was to actually learn blockchain and that seemed too much like hard work. Sporadic bursts of investigation had taught me this technology was pretty weird and fundamentally very different from the tech I had leveraged throughout my career.</p>
<p>Eventually, after further polite nudging, I rolled up my sleeves and worked to get my head around the Solana ecosystem. Solana has operational qualities (throughput / latency / cost) that align well with the event-driven architectures I’m familiar with from the enterprise world. It felt like a technology that could solve real-world problems. Today, after a number of (confusing yet fun) months, I’m a converted man. I’ve drunk the crypto Kool-Aid and am very much on board with the spirit of the web3 movement and what modern blockchain technologies can offer. </p>
<p>So like Yamen, I left what was a challenging-yet-enormously-rewarding gig as a consulting Partner and I now find myself building a web3 startup. There’s an enormous amount of energy and momentum in the crypto domain so we are being careful to be respectful and play to our pedigree as founders who have:</p>
<ul>
<li>Started and grown significant and highly-respected software engineering teams</li>
<li>Implemented (literally hundreds) of mission-critical, enterprise-grade distributed systems</li>
<li>Amassed enormous delivery experience of sophisticated solutions with ambitious clients</li>
</ul>
<p>Cut out the fluff and we land with our mission statement:</p>
<blockquote>
<p>Lab Eleven provides engineering and delivery horsepower to fuel ambitious web3 projects on the Solana blockchain.</p>
</blockquote>
<h2 id="heading-howdy-partner">Howdy Partner!</h2>
<p>When shaping the Lab Eleven vision it was easier for us to agree on what Lab Eleven <strong>is not</strong> rather than what it is. After 20 years or more in the consulting game, I am hungry to play a role on the product side of the fence. This means pushing beyond the initial project to build sustainable products with ambitious founders with more skin in the game.</p>
<p>We’ve chosen a ‘lab’ dynamic explicitly to build and nurture a team of Solana specialists who will be recognised as masters in their craft. Through focus and engineering precision, we will develop and contribute to the Solana ecosystem whilst partnering with like-minded web3 entrepreneurs who have cool shit to build. </p>
<p>Lab Eleven will operate primarily through an ‘engineering for equity’ partnership model. We will invest our engineering time and delivery expertise (our capital) to ensure innovative web3 ideas we believe in make it to market. We will take ownership of the heavy lifting (blockchain / treasury / infrastructure / security / cloud / automation / quality) to let web3 founders focus on the killer use cases and delightful experiences that captivate users (which isn’t really our thing).</p>
<p>Our confidence in getting web3 solutions to market shapes our partnering preference to share both risk and reward. Rather than a ‘bums on seats’ mentality, Lab Eleven will truly partner with ambitious web3 projects and be rewarded in the same manner as founders and strategic investors. Partners with aligned incentives and shared ambitions quickly find great working dynamics which in turn surface the right engineering behaviours.</p>
<p>We are aiming to be the ‘go to’ partner for Solana development and delivery expertise. With our goal to keep the lab small, we recognise there will be times when we can’t support every clever web3 idea, hence we will prioritise projects which are:</p>
<ul>
<li>Solving an interesting problem (that’s not obviously solved)</li>
<li>Have unique differentiation in the market</li>
<li>Are aligned with an open-source mindset and the spirit of web3</li>
<li>Have a valid and thoughtful business model (inc tokenomics)</li>
<li>Have passionate, genuine and ideally altruistic founders</li>
<li>Are using interesting technology (ie Solana) in an interesting way</li>
</ul>
<p>There are plenty of fascinating ideas around and we’re excited about playing a part in them!</p>
<h2 id="heading-whats-in-it-for-us">What’s in it for us?</h2>
<p>Our engineers fundamentally just want to build cool things. Bringing an idea to life is what motivates our founders and developers. We recognise however that whilst we are very good at building engineering teams, those killer product ideas won’t all come from Lab Eleven. Hence we’re playing to our strengths. Bring us your web3 project and we will make it happen!</p>
<p>We aim to partner and co-invest in a handful of web3 projects each year and, as a result, grow a stake in web3 businesses we are proud to have helped build. Obviously, we hope that with Lab Eleven’s engineering all these projects will do well. More obviously we hope some will do <em>very</em> well. Regardless we’ll be along for the ride and we’ll share the risks and rewards with the entrepreneurs and investors who trust us with their idea.</p>
<h2 id="heading-first-steps">First steps?</h2>
<p>Really the first step is to evangelise and grow our engineering team. We’re focusing exclusively on the Solana blockchain. Masters of one trade. We will be training, enabling and certifying talented software engineers to grow the region’s (heck - the globe’s) most highly credentialed <strong>Solana Dev Shop</strong>. More than a community, more than a DAO (although we do like DAOs), we are a company offering permanent employees an opportunity to join a peloton of exceptional Solana engineers to build a career in web3.</p>
<p>So Solana engineering is the <em>what</em>, but our delivery pedigree underpins the <em>how</em>. We’ll be working more with web3 founders and investors to offer a <strong>Solana Delivery Partner</strong> that co-invests to bring innovative web3 ideas to market. With the crypto world being a little turbulent, anonymous and unpredictable at times we hope we’ll be seen as a safe, proven and invested pair of hands.</p>
<p>That’s what Lab Eleven is all about! Makes sense? Wish us luck!</p>
]]></content:encoded></item><item><title><![CDATA[Road to the Lab]]></title><description><![CDATA[When I left my rewarding career as a Deloitte partner, I did not expect to be announcing a startup in the blockchain space 15 months later.
After 10 years of co-building one of Australia’s most successful software engineering businesses, I wanted a (...]]></description><link>https://blog.labeleven.dev/road-to-the-lab</link><guid isPermaLink="true">https://blog.labeleven.dev/road-to-the-lab</guid><category><![CDATA[Solana]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Web3]]></category><dc:creator><![CDATA[Yamen Sader]]></dc:creator><pubDate>Thu, 19 May 2022 22:28:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709677073485/259a0f3e-6b12-4906-baf4-10ffe23bb406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When I <a target="_blank" href="https://www.linkedin.com/posts/yamen_today-marked-my-last-day-at-deloitte-10-activity-6770977032005402624-lWfZ">left my rewarding career</a> as a Deloitte partner, I did not expect to be announcing a startup in the blockchain space 15 months later.</p>
<p>After 10 years of co-building one of Australia’s most successful software engineering businesses, I wanted a (questionably) well-earned break. My wife had been presented with an excellent work opportunity, and I offered to take the reins at home with our three kids.</p>
<p>After a few months of adjusting to one of the toughest jobs in the world - raising children - I was ready to seek sanctuary and solitude in my first love: technology. Untethered from any actual users or problems to solve, curiosity was my guide.</p>
<p>Like many people in technology, blockchain had been on my periphery for the last decade. And like almost everyone both in and out of technology, I had been fairly quick to form an opinion and dismiss it.</p>
<p><em>A solution looking for a problem</em>. <em>Just a database.A haven for Ponzi schemes and scams</em>. <em>A phenomenal waste of energy. Far too slow and expensive for anything useful.</em></p>
<p>Despite this, the allure remained - the unique melding of computer science and maths intrigued my inner nerd. And it had been many years since I last looked at the space.</p>
<p>Perhaps things had changed?</p>
<p>What I found took me <em>totally by surprise</em> and ignited the passion that eventually lead to the announcement today.</p>
<h2 id="heading-not-your-fathers-blockchain">Not your father’s blockchain</h2>
<p>I read some blogs, fired up a new wallet, added some funds, and dove into some apps. I signed my first transaction and waited. To my delight, it was confirmed a few seconds later and cost me fractions of a cent. This reasonably pleasant user experience was <em>not</em> the one I was expecting.</p>
<p>What was going on?</p>
<p>When I read popular critical commentary on the blockchain these days, it is dominated by soft and easy targets:</p>
<ul>
<li><p>Too slow</p>
</li>
<li><p>Too expensive</p>
</li>
<li><p>Too limited</p>
</li>
<li><p>Too wasteful</p>
</li>
</ul>
<p>What I learned is that above all else, <strong>the blockchain you’re looking at matters</strong>. We are in at least the third generation of blockchains, and <strong>everything has changed</strong>.</p>
<ul>
<li><p><strong>Generation 1</strong> is Bitcoin and its direct derivatives. They introduced the technology to the world, but are absolutely guilty of the above characterisations. I am thankful to Bitcoin for the innovation it unlocked but have little informed opinion on its long term usefulness to society.</p>
</li>
<li><p><strong>Generation 2</strong> is Ethereum, which introduced programmability and a path to less resource usage but did not solve for speed or cost.</p>
</li>
<li><p><strong>Generation 3</strong> is Solana, Avalanche, NEAR and various Ethereum ‘Level 2’ scaling solutions that directly tackle speed and cost: the primary impediments to widespread usefulness and adoption.</p>
</li>
</ul>
<p>With these last gaps closed or closing, the obvious criticisms of blockchain begin to fade. But one much more subtle and elusive one remains: <strong>why blockchain at all?</strong></p>
<p>For me, there are four core reasons:</p>
<ol>
<li><p>Extend the lever (of software)</p>
</li>
<li><p>Start with open (not closed)</p>
</li>
<li><p>Value to users (not platforms)</p>
</li>
<li><p>Embrace the bazaar (not the cathedral)</p>
</li>
</ol>
<h2 id="heading-extend-the-lever">Extend the lever</h2>
<blockquote>
<p>Give me a lever long enough ... and I shall move the world</p>
<p>-- <cite>Archimedes</cite></p>
</blockquote>
<p>In 2011, Marc Andreessen argued in <a target="_blank" href="https://a16z.com/2011/08/20/why-software-is-eating-the-world/">Why Software is Eating the World</a> that “<em>all of the technology required to transform industries through software finally works and can be widely delivered at global scale</em>”, and as such software is poised to disrupt all industries.</p>
<p>This article’s prescience is undeniable - since then, the NASDAQ has outperformed the S&amp;P 500 in all years bar one, and the 8 out of the 10 most valuable public companies in the world are focused on technology.</p>
<p>What’s not said but is implied by Andreessen’s argument is that the disruption will continue <em>as more of the world becomes software-enabled.</em> This is a dynamic phenomenon that grows with software’s reach.</p>
<p>The greatest example of this is the cloud. Enterprise-grade hardware, hosting, networks and platforms became available at the click of a mouse for a low pay-as-you-go cost. The hurdle to starting a business, in time, cost and risk, was reduced by several orders of magnitude.</p>
<p>And as a result, a whole generation of new businesses became <em>possible</em>.</p>
<p>Blockchain represents the single biggest increase in the ‘surface area of programmability’ since the cloud. For the first time, money, ownership and contracts could be programmed at a global scale, without being gatekept by intermediaries.</p>
<p>And once again, as a result, a whole generation of new businesses becomes <em>possible</em>.</p>
<p>But why would these businesses be different?</p>
<h2 id="heading-start-with-open">Start with open</h2>
<p>I spent a good portion of the last few years of my career working on Open Banking initiatives. The premise here is straightforward: consumers should have control over their financial data and the ability to share that with companies they trust.</p>
<p>After many years and many hundreds of millions of dollars spent globally, the initiative has only had modest success. The standard requires regulation to push through, is not globally adopted, is severely limited in functionality, and often pushes against the moats and business strategies of the banks themselves. Stripe and others like Plaid <a target="_blank" href="https://stripe.com/newsroom/news/financial-connections#:~:text=Brand%20assets-,Stripe%20introduces%20Financial%20Connections%20to%20help,to%20their%20customers'%20bank%20accounts&amp;text=Stripe%20Financial%20Connections%20offers%20businesses,reduce%20payout%20failures%20by%2075%25.">have built whole businesses</a> on solving this problem.</p>
<p>And this is just to get access to your <strong>own data</strong>!</p>
<p>The unfortunate reality is that most businesses benefit from starting closed, and getting more closed over time. This often benefits the business but comes at a cost to competitors (barriers to entry) and consumers (increased lock-in and reduced choice).</p>
<p>And trying to open up a business that is already closed is a difficult and often futile proposition.</p>
<p>But a blockchain native business is designed from the ground up to ‘live in the open’. Users always own their data, and a user is always free to move between offerings.</p>
<p>Removing the artificial barriers to competition or portability is a huge boon - it creates incentives to retain users based on the value given to them, rather than by removing their choice to leave.</p>
<p>But this is not the only way in which blockchain native businesses can drive value back to users.</p>
<h2 id="heading-value-to-users">Value to users</h2>
<p>The largest technology businesses in the world rely heavily on the contribution of users:</p>
<ul>
<li><p>Google search indexes the content created by people all over the world</p>
</li>
<li><p>Facebook and Instagram surface content created by the users of the network</p>
</li>
<li><p>Spotify provides access to music from millions of (often independent) artists</p>
</li>
</ul>
<p>Yet the users of these platforms capture almost <em>none</em> of the value created on them.</p>
<blockquote>
<p>You know something is profoundly wrong with our economy when Big Tech has a higher take rate than the mafia.</p>
<p>-- <cite>Ritchie Torres, U.S. Congressman representing the South Bronx</cite></p>
</blockquote>
<p>And in many cases, the resulting power of these platforms (described brilliantly by Ben Thompson as <a target="_blank" href="https://stratechery.com/2015/aggregation-theory/">Aggregators</a>) also extracts the majority of the value from <em>businesses</em> hosted on them as well: <a target="_blank" href="https://www.inc.com/magazine/201805/tom-foster/direct-consumer-brands-middleman-warby-parker.html">CAC becomes the new rent</a> and the value over time accrues to the ‘ad space landowner’.</p>
<p>By enabling simple, cheap and ubiquitous access to primitives such as tokens and ownership, native web3 businesses can create business models where ownership is shared by all participants in the platform, not just its owners.</p>
<p>And these business models are incentivised to maximise the flow of value to users - because the platforms are open and barriers to competition and user portability are so low.</p>
<p>But even if a blockchain native business does represent a far greater value proposition to the consumer - through increased ownership and value - how can they possibly get off the ground given the current power and reach of incumbents?</p>
<h2 id="heading-embrace-the-bazaar">Embrace the bazaar</h2>
<p>In Eric Raymond’s <a target="_blank" href="http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/">The Cathedral and the Bazaar</a>, one quote always stood out for me:</p>
<blockquote>
<p><em>Who would have thought ... that a world-class operating system could coalesce as if by magic out of part-time hacking by several thousand developers scattered all over the planet, connected only by the tenuous strands of the Internet?</em></p>
</blockquote>
<p>One of the most easily dismissed yet most powerful aspects of blockchain technology is that <strong>you can just get started</strong>. There are no barriers beyond committing the time - no gatekeepers, no upfront costs.</p>
<p>And you’re never starting with a blank slate - not only is there an open and inviting community connected by the (far less tenuous these days) strands of the internet, but you also have access to all the existing contracts and data on the chain. It is there, ready to be extended and built upon.</p>
<p>Coupled with the extended lever of blockchain, the ability to empower users with economic incentives, and a community that works in the open world of the bazaar: <strong>small teams can do more with much, much less on the blockchain.</strong></p>
<h2 id="heading-time-to-build">Time to build</h2>
<p>But that is just a lot of words.</p>
<p>When I first started in blockchain, I must admit that I was not building toward the future that I’ve described. I participated in decentralised finance, generating income for myself and providing liquidity through the markets through nothing more than code. I marvelled at the power of a single engineer in blockchain, and at the magic of the technology that I was using. But given what I believed about the blockchain, I did feel very keenly that I <em>was not doing enough</em>.</p>
<p>And that leads us to here. We started Lab Eleven because we believe in the power of the technology, and what it can do to democratise value to users around the world.</p>
<p>So once again, we are bringing together a world-class engineering team, and putting our own efforts behind this movement. If this story has piqued your interest and you want to know more, my co-founder Ben wrote reveals <a target="_blank" href="https://blog.labeleven.dev/so-what-is-this-lab-eleven-thing-all-about">what this whole Lab Eleven thing is all about</a>.</p>
<p>We are thrilled to now be part of accelerating towards a web3 future. Join us!</p>
]]></content:encoded></item></channel></rss>