<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on Program the Blockchain</title>
    <link>https://programtheblockchain.com/posts/</link>
    <description>Recent content in Posts on Program the Blockchain</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 10 Dec 2018 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://programtheblockchain.com/posts/rss.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Introduction to Ethereum Payment Channels Video</title>
      <link>https://programtheblockchain.com/posts/2018/12/10/introduction-to-ethereum-payment-channels-video/</link>
      <pubDate>Mon, 10 Dec 2018 00:00:00 +0000</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/12/10/introduction-to-ethereum-payment-channels-video/</guid>
      <description>&lt;p&gt;We&amp;rsquo;ve created a short (32-minute) video to help explain Ethereum payment channels&amp;mdash;what they are and how they work.  This video complements two of our previous posts:
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/02/23/writing-a-simple-payment-channel/&#34;&gt;Writing a Simple Payment Channel&lt;/a&gt;
and
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/02/building-long-lived-payment-channels/&#34;&gt;Building Long-lived Payment Channels&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Implementing Harberger Tax Deeds</title>
      <link>https://programtheblockchain.com/posts/2018/09/19/implementing-harberger-tax-deeds/</link>
      <pubDate>Wed, 19 Sep 2018 00:00:00 +0000</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/09/19/implementing-harberger-tax-deeds/</guid>
      <description>&lt;p&gt;This post will demonstrate how to implement deeds that collect a &amp;ldquo;Harberger tax&amp;rdquo;.  The recently published book,
