<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ ICO - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ ICO - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 31 May 2026 09:39:34 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/ico/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to create and deploy a full-fledged Initial Coin Offering in one hour ]]>
                </title>
                <description>
                    <![CDATA[ By Gilad Haimov This article will show you how you can create and deploy a full-fledged ERC20 token in less than an hour. In the last couple of years the ERC20 token specification has practically become the standard for Ethereum tokens. In fact most ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/the-1-hour-ico-296568870cd2/</link>
                <guid isPermaLink="false">66c3608656e6b06442afd88c</guid>
                
                    <category>
                        <![CDATA[ Blockchain ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ethereum ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ICO ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Solidity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 26 Aug 2018 10:42:12 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*nCwrO-nVS4dJevh67knnRw.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Gilad Haimov</p>
<p>This article will show you how you can create and deploy a full-fledged ERC20 token in less than an hour.</p>
<p>In the last couple of years the ERC20 token specification has practically become the standard for Ethereum tokens. In fact most Ethereum tokens are ERC20-compliant.</p>
<p>There are several factors that make ERC20 so successful:</p>
<ol>
<li>It is simple. Really simple. As we will soon find out.</li>
<li>It solves a real problem: blockchain marketplaces and crypto-wallets need a single set of commands to communicate with all of the tokens they manage, including interaction rules between tokens and token purchase rules</li>
<li>It was the first (well almost the first) specification to offer Ethereum token standardization.</li>
</ol>
<p>As any other Ethereum token, ERC-20 tokens are implemented as smart contracts and are executed on the Ethereum Virtual Machine (EVM) in a decentralized manner.</p>
<p>Ethereum smart contracts are written in a language called Solidity (there are other options, but hardly anyone uses them). Solidity is somewhat similar to JavaScript. In fact, if you have some knowledge of JavaScript, Java or other C-like languages you will probably figure out what a Solidity piece of code does even before learning the language.</p>
<p>And now comes the fun part: creating a basic ERC20 contract. This is in fact a rather simple task. Simple enough that we will be able to write and deploy your first ERC20 token in no more than an hour.</p>
<p>Granted, the token we will be creating will be a bare bones implementation, but I have seen many bare bones tokens that do real well.</p>
<h3 id="heading-the-standard">The Standard</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*Pn9Fl-H1fuYdnXLsp5WJ6A.png" alt="Image" width="330" height="174" loading="lazy"></p>
<h4 id="heading-what-is-this-erc20-anyway"><strong>What is this ERC20 anyway?</strong></h4>
<p>The ERC20 standard defines a short and basic set of functions to be implemented by all ERC20 compatible tokens so as to allow integration with other contracts, wallets, or marketplaces:</p>
<pre><code> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">totalSupply</span>(<span class="hljs-params"></span>) <span class="hljs-title">public</span> <span class="hljs-title">view</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint256</span>); <span class="hljs-title">function</span> <span class="hljs-title">balanceOf</span>(<span class="hljs-params">address tokenOwner</span>) <span class="hljs-title">public</span> <span class="hljs-title">view</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint</span>); <span class="hljs-title">function</span> <span class="hljs-title">allowance</span>(<span class="hljs-params">address tokenOwner, address spender</span>) <span class="hljs-title">public</span> <span class="hljs-title">view</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint</span>);</span>
</code></pre><pre><code> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">transfer</span>(<span class="hljs-params">address to, uint tokens</span>) <span class="hljs-title">public</span> <span class="hljs-title">returns</span> (<span class="hljs-params">bool</span>); <span class="hljs-title">function</span> <span class="hljs-title">approve</span>(<span class="hljs-params">address spender, uint tokens</span>)  <span class="hljs-title">public</span> <span class="hljs-title">returns</span> (<span class="hljs-params">bool</span>); <span class="hljs-title">function</span> <span class="hljs-title">transferFrom</span>(<span class="hljs-params">address from, address to, uint tokens</span>) <span class="hljs-title">public</span>   <span class="hljs-title">returns</span> (<span class="hljs-params">bool</span>);</span>
</code></pre><p>These functions will allow an external user, say a wallet, to find out a user’s balance and to perform safe and authorized fund transfers from one user to another.</p>
<p>Additionally, the contract defines two events:</p>
<pre><code>event Approval(address indexed tokenOwner, address indexed spender,   uint tokens);event Transfer(address indexed <span class="hljs-keyword">from</span>, address indexed to,   uint tokens);
</code></pre><p>These events will be invoked or <em>emitted</em> when another user has been granted the right to withdraw tokens from an account, and when tokens have actually been transferred.</p>
<p>Many tokens also add the following fields which have became de-facto part of the standard:</p>
<pre><code> string public constant name; string public constant symbol; uint8 public constant decimals;
</code></pre><p>Regarding the nomenclature:</p>
<ul>
<li>A <code>public</code> function can be accessed outside of the contract itself</li>
<li><code>view</code> basically means constant, i.e. the contract’s internal state will not be changed by the function</li>
<li>An <code>event</code> is Solidity’s way of allowing clients e.g. your application frontend to be notified on specific occurrences within the contract</li>
</ul>
<p>The rest of the language constructs should be clear if you’ve ever learned Java/JavaScript.</p>
<h3 id="heading-the-code">The Code</h3>
<p>So far we’ve discussed the interface. Now let’s actually write some logic.</p>
<p>For this, we will need to define two mapping objects, which is the Solidity notion for an associative or key/value array:</p>
<pre><code> mapping(<span class="hljs-function"><span class="hljs-params">address</span> =&gt;</span> uint256) balances; mapping(<span class="hljs-function"><span class="hljs-params">address</span> =&gt;</span> mapping (<span class="hljs-function"><span class="hljs-params">address</span> =&gt;</span> uint256)) allowed;
</code></pre><p>The expression <code>mapping(address =&gt; uint2</code>56) defines an associative array whose keys are of ty<code>pe addr</code>ess— a number used to denote account addresses, and whose values are of ty<code>pe uint</code>256 — a 256-bit integer typically used to store token balances.  </p>
<p>The first mapping objec<code>t, balan</code>ces, will hold the token balance of each owner account.</p>
<p>The second mapping object, <code>allowed</code>, will include all of the accounts approved to withdraw from a given account together with the withdrawal sum allowed for each.</p>
<p>As you can see, the value field of the allowed mapping is by itself a mapping plotting account address to its approved withdrawal sum.</p>
<p>These mappings together with all other contract fields will be stored in the blockchain and will be <em>mined</em> resulting in changes being propagated to all network user nodes.</p>
<p>Blockchain storage is expensive. It costs gas that users of your contract will need to pay for. Where possible, always try to minimize both storage size and writes into the blockchain.</p>
<p>Now that we have the required data structures set, let’s continue and actually write the ERC20 logic into the appropriate functions.</p>
<h4 id="heading-get-the-total-number-of-tokens">Get the total number of tokens</h4>
<p>There are several approaches to setting the maximal number of an ICO tokens and, in fact, this issue might be worth a discussion by itself.</p>
<p>For our needs we will use the simplest approach, which is to set the total amount of tokens at contract creation time and initially assign all of them to the ‘contract owner’ account i.e. the account that deployed the contract:</p>
<pre><code>uint256 totalSupply_;   <span class="hljs-keyword">constructor</span>(uint256 total) public {     totalSupply_ = total;    balances[msg.sender] = _totalSupply; }
</code></pre><p>A constructor is a special function automatically called by Ethereum right after the contract’s deployment. You would typically use it, as we do here, to initialize the token’s state using parameters passed by the contract’s deployer.</p>
<p><code>msg</code> is a global variable declared and populated by Ethereum itself, and which contains important data for performing the contract’s duty. The field we are using here: <code>msg.sender</code> contains the Ethereum account executing the current contract function.</p>
<p>Since only the deploying account can ever enter a contract’s constructor, what this function does is, at the contract’s startup, it allocates all available tokens to the ‘contract owner’ account.</p>
<h4 id="heading-get-total-token-supply">Get total token supply</h4>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">totalSupply</span>(<span class="hljs-params"></span>) <span class="hljs-title">public</span> <span class="hljs-title">view</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint256</span>) </span>{   <span class="hljs-keyword">return</span> totalSupply_;}
</code></pre><p>This function will return the number of all tokens allocated by this contract regardless of who their owner is.</p>
<h4 id="heading-get-token-balance-of-owner">Get token balance of owner</h4>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">balanceOf</span>(<span class="hljs-params">address tokenOwner</span>) <span class="hljs-title">public</span> <span class="hljs-title">view</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint</span>) </span>{   <span class="hljs-keyword">return</span> balances[tokenOwner];}
</code></pre><p>balanceOf will return the current token balance of an account, identified by its owner’s address.</p>
<h4 id="heading-transfer-tokens-to-other-account">Transfer tokens to other account</h4>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">transfer</span>(<span class="hljs-params">address receiver,                   uint numTokens</span>) <span class="hljs-title">public</span> <span class="hljs-title">returns</span> (<span class="hljs-params">bool</span>) </span>{   <span class="hljs-built_in">require</span>(numTokens &lt;= balances[msg.sender]);   balances[msg.sender] = balances[msg.sender] — numTokens;   balances[receiver] = balances[receiver] + numTokens;   emit Transfer(msg.sender, receiver, numTokens);   <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;}
</code></pre><p>The <code>transfer</code> function does what its name implies, which is to move <code>numTokens</code> amount of tokens from the owner’s balance to that of another user <code>receiver</code>. Note that the transferring owner is <code>msg.sender</code> i.e. the one executing the function, which implies that only the owner of the tokens can transfer them to others.</p>
<p><code>require</code> is Solidity’s way of asserting a predicate, in this case that the transferring account has enough balance to transfer. If a require statement fails, the transaction is immediately rolled back with no changes written into the blockchain.</p>
<p>Right before exiting, the function fires ERC20 event <code>Transfer</code> allowing registered listeners to react to its completion.</p>
<h4 id="heading-allow-delegate-to-withdraw-tokens-from-my-account">Allow delegate to withdraw tokens from my account</h4>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">approve</span>(<span class="hljs-params">address delegate,                  uint numTokens</span>) <span class="hljs-title">public</span> <span class="hljs-title">returns</span> (<span class="hljs-params">bool</span>) </span>{   allowed[msg.sender][delegate] = numTokens;   emit Approval(msg.sender, delegate, numTokens);   <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;}
</code></pre><p>This function is typically used in a token marketplace context. What it does is to allow an owner i.e. <code>msg.sender</code> to approve a delegate account — possibly the marketplace itself — to withdraw some tokens from his account and to transfer them to other accounts.</p>
<p>A typical use case for this scenario would be an owner offering tokens for sale in a marketplace without having to need his own approval before the actual transaction takes place. At the end of its execution this function fires an <code>Approval</code> event.</p>
<h4 id="heading-get-number-of-tokens-approved-for-withdrawal">Get number of tokens approved for withdrawal</h4>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">allowance</span>(<span class="hljs-params">address owner,                    address delegate</span>) <span class="hljs-title">public</span> <span class="hljs-title">view</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint</span>) </span>{   <span class="hljs-keyword">return</span> allowed[owner][delegate];}
</code></pre><p>This function returns the current approved number of tokens by an owner to a specific delegate, as set in the <code>approve</code> function.   </p>
<p>Transfer tokens by delegate:</p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">transferFrom</span>(<span class="hljs-params">address owner, address buyer,                       uint numTokens</span>) <span class="hljs-title">public</span> <span class="hljs-title">returns</span> (<span class="hljs-params">bool</span>) </span>{   <span class="hljs-built_in">require</span>(numTokens &lt;= balances[owner]);    <span class="hljs-built_in">require</span>(numTokens &lt;= allowed[owner][msg.sender]);
</code></pre><pre><code>   balances[owner] = balances[owner] — numTokens;   allowed[owner][msg.sender] =          allowed[<span class="hljs-keyword">from</span>][msg.sender] — numTokens;   balances[buyer] = balances[buyer] + numTokens;   Transfer(owner, buyer, numTokens);   <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;}
</code></pre><p><code>transferFrom</code> is the peer of <code>approve</code> function we have already visited. It allows a delegate approved for withdrawal to actually transfer owner funds to a 3rd party account.</p>
<p>The two <code>require</code> statements at function start are to verify that the transaction is a legal one, i.e. that the owner has enough tokens to transfer and that the delegate has an allowance for at least <code>numTokens</code> to withdraw.</p>
<p>Other than moving <code>numTokens</code> amount from the owner to the buyer, this function also subtracts <code>numTokens</code> from the delegate’s allowance. This allows a delegate with a given allowance to break it into several withdrawals which is a typical marketplace behavior.</p>
<p>If fact, we could stop here and have a valid ERC20 implementation. But we are aiming higher: we want an industrial strength token, albeit a simple one. This requires us to make our code a bit more secure.</p>
<p><em>SafeMath</em> is a Solidity library aimed at dealing with one way hackers have been known to break contracts: integer overflow attack. In such an attack, the hacker forces the contract to use incorrect numeric values by passing parameters that will take the relevant integers <strong>past</strong> their maximal values.</p>
<p><em>SafeMath</em> protects against this by testing for overflow before performing the arithmetic action, thus removing the danger of overflow attack. It is also really small so that the impact on contract size is minimal, so let’s use it.</p>
<p>First we will add it to our code:</p>
<pre><code>library SafeMath { <span class="hljs-comment">// Only relevant functions</span>
</code></pre><pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sub</span>(<span class="hljs-params">uint256 a, uint256 b</span>) <span class="hljs-title">internal</span> <span class="hljs-title">pure</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint256</span>) </span>{   assert(b &lt;= a);   <span class="hljs-keyword">return</span> a — b;} <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">add</span>(<span class="hljs-params">uint256 a, uint256 b</span>) <span class="hljs-title">internal</span> <span class="hljs-title">pure</span> <span class="hljs-title">returns</span> (<span class="hljs-params">uint256</span>)   </span>{   uint256 c = a + b;   assert(c &gt;= a);   <span class="hljs-keyword">return</span> c; }}
</code></pre><p><em>SafeMath</em> uses <code>assert</code> statements to verify the correctness of the passed parameters. When <code>assert</code> fails, the function execution is immediately stopped and all blockchain changes are rolled back.</p>
<p>Next let us add the following statement introducing the library to the Solidity compiler:</p>
<pre><code>using SafeMath <span class="hljs-keyword">for</span> uint256;
</code></pre><p>and finally, we’ll replace the naive arithmetics we used at the beginning with SafeMath functions:</p>
<pre><code> balances[msg.sender] = balances[msg.sender].sub(numTokens);
</code></pre><pre><code> balances[receiver] = balances[receiver].add(numTokens);   balances[buyer] = balances[buyer].add(numTokens);  balances[owner] = balances[owner].sub(numTokens);
</code></pre><h4 id="heading-let-us-now-pack-it-all-together">Let us now pack it all together</h4>
<p>In Solidity, the contract’s functions and events are wrapped into an entity called a <em>contract</em> which you can silently translate to a “blockchain class”. Below is the ERC20-compatible contract we have thus far created. The name and symbol fields can be changed at will. Most tokens keep the decimal value at 18. We will do the same here:</p>
<h3 id="heading-contract-deployment">Contract Deployment</h3>
<p>We will now deploy our contract into the blockchain. Once deployed, the contract will be transferred to all nodes participating in the network and all changes made to the contract will be propagated to all participating nodes.</p>
<p>Ethereum professionals usually work with deployment tools such as <a target="_blank" href="https://truffleframework.com/">Truffle</a>.<br>For our need, a simple online tool called <a target="_blank" href="https://remix.ethereum.org/">Remix</a> will suffice.</p>
<p>You will first need to have a <a target="_blank" href="https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en">MetaMask plugin</a> installed on your browser (which I hope is Chrome..) and a Rinkeby (Ethereum test network) account with at least some Rinkeby Ether in it. These two pre requisites are out of our current scope and also rather simple to do.</p>
<p>If you do not have any of them, feel free to visit <a target="_blank" href="https://metamask.io/">MetaMask</a> and <a target="_blank" href="https://www.rinkeby.io/#stats">Rinkeby</a><br>to get clear installation and usage directions.</p>
<p>Assuming we have the prerequisites set we will now go to <a target="_blank" href="https://remix.ethereum.org/">Remix</a> and paste the code above including the pragma line and the SafeMath library into the online editor.</p>
<p>After this, we will move to the 2nd tab ‘<strong>Run’</strong> on right panel and click ‘<strong>Deploy’</strong>. A MetaMask popup will appear asking us to confirm the transaction which we of course will.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*nCwrO-nVS4dJevh67knnRw.png" alt="Image" width="538" height="514" loading="lazy"></p>
<ul>
<li><em>Green marker: Make sure you’re on Rinkeby network</em></li>
<li><em>Blue marker: Set total token supply</em></li>
<li><em>Red marker: Deploy!</em></li>
</ul>
<p><strong>Congrats!</strong> You have just deployed your first ERC20 token. It is simple yet fully functional, standard compliant, secure and ready to be purchased, paid with and transferred throughout the Blockchain network!</p>
<h4 id="heading-is-that-all-there-is-to-it">Is that all there is to it?</h4>
<p>Not at all. Smart contracts can get way more complex depending on your business logic, your modeling of the user interaction, on whether or not you allow token minting and burning, on lifecycle changes you introduce into the contract, on the need for admin-level capabilities which usually comes with admin-authorized set of functions and… well you get the picture.</p>
<p>Still, what you have achieved here is a solid base to move on from when a more complex contract is needed.</p>
<p>Hopefully it was also just a bit fun.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ You might have misconceptions about Blockchain. Let me help you fix them. ]]>
                </title>
                <description>
                    <![CDATA[ By Syed Fazle Rahman The internet is going crazy about this new buzzword called “Blockchain.” I am sure you have heard about it too, from your friends, investors, users or team members. As a technology, blockchain is so new and popular that people do... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/misconceptions-about-blockchain-8553262e8ff0/</link>
                <guid isPermaLink="false">66c35b611bbad699e42799fc</guid>
                
                    <category>
                        <![CDATA[ Bitcoin ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Blockchain ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cryptocurrency ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ICO ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 17 Apr 2018 12:08:17 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*ZZe6aLUCv8Qe6wxcl0ZTQA.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Syed Fazle Rahman</p>
<p>The internet is going crazy about this new buzzword called “Blockchain.” I am sure you have heard about it too, from your friends, investors, users or team members. As a technology, blockchain is so new and popular that people don’t have a proper idea about it and its applications.</p>
<p>In this article, let me help you correct the ten misconceptions about blockchain on a superficial level.</p>
<h3 id="heading-1-cryptocurrency-is-the-only-application-of-blockchain">1. Cryptocurrency is the only application of blockchain</h3>
<p>Creating a cryptocurrency seems like the most popular and viable application of blockchain today. This is also an easy way of making money by launching an ICO (Initial Coin Offerings) where investors buy your virtual coins with fiat currency or other coins like ETH, BTC, and so on.</p>
<p>Starting an ICO and making money quickly definitely looks tempting and is one of the reasons why it became massively popular. Take a look at the top 99 cryptocurrencies in the market right now and their current value, <a target="_blank" href="http://99coins.co/">99coins</a>.</p>
<p>On a side note, the ease of launching an ICO opened doors to many scams like the “Vietnamese Modern Tech” scam, where <a target="_blank" href="http://fortune.com/2018/04/12/icos-cryptocurrency-scam-vietnam/">a fake company raised $658M</a> by promising to build tech internet giants in the country.</p>
<p>But in reality, there are multiple real-world applications of blockchain, and cryptocurrency is just one of them. Here are a few of them:</p>
<ol>
<li><strong>Healthcare:</strong> Blockchain can help us keep health records securely with proper timestamps, so they don’t get lost. The current health care systems have a massive amount of data, and they aren’t managed and connected to the internet properly.</li>
<li><strong>Banking:</strong> Blockchain can help in cutting costs of settling transactions involving bonds or other financial instruments. It can help in sending money to countries where banking facilities aren’t a viable option.</li>
<li><strong>Distributed Cloud Storage:</strong> Today, the photos and documents we upload to the cloud (Google Drive, iCloud, and so on.) are all centralized and, and everything is controlled by an organization. With blockchain, we can take full control of our data, encrypt and store them, and access them securely.</li>
</ol>
<blockquote>
<p><strong><em>Tip: ? I</em></strong>f you want to launch your own ICO in a few minutes without any coding, check out T<a target="_blank" href="https://tokenlauncher.co/">okenLauncher,</a> created by S<a target="_blank" href="https://www.freecodecamp.org/news/misconceptions-about-blockchain-8553262e8ff0/undefined">andeep</a> and me.</p>
</blockquote>
<h3 id="heading-2-the-blockchain-is-the-solution-to-all-the-problems-under-the-sun">2. The blockchain is the solution to all the problems under the sun!!</h3>
<blockquote>
<p>“If all you have is a <strong>hammer</strong>, everything looks like a <strong>nail.</strong>”</p>
</blockquote>
<p>Just like the above quote, all the applications in the world needn’t involve blockchain. Blockchain comes with the concept of keeping the data or transactions decentralized. This means all your data is recorded forever in a network of computers. Data, once sent to a blockchain network, cannot be deleted or removed from all the systems. So, if you are thinking to build a decentralized network, think again!</p>
<h3 id="heading-3-bitcoin-is-blockchain">3. Bitcoin is Blockchain</h3>
<p><strong>The blockchain is the technology that powers Bitcoin</strong>. Bitcoin is also one of the first applications of blockchain that went popular. Therefore, many people assume that Bitcoin is blockchain.</p>
<p>Bitcoin was initially created as an alternative, decentralized payment method. However, as the supply of Bitcoin is limited, the value has increased drastically in recent times. Today, Bitcoin is considered digital gold and people treat it as an asset rather than a mode of payment.</p>
<h3 id="heading-4-smart-contracts-are-legal-documents">4. Smart contracts are legal documents!</h3>
<p><strong>No, they are not!</strong> The smart contract helps eliminate the need to pay intermediaries (Middlemen) and saves time and complexity. Think of them as self-executing code blocks that reside on the blockchain that no one can tamper with. However, smart contracts cannot be served as a legal document like Bonds, and so on.</p>
<h3 id="heading-5-blockchains-are-always-public">5. Blockchains are always public</h3>
<p>A public blockchain is open-source and accessible to all, and no one is in charge. Anyone can be part of the consensus in a public blockchain. However, all blockchains need not be public. You can make or create a private blockchain for your closed group of people.</p>
<p>In a private blockchain, the owner is a single entity or an enterprise and can delete/override commands on a blockchain, if needed. The private blockchain is also faster, cheaper, and requires less energy to operate.</p>
<h3 id="heading-6-blockchains-cannot-be-linked-together">6. Blockchains cannot be linked together</h3>
<p>Most of us assume that blockchains cannot communicate with each other. Well, it’s not our fault. That’s how blockchain was implemented, initially.</p>
<p>However, it’s entirely possible to send data between blockchains. <a target="_blank" href="https://cosmos.network/"><strong>Cosmos</strong></a>, a company which is building the future <em>Internet of Blockchain</em>, is trying to bridge the gap between multiple blockchains by enabling them to exchange data easily.</p>
<h3 id="heading-7-proof-of-work-is-the-only-way-of-achieving-consensus">7. Proof of work is the only way of achieving consensus</h3>
<p>As a group of people/nodes run blockchain, they need a way to agree before committing a transaction in the network. In simple terms, the consensus is a dynamic way of reaching agreement in a group.</p>
<p>The most common form of consensus is “<a target="_blank" href="https://hashnode.com/post/back-to-basics-why-proof-of-work-cjfc9pbxa003uo5s1vqbclz81"><strong>Proof of work</strong></a><strong>,</strong>” where every miner has to solve a difficult problem. The reward is given to the first miner who solves each block problem. However, it’s extremely expensive and requires a lot of power to run. Hence, people invented other types of consensus. Read about various types of consensus protocols <a target="_blank" href="https://blockgeeks.com/guides/blockchain-consensus/">here</a>.</p>
<p>Two popular alternatives to POW are:</p>
<ul>
<li><strong>Proof of stake:</strong> a node/person can mine or validate block transactions according to how many coins they hold. Which means the more coins owned by a miner, the more mining power they have. Example: <a target="_blank" href="https://neo.org/">Neo</a></li>
<li><strong>Delegated Proof Of Stake:</strong> people in the blockchain vote for witnesses who are paid for their services. The top witnesses even earn a monthly salary. The amount of stake a person has determines the power of each vote. This means people who have more tokens will influence the network more than people who have very few tokens. Any witness who’s not doing their job is thrown out and replaced with another witness. Example: <a target="_blank" href="https://steem.io/">Steem</a>, <a target="_blank" href="https://lisk.io/">Lisk</a>, and so on.</li>
</ul>
<h3 id="heading-8-the-blockchain-network-can-shut-down-if-the-creator-is-no-longer-interested">8. The Blockchain network can shut down if the creator is no longer interested</h3>
<p>A public blockchain network cannot shut down easily. Since a blockchain is decentralized and no single authority controls it, it’s very difficult to shut it down unless all the participants in the network stop working. In most cases, it’s nearly to impossible to shut down a public blockchain.</p>
<h3 id="heading-9-mentioning-blockchain-in-your-pitch-deck-guarantees-funding">9. Mentioning “Blockchain” in your pitch deck guarantees funding</h3>
<p>Many people around the world want to jump into the hype train and make money out of it. We see this trend every year with new buzzwords. In 2016 and 2017, it was ML and AI. In 2018, it’s Blockchain. ?</p>
<p>If you are raising money without thinking deeper, the product is destined to die as the market stabilizes itself. So, beware! An investor wants a return! ?</p>
<h3 id="heading-10-only-geeks-and-nerds-can-use-blockchain">10. Only geeks and nerds can use Blockchain</h3>
<p>Even my cat can use Blockchain!</p>
<p>You don’t have to be a nerd to use blockchain. For example, to send or receive Bitcoin, all you need is a wallet that supports Bitcoin transactions, a public address, and a private key! Make sure to keep your private key secret. It takes a few seconds to create a new Bitcoin wallet. Get your wallet <a target="_blank" href="https://bitcoin.org/en/choose-your-wallet">here</a>.</p>
<h4 id="heading-bonus"><em>(Bonus)</em></h4>
<h3 id="heading-blockchain-dlt-distributed-ledger-technology">Blockchain === DLT (Distributed Ledger Technology)</h3>
<p>Many believe that blockchain and DLT are the same. However, this is not true. DLT is an umbrella term used to refer to technologies that distribute information among multiple nodes. By this logic, we can say blockchain is a fully functional Distributed Ledger Technology.</p>
<p>Other protocols such as HashGraph, Nano, IOTA (Tangle Network) and so on are also DLTs, but they are not blockchain.</p>
<p>So, blockchain and DLT may be synonymous, but they aren’t the same. Rather, blockchain is a type of DLT.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>I hope I was able to clear any misconceptions you might have had about the blockchain. If I left any out, please leave your comments below.</p>
<p>PS: I am not associated with any blockchain products that I have mentioned in my article.</p>
<p>PPS: My team and I are building a friendly community for developers called <a target="_blank" href="https://hashnode.com">Hashnode</a>. More than half a million developers hang out and discuss programming every month. Make sure to <a target="_blank" href="https://hashnode.com/communities?tab=blockchain">follow popular crypto communities</a> to stay in the loop.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What we can do to reassure ICO investors that we won’t vanish with their money ]]>
                </title>
                <description>
                    <![CDATA[ By Pablo Ruiz What a great time to be in the tech industry! It’s never been easier to raise funds for a new startup. Well, maybe during the dot-com era, but most people of my generation — those born after 1985 — were too young at that time to build ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-we-can-do-to-reassure-ico-investors-that-we-wont-vanish-with-their-money-ae9cfa3e162b/</link>
                <guid isPermaLink="false">66c3661209a9333511bcdb54</guid>
                
                    <category>
                        <![CDATA[ Blockchain ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ethereum ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ICO ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 08 Jan 2018 10:20:16 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*yY21X2rr17WAE_zs35u3pg.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Pablo Ruiz</p>
<p>What a great time to be in the tech industry! It’s never been easier to raise funds for a new startup. Well, maybe during the dot-com era, but most people of my generation — those born after 1985 — were too young at that time to build a company.</p>
<p><strong>For those of us Millennials, it’s never been easier to raise funds for a new startup!</strong></p>
<p>2017 has seen the rise of ICOs (<a target="_blank" href="https://hackernoon.com/twenty-years-and-three-months-to-create-an-overnight-sensation-cf7190df871b">Initial Coin Offerings</a>). ICOs are a novel way for teams to raise funding in exchange for tokens that are (or will be) used to interact with the company’s product. Through the sale of tokens, startup teams can get the funding they need to further develop their products without having to give up control to investors. Instead, they get the funding by selling digital tokens that at some point should be useful within their platform, hopefully holding — or even increasing — their value.</p>
<p>The early days of ICOs were a success, and in most cases, they raised millions of dollars each in a matter of days or even hours. As these results started to make headlines, more people started jumping on the ICO bandwagon. It didn’t matter what the product was, or even if it made sense to build those products using Blockchain technology.</p>
<p><a target="_blank" href="https://www.freecodecamp.org/news/what-we-can-do-to-reassure-ico-investors-that-we-wont-vanish-with-their-money-ae9cfa3e162b/undefined">Eric Risley</a>’s article, <a target="_blank" href="https://hackernoon.com/most-icos-fail-tale-of-two-worlds-d1ab7625ff66">Tale of Two World</a>s, shows that ICOs are failing to raise the funds they intended to raise as the months go by.</p>
<p>The chart he published goes from June to mid-September 2017, but given how exponentially this trend has evolved, I bet it has only gotten worse.</p>
<p>ICOs were bound to start missing their targets. There’s currently an over-saturation of ICOs, as can be evidenced by looking at the popular listing sites. Many of them spring out every day. And many of them are garbage or outright scams.</p>
<p>I’m not going to go over what makes an ICO potentially dangerous to invest in, as it is not the point of this article. But there are many telltale signs, such as ridiculous caps, non-existent MVPs, shady founders and unknown advisors. It is worrisome — but interesting to analyze — given how many of them still do manage to raise some money despite all the red flags.</p>
<p>Alongside these failed ICOs that miss their targets, there’s a new problem starting to manifest in this industry. Some ICOs successfully raise the funds, but either fail to fulfill their promise or directly vanish with the funds they raised.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/-Q-vxQplymMoEO5fmUh6PLXJzDSeDnMj3yy8" alt="Image" width="800" height="600" loading="lazy">
_Photo by [Unsplash](https://unsplash.com/photos/ZbZ5KP7D9z8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" rel="noopener" target="_blank" title=""&gt;Patrick Tomasso on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" rel="noopener" target="<em>blank" title=")</em></p>
<p><a target="_blank" href="https://www.cnbc.com/2017/11/21/confido-ico-exit-scam-founders-run-away-with-375k.html">The most recent case is Confido.</a> In November 2017 they managed to raise almost $400,000 through an Initial Coin Offering and simply vanished with the money. They took down the site, deleted their profiles from social networks, and ran away with the funds they had collected. ? ? ?</p>
<p><strong>If the number of scams and failed ICOs keeps increasing, it’s going to take a toll on the Ethereum community and make it harder for honest founders to access this method of funding.</strong></p>
<p>So, what can we do, as honest founders, to reassure potential contributors/investors of our good intentions?</p>
<p>Currently, most ICOs have outrageous hard caps — typically 10 or more times the funds that any company would need to build a tech product. We are raising tens of millions of dollars to launch products that could be accomplished with a few hundred thousands.</p>
<p>I know, ICOs might soon be dead or the bar might be raised so high that it’s impossible for smaller teams to raise any funding at all. So, better to seize the moment and ask for as much as you can, right? It’s not like you are giving more control of your company by asking for 10 times the money you need.</p>
<p>Well, I firmly believe that at some point we won’t be able to raise funds as easily as we can now. <strong>We will be asked for more accountability.</strong> The market will accommodate, and we will need to up our game in order to be able to do successful ICOs. One of the first things I believe we will be asked to do is to restrict our access to the funds to prevent hit-and-run Confido-like outcomes.</p>
<p>You want to raise 100 million dollars? Perfect, go ahead. But you will only get $500k right after the ICO.</p>
<p>Need more? Show us some progress.</p>
<p>Haven’t shown some considerable progress for months? We’ll take what’s left of our money back.</p>
<h3 id="heading-building-a-milestone-based-vault-for-icos">Building a Milestone-based Vault for ICOs</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/o8-nUBaQEfC7gEtji41CXgZqRq9dtfO3K4dY" alt="Image" width="800" height="533" loading="lazy">
_Photo by [Unsplash](https://unsplash.com/photos/FqaybX9ZiOU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" rel="noopener" target="_blank" title=""&gt;James Sutton on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" rel="noopener" target="<em>blank" title=")</em></p>
<p><a target="_blank" href="https://github.com/pabloruiz55/MilestoneVault">The complete, fully-commented, code can be found on my Github repository</a>. Please refer to the README.md file for detailed usage instructions.</p>
<p>The MilestoneVault is a smart contract implementation of a vault that stores the crowdsale’s contributions and releases the funds as project milestones get completed.</p>
<p>Once the crowdsale has finished, the funds are stored in this vault. At any moment, the team can request a portion of those funds — as previously defined — and the original contributors can cast their vote against that request. If the majority rejects the request, the funds are not made available.<br>If the founding team makes several requests and they keep getting rejected, the project gets cancelled and contributors can get a refund on the money that hasn’t yet been withdrawn on previous milestones.</p>
<p>As I started working on this project, I realized there was not just one right solution. There are many ways this can be achieved depending on how the founding team wants to handle it, <strong>and what the community is willing to tolerate</strong>. For example:</p>
<h4 id="heading-initial-contributors-vs-token-holders">Initial contributors VS token holders</h4>
<p><strong>My current implementation allows the ICO contributors, instead of the token holders, to vote.</strong></p>
<p>A person’s investment in a project is represented by the tokens they got in exchange for their contribution. But I don’t think that, after the ICO, the token holders should have a say on the future of the project. After the ICO, owning tokens don’t necessarily make someone an investor or a supporter of the project. I could have the tokens for mere speculation and not care about the project at all.</p>
<p>On the other hand, as an early contributor to the ICO, I might have already sold my tokens along the way and couldn’t care less about the current and future state of the project.</p>
<p>There could be a third option that takes into account only the votes from early backers that still have all, any, or some portion of the tokens. But I felt this would over-complicate the smart contract.</p>
<h4 id="heading-one-person-one-vote-vs-weighted-votes"><strong>One person, one vote VS weighted votes</strong></h4>
<p><strong>My current implementation is based on weighted votes.</strong></p>
<p>This means that the size of the original investment is taken into account when voting. If I invested 3 ether, my vote will matter more than the vote of someone who invested only 1 ether.</p>
<h4 id="heading-approval-voting-vs-disapproval-voting">Approval voting VS disapproval voting</h4>
<p><strong>My current implementation is based on disapproval voting.</strong></p>
<p>When the team initiates a request for funds, a voting period is started. During that voting period, contributors to the ICO can vote against the request for withdrawal for the current milestone. If the majority votes against, then the request is rejected.</p>
<p>This could be changed so that the request is not approved by default, and the team has to get enough positive votes in order to unlock the next milestone.</p>
<p>Again, I don’t feel that this is a case where one-solution-fits-all applies, and I’m not claiming to know how these choices would affect the project in the long run. Depending on the nature of the project, the composition of its community and contributor base, and many other variables, the voting system could be modified to better represent all parties and prevent issues.</p>
<h4 id="heading-what-about-disputes">What about disputes?</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/sgOSelI2BRXalzMr91P1NkkMHOS09lrxNK0A" alt="Image" width="800" height="533" loading="lazy">
_Photo by [Unsplash](https://unsplash.com/photos/DCtwjzQ9uVE?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" rel="noopener" target="_blank" title=""&gt;CloudVisual on &lt;a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" rel="noopener" target="<em>blank" title=")</em></p>
<p>There’s one final topic I’d like to discuss. My inspiration for looking into this subject and thinking about ways to make ICOs a bit more transparent was <a target="_blank" href="https://medium.com/kleros/kleros-a-tool-against-abuse-in-token-distribution-924217746c16">this post</a> by <a target="_blank" href="https://www.freecodecamp.org/news/what-we-can-do-to-reassure-ico-investors-that-we-wont-vanish-with-their-money-ae9cfa3e162b/undefined">Federico Ast</a>, one of the founders of <a target="_blank" href="https://kleros.io/">Kleros</a>.</p>
<p>In his article, Federico writes how he thinks ICOs should work:</p>
<blockquote>
<p>During the crowdsale, backers from all over the world send payments into a smart contract which will release payments to the team as some predefined milestones are met. For example: “Next payment will be done when the team releases a new version of the software with substantial improvements”.</p>
<p>When the team claims a milestone is reached, token holders have some period of time to dispute it. If a sufficient amount of token holders reject the milestone completion claim, a dispute arises between the team and the token holders (Was the milestone met? Should the money be released?). Kleros is the dispute resolution mechanism.</p>
</blockquote>
<p>As it stands today, the solution I propose could be subject to some abuse from the contributors. They have the final say in whether or not the project gets further funding, and there’s no way to refute their voting. They could even collude to cut off the project’s funds and get their money back if, for example, the tokens are worth much less than the money they put in.</p>
<p>As Federico writes, a dispute resolution mechanism could be put in place so that each time the contributors decide to withhold the funds (or right before deeming the project cancelled), the team can initiate a dispute, present their evidence, and get objective third parties to decide what to do.</p>
<p>I believe that ICOs are a great fundraising mechanism that will enable awesome companies to be born and thrive, but we must do our best effort to use this great tool consciously.</p>
<p>What other mechanisms do you think could be put in place to provide more security for ICO investors?</p>
<p><em>I hope you enjoyed reading this article as much as I enjoyed writing it. I’m currently taking consultancy jobs related to smart contracts development. If you are planning on raising funds through an ICO or building a Blockchain-based product, feel free to get in touch with me.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Smart Contracts for Dummies ]]>
                </title>
                <description>
                    <![CDATA[ By Nik Custodio If you still don’t get what the heck a Smart Contract is… Ok, you know a bit about Bitcoin (see: Explain Bitcoin Like I’m Five). You’ve been seeing the blockchain on the news. But what’s this new Ethereum thing? Apparently it’s this ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/smart-contracts-for-dummies-a1ba1e0b9575/</link>
                <guid isPermaLink="false">66c35efcaf2b7c40e7d7eb29</guid>
                
                    <category>
                        <![CDATA[ Blockchain ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cryptocurrency ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ethereum ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ICO ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 26 May 2017 12:01:00 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*lsZWlQRE0lWRLzx-BpxR8A.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Nik Custodio</p>
<h4 id="heading-if-you-still-dont-get-what-the-heck-a-smart-contract-is"><strong>If you still don’t get what the heck a Smart Contract is…</strong></h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*lsZWlQRE0lWRLzx-BpxR8A.jpeg" alt="Image" width="612" height="609" loading="lazy"></p>
<p>Ok, you know a bit about Bitcoin (see: <a target="_blank" href="https://medium.com/@nik5ter/explain-bitcoin-like-im-five-73b4257ac833">Explain Bitcoin Like I’m Five</a>). You’ve been seeing the blockchain on the news.</p>
<p>But what’s this new <a target="_blank" href="https://www.nytimes.com/2017/02/27/business/dealbook/ethereum-alliance-business-banking-security.html"><strong>Ethereum</strong></a> thing? Apparently it’s this crypto-currency you can use to build “smart contracts”. Sounds impressive. So, uh… what are they again? <em>(Spoiler: They’re not that smart. And they’re not really contracts!)</em></p>
<p>Instead of a one line definition, let’s try to get an intuition. First, we’ll revisit the <em>blockchain</em> and the word “trust”. Then, we’ll talk about the word “contract”. Understanding both words is the secret.</p>
<h3 id="heading-part-i-what-we-mean-by-trustless">Part I: What we mean by “Trust(less)”</h3>
<p>Most of the time, when we think Bitcoin (or Ethereum), we have a mental image of, well…<em>coins</em>.</p>
<p>Aren’t these <em>crypto-currencies</em> after all? Isn’t that the whole point? In our minds we see objects — digital gold, or silver (or tulips for the skeptics).</p>
<p>Because these images are easy to understand, we forget a bit about that <em>thing</em> that’s underneath it all. So, I say we start thinking about this in a different way.</p>
<h3 id="heading-digital-stone"><strong><em>Digital Stone</em></strong></h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*iU2aL8uUyDD5Sqg66Bo9Tw.jpeg" alt="Image" width="800" height="976" loading="lazy"></p>
<p>Ugh, really? Digital rocks? Actually, rocks are pretty useful.</p>
<p>We have this idiom in the english language that goes something like this: “set it in <strong>stone</strong>.”</p>
<blockquote>
<p>“I’ve reviewed the contract Bob. Looks good. Let’s set this in stone!”</p>
<p>“Don’t get too excited Alice, nothing’s in stone yet.”</p>
<p>“This is God. I’ve written my 10 commandments on these two stone tablets. You know. Just in case ya'll start getting any funny ideas.”</p>
</blockquote>
<p>This metaphor continues to have meaning in a modern world because in the physical (ancient) world, stone had some interesting properties:</p>
<ol>
<li>When you carve something on stone there is a physical <strong><em>finality and permanence</em></strong> to it. You can’t make changes just like that.</li>
<li>If you try to “erase” something later on, it’ll be obvious. Any changes you make to it are quite <strong><em>transparent and tamper proof (provable)</em></strong>.</li>
<li>These rules apply equally to all. Stone is <strong><em>neutral</em></strong>. It obeys the laws of physics, not men. It doesn’t care if you’re a powerful king or a peasant — it behaves exactly the same for everyone.</li>
</ol>
<p>Because of all these properties, we have a pretty <strong><em>high level of trust</em></strong> in stone.</p>
<p>I mean — there’s a reason why we never say “let’s set this agreement in <strong><em>sand</em></strong><em>.”</em> Stone is the kind of thing I can point to in the future for evidence. Stone equals solid proof — not just any material will do!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*8sfxhyikasLgeiUpNBa1iw.jpeg" alt="Image" width="400" height="526" loading="lazy">
_[The Economist](http://www.economist.com/news/leaders/21677198-technology-behind-bitcoin-could-transform-how-economy-works-trust-machine" rel="noopener" target="<em>blank" title=") agrees!</em></p>
<p>When it comes down to it, a blockchain is really just the above: <em>a kind of material that, through a special mix of cryptography and decentralization, has the properties of permanence, transparency, and neutrality — whatever you put on it.</em></p>
<p>Whether it’s a list of how many apples you sent to Joe. Or the words “I love Jenny.” It doesn’t matter. When you put it on a blockchain — it’s <em>on</em>.</p>
<blockquote>
<p><strong>Setting something on a blockchain is like setting something in stone. It makes trust easier.</strong></p>
</blockquote>
<p>Except now we can do it <em>digitally</em>. And that’s pretty special.</p>
<p>Thinking about a blockchain as a piece of stone you can write things on (instead of a piece of currency) also helps us understand its broad potential. Which leads us to…contracts!</p>
<h3 id="heading-part-ii-what-we-mean-by-contracts">Part II: What we mean by “Contracts”</h3>
<p>The word “contract” has a lot of baggage. We start thinking: legal documents and lawyers.</p>
<p>The go-to description used in the news is a bit better: things that <em>self-execute</em> or <em>execute automatically</em>. That seems vaguely familiar though. After all, there’s really nothing new about <em>automation</em> or <em>execution.</em></p>
<h4 id="heading-the-great-grandfather-of-smart-contracts">The great grandfather of smart contracts</h4>
<p>Take your good ol’ office <a target="_blank" href="https://perma.cc/V6AZ-7V8W"><strong>vending machine</strong></a> for example. It’s a “stupid” machine that does what it’s told, and executes things automatically. It’s been around for decades!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*U73m4z7Tl3fQVtAThldjGg.png" alt="Image" width="350" height="449" loading="lazy">
<em>Behold, the magical machine that spits out high-fructose sustenance.</em></p>
<p>Let’s pretend one afternoon you find yourself in front of this machine. It says: <strong>“If you give me $2.50, and press this button, you will get a Diet Coke.”</strong></p>
<p>It might not actually <em>say</em> those words anywhere. But that’s the promise of this little interaction. One might even call this a kind of simple <a target="_blank" href="http://internetofagreements.com/files/InternetOfAgreements.pdf"><strong><em>agreement</em></strong></a><em>.</em> (You can guess where this is going.)</p>
<p>You feed in the money. Press the button. Presto! Bottle in hand, you forget this meaningless event in your life 2 seconds later and start worrying again about those darn TPS reports you forgot to do.</p>
<p>Well, you didn’t notice, but this whole thing was actually a small program(“contract”) coded(“written”) into the machine beforehand that ran when you hit the button(“signed off on it”). Something like:</p>
<pre><code>&amp;gt; <span class="hljs-keyword">if</span> money received == $<span class="hljs-number">2.50</span> &gt;     &amp;&amp; the button pressed is <span class="hljs-string">"Diet Coke"</span>&gt; then release Diet__Coke
</code></pre><p>Computer code, as you see, is <em>kind of</em> like a <strong><em>contract</em></strong>.</p>
<p>It’s making statements and declarations. There are terms (if you do this…then…). And just like someone you trust — it even fulfills its end of the bargain!</p>
<p>Voila. Contracts are just code. But unlike a “contract” in English, this is something both humans <em>and</em> machines can read. Extra fun!</p>
<h4 id="heading-ok-but">Ok, but…</h4>
<p>Now you’re more confused about this smart contract business. As we said, this is nothing special. In fact, as the vending machine demonstrates, this kind of code <em>is</em> already everywhere in our daily lives. If a smart contract is just “if…then” code (or <em>any</em> code for that matter), then what’s the hoopla? What’s actually <em>new?</em></p>
<h3 id="heading-vending-machines-20">Vending Machines 2.0</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*fhtPA_xZNCEwq1SMzYS2rw.jpeg" alt="Image" width="800" height="500" loading="lazy"></p>
<p>One sunny day, you spot a vending machine sitting on the corner. You’ve never seen this one before!</p>
<p>You walk over and take a look. This machine says: “<strong>If you put in $1,000 this machine will give you $5,000.”</strong></p>
<p>Whoa! Whoever put this machine together must be very rich and generous.(Or insanely stupid…). Either way. 1k for 5k? No brainer — that’s a deal you’ll take any day! Right?</p>
<p>This is exactly like our good old Diet Coke machine. Same logic. Same if-then process.</p>
<p>Except now the stakes are different. You reach for your pocket but suddenly, you feel hesitant. Who the hell put this machine together anyway? And what if it eats your money? $1,000 isn’t a small amount — you were saving that for months. You didn’t think twice about that Diet Coke. But now? Now you realize that maybe vending machines aren’t that simple.</p>
<p>You start thinking about <strong>trust.</strong></p>
<blockquote>
<p><strong><em>How do we know it has enough funds to spit out the promised $5,000?</em></strong></p>
<p><strong><em>How do we know the code is going to</em> run<em>?</em></strong></p>
<p><strong><em>Is there any way to publicly and transparently verify this code?</em></strong></p>
</blockquote>
<h3 id="heading-conclusion">Conclusion</h3>
<p>The $5,000 vending machine is an extreme, theoretical example but it does hint at the problem with <em>scaling</em> trust. In an expanding, digital world where people can connect anonymously — trust becomes a tricky thing. We usually rely on third-parties and other middle men for that reason. We have to. Especially if we’re moving things way more valuable than Diet Cokes. You know, like newfangled financial stuff. Or <a target="_blank" href="http://nikcustodio.tumblr.com/post/150500263430/why-blockchains-an-eli21">the very idea of “value” and “ownership”</a> itself.</p>
<p>Hmmm. If only you could marry the automation of traditional programming <strong><em>and</em></strong> the trust-worthy properties of <em>digital stone….</em></p>
<p>Well, that is exactly what a smart contract is! It’s just code — with a very special kind of backing.</p>
<blockquote>
<p>Keep in mind, we’ve had both computation and execution before. <em>But never one that was finalized in a neutral, provable, trustable way on (digital) stone.</em></p>
</blockquote>
<h4 id="heading-how-about-the-real-world-a-few-ideas"><strong>How about the real world? A few ideas.</strong></h4>
<p><strong>Online Gaming:</strong> Fight <a target="_blank" href="http://money.cnn.com/2012/07/31/technology/online-poker-settlement/">fraud on gambling sites</a>. Are the odds of that dice roll you just did <em>actually</em> 1 in 6? How do we know they’re going to pay out? Well, why not “set the code in stone” and prove it? A live <a target="_blank" href="https://etheroll.com/#tab7">example</a>.</p>
<p><strong>Supply Chains:</strong> Maybe <a target="_blank" href="https://www.provenance.org/whitepaper">track and verify where and how things are made?</a></p>
<p><strong>Voting:</strong> Maybe a tamper proof <a target="_blank" href="http://www.govtech.com/blogs/lohrmann-on-cybersecurity/can-blockchain-technology-secure-your-vote.html">voting</a> process?</p>
<p><strong>Decentralized and Autonomous Companies:</strong> Sci-fi time.</p>
<p>Throughout history, automation has always been applied to the <em>bottom</em> of companies<em>.</em> The assembly line. The factory worker. But if the rules of a corporation are just a kind of operational <em>logic</em>— then isn’t it possible to flip the pyramid and instead <a target="_blank" href="https://blog.ethereum.org/2014/05/06/daos-dacs-das-and-more-an-incomplete-terminology-guide/">automate the <em>top</em></a>?</p>
<p>These are only a few examples of what you could code on a blockchain using Ethereum’s <a target="_blank" href="https://www.wikiwand.com/simple/Turing_complete">Turing complete programming language</a>. We’re only at the beginning. If you dream it, you might be able to code it.</p>
<p>And in many ways, that’s what makes this whole thing exciting. We have some guesses, but honestly — we have no idea what will be built in the years and decades to come.</p>
<p>All we know is that the building blocks are here. And it is open to all. The rest is up to you.</p>
<h4 id="heading-ready-to-go-down-the-rabbit-hole"><strong>Ready to go down the rabbit hole?</strong></h4>
<ul>
<li><a target="_blank" href="https://blog.coinbase.com/a-beginners-guide-to-ethereum-46dd486ceecf">A Beginner’s Guide to Ethereum</a></li>
<li><a target="_blank" href="https://medium.com/@cdixon/crypto-tokens-a-breakthrough-in-open-network-design-e600975be2ef">Crypto-Tokens: A Breakthrough in Open Network Design <em>(</em></a><em>Chris Dixon)</em></li>
<li><a target="_blank" href="https://perma.cc/V6AZ-7V8W">The Idea of Smart Contracts <em>(Nick Szabo, 1997)</em></a></li>
<li><a target="_blank" href="https://medium.com/@nik5ter/the-other-side-of-the-coin-f293b65b1eda?source=linkShare-2d6f142ff3cc-1513820863">The Other Side of the Coin: A different perspective on cryptocurrencies</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
