Module2_Lect3_202324
Module2_Lect3_202324
Blockchain
and DLT
(BLCH)
ITC801
Subject In-charge
Dr. Joanne Gomes
Professor Dept. of Information Technology SFIT
Room No. 317
email: [email protected]
Module 2
Lecture 3
Bitcoin
Topics:
• Bitcoin Types of Wallets and Wallet Technologies
Revision- Bitcoin Concepts: keys
• Bitcoin is based on public key cryptography
• Ownership of bitcoin is established through digital
keys, bitcoin addresses, and digital signatures.
• Traditional bitcoin addresses begin with the number “1” and are derived from
the public key, which is derived from the private key.
• Although anyone can send bitcoin to a “1” address, that bitcoin can only be
spent by presenting the private key signature and public key hash.
Wallets are containers for
private keys and not coins
• Cons: • Cons:
– prone to hacking and cyber attacks. – not as convenient for frequent
– not as secure as cold wallets. transactions.
– private keys are stored on a third-party – can be lost or damaged, making it
server, which can be a security risk. difficult to access your Bitcoin.
– more expensive than hot wallets.
Desktop Bitcoin Wallet
• A desktop wallet is a computer program that runs on your PC.
• It stores and manages your private keys in the same way that any other wallet
would but usually has more features than other types of wallets.
• Ex.: Electrum, Armory etc.
Mobile Bitcoin Wallet
• Mobile wallets are simply bitcoin wallets designed for a mobile device. This means
they can easily scan QR codes, are easy to navigate with a touch screen, and are
accessible while on the move.
• Examples
• OPOLO crypto wallet:
– Best bitcoin wallet for Android users.
• Mycelium crypto wallet:
– Best bitcoin wallet for mobile users.
Web Bitcoin Wallets
• Web wallets (online) store your private keys on a server, which is always online and
controlled by a third party, such as a cryptocurrency exchange. .
• You can gain access to your coins and make transactions through any device that
lets you connect to the internet.
Example:
• Guarda Bitcoin Wallet
Hardware Bitcoin Wallet
• Trezor is a hardware wallet that will help you store your bitcoins (offline storage).
• You will be able to easily plug Trezor into your computer or a smartphone, then it
would provide you with a pin code which will be generated randomly. This will
ensure that the device is safe and secure.
Paper Wallet
• A paper wallet is a printed piece of paper that has your private key written on it.
• Paper wallets are best for users who rarely plan on interacting with their owned
cryptocurrencies.
• Paper wallets are a very effective way to create backups or offline bitcoin storage,
also known as “cold storage.”
• Paper wallets in themselves are not secure.
• As a backup mechanism, a paper wallet can provide security against the loss of key
due to a computer mishap such as a hard drive failure, theft, or accidental deletion.
• As a “cold storage” mechanism, if the paper wallet keys are generated offline and
never stored on a computer system, they are much more secure against hackers,
key-loggers, and other online computer threats.
• Though paper wallets are completely disconnected from both the internet and
blockchain, the keys on them do indeed represent keys on the blockchain which are
still active and can be used to locate cryptocurrency.
Encrypted paper wallet
Paper Wallet
• Disadvantages of Paper Wallet:
– If the paper gets wet or is burnt in a fire, you will not be able
to read your private key (or seed phrase) and the
representative crypto will be lost forever. A water/fireproof
safe is necessary for the secure storage of a paper wallet.
– Paper wallets also make the process of transacting with
blockchain networks tedious.
• Paper wallets come in many shapes, sizes, and designs,
but they are just a key and an address printed on paper.
1424C2F4bC9JidNjjTUZCbUx 5J3mBbAH58CpQ3Y5RNJpUKPE62S
v6Sa1Mt62x Q5tfcvU2JpbnkeyhfsYB1Jcn
Wallet Technologies
Wallet Technology
Ease of use
Increased security
Advantages
Backup and recovery
Compatibility
Nondeterministic (Random) Wallets
• First bitcoin client wallets were called a Type-0 Type-0 Non-deterministic (random) Wallet
nondeterministic wallet which was simply
collections of randomly generated private keys
• Mnemonic code words make it easier for users to back up wallets as they are easy
to read and correctly transcribe, as compared to a random sequence of numbers.
• Mnemonic codes are defined in Bitcoin Improvement Proposal 39 (BIP0039). It is a
standard that proposed utilizing a mnemonic phrase - a group of easy to remember
words.
BIP0039 Standard
• BIP0039 standard consists of two main parts:
1. How to generate the mnemonic.
2. How to transform the generated mnemonic into a
binary seed.
1. Generating a mnemonic:
• Creation of a mnemonic code and seed:
– Create a random sequence of 128 to 256 bits.
– Create a checksum of the random sequence by
taking the first few bits of its SHA256 hash.
– Add checksum to the end of random sequence.
– Divide sequence into 12 sections of 11 bits, use
them to index a dictionary of 2048 (211)
predefined words.
– Produce 12 to 24 words representing the
mnemonic code.
Mnemonic codes
• Mnemonic codes: entropy and word length
• Bitcoin addresses that begin with the number “3” are pay-to-script hash (P2SH) addresses,
sometimes called as multi-signature or multi-sig addresses.
• They designate the beneficiary of a bitcoin transaction as the hash of a script, instead of the
owner of a public key.
• It was introduced by Bitcoin Improvement Proposal 16, or BIP0016 and is being widely
adopted because it provides the opportunity to add functionality to the address itself.
• Unlike transactions that “send” funds to traditional “1” bitcoin addresses, also known as pay-
to-public-key-hash (P2PKH), funds sent to “3” addresses require something more than the
presentation of one public key hash and one private key signature as proof of ownership.
• The requirements are designated at the time the address is created, within the script, and all
inputs to this address will be burdened with the same requirements.
Multi-signature addresses and P2SH
• A pay-to-script hash address is created from a transaction script, which defines who can
spend a transaction output.
• Encoding a pay-to-script hash address involves using the same double-hash function as
used during creation of a bitcoin address, only applied on the script instead of the public key:
• The most common implementation of the P2SH function is the multi-signature address script.
• Here, the underlying script requires more than one signature to prove ownership and
therefore spend funds.
• The bitcoin multi-signature feature is designed to require M signatures (also known as the
“threshold”) from a total of N keys, known as an M-of-N multi-sig, where M is equal to or less
than N.
Multi-signature addresses Example
• For example, Bob the coffee shop owner could use a multi-signature address
requiring 1-of-2 signatures from a key belonging to him and a key belonging to his
spouse, ensuring either of them could sign to spend a transaction output locked to
this address.
• The web designer paid by Bob to create a website, might have a 2-of-3 multi-
signature address for his business that ensures that no funds can be spent unless at
least two of the business partners sign a transaction.
Vanity Addresses
• Vanity addresses are valid bitcoin addresses that contain human-readable
messages.
• For example, 1LoveBPzzD72PUXLzCkYAtGFYmK5vYNR33 is a valid address that
contains the letters forming the word “Love” as the first four Base-58 letters.
• Vanity addresses require generating and testing billions of candidate private keys,
until one derives a bitcoin address with the desired pattern.
• Although there are some optimizations in the vanity generation algorithm, the
process essentially involves picking a private key at random, deriving the public key,
deriving the bitcoin address, and checking to see if it matches the desired vanity
pattern, repeating billions of times until a match is found.
• Once a vanity address matching the desired pattern is found, the private key from
which it was derived can be used by the owner to spend bitcoins in exactly the same
way as any other address.
Vanity address security
• Vanity addresses are no less or more secure than any other address.
• They depend on the same Elliptic Curve Cryptography (ECC) and Secure Hash
Algorithm (SHA) as any other address.
• You can not easily find the private key of an address starting with a vanity pattern
than you can any other address.