&lt;a href=&#34;https://www.amazon.com/Radical-Markets-Uprooting-Capitalism-Democracy/dp/0691177503&#34;&gt;Radical Markets: Uprooting Capitalism and Democracy for a Just Society&lt;/a&gt;,
proposed Harberger taxes for a number of applications.  Since then Vitalik Buterin
(&lt;a href=&#34;https://vitalik.ca/general/2018/04/20/radical_markets.html&#34;&gt;here&lt;/a&gt;)
and Simon de la Rouviere
(&lt;a href=&#34;https://medium.com/@simondlr/what-is-harberger-tax-where-does-the-blockchain-fit-in-1329046922c6&#34;&gt;here&lt;/a&gt;)
have speculated on smart contract applicability.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Dollar Auction Contract</title>
      <link>https://programtheblockchain.com/posts/2018/08/16/writing-a-dollar-auction-contract/</link>
      <pubDate>Thu, 16 Aug 2018 00:00:00 +0000</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/08/16/writing-a-dollar-auction-contract/</guid>
      <description>&lt;p&gt;This post will implement a
&lt;a href=&#34;https://en.wikipedia.org/wiki/Dollar_auction&#34;&gt;&amp;ldquo;dollar auction&amp;rdquo;&lt;/a&gt;
contract for ERC20 tokens. It will be a modest change to the
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/20/writing-a-token-auction-contract/&#34;&gt;English auction contract&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Penny Auction Contract</title>
      <link>https://programtheblockchain.com/posts/2018/08/08/writing-a-penny-auction-contract/</link>
      <pubDate>Wed, 08 Aug 2018 00:00:00 +0000</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/08/08/writing-a-penny-auction-contract/</guid>
      <description>&lt;p&gt;This post will implement a
&lt;a href=&#34;https://en.wikipedia.org/wiki/Bidding_fee_auction&#34;&gt;bidding fee auction&lt;/a&gt;
(aka &amp;ldquo;penny auction&amp;rdquo;) contract for ERC20 tokens. It will be a modest change to the
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/20/writing-a-token-auction-contract/&#34;&gt;English auction contract&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Contracts Calling Arbitrary Functions</title>
      <link>https://programtheblockchain.com/posts/2018/08/02/contracts-calling-arbitrary-functions/</link>
      <pubDate>Thu, 02 Aug 2018 08:58:52 -0400</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/08/02/contracts-calling-arbitrary-functions/</guid>
      <description>Solidity offers convenient high-level syntax for calling functions in other contracts, but this high-level syntax is only available when the target contract&amp;rsquo;s interface is known at compile time.
In this post, I&amp;rsquo;ll show how smart contracts can use low-level message passing to make arbitrary calls into other contracts. I&amp;rsquo;ll use this mechanism to enhance our trivial multisig wallet so that it can make function calls in addition to transferring ether.</description>
    </item>
    
    <item>
      <title>Anatomy of Transaction Data</title>
      <link>https://programtheblockchain.com/posts/2018/07/25/anatomy-of-transaction-data/</link>
      <pubDate>Wed, 25 Jul 2018 12:46:04 -0400</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/07/25/anatomy-of-transaction-data/</guid>
      <description>&lt;p&gt;&lt;em&gt;[This blog post explains how transaction data is used to invoke smart contracts in Ethereum, but it is &lt;strong&gt;not&lt;/strong&gt; necessary for learning Solidity programming.  We write it for those of you who would like a deeper understanding of what is going on when a transaction is sent to a smart contract.]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In our previous post &lt;a href=&#34;https://programtheblockchain.com/posts/2017/12/29/how-ethereum-transactions-work/&#34;&gt;How Ethereum Transactions Work&lt;/a&gt;, we mentioned that the &lt;code&gt;data&lt;/code&gt; field of a transaction encodes what (if any) smart contract function should be invoked. In this post, I&amp;rsquo;ll dive deeper into the specifics of the &lt;code&gt;data&lt;/code&gt; field.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>State Channels with Signing Keys</title>
      <link>https://programtheblockchain.com/posts/2018/07/18/state-channels-with-signing-keys/</link>
      <pubDate>Wed, 18 Jul 2018 12:38:49 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/07/18/state-channels-with-signing-keys/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll show how a temporary signing key can be used to improve the user experience of working with state channels.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Trivial Multisig Wallet</title>
      <link>https://programtheblockchain.com/posts/2018/07/11/writing-a-trivial-multisig-wallet/</link>
      <pubDate>Wed, 11 Jul 2018 10:15:50 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/07/11/writing-a-trivial-multisig-wallet/</guid>
      <description>&lt;p&gt;This post will demonstrate a very simple
&lt;a href=&#34;https://en.wikipedia.org/wiki/Multisignature&#34;&gt;multisig&lt;/a&gt;
wallet.  This multisig wallet requires unanimous consent for the transfer of funds, and the consent is collected off-chain via signed messages.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Performing Multiple Actions Transactionally</title>
      <link>https://programtheblockchain.com/posts/2018/07/06/performing-multiple-actions-transactionally/</link>
      <pubDate>Fri, 06 Jul 2018 08:41:23 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/07/06/performing-multiple-actions-transactionally/</guid>
      <description>&lt;p&gt;This post will demonstrate a simple technique for combining multiple actions into a single transaction.  This will enable you to be certain that you get &amp;ldquo;all or nothing&amp;rdquo; execution of the combined actions.  It builds on
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/06/28/ensuring-the-effects-of-a-transaction/&#34;&gt;Ensuring the Effects of a Transaction&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Ensuring the Effects of a Transaction</title>
      <link>https://programtheblockchain.com/posts/2018/06/28/ensuring-the-effects-of-a-transaction/</link>
      <pubDate>Thu, 28 Jun 2018 11:35:44 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/06/28/ensuring-the-effects-of-a-transaction/</guid>
      <description>&lt;p&gt;This post will demonstrate a simple technique for ensuring that a transaction had the desired effects.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Working with State Channels in JavaScript</title>
      <link>https://programtheblockchain.com/posts/2018/06/23/working-with-state-channels-in-javascript/</link>
      <pubDate>Sat, 23 Jun 2018 08:26:13 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/06/23/working-with-state-channels-in-javascript/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll show how to build a JavaScript front end for a two-player game based on state channels.&lt;/p&gt;

&lt;p&gt;This post is a continuation of my previous posts &amp;ldquo;&lt;a href=&#34;https://programtheblockchain.com/posts/2018/05/04/two-player-games-in-ethereum/&#34;&gt;Two-Player Games in Ethereum&lt;/a&gt;&amp;rdquo; and &amp;ldquo;&lt;a href=&#34;https://programtheblockchain.com/posts/2018/05/11/state-channels-for-two-player-games/&#34;&gt;State Channels for Two-Player Games&lt;/a&gt;.&amp;rdquo; This post assumes that you&amp;rsquo;ve read and understood those.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Supporting an Off-Chain Market Maker</title>
      <link>https://programtheblockchain.com/posts/2018/06/16/supporting-an-off-chain-market-maker/</link>
      <pubDate>Sat, 16 Jun 2018 06:33:49 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/06/16/supporting-an-off-chain-market-maker/</guid>
      <description>&lt;p&gt;This post will implement a token-trading &amp;ldquo;market maker&amp;rdquo; that will fulfill multiple signed prediction market wagers simultaneously.  It will be a modest change to the
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/06/06/supporting-off-chain-token-trading/&#34;&gt;clearinghouse contract&lt;/a&gt;
presented earlier, and it will exploit the
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/06/12/betting-tokens-in-a-prediction-market/&#34;&gt;token-based prediction market contract&lt;/a&gt;
unchanged.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Betting Tokens In A Prediction Market</title>
      <link>https://programtheblockchain.com/posts/2018/06/12/betting-tokens-in-a-prediction-market/</link>
      <pubDate>Tue, 12 Jun 2018 07:37:58 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/06/12/betting-tokens-in-a-prediction-market/</guid>
      <description>&lt;p&gt;This post will describe how to implement a prediction market where bets are for ERC20 tokens rather than ether.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Reversible Ether</title>
      <link>https://programtheblockchain.com/posts/2018/06/09/reversible-ether/</link>
      <pubDate>Sat, 09 Jun 2018 09:13:25 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/06/09/reversible-ether/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll develop an ERC20 token that acts as &amp;ldquo;reversible ether&amp;rdquo; as described by Ethereum&amp;rsquo;s creator, Vitalik Buterin:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Someone should come along and issue an ERC20 called &#34;Reversible Ether&#34; that is 1:1 backed by ether but has a DAO that can revert transfers within N days.&lt;/p&gt;
&lt;p&gt;&lt;cite class=&#34;f6 ttu tracked fs-normal&#34;&gt;&amp;ndash;Vitalik Buterin, &lt;a href=&#34;https://twitter.com/vitalikbuterin/status/987262267036184577&#34;&gt;April 2018&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Supporting Off-Chain Token Trading</title>
      <link>https://programtheblockchain.com/posts/2018/06/06/supporting-off-chain-token-trading/</link>
      <pubDate>Wed, 06 Jun 2018 07:56:25 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/06/06/supporting-off-chain-token-trading/</guid>
      <description>&lt;p&gt;This post will implement a token trading &amp;ldquo;clearinghouse&amp;rdquo; that will execute multiple signed trade offers simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Storage Patterns: Set</title>
      <link>https://programtheblockchain.com/posts/2018/06/03/storage-patterns-set/</link>
      <pubDate>Sun, 03 Jun 2018 07:14:02 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/06/03/storage-patterns-set/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll build a minimal enumerable &lt;a href=&#34;https://en.wikipedia.org/wiki/Set_(abstract_data_type)&#34;&gt;set&lt;/a&gt; in Solidity. A set stores unordered values without repetition.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Escrowing ERC20 Tokens</title>
      <link>https://programtheblockchain.com/posts/2018/05/30/escrowing-erc20-tokens/</link>
      <pubDate>Wed, 30 May 2018 08:56:35 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/30/escrowing-erc20-tokens/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-06-05&lt;/strong&gt;] &lt;em&gt;This post has been edited to introduce a &lt;code&gt;transfer&lt;/code&gt; function.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This post describes a simple contract to escrow ERC20 tokens for a period of time.  Keeping tokens (or ether) in escrow is a common pattern in smart contracts.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Wrapping Ether in an ERC20 Token</title>
      <link>https://programtheblockchain.com/posts/2018/05/26/wrapping-ether-in-an-erc20-token/</link>
      <pubDate>Sat, 26 May 2018 07:58:51 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/26/wrapping-ether-in-an-erc20-token/</guid>
      <description>&lt;p&gt;In this short post, I&amp;rsquo;ll show how ether can be &amp;ldquo;wrapped&amp;rdquo; in an ERC20-compatible token. This means ether can be used anywhere that an ERC20 token is expected.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Prediction Market Contract</title>
      <link>https://programtheblockchain.com/posts/2018/05/22/writing-a-prediction-market-contract/</link>
      <pubDate>Tue, 22 May 2018 05:33:00 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/22/writing-a-prediction-market-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a smart contract that implements a prediction market.  The contract will leverage much of the logic in my
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/05/18/using-tokens-for-parimutuel-wagers/&#34;&gt;token-based parimutuel betting contract&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Using Tokens for Parimutuel Wagers</title>
      <link>https://programtheblockchain.com/posts/2018/05/18/using-tokens-for-parimutuel-wagers/</link>
      <pubDate>Fri, 18 May 2018 05:21:04 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/18/using-tokens-for-parimutuel-wagers/</guid>
      <description>&lt;p&gt;This post describes an alternative implementation of parimutuel wagering to
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/05/08/writing-a-parimutuel-wager-contract/&#34;&gt;my original post&lt;/a&gt;. This implementation will use ERC20 tokens to represent wagers.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Changing the Supply of ERC20 Tokens</title>
      <link>https://programtheblockchain.com/posts/2018/05/16/changing-the-supply-of-erc20-tokens/</link>
      <pubDate>Wed, 16 May 2018 05:15:24 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/16/changing-the-supply-of-erc20-tokens/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-05-25&lt;/strong&gt;] &lt;em&gt;This post has been edited to introduce a &lt;code&gt;BaseERC20Token&lt;/code&gt; contract.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This short post will add dynamic control of the total supply of tokens to the previously introduced
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/30/writing-an-erc20-token-contract/&#34;&gt;simple ERC20 tokens&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>State Channels for Two-Player Games</title>
      <link>https://programtheblockchain.com/posts/2018/05/11/state-channels-for-two-player-games/</link>
      <pubDate>Fri, 11 May 2018 13:31:35 -0400</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/11/state-channels-for-two-player-games/</guid>
      <description>&lt;p&gt;This post will introduce the concept of &lt;em&gt;state channels&lt;/em&gt; in the context of a two-player game. I&amp;rsquo;ll enhance the contract from &lt;a href=&#34;https://programtheblockchain.com/posts/2018/05/04/two-player-games-in-ethereum/&#34;&gt;Two-Player Games in Ethereum&lt;/a&gt; to support making moves in the game without sending transactions. By avoiding on-chain transactions, the new game will be faster and less expensive.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Parimutuel Wager Contract</title>
      <link>https://programtheblockchain.com/posts/2018/05/08/writing-a-parimutuel-wager-contract/</link>
      <pubDate>Tue, 08 May 2018 05:37:16 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/08/writing-a-parimutuel-wager-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a smart contract that implements parimutuel betting.  The contract will accept and pay off bets on the outcome of a single proposition.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Two-Player Games in Ethereum</title>
      <link>https://programtheblockchain.com/posts/2018/05/04/two-player-games-in-ethereum/</link>
      <pubDate>Fri, 04 May 2018 09:57:46 -0400</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/04/two-player-games-in-ethereum/</guid>
      <description>&lt;p&gt;This is the first post in a series about building efficient two-player games in Ethereum. This post will demonstrate a simple, but complete, smart contract that implements a variant of &amp;ldquo;&lt;a href=&#34;https://en.wikipedia.org/wiki/Nim#The_21_game&#34;&gt;the 21 game&lt;/a&gt;.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Dominant Assurance Contract</title>
      <link>https://programtheblockchain.com/posts/2018/05/01/writing-a-dominant-assurance-contract/</link>
      <pubDate>Tue, 01 May 2018 06:15:04 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/05/01/writing-a-dominant-assurance-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a smart contract that implements a
