Creating your own Bitcoin

Anthony Wood
6 min readApr 21, 2021

It is surprisingly straightforward to create your own cryptocurrency. Anyone with programming experience can do it.

In true tradition of crypto I need to stress that this post isn’t financial/legal advice. I may have got something wrong, it may also be out of date. Hopefully you’ll find this useful though as part of your research.

So let’s make a start, but before we get into the nuts and bolts of it let me start by giving an, almost certainly inaccurate …

History of Crypto

Bitcoin (2009) was the first, seminal, crypto currency. It doesn’t ‘do’ anything, it just exists, you can transfer it, and if you want to get involved in maintaining the blockchain, you can get rewarded with a few newly minted Bitcoin (BTC).

The bitcoin blockchain just records transactions between bitcoin accounts, and records who has been granted new bitcoin for maintaining the blockchain (aka mining.) The data content in a blockchain does not have to be restricted to just a list of transactions though.

Ethereum changed the rule book in 2015 by allowing users to store code in the blockchain as well as storing a list of transactions. Users can run these code segments to create new crypto ‘tokens’ (new coins) and these can be transferred between user accounts too in addition to Ethereum’s native Ether (ETH) coin.

Ethereum developed the ERC-20 standard for creating new tokens. We are going to create an ERC-20 token which acts basically the same as BTC.

The value of ETH has risen and demand for the Ethereum network has also risen to the point where recording simple transactions on the Ethereum blockchain has become very expensive (e.g. $100).

Binance is the largest cyrpto exchange and is very ambitious. Binance saw an opportunity to address the high Ethereum network fees by copying the open source Ethereum code and creating their own network, the Binance Smart Chain (BSC). This uses the Binance coin (BNB) to pay for entries in the BSC block chain and it is very much quicker and cheaper to use than the Ethereum network.

The code that is stored on the blockchain (smart contracts) is usually compiled from Solidity language source code. Because BSC is a clone of the Ethereum network, the same Solidity code can be compiled to run on both networks.

BSC has published the BEP-20 standard for tokens that is the same as the ERC-20 token standard.

We are actually going to create a BEP-20 token (honestly this time!)

To develop and debug smart contract code, like the code we will write, test networks exist which run the same code as the main networks (Ethereum or BSC), but they are free to use.

We are going to create our token on the BSC test network.

Crypto Accounts

Crypto coins/tokens are stored on a network in an ‘account’. An account consists of just two things:

  1. A private or secret key
  2. A public address

The private or secret key is:

  • A long number
  • It may actually be a sequence of seemingly random words used to generate that long number.
  • Anyone and everyone who knows this number (or words) owns the crypto, and they can transfer/sell it.

The public address.

  • Another long number,
  • which is generated by software from the secret key.
  • People can transfer money into the account by sending it its public address.
  • Anyone who knows the public address may typically look at your crypto balance and transactions, but does not own your crypto.

Entries in the blockchain record currencies are stored in this account on this network.

MetaMask Wallet Overview

A crypto wallet is some software which gives you easy access to your crypto accounts.

Typically you need a different wallet (i.e. completely different software) to access accounts connected to each different blockchain.

You need to be very careful when installing and using a wallet. If you install it from a compromised location, or onto a compromised computer you can lose your crypto instantly.

MetaMask is a well respected wallet that provides users access to their accounts on the Ethereum blockchain. Note that this is not only the ‘native’ ETH coins, but also ERC-20 tokens.

Because Binance Smart Chain (BSC) is almost an exact clone of the Ethereal blockchain, MetaMask users can also use MetaMask to access BSC’s native BNB coins, and BEP-20 tokens.

In fact, MetaMask users do not even need to create a new account to use BSC, they can hold and transact BNB and BEP-20 tokens in the same account as they use to hold ETH and ERC-20 tokens. Transactions are made to the same public address and the same private or secret key is used to control ownership of the account.

However, when MetaMask is accessing ETH and ERC-20 tokens MetaMask must be connected to the Ethereum blockchain. Similarly, when MetaMask is accessing BNB and BEP-20 tokens, MetaMask must be connected to the BSC.

MetaMask wallet users add the accounts they control to MetaMask by entering the account’s private or secret key into MetaMask. This only needs to be done during the setup of MetaMask. After that anyone who has access to MetaMask can access all of the accounts that have been loaded into MetaMask. To provide security

Users need to create and use a password to access MetaMask. This MetaMask password protects users who have added their accounts to the MetaMask wallet. When the password is entered the user has access to the account or accounts loaded into MetaMask without having to enter the private or secret key again.

Note that the MetaMask password is unique to an installation of MetaMask. In theory multiple MetaMask users on multiple computers could all access the same Ethereum account.

Create a MetaMask Wallet

It is critical that when you install MetaMask you install it from the correct location. If you install a hacked version of MetaMask or any other wallet, you will lose all your crypto. Do not click on links from blog posts like this to install it. Instead, look for multiple sources all giving you the same, presumably correct web address (URL) to go to to install MetaMask. Then do a Google/other search engine search for ‘metamask’ and check that it is sending you to to the address that matches the location from multiple sources.

  • The correct place to download MetaMask from is ‘metamask.io’.
  • Now go and check this matches the URL given by other reputable sources
  • Google ‘MetaMask’, check the URL matchs the URL on this page and on other sites.

MetaMask is a browser plugin, so when you are at ‘metamask.io’

  • hit the ‘download’ button
  • select the browser you are using
  • hit install
  • For Chrome this takes you to the ‘chrome web store’
  • Again make really sure you are at the correct URL (somewhere in google)
  • Then add the plugin to chrome.

I used the ‘Every Bit Helps’ YouTube tutorial to help install and ‘Create a Wallet’. So watch and follow that. No need to get too involved in buying and transferring ETH though.

Write down your ‘secret backup phrase’ (this is your private or secret key) and store it safely. Do not screenshot it.

How you store your secret keys is very tricky and is a major barrier to crypto adoption. The problem of crypto ownership is known as ‘custody’. You have to make sure you:

a) Don’t lose them, &

b) Don’t let anyone else ever see them.

It is very tricky to achieve both of these things!.

Connect MetaMask to Binance Smart Chain testnet

MetaMask connects to the Ethereum network by default. We want to connect to the Binance Smart Chain (BSC) Testnet.

Follow these instructions for how to connect MetaMask to BSC. Make sure you enter the details for the Testnet (not the Mainnet)

Add some ‘pretend’ BNB to your wallet using the BSC testnet faucet https://testnet.binance.org/faucet-smart. It’s basically a tap to give BNB to any wallet. Copy your account’s public address from MetaMask (It will be something like ‘0xc6ea00714460272a73240bc179a707917274ea92’).

Check in MetaMask that your account has now been credited with ‘pretend’ BNB on the testnet.

Create your BEP-20 token

We will follow this video: https://www.youtube.com/watch?v=Q_wK6N9GtS8

This takes us step by step creating the Solidity code for our token; loading it into remix; connecting remix to MetaMask to create the tokens. Then using the block explorer to track the transactions.

Code and links are here:

https://github.com/ChippendaleMupp/Wednesday

--

--