Kenneth Hu
• CTO at Baypay Inc.
• I am enthusiast, not expert.
• Ethereum, Bitcoin, AR, ChatBot
• Email: Kenneth.hu@Hotmail.com
• Blockchain&Dapps meetup
• Singapore IOTA meetup
BIP : Bitcoin Improvement Proposals
• A Bitcoin Improvement Proposal (BIP) is a design
document for introducing features or information to
Bitcoin. The BIP should provide a concise technical
specification of the feature and a rationale for the
feature. This is the standard way of communicating
ideas since Bitcoin has no formal structure.
BIP Life Cycle
Types of BIPs
• 1. Standards Track BIPs – Such types of BIPs entail
making changes to the network protocol, block, or
transaction validation method. An example of this is BIP
91.
• 2. Informational BIPs – Such types of BIPs highlight the
design issues, general guidelines, and supporting
information. An example of this is BIP 32.
• 3. Process BIPs – These types of BIPs describe or propose
a change in the process. An example of this is BIP 2.
Bitcoin Wallet with BIP
Bitcoin Wallet with BIP
• BIP-32
• BIP-39
• BIP-44
BIP-0032
• This document describes hierarchical determinstic
wallets (or "HD Wallets"): wallets which can be shared
partially or entirely with different systems, each with
or without the ability to spend coins.
• https://github.com/bitcoin/bips/blob/master/
bip-0032.mediawiki
BIP-0032
BIP-0039
• This BIP describes the implementation of a
mnemonic code or mnemonic sentence -- a group of
easy to remember words -- for the generation of
deterministic wallets.
• https://github.com/bitcoin/bips/blob/master/
bip-0039.mediawiki
BIP-0039
BIP-0044
• This BIP defines a logical hierarchy for deterministic
wallets based on an algorithm described in BIP-0032
(BIP32 from now on) and purpose scheme described
in BIP-0043 (BIP43 from now on).
• https://github.com/bitcoin/bips/blob/master/
bip-0044.mediawiki
BIP-0044
• Define the following 5 levels in BIP32 path:
• Purporse : BIP44
• Coin_type: 0 (Bitcoin)、60 (Ethereum)
• Account: are numbered from index 0 in sequentially
increasing manner. This number is used as child index in
BIP32 derivation.
Brain wallet
A brain wallet is a standard wallet that
generates its address by hashing a
passphrase to create a private key and
therefore a public key and resultant
address.
Brain wallet
private key :
65be4aa2cbc47df49336225155481f20305cf49ee8
baf66edeb808bc4e7bc4c9 ,
Public key :
14TbUVUR7BbzBvjKoURTgLNcpq6EbScEdF
Wallet import format (WIF)
Wallet Import Format (WIF, also known as Wallet
Export Format) is a way of encoding a private
ECDSA key so as to make it easier to copy.
https://bitcoin.org/en/glossary/wallet-import-format
Wallet import format (WIF)
https://bitcoin.org/en/glossary/wallet-import-format
Mnemonic
A mnemonic phrase, mnemonic recovery phrase or mnemonic seed is a
list of words which store all the information needed to recover a
Bitcoin wallet. Wallet software will typically generate a mnemonic
backup phrase and instruct the user to write it down on paper. If the
user's computer breaks or their hard drive becomes corrupted, they can
download the same wallet software again and use the paper backup to
get their bitcoins back.
Anybody else who discovers the phrase can steal the bitcoins, so it
must be kept safe like jewels or cash. For example, it must not be
typed into any website.
Mnemonic phrases are an excellent way of backing up and storing
bitcoins and so they are used by almost all well-regarded wallets.
Mnemonic
Private 、Public and address
Private
Key
Public
Key
Wallet
address
Public
ledger
Bitcoin
Transaction
Every Bitcoin wallet is created based
on a cryptography algorithm, which
create asymmetric key paris: Private
and Public
Every time there is an exchange of Bitcoin
between two parities, the transaction has be
signed by the private keys
Sign-verify messages
You can verify Bitcoin signed message signature. You just have to provide
the Bitcoin address, generated signature and the message that has to be
verified.
Bitcoin WebSite
Kenneth’s bitcoin website
• Wallet
• Converter
• Wallet Info
• Transfer
• QRcode
• http://www.kennethhu.net/example/bitcoin/index.html
Framework & Package
Framework :
• NodeJS
• EJS -- Embedded JavaScript templates
Package :
• bitcore-mnemonic
• bitcore-explorers
• bitcore-lib
• express
• request
• body-parser
Website
Folder
EJS -- Embedded JavaScript
templates