&lt;a href=&#34;https://en.wikipedia.org/wiki/Assurance_contract#Dominant_assurance_contracts&#34;&gt;&amp;ldquo;dominant assurance contract&amp;rdquo;&lt;/a&gt;.
It assumes that you have read our previous post on vanilla
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/19/writing-a-crowdfunding-contract-a-la-kickstarter/&#34;&gt;assurance contracts&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Avoiding Integer Overflows: SafeMath Isn&#39;t Enough</title>
      <link>https://programtheblockchain.com/posts/2018/04/27/avoiding-integer-overflows-safemath-isnt-enough/</link>
      <pubDate>Fri, 27 Apr 2018 12:20:05 -0400</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/04/27/avoiding-integer-overflows-safemath-isnt-enough/</guid>
      <description>&lt;p&gt;This post describes what an integer overflow is and how to avoid them in smart contracts.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Periodic Loan Contract</title>
      <link>https://programtheblockchain.com/posts/2018/04/24/writing-a-periodic-loan-contract/</link>
      <pubDate>Tue, 24 Apr 2018 05:28:18 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/04/24/writing-a-periodic-loan-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a smart contract that will administer an ether loan while holding ERC20 tokens as collateral.  My previous post on
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/06/writing-a-collateralized-loan-contract/&#34;&gt;a collateralized loan contract&lt;/a&gt;
assumed that there would be just a single loan payment.  This post will generalize that to a more typical structure where the loan requires equal payments at regularly-spaced intervals at a fixed interest rate.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Storage Patterns: Pagination</title>
      <link>https://programtheblockchain.com/posts/2018/04/20/storage-patterns-pagination/</link>
      <pubDate>Fri, 20 Apr 2018 09:21:02 -0400</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/04/20/storage-patterns-pagination/</guid>
      <description>&lt;p&gt;This post will show how to support pagination for returning large data sets from a smart contract. It builds on concepts introduced in my post on &lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/30/storage-patterns-doubly-linked-list/&#34;&gt;doubly-linked lists&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Keep Your Code Simple</title>
      <link>https://programtheblockchain.com/posts/2018/04/17/keep-your-code-simple/</link>
      <pubDate>Tue, 17 Apr 2018 08:43:38 -0400</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/04/17/keep-your-code-simple/</guid>
      <description>&lt;p&gt;This post will explain the importance of writing &lt;em&gt;simple&lt;/em&gt; code in the context of smart contracts, where bugs can be very expensive.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Pawnshop Bazaar Contract</title>
      <link>https://programtheblockchain.com/posts/2018/04/13/writing-a-pawnshop-bazaar-contract/</link>
      <pubDate>Fri, 13 Apr 2018 05:44:23 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/04/13/writing-a-pawnshop-bazaar-contract/</guid>
      <description>&lt;p&gt;In our &lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/13/writing-an-erc20-pawnshop-contract/&#34;&gt;pawnshop&lt;/a&gt; post, we built a contract that creates loans between a lender and multiple borrowers using ERC20 tokens as collateral.&lt;/p&gt;

