Using Ethereum Wallets (part 1 of 2)

Pavlos Polianidis
Token Lounge
Published in
6 min readJun 29, 2018

Introduction

Token Lounge utilises the power of smart contract to secure the funds of each participant in the crowd sale pool. The benefits of that approach are numerous and are outlined in a previous article.

In this article we will explain the basic concepts of communicating with smart contracts outside the realms of the blockchain they operate in. Token Lounge smart contracts are written in the Solidity Language and are hosted on the public Ethereum blockchain. Of course, this low level implementation details should not be of any concern to the investors. The novelty of Token Lounge is the ease of use through web-based user interface (DApp) that allows end users to communicate their actions to the smart contracts on the Ethereum blockchain.

These are new concepts and somewhat it resembles the learning curve people had to go through during the rise of the the Eeb in the late 90s and early 2000s. In this blog post we will demonstrate the basic concepts of this communication protocol and try to make analogies with the way the Web works.

Today the majority of people understand the process of visiting a url address through a specific piece of software called browser. It is a very natural and intuitive action to open the browser of your preference and type the url http://amazon.co.uk for example, and navigate through the user interface that appears when the page is loaded. We also know that any purchase we make on that web site is saved on some kind of persistent storage that is maintained by the IT infrastructure of Amazon. To make this slightly technical, it is a common knowledge that the storage is called a database and the “thing” that provides the page is called server.

Ethereum Transactions

At a very a high level, the blockchain operates within the same principles. We still open a browser and navigate to the destination using a url path. We also do have some server thats loads the DApp via the http (or https) protocol. The main difference is the location where the actual business logic is run. Unlike Web application that make use of a centralised servers to carry on all the tasks, a DApp utilises the JSON-RPC protocol to communicate with the decentralised peer-to-peer nodes. Essentially, the actual business logic spans across several computers around the world instead of silos maintained by various corporations.

Now that we know the basics of DApps, let’s briefly explain the concept of a transaction within the realms of the Ethereum blockchain. A transaction is a data structure, at a lower level, that is digitally signed and transmitted to the peer-to-peer network for processing. Below you can see a an example of a transaction data structure.

{
nonce: '0x00',
gasPrice: '0x09184e72a000',
gasLimit: '0x2710',
to: ' 0x0000000000000000000000000000000000000000',
value: '0x00',
data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057'
}

You can view an example of a real transaction here.

We don’t need to go into details and explain each of the above attributes. What is important for the purpose of this article is the data field. In short, this is a ABI encoded piece of information that is interpreted in a unique way. Most of the time, it describes the method within the smart contract that the transaction is supposed to trigger. Imagine a use case where we want to transfer a particular amount of ERC20 tokens to a specific address. The ERC20 specification suggests that this should happen via a transfer method with the following signature

transfer(address to, uint256 value)

The data field is a specific encoding of the above information. You can find more details about this process here.

Wallets

The knowledge of the aforementioned technical details is not vital for someone who wants to use the Token Lounge pool. However, we believe that people in the future will find it natural and intuitive, similarly to how they know the different protocols on the Web today.

The abstract description of Ethereum transactions is a very good introduction to a specific a piece of software that is called Ethereum wallet. The majority of people would appreciate the existence of wallets for the simple reason that wallets abstract all the implementation details we discussed above. So now when someone mentions the word Ethereum wallet you should know the purpose of existence of such tools.

In Token Lounge wallets are very important. In this part we will describe MetaMask, which is a wallet that comes in the form of a browser extension.

Installing Metamask

Below are the steps you need to follow to Install MetaMask in your browser.

Step 1

Click here to open the Chrome extension page.

Step 2

Click on the Add to Chrome button

Installing Chrome extension

Step 3

Select the correct network.

Select the Ethereum Network

In the above screenshot we can see the various Ethereum networks MetaMask can connect to. Make sure you select the Main Ethereum Network. This is the live peer-to-peer Ethereum network. The alternative options are there for testing and development purposes; so you can ignore them.

Step 4

Read the MetaMask terms and condition and click agree if you’re happy.

MetaMask Terms and Conditions

Step 5

Create a new wallet or use an existing one.

Create new wallet

At this point you have two options. You can either create a new wallet or you can re-create an existing one using a passphrase.

If you’ve already in a procession of an HD wallet that uses the the following derivation path

m/44'/60'/0'/0/{account_index}

Then you can click on the Import Existing DEN and enter the mnemonic passphrase.

Re-creating a waller using a mnemonic passphrase

But let’s assume this is the first time you create a wallet. In that case, enter a password and click on the create button.

This will create a new waller for you.

MetaMask main acocunt

That’s pretty much all you need to know about MetaMask. In the following lines we will illustrate how you can use MetaMask to sign and send transactions via the Token Lounge user interface.

Send Transaction

One of the main action an investor would perform is to send ETH to the pool. By now you’re are aware of what that might mean in technical terms. Sending a contribution is essentially a transaction that needs to be put together, signed and delivered to the Ethereum network.

Token Lounge takes care of all the heave lifting. In combination with MetaMask, a user can simply enter the amount of ETH she want to contribute and click on the Contribute button.

Sending a contribution to a pool

In the above figure we can see a dummy pool, where users can enter the contribution amount. Upon clicking contribute, the following MetaMask pop up window will appear asking you to sign the transaction.

Sign Ethereum Transaction

By clicking Submit, you can sign and transmit the transaction to the Toke Lounge pool smart contract that lives on the Ethereum blockchain. That is all the knowledge and effort required by the investor to participate in an investment pool.

Conclusion

In this part we briefly touched upon some technical parts of the Ethereum blockchain. More specifically, we described the way an external account can communicate with a smart contract. We outlined some low level implementation details and continued with the importance of wallets. Finally we demonstrated how users can install the MetaMask wallet and use it in the Token Lounge DApp to send contributions to a pool. In the next part, we will show MyEtherWallet, an alternative Ethereum wallet.

--

--

Pavlos Polianidis
Token Lounge

Interested in blockchain technology varying from low-level cryptographic structures, chain implementation detail, and authoring of Smart Contract