EJS file
MVC (model, View and Controller)
M = model !Data JSON
V = view !Template ejs
C = controller !node.js
MVC (model, View and Controller)
MVC (model, View and Controller)
Project folder
App.js
Index.ejs
superheroes.ejs
about.ejs
Partials – head.ejs
Partials – header.ejs
EJS
How to create bitcoin wallet
3 ways to generate bitcoin wallet
• Brain wallet
• WIF wallet
• Mnemonic
Exchange Rate source
• CoinMarketCap
• https://pro.coinmarketcap.com/features
• API :
• CoinAPI.io
• CoinBase
• https://api.coinbase.com/v2/prices/spot?currency=USD
• Blockchain
• https://www.blockchain.com/stats
• API : https://api.blockchain.info/stats
Exchange Rate code
• https://api.blockchain.info/stats
Exchange Rate code
• https://api.blockchain.info/stats
Wallet Info
Wallet Info
• https://blockexplorer.com/api
Wallet Info
Wallet Info
Transfer
UXTO
UXTO (Unspent Transaction Outputs), An Unspent
Transaction Output (UTXO) that can be spent as an input in a
new transaction.
https://bitcoin.org/en/glossary/unspent-transaction-output
UXTO
UXTO (Unspent Transaction Outputs)
QR Code
Useful links
• https://www.bitaddress.org/
• https://iancoleman.io/bip39/
• https://iancoleman.io/bitcoin-key-compression/
• Check public key
• https://blockchain.info/
• https://live.blockcypher.com/
• https://blockexplorer.com/
• Faucet
• https://coinfaucet.eu/en/btc-testnet/
2019 03 18_kenneth_simplebitcoinwebsite