&lt;p&gt;This post will demonstrate a token &lt;em&gt;bazaar&lt;/em&gt; contract which creates and tracks many pawnshops on behalf of many lenders.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Capture the Ether: the Game of Smart Contract Security</title>
      <link>https://programtheblockchain.com/posts/2018/04/10/capture-the-ether-the-game-of-smart-contract-security/</link>
      <pubDate>Tue, 10 Apr 2018 09:39:49 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/04/10/capture-the-ether-the-game-of-smart-contract-security/</guid>
      <description>&lt;p&gt;Capture the Ether is a game that tests your understanding of smart contract security by challenging you to hack a series of smart contracts.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Vickrey Auction Contract</title>
      <link>https://programtheblockchain.com/posts/2018/04/03/writing-a-vickrey-auction-contract/</link>
      <pubDate>Tue, 03 Apr 2018 11:00:33 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/04/03/writing-a-vickrey-auction-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to implement a
&lt;a href=&#34;https://en.wikipedia.org/wiki/Vickrey_auction&#34;&gt;Vickrey auction&lt;/a&gt;.
The post assumes you are familiar with techniques introduced in my post on
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/27/writing-a-sealed-bid-auction-contract/&#34;&gt;sealed-bid auctions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Storage Patterns: Doubly Linked List</title>
      <link>https://programtheblockchain.com/posts/2018/03/30/storage-patterns-doubly-linked-list/</link>
      <pubDate>Fri, 30 Mar 2018 09:44:41 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/30/storage-patterns-doubly-linked-list/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll build a &lt;a href=&#34;https://en.wikipedia.org/wiki/Doubly_linked_list&#34;&gt;doubly linked list&lt;/a&gt; in Solidity. A &lt;a href=&#34;https://en.wikipedia.org/wiki/Doubly_linked_list&#34;&gt;doubly linked list&lt;/a&gt; supports efficient insertion and deletion of nodes anywhere within an ordered list. I&amp;rsquo;ll be building on concepts introduced in &lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/09/understanding-ethereum-smart-contract-storage/&#34;&gt;&amp;ldquo;Understanding Ethereum Smart Contract Storage&amp;rdquo;&lt;/a&gt; and &lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/23/storage-patterns-stacks-queues-and-deques/&#34;&gt;&amp;ldquo;Storage Patterns: Stacks, Queues, and Deques&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Sealed-Bid Auction Contract</title>
      <link>https://programtheblockchain.com/posts/2018/03/27/writing-a-sealed-bid-auction-contract/</link>
      <pubDate>Tue, 27 Mar 2018 09:32:58 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/27/writing-a-sealed-bid-auction-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to implement a
