Skip to content

Commit 116895c

Browse files
authored
Update README.md
1 parent e576827 commit 116895c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
My implementation of a blockchain in C++ I created for fun :)
33
Follows some Bitcoin design choices including using SHA-256 to hash headers and blocks, merkle trees, and mining WoS.
44

5+
Includes a Command line interface that allows you to view blockchains at different indices and add new blocks.
6+
57
### BlockChain Class
68
Every time you want to add a block to the blockchain, you will need to provide it:
79

10+
#### Private Variables:
11+
- blockchain(vector<unique_ptr<Block> >): vector of smart pointers to Block objects
12+
813
`int index, string prevHash, string hash, string nonce, vector<string> &merkle`
914
- index: index of the block
1015
- prevHash: hash of the previous block
@@ -13,18 +18,19 @@ Every time you want to add a block to the blockchain, you will need to provide i
1318

1419
### Mining
1520
(I made it very simple because I didn't want to spend much processing power)
21+
1622
first two characters of the hash must be 0
17-
e.g. `003d9dc40cad6b414d45555e4b83045cfde74bcee6b09fb42536ca2500087fd9` works
23+
- e.g. `003d9dc40cad6b414d45555e4b83045cfde74bcee6b09fb42536ca2500087fd9` works
1824

1925

2026
### Block
2127
Hash header: index + prevHash + merkleRoot(data) + nonce
2228

23-
##### Private Variables:
29+
#### Private Variables:
2430
- index
2531
- Data: vector of strings
2632
- previousHash
2733
- blockHash
2834
- nonce
2935

30-
Peer-to-Peer coming soon!
36+
### Peer-to-Peer coming soon!

0 commit comments

Comments
 (0)