2019 03 18_kenneth_simplebitcoinwebsite

  • 2.
    Kenneth Hu • CTOat Baypay Inc. • I am enthusiast, not expert. • Ethereum, Bitcoin, AR, ChatBot • Email: Kenneth.hu@Hotmail.com • Blockchain&Dapps meetup • Singapore IOTA meetup
  • 3.
    BIP : BitcoinImprovement Proposals • A Bitcoin Improvement Proposal (BIP) is a design document for introducing features or information to Bitcoin. The BIP should provide a concise technical specification of the feature and a rationale for the feature. This is the standard way of communicating ideas since Bitcoin has no formal structure.
  • 4.
  • 5.
    Types of BIPs •1. Standards Track BIPs – Such types of BIPs entail making changes to the network protocol, block, or transaction validation method. An example of this is BIP 91. • 2. Informational BIPs – Such types of BIPs highlight the design issues, general guidelines, and supporting information. An example of this is BIP 32. • 3. Process BIPs – These types of BIPs describe or propose a change in the process. An example of this is BIP 2.
  • 6.
  • 7.
    Bitcoin Wallet withBIP • BIP-32 • BIP-39 • BIP-44
  • 8.
    BIP-0032 • This documentdescribes hierarchical determinstic wallets (or "HD Wallets"): wallets which can be shared partially or entirely with different systems, each with or without the ability to spend coins. • https://github.com/bitcoin/bips/blob/master/ bip-0032.mediawiki
  • 9.
  • 10.
    BIP-0039 • This BIPdescribes the implementation of a mnemonic code or mnemonic sentence -- a group of easy to remember words -- for the generation of deterministic wallets. • https://github.com/bitcoin/bips/blob/master/ bip-0039.mediawiki
  • 11.
  • 12.
    BIP-0044 • This BIPdefines a logical hierarchy for deterministic wallets based on an algorithm described in BIP-0032 (BIP32 from now on) and purpose scheme described in BIP-0043 (BIP43 from now on). • https://github.com/bitcoin/bips/blob/master/ bip-0044.mediawiki
  • 13.
    BIP-0044 • Define thefollowing 5 levels in BIP32 path: • Purporse : BIP44 • Coin_type: 0 (Bitcoin)、60 (Ethereum) • Account: are numbered from index 0 in sequentially increasing manner. This number is used as child index in BIP32 derivation.
  • 14.
    Brain wallet A brainwallet is a standard wallet that generates its address by hashing a passphrase to create a private key and therefore a public key and resultant address.
  • 15.
    Brain wallet private key: 65be4aa2cbc47df49336225155481f20305cf49ee8 baf66edeb808bc4e7bc4c9 , Public key : 14TbUVUR7BbzBvjKoURTgLNcpq6EbScEdF
  • 16.
    Wallet import format(WIF) Wallet Import Format (WIF, also known as Wallet Export Format) is a way of encoding a private ECDSA key so as to make it easier to copy. https://bitcoin.org/en/glossary/wallet-import-format
  • 17.
    Wallet import format(WIF) https://bitcoin.org/en/glossary/wallet-import-format
  • 18.
    Mnemonic A mnemonic phrase,mnemonic recovery phrase or mnemonic seed is a list of words which store all the information needed to recover a Bitcoin wallet. Wallet software will typically generate a mnemonic backup phrase and instruct the user to write it down on paper. If the user's computer breaks or their hard drive becomes corrupted, they can download the same wallet software again and use the paper backup to get their bitcoins back. Anybody else who discovers the phrase can steal the bitcoins, so it must be kept safe like jewels or cash. For example, it must not be typed into any website. Mnemonic phrases are an excellent way of backing up and storing bitcoins and so they are used by almost all well-regarded wallets.
  • 19.
  • 20.
    Private 、Public andaddress Private Key Public Key Wallet address Public ledger Bitcoin Transaction Every Bitcoin wallet is created based on a cryptography algorithm, which create asymmetric key paris: Private and Public Every time there is an exchange of Bitcoin between two parities, the transaction has be signed by the private keys
  • 21.
    Sign-verify messages You canverify Bitcoin signed message signature. You just have to provide the Bitcoin address, generated signature and the message that has to be verified.
  • 22.
  • 23.
    Kenneth’s bitcoin website •Wallet • Converter • Wallet Info • Transfer • QRcode • http://www.kennethhu.net/example/bitcoin/index.html
  • 24.
    Framework & Package Framework: • NodeJS • EJS -- Embedded JavaScript templates Package : • bitcore-mnemonic • bitcore-explorers • bitcore-lib • express • request • body-parser
  • 25.
  • 26.
  • 27.
    EJS -- EmbeddedJavaScript templates

  • 28.
  • 29.
    MVC (model, Viewand Controller) M = model !Data JSON V = view !Template ejs C = controller !node.js
  • 30.
    MVC (model, Viewand Controller)
  • 31.
    MVC (model, Viewand Controller)
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
    How to createbitcoin wallet
  • 41.
    3 ways togenerate bitcoin wallet • Brain wallet • WIF wallet • Mnemonic
  • 43.
    Exchange Rate source •CoinMarketCap • https://pro.coinmarketcap.com/features • API : • CoinAPI.io • CoinBase • https://api.coinbase.com/v2/prices/spot?currency=USD • Blockchain • https://www.blockchain.com/stats • API : https://api.blockchain.info/stats
  • 44.
    Exchange Rate code •https://api.blockchain.info/stats
  • 45.
    Exchange Rate code •https://api.blockchain.info/stats
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
    UXTO UXTO (Unspent TransactionOutputs), An Unspent Transaction Output (UTXO) that can be spent as an input in a new transaction. https://bitcoin.org/en/glossary/unspent-transaction-output
  • 52.
  • 53.
  • 54.
    Useful links • https://www.bitaddress.org/ •https://iancoleman.io/bip39/ • https://iancoleman.io/bitcoin-key-compression/ • Check public key • https://blockchain.info/ • https://live.blockcypher.com/ • https://blockexplorer.com/ • Faucet • https://coinfaucet.eu/en/btc-testnet/