&lt;a href=&#34;https://en.wikipedia.org/wiki/First-price_sealed-bid_auction&#34;&gt;first-price sealed-bid auction&lt;/a&gt;
of ERC20 tokens.  The post assumes you are familiar with techniques introduced in our posts on
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/20/writing-a-token-auction-contract/&#34;&gt;English auctions&lt;/a&gt;
and
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/16/flipping-a-coin-in-ethereum/&#34;&gt;revealing secrets&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Storage Patterns: Stacks Queues and Deques</title>
      <link>https://programtheblockchain.com/posts/2018/03/23/storage-patterns-stacks-queues-and-deques/</link>
      <pubDate>Fri, 23 Mar 2018 07:58:57 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/23/storage-patterns-stacks-queues-and-deques/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll show how a few common data structures can be implemented in Solidity. I recommend first reading our post &amp;ldquo;&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/09/understanding-ethereum-smart-contract-storage/&#34;&gt;Understanding Ethereum Smart Contract Storage&lt;/a&gt;.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Token Auction Contract</title>
      <link>https://programtheblockchain.com/posts/2018/03/20/writing-a-token-auction-contract/</link>
      <pubDate>Tue, 20 Mar 2018 10:39:42 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/20/writing-a-token-auction-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a smart contract that will auction off ERC20 tokens to the highest bidder.  The post assumes you are familiar with techniques for how a contract deals with an ERC20 token contract, which we covered in our
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/02/02/writing-a-token-sale-contract/&#34;&gt;token sale post&lt;/a&gt;.
The post will briefly touch on some of the challenges around conducting auctions on the blockchain.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Flipping a Coin in Ethereum</title>
      <link>https://programtheblockchain.com/posts/2018/03/16/flipping-a-coin-in-ethereum/</link>
      <pubDate>Fri, 16 Mar 2018 11:09:36 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/16/flipping-a-coin-in-ethereum/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll describe how two parties can bet on a coin flip in an Ethereum smart contract by using a simple &lt;a href=&#34;https://en.wikipedia.org/wiki/Commitment_scheme&#34;&gt;commitment scheme&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing an ERC20 Pawnshop Contract</title>
      <link>https://programtheblockchain.com/posts/2018/03/13/writing-an-erc20-pawnshop-contract/</link>
      <pubDate>Tue, 13 Mar 2018 06:11:09 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/13/writing-an-erc20-pawnshop-contract/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a pawnshop-like smart contract that will lend ether to anybody willing to provide  ERC20 tokens as collateral.  The post adopts and generalizes techniques that we covered in our
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/03/06/writing-a-collateralized-loan-contract/&#34;&gt;collateralized-loan post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Understanding Ethereum Smart Contract Storage</title>
      <link>https://programtheblockchain.com/posts/2018/03/09/understanding-ethereum-smart-contract-storage/</link>
      <pubDate>Fri, 09 Mar 2018 06:45:17 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/09/understanding-ethereum-smart-contract-storage/</guid>
      <description>&lt;p&gt;Ethereum smart contracts use an uncommon storage model that often confuses new developers. In this post, I&amp;rsquo;ll describe that storage model and explain how the Solidity programming language makes use of it.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Collateralized Loan Contract</title>
      <link>https://programtheblockchain.com/posts/2018/03/06/writing-a-collateralized-loan-contract/</link>
      <pubDate>Tue, 06 Mar 2018 07:13:04 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/06/writing-a-collateralized-loan-contract/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This post will demonstrate how to write a smart contract that will administer an ether loan while holding ERC20 tokens as collateral.  The post assumes you are familiar with techniques for how a contract deals with an ERC20 token contract, which we covered in our
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/02/02/writing-a-token-sale-contract/&#34;&gt;token sale post&lt;/a&gt;.  The post introduces the technique of having a smart contract deploy a second contract to carry out future work.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Building Long-Lived Payment Channels</title>
      <link>https://programtheblockchain.com/posts/2018/03/02/building-long-lived-payment-channels/</link>
      <pubDate>Fri, 02 Mar 2018 04:56:33 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/03/02/building-long-lived-payment-channels/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-12-10&lt;/strong&gt;] &lt;em&gt;Since publishing this post, We&amp;rsquo;ve added a related
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/12/10/introduction-to-ethereum-payment-channels-video/&#34;&gt;video explanation of payment channels&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In &lt;a href=&#34;https://programtheblockchain.com/posts/2018/02/23/writing-a-simple-payment-channel/&#34;&gt;Writing a Simple Payment Channel&lt;/a&gt;, I introduced &lt;em&gt;payment channels&lt;/em&gt; as a way to reduce the number of Ethereum transactions required for repeated payments between the same two parties. This post will improve upon that post&amp;rsquo;s &lt;code&gt;SimplePaymentChannel&lt;/code&gt; contract to make it suitable for long-lived payment channels, such as might be used to pay an employee an hourly wage over the course of their career.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Token Market Contract</title>
      <link>https://programtheblockchain.com/posts/2018/02/27/writing-a-token-market-contract/</link>
      <pubDate>Tue, 27 Feb 2018 06:13:43 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/27/writing-a-token-market-contract/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This post will demonstrate how to write a smart contract that creates a token marketplace, where people can buy and sell ERC20 tokens.  The smart contract acts like
