• Stars
    star
    5,139
  • Rank 8,036 (Top 0.2 %)
  • Language Pug
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A web-based demonstration of blockchain concepts.

Blockchain Demo

A web-based demonstration of blockchain concepts.

Blockchain 101 - Demo

This is a very basic visual introduction to the concepts behind a blockchain. We introduce the idea of an immutable ledger using an interactive web demo that is available here:

http://andersbrownworth.com/blockchain/

Setup

Get the code:

git clone https://github.com/anders94/blockchain-demo.git

Install dependencies:

cd blockchain-demo
npm install

Run the server:

npm start

OR

./bin/www

#For windows: if the above command didn't work, use this (make sure you have Node.js installed in your system):

node ./bin/www      

Point a web browser at the demo:

http://localhost:3000

Setup using Docker

Get the code:

git clone https://github.com/anders94/blockchain-demo.git

Run the Docker setup:

cd blockchain-demo
docker-compose up -d

Point a web browser at the demo:

http://localhost:3000

Optional Configuration

You can adjust the "number of zeros" required by the demo by editing the first two lines of public/javascripts/blockchain.js.

Because there are 16 possible characters in a hex value, each time you increment the difficulty by one you make the puzzle 16 times harder. In my testing, a difficulty of 6 requires a maximumNonce well over 500,000,000.

If you adjust the difficulty above 4, blocks will show up as not mined because the demo data assumes 4 zeros for a signed block. For example, on the http://localhost:3000/block page with a difficulty of 6, the first nonce that works is 8719932 yielding a hash of 000000669445c22167511857d8f3b822b331c3342f25dfdcb326e35c1a7aa267. This gets out of hand fairly quickly though. Here's some time estimates at the various thresholds.

digits nonce time estimate
4 500,000 15 minutes
5 8,000,000 4 hours
6 128,000,000 3 days
7 2,048,000,000 a month
8 32,768,000,000 2 years
9 524,288,000,000 30 years
10 8,388,608,000,000 481 years
11 134,217,728,000,000 7,690 years
12 2,147,483,648,000,000 123,036 years
13 34,359,738,368,000,000 1,968,581 years
14 549,755,813,888,000,000 31,497,291 years
15 8,796,093,022,208,000,000 503,956,662 years

In the production bitcoin blockchain, block 458,091 has the hash digest 00000000000000000000011246f099d94f91628d71c9d75ad2f9a06e2beb7e92. That's 21 zeros in a row! That one block would take this software approximately 8,454,989,768,407,765 years to mine.

Public Private Key Demo

The 2nd part of the 101 session:

Send Thanks

Bitcoin gratefully accepted: 1K3NvcuZzVTueHW1qhkG2Cm3viRkh2EXJp

More Repositories

1

public-private-key-demo

Demonstrates public / private key pairs and signing in a blockchain context. This is part 2 of my Blockchain 101 video explainer.
JavaScript
546
star
2

raspberry-pi-home-automation

A node.js based home automation system based around the Raspberry Pi.
JavaScript
167
star
3

bitcoin-2-of-3-multisig

Walkthrough of a multisig create / receive / spend on the command line.
JavaScript
52
star
4

disruptor

A distributed real-time computation platform in node.js.
JavaScript
29
star
5

https-authorized-clients

Force HTTPS clients to present a valid certificate
JavaScript
27
star
6

order-matching-engine

An exchange order matching engine implemented within PostgreSQL stored procedures.
JavaScript
27
star
7

loan-manager

Loan management bot supporting Bitfinex and Poloniex
JavaScript
23
star
8

pub-sub-map

Publish and subscribe to markers on a Google Map with real-time updating.
CSS
15
star
9

bitcoin-supply.com

We're tracking provably lost bitcoin at https://bitcoin-supply.com
JavaScript
10
star
10

sql-course

A beginner class on learning SQL
7
star
11

framebuffer-digits

Command line utility to display graphical digits on the frame buffer.
C
7
star
12

geoipdns

Location-Aware Authoritative DNS Server
C
6
star
13

iphone-sms-webapp

View and navigate SMS data from iPhone backups.
HTML
5
star
14

wif-decorruptor

A bitcoin WIF private key decorruptor.
JavaScript
4
star
15

mitcoin

mitcoin - a bitcoin fork
C++
3
star
16

eth-vanity-gen

A vanity Ethereum address generator.
JavaScript
3
star
17

with.drawal.info

ETH withdrawal monitoring website
JavaScript
2
star
18

generate-multisig-addresses

Node.js code to generate a large number of multisig bitcoin addresses.
JavaScript
2
star
19

LiftoffIn.com

Web based countdown timer. That's it - nothing else.
JavaScript
1
star
20

express-bootstrap-template

An express project with bootstrap to use as a template.
JavaScript
1
star
21

usdc-cool-js

The USDC stablecoin supply scanner
TypeScript
1
star
22

usdc-aum

JavaScript
1
star
23

api-docs

JavaScript
1
star
24

sbs

Old code from Stony Brook School services
Java
1
star
25

count-of-monte-cristo

The Project Gutenberg eBook of The Count of Monte Cristo, by Alexandre Dumas, père
1
star
26

picture-archiver

HTML
1
star
27

boxque

A web chat application eventually supporting file transfer via WebRTC
JavaScript
1
star
28

bitcoin-mempool-tracker

JavaScript
1
star
29

qfunc

Node.js queue of async/await functions that execute sequentially.
JavaScript
1
star
30

blockchains

Python
1
star