Cryptocurrency primer

 

Kaunas Blockchain Meetup

What is a cryptocurrency?

Cryptocurrency is a ledger stored in many computers in a way that everybody agrees on its contents and changes to it.

So I can edit it and give myself more money?

Fortunately, no.

 

These ledgers are secured by a branch of math called cryptography.

 

from Greek κρυπτός kryptós, "hidden, secret"; and γράφειν graphein, "to write"

How does it work?

The very basic (and inaccurate) process is:

 

  • We have numbers from 0 to N (a very large number, say 18,446,744,073,709,551,615).
  • Some of these numbers are lucky. There is a formula to determine which.
  • You randomly guess a number. If you get lucky, you write it into the ledger and everybody agrees that X crypto coins now belong to you. No one else can use that number again.
  • You can then send those coins to someone else.

So it's not backed by anything?

Yes and no.

 

It is backed by:

  1. The amount of work put into the system.
  2. The collective belief that these coins are worth something.

OK then.

 

What prevents me from spending other peoples coins?

Cryptography

More specifically - public key cryptography.

 

In a public key encryption system, any person can encrypt a message using the receiver's public key. That encrypted message can only be decrypted with the receiver's private key.

Public key cryptography

For example in Bitcoin, your address is your public key.

And a bitcoin wallet is just a pair of public and private key.

 

Bitcoin network only confirms transactions that are signed with a private key for the address which is the source of the transaction.

 

In other words - if you put your private key on the internet - you're broke. 

So how do I store my wallet?

There are a couple of ways.

In a PC, online, unencrypted

  • You just have a wallet on your working PC and run it just like MS Word.

In a PC, online, unencrypted

Pros

  • It's super easy and convenient!

Cons

  • ...to get your money stolen.
  • PCs (esp. Windows) are prone to viruses, trojans, targeted attacks.
  • If someone gets your private key, your wallet is as good as gone.

In a PC, online, encrypted

  • Same idea, but your wallet is encrypted with a password.

In a PC, online, encrypted

Pros

  • It's quite easy and convenient.
  • If someone gets your wallet file they have to crack the password.

Cons

  • Your wallet is as safe as your password. People tend to make shitty (easy to crack) passwords.
  • If your PC is infected, your funds can be stolen right after you enter your password.
  • You might forget the password. Say bye to your funds.

In a smartphone

You just run the wallet as an app on your phone.

In a smartphone

Pros

  • Probably safer than Windows.

Cons

  • Can be lost.
  • Need wallet software to exist.
  • Phones can still be hacked.
  • Always online.

In a hardware wallet

  • Buy a device that will keep your cryptos safe for you.

In a hardware wallet

Pros

  • It's quite easy and convenient.
  • Allows you to have different pins for different wallets. Prevents gun-in-the-head robberies.

Cons

  • You have to trust your wallet.
  • They cost extra money.
  • You need to keep your recovery phrase safe.

In a PC, airgapped, encrypted

  • Your private keys reside in a persistent security-tailored Linux USB stick (bitkey, tails).
  • Only run it with HDD, printers, network disconnected (cold PC).
  • You have a watching wallet on your PC with internet (hot PC).
  • Make your transactions on hot PC.
  • Use a secure USB stick to transfer the unsigned transaction.
  • Sign your transactions on cold PC.
  • Use a secure USB stick to transfer the signed transaction back.
  • Transmit it using hot PC.

In a PC, airgapped, encrypted

Pros

  • Very safe.
  • Can reuse existing hardware.

Cons

  • Not so convenient.
  • Not all cryptocurrencies support it.
  • Hardware can fail, so make (encrypted!) backups in other USB sticks and/or paper.
  • You can forget your password.
  • Even they can be hacked.

https://thehackernews.com/2016/02/hacking-air-gapped-computer.html

With basics out of the way...

...lets look at couple of cryptos.

Bitcoin

  • First cryptocurrency ever.
  • 10 minute block time. 1MB block size.
  • Wallet software I use: Electrum
  • Transactions work on auction model. You bid a price for your TX to be executed, miners (usually) execute highest paying TXs first.

Electrum

  • Light wallet.
  • Windows/OS X/Linux

Sending funds

On hot PC

On cold PC

On hot PC

Fee estimation

Bitcoin Cash

  • Forked from bitcoin at August 2017.
  • 10 minute block time. 8MB block size.
  • Wallet software I use: Electron Cash.
  • Electron Cash is a fork of Electrum and looks and acts the same.

Ethereum

  • A decentralized computer + cryptocurrency.
  • Can run programs (execution is paid for with ether).
  • Sending money is running a program (with a fixed cost).
  • If you send to smart contract - you never know how much will it cost.
  • Allows you to create your own tokens easily (ERC20).
  • Wallet software I use: MyEtherWallet.

MyEtherWallet

  • Browser-based light wallet.
  • Can be run offline (portable).
  • Browser-based light wallet.
  • Can be run offline (portable).

Monero

  • Privacy oriented cryptocurrency.
  • When receiving funds you have no idea who sent them.
  • Can set a payment id.
  • Can use offline/do offline transactions.
  • Mineable on CPU!
  • Wallet software I use: Monero Wallet (full) / moneroJu (android, light).

Cardano (ADA)

  • Very new cryptocurrency - aims to be a scalable smart contract platform with optional privacy/transparency.
  • Very risky bet.
  • Daedalus wallet (needs internet connection, full wallet, only runs on Windows & OS X).

Questions?

Made with Slides.com