&lt;a href=&#34;https://www.ebay.com&#34;&gt;eBay&lt;/a&gt;
by enabling sellers to list tokens for sale, and then brokering sales to buyers.  This post relies on concepts introduced in our post on
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/30/writing-an-erc20-token-contract/&#34;&gt;ERC20 tokens&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Simple Payment Channel</title>
      <link>https://programtheblockchain.com/posts/2018/02/23/writing-a-simple-payment-channel/</link>
      <pubDate>Fri, 23 Feb 2018 10:28:42 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/23/writing-a-simple-payment-channel/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-12-10&lt;/strong&gt;] &lt;em&gt;Since publishing this post, We&amp;rsquo;ve added a related
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/12/10/introduction-to-ethereum-payment-channels-video/&#34;&gt;video explanation of payment channels&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this post, I&amp;rsquo;ll build a simple, but complete, implementation of a &lt;em&gt;payment channel&lt;/em&gt;. Payment channels use cryptographic signatures to make repeated transfers of ether securely, instantaneously, and without transaction fees. This post will rely heavily on the concepts and code from our post &lt;a href=&#34;https://programtheblockchain.com/posts/2018/02/17/signing-and-verifying-messages-in-ethereum/&#34;&gt;&amp;ldquo;Signing and Verifying Messages in Ethereum&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing an Estate Planning Contract</title>
      <link>https://programtheblockchain.com/posts/2018/02/20/writing-an-estate-planning-contract/</link>
      <pubDate>Tue, 20 Feb 2018 13:05:14 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/20/writing-an-estate-planning-contract/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This post will demonstrate how to write a smart contract that transfers your ether to a beneficiary after you die.  It assumes that you have read our previous post on dealing with
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/12/writing-a-contract-that-handles-time/&#34;&gt;time&lt;/a&gt;
on the blockchain.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Signing and Verifying Messages in Ethereum</title>
      <link>https://programtheblockchain.com/posts/2018/02/17/signing-and-verifying-messages-in-ethereum/</link>
      <pubDate>Sat, 17 Feb 2018 06:47:55 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/17/signing-and-verifying-messages-in-ethereum/</guid>
      <description>&lt;p&gt;Cryptographic signatures are a powerful primitive in Ethereum. Signatures are used to authorize transactions, but they&amp;rsquo;re a more general tool that&amp;rsquo;s available to smart contracts. Signatures can be used to prove to a smart contract that a certain account approved a certain message.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing A Robust Dividend Token Contract</title>
      <link>https://programtheblockchain.com/posts/2018/02/13/writing-a-robust-dividend-token-contract/</link>
      <pubDate>Tue, 13 Feb 2018 13:29:03 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/13/writing-a-robust-dividend-token-contract/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/02/07/writing-a-simple-dividend-token-contract/&#34;&gt;simple dividend token post&lt;/a&gt;
made one big simplifying assumption&amp;mdash;it assumed that there were few token units compared to the number of wei in a typical dividend deposit.  This assumption meant that the contract could ignore the fact that integer divisions could result in some wei being forever wasted.  This post will demonstrate how to write an ERC20-compliant token contract that is robust to that problem.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>End to End: Initial Coin Offering</title>
      <link>https://programtheblockchain.com/posts/2018/02/09/end-to-end-initial-coin-offering/</link>
      <pubDate>Fri, 09 Feb 2018 12:10:47 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/09/end-to-end-initial-coin-offering/</guid>
      <description>&lt;p&gt;In this post, I&amp;rsquo;ll walk through the end-to-end process of deploying a new ERC20-compatible token, a token sale contract to sell it, and a website to help users buy the token.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing A Simple Dividend Token Contract</title>
      <link>https://programtheblockchain.com/posts/2018/02/07/writing-a-simple-dividend-token-contract/</link>
      <pubDate>Wed, 07 Feb 2018 05:49:29 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/07/writing-a-simple-dividend-token-contract/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Tokens can provide rights or privileges to their owners.  One of the most natural is the right to share proportionally in an income stream.  This post will demonstrate how to write an ERC20-compliant contract that can divide ether dividends proportionally amongst token owners. This post combines ideas from our
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/30/writing-an-erc20-token-contract/&#34;&gt;ERC20 token post&lt;/a&gt;,
and our
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/05/writing-a-banking-contract/&#34;&gt;banking post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Token Sale Contract</title>
      <link>https://programtheblockchain.com/posts/2018/02/02/writing-a-token-sale-contract/</link>
      <pubDate>Fri, 02 Feb 2018 12:14:20 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/02/02/writing-a-token-sale-contract/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this post, I&amp;rsquo;ll build a simple smart contract that sells a limited supply of an Ethereum-based token for a fixed price. To understand this post, you&amp;rsquo;ll need to be familiar with &lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/30/writing-an-erc20-token-contract/&#34;&gt;ERC20 Tokens&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing an ERC20 Token Contract</title>
      <link>https://programtheblockchain.com/posts/2018/01/30/writing-an-erc20-token-contract/</link>
      <pubDate>Tue, 30 Jan 2018 13:33:39 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/30/writing-an-erc20-token-contract/</guid>
      <description>&lt;p&gt;[&lt;strong&gt;EDIT 2018-03-13&lt;/strong&gt;] &lt;em&gt;This post has been updated to use Solidity 0.4.21 event syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This post will demonstrate how to write a simple, but complete, smart contract in Solidity that implements the ERC20 token standard. It assumes that you are familiar with concepts introduced in our post,
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/26/what-is-an-ethereum-token/&#34;&gt;What is an Ethereum Token?&lt;/a&gt;,
which discussed how tokens are maintained as per-account balances and how those balances can be transferred between accounts.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>What is an Ethereum Token?</title>
      <link>https://programtheblockchain.com/posts/2018/01/26/what-is-an-ethereum-token/</link>
      <pubDate>Fri, 26 Jan 2018 09:15:05 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/26/what-is-an-ethereum-token/</guid>
      <description>&lt;p&gt;This post explains what an Ethereum &amp;ldquo;token&amp;rdquo; or &amp;ldquo;coin&amp;rdquo; is (and is not).  It will convey an intuitive understanding of tokens and describe the implementation of a very simple token in Solidity.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Logging and Watching Solidity Events</title>
      <link>https://programtheblockchain.com/posts/2018/01/24/logging-and-watching-solidity-events/</link>
      <pubDate>Wed, 24 Jan 2018 08:04:38 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/24/logging-and-watching-solidity-events/</guid>
      <description>[EDIT 2018-03-13] This post has been updated to use Solidity 0.4.21 event syntax.
