Developing our first Ethereum app (DApp)

And the trials and tribulations thereof


As amazing as that was, the real killer app that bitcoin ushered in was the “Blockchain”. Smart folks quickly realized that an immutable, distributed, fault tolerant database that couldn’t be revised without leaving a clear audit trail opened the door to some fantastic opportunities.

Ethereum was designed to take better advantage of this powerful new database than Bitcoin had. Instead of simply recording transactions, the designers of Ethereum made a virtual machine and storage mechanism resulting in a “turing complete” machine, that was simple enough to suit fast peer to peer validation and confirmation of new transactions.

Introduction to the Project

How can we, in just a couple weeks, build a useful app on top of Ethereum?

After considering some amazing ideas we decided on a small project to provide a way for content publishers to accept micro-payments in order to unlock access to content.

The idea is straightforward; a smart contract that accepts a small payment of ether (or it could be expanded to other considerations of value; from bitcoin, to other currencies, or even more creative exchanges), and when the payment is confirmed the contract automatically releases the funds to the seller, and access to the content to the buyer. We called it TinyPay.

Thumbnail sketch of TinyPay

  1. Sign up on our web app with the sellers domain name.
  2. Ask the seller to register a DNS record with a token we provide.
  3. Send an event from the contract once the domain is configured to trigger our “oracle” to perform a DNS check for the token.
  4. The oracle periodically checks the DNS record, and once the domain has been verified the oracle sends a follow up transaction to the contract, confirming that the domain is legitimate.
  5. Once the seller is recognized, they place our javascript code on their site and configure it to display our payment button at the appropriate time
  6. Consumers of the sellers content see the prompt to make a micropayment, and if they choose to buy access to the content, then they click the payment button.
  7. A secure payment window pops up (currently using browser plugin MetaMask), prompting the user to confirm a small micro transaction of ether to the contract, from their configured Ethereum wallet.
  8. As soon as the payment is approved, the seller provides access to the content to the buyer. Funds are transferred quickly and irrevocably in seconds.
  9. A very small transaction fee is sent to the holder of the contract, and payment is released to the seller from the contract on behalf of the buyer.

The Architecture


Other high level languages you can use are Serpent (similar to Python), and LLL (Lisp Like Language, but closer to assembly). Serpent compiles down to LLL and direct use of LLL seems to be deprecated. In reality Solidity is quickly becoming the de-facto standard for writing Ethereum contracts.


Web app client (for third party sites)

When a buyer clicks our “buy now” button the web app client triggers the transaction process.

Web app sign up

Ethereum node

Consensus and transactions in general are a byproduct of the mining process that propagates the Ethereum blockchain. In Bitcoin, for example, the incentive for miners to expend resources on mining is that they can earn Bitcoin for each block they mine. Ethereum is similar, but there are additional incentives for miners; each transaction includes a (usually very small) fee that goes to the miners who process the transactions.

When building distributed apps, all your middleware and front end code can be written essentially as you normally would. To connect to the “database” back end, there are language bindings for most of the popular languages these days. (Go, .NET, node.js, Java, Python, Ruby, etc.) One thing to keep in mind is that Ethereum is under active development, and the client libraries are in various stages of completion.


Must Win would love to help develop your next “DApp”. If you’re looking for help understanding or utilizing block chain tech, reach out to and reference this post.

John Weldon writes back-end code for various projects and has experience in a wide range of technologies and programming languages.

World Class Engineers and Designers Helping You Ship Lovable Web and Mobile Technology.

World Class Engineers and Designers Helping You Ship Lovable Web and Mobile Technology.