Events are a way for smart contracts written in Solidity to log that something has occurred. Interested observers, notably JavaScript front ends for decentralized apps, can watch for events and react accordingly. In this post, I&amp;rsquo;ll show you how to log events from a Solidity smart contract and watch those events in JavaScript. The code in this post builds on the example from the earlier post, Building Decentralized Apps With Ethereum and JavaScript.</description>
    </item>
    
    <item>
      <title>Writing a Crowdfunding Contract (a la Kickstarter)</title>
      <link>https://programtheblockchain.com/posts/2018/01/19/writing-a-crowdfunding-contract-a-la-kickstarter/</link>
      <pubDate>Fri, 19 Jan 2018 06:11:30 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/19/writing-a-crowdfunding-contract-a-la-kickstarter/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a smart contract that controls a crowdfunding effort in the spirit of &lt;a href=&#34;https://www.kickstarter.com/&#34;&gt;Kickstarter&lt;/a&gt;.  It assumes that you have read our previous posts on
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/05/writing-a-banking-contract/&#34;&gt;banking&lt;/a&gt; and
&lt;a href=&#34;https://programtheblockchain.com/posts/2018/01/12/writing-a-contract-that-handles-time/&#34;&gt;time&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Verifying Contract Source Code</title>
      <link>https://programtheblockchain.com/posts/2018/01/16/verifying-contract-source-code/</link>
      <pubDate>Tue, 16 Jan 2018 09:16:05 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/16/verifying-contract-source-code/</guid>
      <description>&lt;p&gt;For a deployed smart contract to be trusted, its source code should be available for inspection. This post explains why source code for smart contracts should be published and how someone can verify that published source code corresponds to a given deployed smart contract.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Contract That Handles Time</title>
      <link>https://programtheblockchain.com/posts/2018/01/12/writing-a-contract-that-handles-time/</link>
      <pubDate>Fri, 12 Jan 2018 09:22:33 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/12/writing-a-contract-that-handles-time/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a simple, but complete, smart contract in Solidity that deals with time.  It assumes that you have read our previous post, &lt;a href=&#34;https://programtheblockchain.com/posts/2017/12/26/checking-the-sender-in-a-smart-contract/&#34;&gt;Checking the Sender In a Smart Contract&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>How Smart Contract Deployment Works</title>
      <link>https://programtheblockchain.com/posts/2018/01/09/how-smart-contract-deployment-works/</link>
      <pubDate>Tue, 09 Jan 2018 07:20:47 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/09/how-smart-contract-deployment-works/</guid>
      <description>[This blog post explains a little bit about how smart contract deployment works in an Ethereum network, but it is not necessary for learning Solidity programming. We write it for those of you who&amp;rsquo;d like a little deeper understanding of what is going on when a smart contracts are deployed.]
In our How Ethereum Transactions Work post, we described the essential elements of a transaction message in an Ethereum network and how they work.</description>
    </item>
    
    <item>
      <title>Writing a Banking Contract</title>
      <link>https://programtheblockchain.com/posts/2018/01/05/writing-a-banking-contract/</link>
      <pubDate>Fri, 05 Jan 2018 13:10:30 -0800</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/05/writing-a-banking-contract/</guid>
      <description>&lt;p&gt;This article will demonstrate how to write a simple, but complete, smart contract in Solidity that acts like a bank that stores ether on behalf of its clients.  The contract will allow deposits from any account, and can be trusted to allow withdrawals only by accounts that have sufficient funds to cover the requested withdrawal.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Making Smart Contracts with Public Variables</title>
      <link>https://programtheblockchain.com/posts/2018/01/02/making-smart-contracts-with-public-variables/</link>
      <pubDate>Tue, 02 Jan 2018 07:08:58 -0500</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2018/01/02/making-smart-contracts-with-public-variables/</guid>
      <description>State variables in Solidity, like functions, have a notion of visibility. By default, they are not marked as &amp;ldquo;public,&amp;rdquo; but this is a somewhat confusing concept in the context of a public blockchain, where all data can be read by anyone. In this post, I&amp;rsquo;ll give an overview of state variable visibility and explain why and how to mark a state variable as public.
Nothing is Hidden The nature of a public blockchain like Ethereum is that all data is replicated on all nodes.</description>
    </item>
    
    <item>
      <title>How Ethereum Transactions Work</title>
      <link>https://programtheblockchain.com/posts/2017/12/29/how-ethereum-transactions-work/</link>
      <pubDate>Fri, 29 Dec 2017 09:33:18 -0500</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/29/how-ethereum-transactions-work/</guid>
      <description>[This blog post explains a little bit about how transactions work in Ethereum, but it is not necessary for learning Solidity programming. We write it for those of you who&amp;rsquo;d like a little deeper understanding of what is going on when a transaction is attempted.]
Smart contracts are interesting because of the side-effects they can have&amp;mdash;including transferring ether&amp;mdash;when executing transactions. How exactly are transactions constructed and sent to the network?</description>
    </item>
    
    <item>
      <title>Checking the Sender in a Smart Contract</title>
      <link>https://programtheblockchain.com/posts/2017/12/26/checking-the-sender-in-a-smart-contract/</link>
      <pubDate>Tue, 26 Dec 2017 10:26:27 -0500</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/26/checking-the-sender-in-a-smart-contract/</guid>
      <description>&lt;p&gt;This article will demonstrate how to write a simple, but complete, smart contract in Solidity that accepts and distributes ether on behalf of the contract&amp;rsquo;s owner.  It assumes that you are comfortable with the ether-handling concepts introduced in our
&lt;a href=&#34;https://programtheblockchain.com/posts/2017/12/15/writing-a-contract-that-handles-ether/&#34;&gt;last Solidity example blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Testing and Deploying Smart Contracts with Remix</title>
      <link>https://programtheblockchain.com/posts/2017/12/19/testing-and-deploying-smart-contracts-with-remix/</link>
      <pubDate>Tue, 19 Dec 2017 07:11:31 -0500</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/19/testing-and-deploying-smart-contracts-with-remix/</guid>
      <description>&lt;p&gt;In my post &lt;a href=&#34;https://programtheblockchain.com/posts/2017/12/13/building-decentralized-apps-with-ethereum-and-javascript/&#34;&gt;Building Decentralized Apps With Ethereum and JavaScript&lt;/a&gt;, I showed how to write a front end for a smart contract that was already deployed to the Ethereum network. This post will cover how that smart contract got deployed. I&amp;rsquo;ll walk you through compiling a smart contract, doing some basic testing, and deploying it to the world.&lt;/p&gt;

&lt;p&gt;There are a number of tools available for compiling, testing, and deploying smart contracts. For this post, I&amp;rsquo;ll use &lt;a href=&#34;https://remix.ethereum.org&#34;&gt;Remix&lt;/a&gt;, which has the advantage of being entirely browser-based. This means you&amp;rsquo;ll be able to compile, deploy, and test smart contracts without installing any local tools.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Be Careful When Using the Solidity Fallback Function</title>
      <link>https://programtheblockchain.com/posts/2017/12/16/be-careful-when-using-the-solidity-fallback-function/</link>
      <pubDate>Sat, 16 Dec 2017 04:46:36 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/16/be-careful-when-using-the-solidity-fallback-function/</guid>
      <description>&lt;p&gt;This post will discuss Solidity&amp;rsquo;s anonymous &amp;ldquo;fallback function&amp;rdquo;, which is a commonly used mechanism for accepting ether transfers.  This post expands a topic briefly mentioned in the post, &lt;a href=&#34;https://programtheblockchain.com/posts/2017/12/15/writing-a-contract-that-handles-ether/&#34;&gt;Writing a Contract That Handles Ether&lt;/a&gt;.

Below, we explain what this function does and why we encourage caution when using it.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Contract That Handles Ether</title>
      <link>https://programtheblockchain.com/posts/2017/12/15/writing-a-contract-that-handles-ether/</link>
      <pubDate>Fri, 15 Dec 2017 15:13:40 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/15/writing-a-contract-that-handles-ether/</guid>
      <description>&lt;p&gt;This post will demonstrate how to write a simple, but complete, smart contract in Solidity that accepts and distributes ether.  It assumes that you have read our previous post, &lt;a href=&#34;https://programtheblockchain.com/posts/2017/12/08/writing-a-very-simple-smart-contract/&#34;&gt;Writing a Very Simple Smart Contract&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Building Decentralized Apps With Ethereum and JavaScript</title>
      <link>https://programtheblockchain.com/posts/2017/12/13/building-decentralized-apps-with-ethereum-and-javascript/</link>
      <pubDate>Wed, 13 Dec 2017 08:26:31 -0500</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/13/building-decentralized-apps-with-ethereum-and-javascript/</guid>
      <description>&lt;p&gt;For users to be able to interact with a smart contract, they need some sort of user interface. The standard means of providing this interface in Ethereum is called a &amp;ldquo;decentralized app.&amp;rdquo;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Writing a Very Simple Smart Contract</title>
      <link>https://programtheblockchain.com/posts/2017/12/08/writing-a-very-simple-smart-contract/</link>
      <pubDate>Fri, 08 Dec 2017 05:48:50 -0700</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/08/writing-a-very-simple-smart-contract/</guid>
      <description>&lt;p&gt;This article will demonstrate how to write a simple, but complete, smart contract in Solidity that maintains and updates persistent state.  The demonstration will begin with an even simpler contract, which is progressively enhanced in two steps.  Future articles will build on these ideas to construct more complicated and interesting smart contracts.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>What Is a Smart Contract?</title>
      <link>https://programtheblockchain.com/posts/2017/12/06/what-is-a-smart-contract/</link>
      <pubDate>Wed, 06 Dec 2017 08:29:53 -0500</pubDate>
      
      <guid>https://programtheblockchain.com/posts/2017/12/06/what-is-a-smart-contract/</guid>
      <description>&lt;p&gt;An Ethereum &amp;ldquo;smart contract&amp;rdquo; is a computer program that has been deployed to the Ethereum blockchain, where it will exist forever.  Deployed smart contracts represent many different capabilities:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>