1080 lines
73 KiB
HTML
1080 lines
73 KiB
HTML
<p>Mining Digital Gold one Block at a Time?! • Don’t Expect to Get
|
||
Insanely Rich (Quick) • Tulips :tulip::tulip::tulip: (like Blockchains)
|
||
are Great and Gorgeous (and will Endure)</p>
|
||
<div class="sourceCode" id="cb1"><pre
|
||
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>b0 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.first</span>(</span>
|
||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="kw">{</span> <span class="wa">from: </span><span class="st">"Dutchgrown"</span>, <span class="wa">to: </span><span class="st">"Vincent"</span>, <span class="wa">what: </span><span class="st">"Tulip Bloemendaal Sunset"</span>, <span class="wa">qty: </span><span class="dv">10</span> <span class="kw">}</span>,</span>
|
||
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> <span class="kw">{</span> <span class="wa">from: </span><span class="st">"Keukenhof"</span>, <span class="wa">to: </span><span class="st">"Anne"</span>, <span class="wa">what: </span><span class="st">"Tulip Semper Augustus"</span>, <span class="wa">qty: </span><span class="dv">7</span> <span class="kw">}</span> )</span>
|
||
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a>b1 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.next</span>( b0,</span>
|
||
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">{</span> <span class="wa">from: </span><span class="st">"Flowers"</span>, <span class="wa">to: </span><span class="st">"Ruben"</span>, <span class="wa">what: </span><span class="st">"Tulip Admiral van Eijck"</span>, <span class="wa">qty: </span><span class="dv">5</span> <span class="kw">}</span>,</span>
|
||
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> <span class="kw">{</span> <span class="wa">from: </span><span class="st">"Vicent"</span>, <span class="wa">to: </span><span class="st">"Anne"</span>, <span class="wa">what: </span><span class="st">"Tulip Bloemendaal Sunset"</span>, <span class="wa">qty: </span><span class="dv">3</span> <span class="kw">}</span>,</span>
|
||
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> <span class="kw">{</span> <span class="wa">from: </span><span class="st">"Anne"</span>, <span class="wa">to: </span><span class="st">"Julia"</span>, <span class="wa">what: </span><span class="st">"Tulip Semper Augustus"</span>, <span class="wa">qty: </span><span class="dv">1</span> <span class="kw">}</span>,</span>
|
||
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a> <span class="kw">{</span> <span class="wa">from: </span><span class="st">"Julia"</span>, <span class="wa">to: </span><span class="st">"Luuk"</span>, <span class="wa">what: </span><span class="st">"Tulip Semper Augustus"</span>, <span class="wa">qty: </span><span class="dv">1</span> <span class="kw">}</span> )</span>
|
||
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="kw">...</span></span></code></pre></div>
|
||
<p>(Source: <a
|
||
href="blockchain.rb/blockchain_with_transactions.rb"><code>blockchain_with_transactions.rb</code></a>)</p>
|
||
<h1 id="awesome-blockchains">Awesome Blockchains</h1>
|
||
<p>A collection about awesome blockchains - open distributed databases
|
||
w/ crypto hashes incl. git ;-). Blockchains are the new tulips
|
||
:tulip::tulip::tulip:.</p>
|
||
<p>Contents:</p>
|
||
<ul>
|
||
<li><a href="#frequently-asked-questions-faqs--answers">Frequently Asked
|
||
Questions (F.A.Q.s) & Answers</a></li>
|
||
<li><a
|
||
href="#do-it-yourself-diy---build-your-own-blockchain">Do-It-Yourself
|
||
(DIY) - Build Your Own Blockchain</a>
|
||
<ul>
|
||
<li><a href="#python">Python</a> • <a href="#ruby">Ruby</a> • <a
|
||
href="#javascript">JavaScript</a> • <a href="#java">Java</a> • <a
|
||
href="#go">Go</a></li>
|
||
</ul></li>
|
||
<li><a href="#blockchain-articles">Blockchain Articles</a></li>
|
||
<li><a href="#blockchain-books">Blockchain Books</a></li>
|
||
<li><a href="#blockchain-lite-crypto-hash-libraries">Blockchain (Lite)
|
||
Crypto Hash Libraries</a></li>
|
||
<li><a
|
||
href="#git-git-git---the-stupid-content-tracker-with-crypto-hashes">Git,
|
||
Git, Git - The Stupid Content Tracker with Crypto Hashes</a></li>
|
||
<li><a href="#classic-tulip-mania">Classic Tulip Mania</a></li>
|
||
<li><a href="#awesome-awesomeness">Awesome Awesomeness</a></li>
|
||
</ul>
|
||
<h2 id="whats-news">What’s News?</h2>
|
||
<p>For blockchain books, see the new <a
|
||
href="https://openblockchains.github.io/crypto-books/"><strong>Best of
|
||
Crypto Books page »</strong></a></p>
|
||
<h3 id="the-open-blockchains-book-of-the-year-2020-award-goes-to">The
|
||
Open Blockchains Book of the Year 2020 Award Goes To…</h3>
|
||
<p><img src="i/libra-shrugged.png" /> <a
|
||
href="https://davidgerard.co.uk/blockchain/libra/"><strong>Libra
|
||
Shrugged: How Facebook Tried to Take Over the Money</strong></a> by
|
||
David Gerard, November 2020, 182 Pages – <em>Introduction: Taking over
|
||
the money ++ A user’s guide to Libra ++ The genesis of Libra: Beller’s
|
||
blockchain ++ To launch a Libra: Let’s start a crypto ++ Bitcoin: why
|
||
Libra is like this ++ The Libra White Papers ++ Banking the unbanked ++
|
||
The Libra Reserve plan and economic stability ++ Libra, privacy and your
|
||
digital identity ++ The regulators recoil in horror ++ David Marcus
|
||
before the US House and Senate ++ July to September 2019: Libra runs the
|
||
gauntlet ++ October 2019: Libra’s bad month ++ Mark Zuckerberg before
|
||
the US House ++ November 2019: The comedown ++ Central bank digital
|
||
currencies ++ Epilogue: Libra 2.0: not dead yet ++ Appendix: 2010–2013:
|
||
The rise and fall of Facebook Credits</em></p>
|
||
<p>For more about Diem (formerly Libra), see the <a
|
||
href="https://github.com/openblockchains/awesome-diem">Awesome Diem
|
||
(formerly Libra) and Move page »</a></p>
|
||
<hr />
|
||
<p>For crypto quotes, see the new <a
|
||
href="https://github.com/openblockchains/crypto-quotes"><strong>100+
|
||
Best of Crypto Quotes - I HODL, you HODL, we HODL! - BREAKING: BITCOIN
|
||
JUST BROKE $22 000! page »</strong></a></p>
|
||
<h3
|
||
id="the-best-crypto-quote-oracle-saying-of-the-year-2020-award-goes-to">The
|
||
Best Crypto Quote “Oracle Saying” of the Year 2020 Award Goes To…</h3>
|
||
<blockquote>
|
||
<p>SEC Investor Education: - Don’t understand an investment? - Don’t
|
||
invest in it.</p>
|
||
</blockquote>
|
||
<p>Yes, but what if there’s only 21 million of it?</p>
|
||
<p>- Trolly McTrollface</p>
|
||
<h2 id="frequently-asked-questions-f.a.q.s-answers">Frequently Asked
|
||
Questions (F.A.Q.s) & Answers</h2>
|
||
<p><strong>Q: What’s a Blockchain?</strong></p>
|
||
<p>A: A blockchain is a distributed database with a list (that is,
|
||
chain) of records (that is, blocks) linked and secured by digital
|
||
fingerprints (that is, cryptho hashes). Example from <a
|
||
href="blockchain.rb/blockchain.rb"><code>blockchain.rb</code></a>:</p>
|
||
<pre><code>[#<Block:0x1eed2a0
|
||
@timestamp = 1637-09-15 20:52:38,
|
||
@data = "Genesis",
|
||
@previous_hash = "0000000000000000000000000000000000000000000000000000000000000000",
|
||
@hash = "edbd4e11e69bc399a9ccd8faaea44fb27410fe8e3023bb9462450a0a9c4caa1b">,
|
||
#<Block:0x1eec9a0
|
||
@timestamp = 1637-09-15 21:02:38,
|
||
@data = "Transaction Data...",
|
||
@previous_hash = "edbd4e11e69bc399a9ccd8faaea44fb27410fe8e3023bb9462450a0a9c4caa1b",
|
||
@hash = "eb8ecbf6d5870763ae246e37539d82e37052cb32f88bb8c59971f9978e437743">,
|
||
#<Block:0x1eec838
|
||
@timestamp = 1637-09-15 21:12:38,
|
||
@data = "Transaction Data......",
|
||
@previous_hash = "eb8ecbf6d5870763ae246e37539d82e37052cb32f88bb8c59971f9978e437743",
|
||
@hash = "be50017ee4bbcb33844b3dc2b7c4e476d46569b5df5762d14ceba9355f0a85f4">,
|
||
...</code></pre>
|
||
<p><img src="i/blockchain-jesus.png" /></p>
|
||
<p><strong>Q: What’s a Hash? What’s a (One-Way) Crypto(graphic) Hash
|
||
Digest Checksum</strong>?</p>
|
||
<p>A: A hash
|
||
e.g. <code>eb8ecbf6d5870763ae246e37539d82e37052cb32f88bb8c59971f9978e437743</code>
|
||
is a small digest checksum calculated with a one-way crypto(graphic)
|
||
hash digest checksum function e.g. SHA256 (Secure Hash Algorithm 256
|
||
Bits) from the data. Example from <a
|
||
href="blockchain.rb/blockchain.rb"><code>blockchain.rb</code></a>:</p>
|
||
<div class="sourceCode" id="cb3"><pre
|
||
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="cf">def</span> calc_hash</span>
|
||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> sha <span class="kw">=</span> <span class="dt">Digest</span><span class="kw">::</span><span class="dt">SHA256</span><span class="at">.new</span></span>
|
||
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> sha<span class="at">.update</span>( <span class="ot">@timestamp</span><span class="at">.to_s</span> <span class="kw">+</span> <span class="ot">@previous_hash</span> <span class="kw">+</span> <span class="ot">@data</span> )</span>
|
||
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> sha<span class="at">.hexdigest</span> <span class="co">## returns "eb8ecbf6d5870763ae246e37539d82e37052cb32f88bb8c59971f9978e437743"</span></span>
|
||
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="cf">end</span></span></code></pre></div>
|
||
<p>A blockchain uses</p>
|
||
<ul>
|
||
<li>the block timestamp (e.g. <code>1637-09-15 20:52:38</code>) and</li>
|
||
<li>the hash from the previous block
|
||
(e.g. <code>edbd4e11e69bc399a9ccd8faaea44fb27410fe8e3023bb9462450a0a9c4caa1b</code>)
|
||
and finally</li>
|
||
<li>the block data (e.g. <code>Transaction Data...</code>)</li>
|
||
</ul>
|
||
<p>to calculate the new hash digest checksum, that is, the hash
|
||
e.g. <code>be50017ee4bbcb33844b3dc2b7c4e476d46569b5df5762d14ceba9355f0a85f4</code>.</p>
|
||
<p><strong>Q: What’s a Merkle Tree?</strong></p>
|
||
<p>A: A Merkle tree is a hash tree named after Ralph Merkle who patented
|
||
the concept in 1979 (the patent expired in 2002). A hash tree is a
|
||
generalization of hash lists or hash chains where every leaf node (in
|
||
the tree) is labelled with a data block and every non-leaf node (in the
|
||
tree) is labelled with the crypto(graphic) hash of the labels of its
|
||
child nodes. For more see the <a
|
||
href="https://en.wikipedia.org/wiki/Merkle_tree">Merkle tree</a>
|
||
Wikipedia Article.</p>
|
||
<p>Note: By adding crypto(graphic) hash functions you can “merkelize”
|
||
any data structure.</p>
|
||
<p><strong>Q: What’s a Merkelized DAG (Directed Acyclic
|
||
Graph)?</strong></p>
|
||
<p>A: It’s a blockchain secured by crypto(graphic) hashes that uses a
|
||
directed acyclic graph data structure (instead of linear “classic”
|
||
linked list).</p>
|
||
<p>Note: Git uses merkelized dag (directed acyclic graph)s for its
|
||
blockchains.</p>
|
||
<p><strong>Q: Is the Git Repo a Blockchain?</strong></p>
|
||
<p>A: Yes, every branch in the git repo is a blockchain. The “classic”
|
||
Satoshi-blockchain is like a git repo with a single master branch
|
||
(only).</p>
|
||
<h2 id="do-it-yourself-diy---build-your-own-blockchain">Do-It-Yourself
|
||
(DIY) - Build Your Own Blockchain</h2>
|
||
<p><img src="i/fake-dilbert-blockchain.png" /></p>
|
||
<p><a href="#python">Python</a> • <a href="#ruby">Ruby</a> • <a
|
||
href="#javascript">JavaScript</a> • <a href="#java">Java</a> • <a
|
||
href="#go">Go</a></p>
|
||
<h3 id="python">Python</h3>
|
||
<p><strong>Let’s Build the Tiniest Blockchain in Python Series</strong>
|
||
by Gerald Nash</p>
|
||
<ul>
|
||
<li><a
|
||
href="https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b"><strong>Let’s
|
||
Build the Tiniest Blockchain In Less Than 50 Lines of Python (Part
|
||
1)</strong></a>, July 2016</li>
|
||
<li><a
|
||
href="https://medium.com/crypto-currently/lets-make-the-tiniest-blockchain-bigger-ac360a328f4d"><strong>Let’s
|
||
Make the Tiniest Blockchain Bigger With More Lines of Python (Part
|
||
2)</strong></a>, July 2016</li>
|
||
</ul>
|
||
<!-- break -->
|
||
<p><a
|
||
href="http://ecomunsing.com/build-your-own-blockchain"><strong>Build
|
||
Your Own Blockchain: A Python Tutorial</strong></a> by Eric Munsing,
|
||
March 2017, <a
|
||
href="https://github.com/emunsing/tutorials/blob/master/BuildYourOwnBlockchain.ipynb">(Source)</a></p>
|
||
<p><a
|
||
href="https://hackernoon.com/learn-blockchains-by-building-one-117428612f46"><strong>Learn
|
||
Blockchains by Building One (in Python)</strong></a> by Daniel van
|
||
Flymen, September 2017, <a
|
||
href="https://github.com/dvf/blockchain">(Source)</a> – The fastest way
|
||
to learn how Blockchains work is to build one</p>
|
||
<p><strong>Build Your Own Blockchain (in Python 3) Series</strong> by
|
||
Jack Schultz, <a
|
||
href="https://github.com/jackschultz/jbc">(Source)</a></p>
|
||
<ul>
|
||
<li><a
|
||
href="https://bigishdata.com/2017/10/17/write-your-own-blockchain-part-1-creating-storing-syncing-displaying-mining-and-proving-work/"><strong>Part
|
||
1: Creating, Storing, Syncing, Displaying, Mining, and Proving
|
||
Work</strong></a>, October 2017</li>
|
||
<li><a
|
||
href="https://bigishdata.com/2017/10/27/build-your-own-blockchain-part-2-syncing-chains-from-different-nodes/"><strong>Part
|
||
2: Syncing Chains From Different Nodes</strong></a>, October 2017</li>
|
||
<li><a
|
||
href="https://bigishdata.com/2017/11/02/build-your-own-blockchain-part-3-writing-nodes-that-mine/"><strong>Part
|
||
3: Writing Nodes that Mine and Talk</strong></a>, November 2017</li>
|
||
</ul>
|
||
<!-- break -->
|
||
<p><a
|
||
href="http://adilmoujahid.com/posts/2018/03/intro-blockchain-bitcoin-python/"><strong>A
|
||
Practical Introduction to Blockchain with Python</strong></a> by Adil
|
||
Moujahid, March 2018, <a
|
||
href="https://github.com/adilmoujahid/blockchain-python-tutorial">(Source)</a></p>
|
||
<h3 id="ruby">Ruby</h3>
|
||
<p><a
|
||
href="http://www.akitaonrails.com/2017/11/01/how-does-bitcoin-force-consensus-among-byzantine-generals"><strong>How
|
||
Does Bitcoin Force Consensus Among Byzantine Generals?</strong></a> by
|
||
Fabio Akita, November 2017</p>
|
||
<p><a
|
||
href="https://planetruby.github.io/calendar/advent2017/01-blockchain-lite"><strong>blockchain-lite
|
||
- Build your own blockchains with crypto hashes; revolutionize the world
|
||
with blockchains, blockchains, blockchains one block at a
|
||
time!</strong></a> by Gerald Bauer, Ruby Advent Calendar 2017 / Day 1,
|
||
December 2017</p>
|
||
<p><a
|
||
href="https://planetruby.github.io/calendar/advent2017/19-merkletree.html"><strong>merkletree
|
||
library - Build Your Own Crypto Hash Trees; Grow Your Own Money on
|
||
Trees</strong></a> by Gerald Bauer, Ruby Advent Calendar 2017 / Day 19,
|
||
December 2017</p>
|
||
<p><a
|
||
href="https://planetruby.github.io/calendar/advent2017/24-centralbank.html"><strong>centralbank
|
||
command line tool (and library) - Print Your Own Money / Cryptocurrency;
|
||
Run Your Own Federated Central Bank Nodes on the Blockchain Peer-to-Peer
|
||
over HTTP</strong></a> by Gerald Bauer, Ruby Advent Calendar 2017 / Day
|
||
24, December 2017</p>
|
||
<p><a
|
||
href="https://antoinefink.com/building-a-blockchain-and-cryptocurrency-in-ruby"><strong>A
|
||
guide to building a blockchain & cryptocurrency from
|
||
scratch</strong></a> <a
|
||
href="https://github.com/antoinefink/melon">(Source)</a> by Antoine
|
||
Fink, April 2021</p>
|
||
<h3 id="crystal">Crystal</h3>
|
||
<p><a
|
||
href="https://medium.com/@bradford_hamilton/write-your-own-blockchain-and-pow-algorithm-using-crystal-d53d5d9d0c52"><strong>Write
|
||
your own blockchain and Proof-of-Work (PoW) algorithm using
|
||
Crystal</strong></a> by Bradford Lamson-Scribner, May 2018, <a
|
||
href="https://github.com/bradford-hamilton/crystal-blockchain">(Source)</a></p>
|
||
<h3 id="javascript">JavaScript</h3>
|
||
<p><a
|
||
href="https://www.savjee.be/2017/07/Writing-tiny-blockchain-in-JavaScript/"><strong>Writing
|
||
a Tiny Blockchain in JavaScript</strong></a> by Xavier Decuyper, July
|
||
2017</p>
|
||
<p><a
|
||
href="http://www.darrenbeck.co.uk/blockchain/nodejs/nodejscrypto/"><strong>Node.js
|
||
Blockchain Imlementation: BrewChain: Chain+WebSockets+HTTP
|
||
Server</strong></a> by Darren Beck, November 2017, <a
|
||
href="https://github.com/dbbddb/BrewChain">(Source)</a> – Protecting the
|
||
tea making ledger from unscrupulous colleagues</p>
|
||
<p><a href="https://github.com/nambrot/blockchain-in-js"><strong>Build
|
||
your own Blockchain in Javascript/Visualization of
|
||
Blockchains</strong></a> by Nam Chu Hoai, January 2018</p>
|
||
<h3 id="typescript">TypeScript</h3>
|
||
<p><a href="https://lhartikk.github.io"><strong>Naivecoin: a tutorial
|
||
for building a cryptocurrency</strong></a> by Lauri Hartikka, <a
|
||
href="https://github.com/lhartikk/naivecoin">(Source)</a></p>
|
||
<h3 id="java">Java</h3>
|
||
<p><a
|
||
href="https://medium.com/programmers-blockchain/create-simple-blockchain-java-tutorial-from-scratch-6eeed3cb03fa"><strong>Creating
|
||
Your First Blockchain with Java, Part 1</strong></a> by Kass, December
|
||
2017, <a
|
||
href="https://github.com/CryptoKass/NoobChain-Tutorial-Part-1">(Source)</a></p>
|
||
<h3 id="kotlin">Kotlin</h3>
|
||
<p><a
|
||
href="https://medium.com/@vasilyf/lets-implement-a-cryptocurrency-in-kotlin-part-1-blockchain-8704069f8580"><strong>Let’s
|
||
implement a cryptocurrency in Kotlin</strong></a> by Vasily Fomin, July
|
||
2018, <a href="https://github.com/VasilyFomin/kCoin">(Source)</a></p>
|
||
<h3 id="sql">SQL</h3>
|
||
<p><a
|
||
href="https://medium.com/@benjaminsky/blockchain-by-example-in-sql-server-8376b410128"><strong>Blockchain
|
||
by Example in SQL Server</strong></a> by Benjamin Campbell, December
|
||
2017, <a
|
||
href="https://github.com/benjaminsky/BlockchainMessenger">(Source)</a></p>
|
||
<h3 id="rust">Rust</h3>
|
||
<p><strong>Building Blockchain in Rust Series</strong> by Jacob Lindahl,
|
||
GeekLaunch, <a
|
||
href="https://github.com/GeekLaunch/blockchain-rust">(Source)</a>, <a
|
||
href="https://github.com/GeekLaunch/slides">(Slide Decks in PDF)</a> -
|
||
<a
|
||
href="https://medium.com/geeklaunch/blockchain-in-rust-01-blocks-hashing-4192f2265d3d"><strong>Part
|
||
1: Blocks and Hashing</strong></a>, January 2019 - <a
|
||
href="https://medium.com/geeklaunch/blockchain-in-rust-02-mining-companion-guide-9106b7a7696d"><strong>Part
|
||
2: Mining</strong></a>, January 2019 - <a
|
||
href="https://medium.com/geeklaunch/blockchain-in-rust-03-chains-checks-companion-guide-2714e1a76654"><strong>Part
|
||
3: Chains and Checks</strong></a>, January 2019</p>
|
||
<h3 id="go">Go</h3>
|
||
<p><strong>Building Blockchain in Go Series</strong> by Ivan Kuznetsov,
|
||
<a href="https://github.com/Jeiwan/blockchain_go">(Source)</a></p>
|
||
<ul>
|
||
<li><a
|
||
href="https://jeiwan.cc/posts/building-blockchain-in-go-part-1/"><strong>Part
|
||
1: Basic Prototype</strong></a>, August 2017</li>
|
||
<li><a
|
||
href="https://jeiwan.cc/posts/building-blockchain-in-go-part-2/"><strong>Part
|
||
2: Proof-of-Work</strong></a>, August 2017</li>
|
||
<li><a
|
||
href="https://jeiwan.cc/posts/building-blockchain-in-go-part-3/"><strong>Part
|
||
3: Persistence and CLI</strong></a>, August 2017</li>
|
||
<li><a
|
||
href="https://jeiwan.cc/posts/building-blockchain-in-go-part-4/"><strong>Part
|
||
4: Transactions 1</strong></a>, September 2017</li>
|
||
<li><a
|
||
href="https://jeiwan.cc/posts/building-blockchain-in-go-part-5/"><strong>Part
|
||
5: Addresses</strong></a>, September 2017</li>
|
||
<li><a
|
||
href="https://jeiwan.cc/posts/building-blockchain-in-go-part-6/"><strong>Part
|
||
6: Transactions 2</strong></a>, September 2017</li>
|
||
<li><a
|
||
href="https://jeiwan.cc/posts/building-blockchain-in-go-part-7/"><strong>Part
|
||
7: Network</strong></a>, October 2017</li>
|
||
</ul>
|
||
<!-- break -->
|
||
<p>Blockchain Series in Go by by Coral Health <a
|
||
href="https://github.com/mycoralhealth/blockchain-tutorial">(Source)</a></p>
|
||
<ul>
|
||
<li><a
|
||
href="https://medium.com/@mycoralhealth/code-your-own-blockchain-in-less-than-200-lines-of-go-e296282bcffc"><strong>Code
|
||
your own blockchain in less than 200 lines of Go!</strong></a> by Coral
|
||
Health, January 2018</li>
|
||
<li><a
|
||
href="https://medium.com/@mycoralhealth/part-2-networking-code-your-own-blockchain-in-less-than-200-lines-of-go-17fe1dad46e1"><strong>Part
|
||
2: Networking — Code your own blockchain in less than 200 lines of
|
||
Go!</strong></a> by Coral Health, February 2018</li>
|
||
<li><a
|
||
href="https://medium.com/@mycoralhealth/code-your-own-blockchain-mining-algorithm-in-go-82c6a71aba1f"><strong>Code
|
||
your own blockchain mining algorithm in Go!</strong></a> by Coral
|
||
Health, March 2018</li>
|
||
</ul>
|
||
<!--
|
||
it's more about bitcoin (and not about blockchain really)
|
||
### C#
|
||
|
||
[**Programming The Blockchain in C#**](https://programmingblockchain.gitbooks.io/programmingblockchain/)
|
||
-->
|
||
<h3 id="talk-notes">Talk Notes</h3>
|
||
<ul>
|
||
<li><a
|
||
href="https://github.com/geraldb/talks/blob/master/blockchain.md"><strong>Blockchain!
|
||
Blockchain! Blockchain! - Build Your Own Blockchains in JavaScript from
|
||
Zero (Scratch)</strong></a> by Gerald Bauer, Vienna.js, September
|
||
2017</li>
|
||
<li><a
|
||
href="https://github.com/geraldb/talks/blob/master/blockchain_ruby.md"><strong>Blockchain!
|
||
Blockchain! Blockchain! - Build Your Own Blockchains in Ruby from Zero
|
||
(Scratch)</strong></a> by Gerald Bauer, Vienna.rb, Dezember 2017</li>
|
||
<li><a
|
||
href="https://github.com/geraldb/talks/blob/master/hyperledger.md"><strong>Blockchain
|
||
vs (Hyper) Ledger – Inside (Hyper) Ledger Lite - Add Transactions One
|
||
Block at a Time and Balance the Accounts (Books)</strong></a> by Gerald
|
||
Bauer, Hyperledger Vienna, March 2018</li>
|
||
<li><a
|
||
href="https://github.com/geraldb/talks/blob/master/blockchain_go.md"><strong>Blockchain!
|
||
Blockchain! Blockchain! - Build Your Own Blockchains in Go from Zero
|
||
(Scratch)</strong></a> by Gerald Bauer, Vienna.go, April 2018</li>
|
||
</ul>
|
||
<h3 id="more">More</h3>
|
||
<p>See <a
|
||
href="https://github.com/danistefanovic/build-your-own-x#build-your-own-blockchain--cryptocurrency"><strong>Build
|
||
your own Blockchain / Cryptocurrency</strong></a> @ Build your own
|
||
(insert technology here)</p>
|
||
<h3 id="samples">Samples</h3>
|
||
<h4 id="blockchain-from-scratch---ruby-version">Blockchain from Scratch
|
||
- Ruby Version</h4>
|
||
<div class="sourceCode" id="cb4"><pre
|
||
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="cf">class</span> <span class="dt">Block</span></span>
|
||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ot">attr_reader</span> <span class="wa">:timestamp</span></span>
|
||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ot">attr_reader</span> <span class="wa">:data</span></span>
|
||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="ot">attr_reader</span> <span class="wa">:previous_hash</span></span>
|
||
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> <span class="ot">attr_reader</span> <span class="wa">:hash</span></span>
|
||
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> <span class="cf">def</span> initialize(data, previous_hash)</span>
|
||
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> <span class="ot">@timestamp</span> <span class="kw">=</span> <span class="dt">Time</span><span class="at">.now</span></span>
|
||
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> <span class="ot">@data</span> <span class="kw">=</span> data</span>
|
||
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a> <span class="ot">@previous_hash</span> <span class="kw">=</span> previous_hash</span>
|
||
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a> <span class="ot">@hash</span> <span class="kw">=</span> calc_hash</span>
|
||
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a> <span class="cf">end</span></span>
|
||
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">def</span> <span class="dv">self</span><span class="at">.first</span>( data<span class="kw">=</span><span class="st">"Genesis"</span> ) <span class="co"># create genesis (big bang! first) block</span></span>
|
||
<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a> <span class="co">## note: uses all zero for previous_hash ("0")</span></span>
|
||
<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a> <span class="dt">Block</span><span class="at">.new</span>( data, <span class="st">"0000000000000000000000000000000000000000000000000000000000000000"</span> )</span>
|
||
<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a> <span class="cf">end</span></span>
|
||
<span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a> <span class="cf">def</span> <span class="dv">self</span><span class="at">.next</span>( previous, data<span class="kw">=</span><span class="st">"Transaction Data..."</span> )</span>
|
||
<span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a> <span class="dt">Block</span><span class="at">.new</span>( data, previous<span class="at">.hash</span> )</span>
|
||
<span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a> <span class="cf">end</span></span>
|
||
<span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-24"><a href="#cb4-24" aria-hidden="true" tabindex="-1"></a><span class="at">private</span></span>
|
||
<span id="cb4-25"><a href="#cb4-25" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-26"><a href="#cb4-26" aria-hidden="true" tabindex="-1"></a> <span class="cf">def</span> calc_hash</span>
|
||
<span id="cb4-27"><a href="#cb4-27" aria-hidden="true" tabindex="-1"></a> sha <span class="kw">=</span> <span class="dt">Digest</span><span class="kw">::</span><span class="dt">SHA256</span><span class="at">.new</span></span>
|
||
<span id="cb4-28"><a href="#cb4-28" aria-hidden="true" tabindex="-1"></a> sha<span class="at">.update</span>( <span class="ot">@timestamp</span><span class="at">.to_s</span> <span class="kw">+</span> <span class="ot">@previous_hash</span> <span class="kw">+</span> <span class="ot">@data</span> )</span>
|
||
<span id="cb4-29"><a href="#cb4-29" aria-hidden="true" tabindex="-1"></a> sha<span class="at">.hexdigest</span></span>
|
||
<span id="cb4-30"><a href="#cb4-30" aria-hidden="true" tabindex="-1"></a> <span class="cf">end</span></span>
|
||
<span id="cb4-31"><a href="#cb4-31" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-32"><a href="#cb4-32" aria-hidden="true" tabindex="-1"></a><span class="cf">end</span> <span class="co"># class Block</span></span>
|
||
<span id="cb4-33"><a href="#cb4-33" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-34"><a href="#cb4-34" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-35"><a href="#cb4-35" aria-hidden="true" tabindex="-1"></a><span class="co">#####</span></span>
|
||
<span id="cb4-36"><a href="#cb4-36" aria-hidden="true" tabindex="-1"></a><span class="co">## let's get started</span></span>
|
||
<span id="cb4-37"><a href="#cb4-37" aria-hidden="true" tabindex="-1"></a><span class="co">## build a blockchain a block at a time</span></span>
|
||
<span id="cb4-38"><a href="#cb4-38" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-39"><a href="#cb4-39" aria-hidden="true" tabindex="-1"></a>b0 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.first</span>( <span class="st">"Genesis"</span> )</span>
|
||
<span id="cb4-40"><a href="#cb4-40" aria-hidden="true" tabindex="-1"></a>b1 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.next</span>( b0, <span class="st">"Transaction Data..."</span> )</span>
|
||
<span id="cb4-41"><a href="#cb4-41" aria-hidden="true" tabindex="-1"></a>b2 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.next</span>( b1, <span class="st">"Transaction Data......"</span> )</span>
|
||
<span id="cb4-42"><a href="#cb4-42" aria-hidden="true" tabindex="-1"></a>b3 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.next</span>( b2, <span class="st">"More Transaction Data..."</span> )</span>
|
||
<span id="cb4-43"><a href="#cb4-43" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-44"><a href="#cb4-44" aria-hidden="true" tabindex="-1"></a>blockchain <span class="kw">=</span> <span class="kw">[</span>b0, b1, b2, b3<span class="kw">]</span></span>
|
||
<span id="cb4-45"><a href="#cb4-45" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb4-46"><a href="#cb4-46" aria-hidden="true" tabindex="-1"></a>pp blockchain</span></code></pre></div>
|
||
<p>(Source: <a
|
||
href="blockchain.rb/blockchain.rb"><code>blockchain.rb</code></a>)</p>
|
||
<p>will pretty print (pp) something like:</p>
|
||
<pre><code>[#<Block:0x1eed2a0
|
||
@timestamp = 1637-09-15 20:52:38,
|
||
@data = "Genesis",
|
||
@previous_hash = "0000000000000000000000000000000000000000000000000000000000000000",
|
||
@hash = "edbd4e11e69bc399a9ccd8faaea44fb27410fe8e3023bb9462450a0a9c4caa1b">,
|
||
#<Block:0x1eec9a0
|
||
@timestamp = 1637-09-15 21:02:38,
|
||
@data = "Transaction Data...",
|
||
@previous_hash = "edbd4e11e69bc399a9ccd8faaea44fb27410fe8e3023bb9462450a0a9c4caa1b",
|
||
@hash = "eb8ecbf6d5870763ae246e37539d82e37052cb32f88bb8c59971f9978e437743">,
|
||
#<Block:0x1eec838
|
||
@timestamp = 1637-09-15 21:12:38,
|
||
@data = "Transaction Data......",
|
||
@previous_hash = "eb8ecbf6d5870763ae246e37539d82e37052cb32f88bb8c59971f9978e437743",
|
||
@hash = "be50017ee4bbcb33844b3dc2b7c4e476d46569b5df5762d14ceba9355f0a85f4">,
|
||
#<Block:0x1eec6d0
|
||
@timestamp = 1637-09-15 21:22:38,
|
||
@data = "More Transaction Data...",
|
||
@previous_hash = "be50017ee4bbcb33844b3dc2b7c4e476d46569b5df5762d14ceba9355f0a85f4",
|
||
@hash = "5ee2981606328abfe0c3b1171440f0df746c1e1f8b3b56c351727f7da7ae5d8d">]</code></pre>
|
||
<p>Comments from the <a
|
||
href="https://www.reddit.com/r/ruby/comments/70c30f/build_your_own_blockchain_in_20_lines_of_ruby/">reddit
|
||
ruby posting</a>:</p>
|
||
<blockquote>
|
||
<p>Wait, so a blockchain is just a linked list?</p>
|
||
<blockquote>
|
||
<p>No. A linked list is only required to have a reference to the
|
||
previous element, a block must have an identifier depending on the
|
||
previous block’s identifier, meaning that you cannot replace a block
|
||
without recomputing every single block that comes after. In this
|
||
implementation that happens as the previous digest is input in the
|
||
calc_hash method.</p>
|
||
</blockquote>
|
||
</blockquote>
|
||
<p><strong>What about Proof of Work / Waste?</strong></p>
|
||
<p>Let’s add a proof of work / waste to the blockchain. In the classic
|
||
blockchain you have to compute a block hash that starts with leading
|
||
zeros (<code>00</code>). The more leading zeros the harder (more
|
||
difficult) to compute. Let’s keep it easy to compute with two leading
|
||
zeros (<code>00</code>), that is, 16^2 = 256 possibilites (^1,2). Three
|
||
leading zeros (<code>000</code>) would be 16^3 = 4_096 possibilites and
|
||
four zeros (<code>0000</code>) would be 16^4 = 65_536 and so on.</p>
|
||
<p>(^1): 16 possibilties because it’s a hex or hexadecimal or base 16
|
||
number, that is, <code>0</code> <code>1</code> <code>2</code>
|
||
<code>3</code> <code>4</code> <code>6</code> <code>7</code>
|
||
<code>8</code> <code>9</code> <code>a</code> (10) <code>b</code> (11)
|
||
<code>c</code> (12) <code>d</code> (13) <code>e</code> (14)
|
||
<code>f</code> (15).</p>
|
||
<p>(^2): A random secure hash algorithm needs on average 256 tries
|
||
(might be lets say 305 tries, for example, because it’s NOT a perfect
|
||
statistic distribution of possibilities).</p>
|
||
<p>Example:</p>
|
||
<div class="sourceCode" id="cb6"><pre
|
||
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="cf">def</span> compute_hash_with_proof_of_work( difficulty<span class="kw">=</span><span class="st">"00"</span> )</span>
|
||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> nonce <span class="kw">=</span> <span class="dv">0</span></span>
|
||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">loop</span> <span class="cf">do</span></span>
|
||
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> hash <span class="kw">=</span> calc_hash_with_nonce( nonce )</span>
|
||
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> hash<span class="at">.start_with?</span>( difficulty )</span>
|
||
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="kw">[</span>nonce,hash<span class="kw">]</span> <span class="co">## bingo! proof of work if hash starts with leading zeros (00)</span></span>
|
||
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span></span>
|
||
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a> nonce <span class="kw">+=</span> <span class="dv">1</span> <span class="co">## keep trying (and trying and trying)</span></span>
|
||
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">end</span></span>
|
||
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a> <span class="cf">end</span></span>
|
||
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a><span class="cf">end</span></span>
|
||
<span id="cb6-12"><a href="#cb6-12" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb6-13"><a href="#cb6-13" aria-hidden="true" tabindex="-1"></a><span class="cf">def</span> calc_hash_with_nonce( nonce<span class="kw">=</span><span class="dv">0</span> )</span>
|
||
<span id="cb6-14"><a href="#cb6-14" aria-hidden="true" tabindex="-1"></a> sha <span class="kw">=</span> <span class="dt">Digest</span><span class="kw">::</span><span class="dt">SHA256</span><span class="at">.new</span></span>
|
||
<span id="cb6-15"><a href="#cb6-15" aria-hidden="true" tabindex="-1"></a> sha<span class="at">.update</span>( nonce<span class="at">.to_s</span> <span class="kw">+</span> <span class="ot">@timestamp</span><span class="at">.to_s</span> <span class="kw">+</span> <span class="ot">@previous_hash</span> <span class="kw">+</span> <span class="ot">@data</span> )</span>
|
||
<span id="cb6-16"><a href="#cb6-16" aria-hidden="true" tabindex="-1"></a> sha<span class="at">.hexdigest</span></span>
|
||
<span id="cb6-17"><a href="#cb6-17" aria-hidden="true" tabindex="-1"></a><span class="cf">end</span></span></code></pre></div>
|
||
<p>(Source: <a
|
||
href="blockchain.rb/blockchain_with_proof_of_work.rb"><code>blockchain_with_proof_of_work.rb</code></a>)</p>
|
||
<p>Let’s rerun the sample with the proof of work machinery added. Now
|
||
the sample will pretty print (pp) something like:</p>
|
||
<pre><code>[#<Block:0x1e204f0
|
||
@timestamp = 1637-09-20 20:13:38,
|
||
@data = "Genesis",
|
||
@previous_hash = "0000000000000000000000000000000000000000000000000000000000000000",
|
||
@nonce = 242,
|
||
@hash = "00b8e77e27378f9aa0afbcea3a2882bb62f6663771dee053364beb1887e18bcf">,
|
||
#<Block:0x1e56e20
|
||
@timestamp = 1637-09-20 20:23:38,
|
||
@data = "Transaction Data...",
|
||
@previous_hash = "00b8e77e27378f9aa0afbcea3a2882bb62f6663771dee053364beb1887e18bcf",
|
||
@nonce = 46,
|
||
@hash = "00aae8d2e9387e13c71b33f8cd205d336ac250d2828011f5970062912985a9af">,
|
||
#<Block:0x1e2bd58
|
||
@timestamp = 1637-09-20 20:33:38,
|
||
@data = "Transaction Data......",
|
||
@previous_hash = "00aae8d2e9387e13c71b33f8cd205d336ac250d2828011f5970062912985a9af",
|
||
@nonce = 350,
|
||
@hash = "00ea45e0f4683c3bec4364f349ee2b6816be0c9fd95cfd5ffcc6ed572c62f190">,
|
||
#<Block:0x1fa8338
|
||
@timestamp = 1637-09-20 20:43:38,
|
||
@data = "More Transaction Data...",
|
||
@previous_hash = "00ea45e0f4683c3bec4364f349ee2b6816be0c9fd95cfd5ffcc6ed572c62f190",
|
||
@nonce = 59,
|
||
@hash = "00436f0fca677652963e904ce4c624606a255946b921132d5b1f70f7d86c4ab8">]</code></pre>
|
||
<p>See the difference? All hashes now start with leading zeros
|
||
(<code>00</code>) and the nonce is the random “lucky number” that makes
|
||
it happen. That’s the magic behind the proof of work.</p>
|
||
<h5 id="blockchain-from-scratch---javascript-version">Blockchain from
|
||
Scratch - JavaScript Version</h5>
|
||
<div class="sourceCode" id="cb8"><pre class="sourceCode js"><code class="sourceCode javascript"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="kw">class</span> Block {</span>
|
||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">constructor</span>(data<span class="op">,</span> previousHash) {</span>
|
||
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">this</span><span class="op">.</span><span class="at">timestamp</span> <span class="op">=</span> <span class="kw">new</span> <span class="bu">Date</span>()</span>
|
||
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">this</span><span class="op">.</span><span class="at">data</span> <span class="op">=</span> data</span>
|
||
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">this</span><span class="op">.</span><span class="at">previousHash</span> <span class="op">=</span> previousHash</span>
|
||
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> <span class="kw">this</span><span class="op">.</span><span class="at">hash</span> <span class="op">=</span> <span class="kw">this</span><span class="op">.</span><span class="fu">calcHash</span>()</span>
|
||
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a> }</span>
|
||
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">calcHash</span>() {</span>
|
||
<span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a> <span class="kw">var</span> sha <span class="op">=</span> SHA256<span class="op">.</span><span class="fu">create</span>()</span>
|
||
<span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a> sha<span class="op">.</span><span class="fu">update</span>( <span class="kw">this</span><span class="op">.</span><span class="at">timestamp</span><span class="op">.</span><span class="fu">toString</span>() <span class="op">+</span> <span class="kw">this</span><span class="op">.</span><span class="at">previousHash</span> <span class="op">+</span> <span class="kw">this</span><span class="op">.</span><span class="at">data</span> )</span>
|
||
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> sha<span class="op">.</span><span class="fu">hex</span>()</span>
|
||
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a> }</span>
|
||
<span id="cb8-15"><a href="#cb8-15" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-16"><a href="#cb8-16" aria-hidden="true" tabindex="-1"></a> <span class="kw">static</span> <span class="fu">first</span>( data<span class="op">=</span><span class="st">"Genesis"</span> ) { <span class="co">// create genesis (big bang! first) block</span></span>
|
||
<span id="cb8-17"><a href="#cb8-17" aria-hidden="true" tabindex="-1"></a> <span class="co">// uses all-zero previousHash</span></span>
|
||
<span id="cb8-18"><a href="#cb8-18" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="kw">new</span> <span class="fu">Block</span>( data<span class="op">,</span> <span class="st">"0000000000000000000000000000000000000000000000000000000000000000"</span> )</span>
|
||
<span id="cb8-19"><a href="#cb8-19" aria-hidden="true" tabindex="-1"></a> }</span>
|
||
<span id="cb8-20"><a href="#cb8-20" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-21"><a href="#cb8-21" aria-hidden="true" tabindex="-1"></a> <span class="kw">static</span> <span class="fu">next</span>( previous<span class="op">,</span> data<span class="op">=</span><span class="st">"Transaction Data..."</span> ) {</span>
|
||
<span id="cb8-22"><a href="#cb8-22" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="kw">new</span> <span class="fu">Block</span>( data<span class="op">,</span> previous<span class="op">.</span><span class="at">hash</span> )</span>
|
||
<span id="cb8-23"><a href="#cb8-23" aria-hidden="true" tabindex="-1"></a> }</span>
|
||
<span id="cb8-24"><a href="#cb8-24" aria-hidden="true" tabindex="-1"></a>}</span>
|
||
<span id="cb8-25"><a href="#cb8-25" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-26"><a href="#cb8-26" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-27"><a href="#cb8-27" aria-hidden="true" tabindex="-1"></a><span class="co">//////</span></span>
|
||
<span id="cb8-28"><a href="#cb8-28" aria-hidden="true" tabindex="-1"></a><span class="co">// let's get started</span></span>
|
||
<span id="cb8-29"><a href="#cb8-29" aria-hidden="true" tabindex="-1"></a><span class="co">// build a blockchain a block at a time</span></span>
|
||
<span id="cb8-30"><a href="#cb8-30" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-31"><a href="#cb8-31" aria-hidden="true" tabindex="-1"></a>b0 <span class="op">=</span> Block<span class="op">.</span><span class="fu">first</span>( <span class="st">"Genesis"</span> )</span>
|
||
<span id="cb8-32"><a href="#cb8-32" aria-hidden="true" tabindex="-1"></a>b1 <span class="op">=</span> Block<span class="op">.</span><span class="fu">next</span>( b0<span class="op">,</span> <span class="st">"Transaction Data..."</span> )</span>
|
||
<span id="cb8-33"><a href="#cb8-33" aria-hidden="true" tabindex="-1"></a>b2 <span class="op">=</span> Block<span class="op">.</span><span class="fu">next</span>( b1<span class="op">,</span> <span class="st">"Transaction Data......"</span> )</span>
|
||
<span id="cb8-34"><a href="#cb8-34" aria-hidden="true" tabindex="-1"></a>b3 <span class="op">=</span> Block<span class="op">.</span><span class="fu">next</span>( b2<span class="op">,</span> <span class="st">"More Transaction Data..."</span> )</span>
|
||
<span id="cb8-35"><a href="#cb8-35" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-36"><a href="#cb8-36" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-37"><a href="#cb8-37" aria-hidden="true" tabindex="-1"></a>blockchain <span class="op">=</span> [b0<span class="op">,</span> b1<span class="op">,</span> b2<span class="op">,</span> b3]</span>
|
||
<span id="cb8-38"><a href="#cb8-38" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb8-39"><a href="#cb8-39" aria-hidden="true" tabindex="-1"></a><span class="bu">console</span><span class="op">.</span><span class="fu">log</span>( blockchain )</span></code></pre></div>
|
||
<p>(Source: <a
|
||
href="blockchain.js/blockchain.js"><code>blockchain.js</code></a>)</p>
|
||
<p>will log something like:</p>
|
||
<pre><code>[ Block {
|
||
timestamp : 1637-09-18 08:25:54,
|
||
data : 'Genesis',
|
||
previousHash : '0000000000000000000000000000000000000000000000000000000000000000',
|
||
hash : 'c396de4c03ddb5275661982adc75ce5fc5905d2a2457d1266c74436c1f3c50f1' },
|
||
Block {
|
||
timestamp : 1637-09-18 08:35:54,
|
||
data : 'Transaction Data...',
|
||
previousHash : 'c396de4c03ddb5275661982adc75ce5fc5905d2a2457d1266c74436c1f3c50f1',
|
||
hash : '493131e09c069645c82795c96e4715cea0f5558be514b5096d853a5b9899154a' },
|
||
Block {
|
||
timestamp : 1637-09-18 08:45:54,
|
||
data : 'Transaction Data......',
|
||
previousHash : '493131e09c069645c82795c96e4715cea0f5558be514b5096d853a5b9899154a',
|
||
hash : '97aa3cb5052615d60ff8e6b41bef606562588c4874f011970ac2f218e2f0f4a8' },
|
||
Block {
|
||
timestamp : 1637-09-18 08:55:54,
|
||
data : 'More Transaction Data...',
|
||
previousHash : '97aa3cb5052615d60ff8e6b41bef606562588c4874f011970ac2f218e2f0f4a8',
|
||
hash : 'e10e020f832e46c2b60e1c3c0412bd370b2fde5f0f782c16eb87d0313ea0d3a3' } ]</code></pre>
|
||
<h2 id="blockchain-articles">Blockchain Articles</h2>
|
||
<p><a
|
||
href="http://rufuspollock.com/2016/07/02/reflections-on-the-blockchain"><strong>Reflections
|
||
on the Blockchain</strong></a> by Rufus Pollock (Open Knowledge
|
||
Foundation), July 2016 – <em>The DAO: Code is not Law – and It’s
|
||
Dangerous to Think So ++ The Internet changed the world - surely the
|
||
Blockchain will too? ++ Gold-rush or Internet-rush? ++ Governance
|
||
Matters in Bitcoin ++ The Myth of a Costless, Ownerless Network ++
|
||
Lessons from History</em></p>
|
||
<p><a
|
||
href="https://tonyarcieri.com/on-the-dangers-of-a-blockchain-monoculture"><strong>On
|
||
the Dangers of a Blockchain Monoculture</strong></a> by Tony Arcieri,
|
||
January 2016 – <em>The Bitcoin blockchain: the world’s worst database ++
|
||
Next-generation protocols ++ Decentralized ledger protocols ++
|
||
Bitcoin-NG ++ Blockchain! Blockchain! Blockchain! ++ The great
|
||
decentralized database in the sky</em></p>
|
||
<p><a
|
||
href="https://www.tbray.org/ongoing/When/201x/2017/05/13/Not-Believing-in-Blockchain"><strong>I
|
||
Don’t Believe in Blockchain</strong></a> by Tim Bray, May 2017</p>
|
||
<p><a
|
||
href="https://www.igvita.com/2014/05/05/minimum-viable-block-chain/"><strong>Minimum
|
||
Viable Blockchain</strong></a> by Ilya Grigorik, May 2014 – <em>Securing
|
||
transactions with triple-entry bookkeeping ++ Securing transactions with
|
||
PKI ++ Balance = Σ(receipts) ++ Multi-party transfers & verification
|
||
++ Double-spending and distributed consensus - Requirements for a
|
||
distributed consensus network; Protecting the network from Sybil
|
||
attacks; Proof-of-work as a participation requirement ++ Building the
|
||
minimum viable blockchain - Adding “blocks” & transaction fee
|
||
incentives; Racing to claim the transaction fees; Resolving chain
|
||
conflicts; Blocks are never final ++ Properties of the (minimum viable)
|
||
blockchain</em></p>
|
||
<p><a
|
||
href="https://www.oreilly.com/ideas/blockchains-by-analogies-and-applications"><strong>Blockchains
|
||
by analogies and applications: How blockchain compares to Git, Raft, and
|
||
other technologies.</strong></a> by Kieren James-Lubin, January 2016 –
|
||
<em>Blockchains are databases ++ Understanding transactions ++
|
||
Persistent, replicated databases (related technology: Git) ++
|
||
Peer-to-peer networks (related technology: BitTorrent) ++ Distributed
|
||
consensus (related technology: distributed databases, Raft) ++ Minting
|
||
new coins (mining) ++ Embedded identities (related technology: TLS) ++
|
||
Smart contracts: Like SQL expressions & triggers ++ What can we
|
||
really do with blockchains?</em></p>
|
||
<h2 id="blockchain-books">Blockchain Books</h2>
|
||
<p><a
|
||
href="https://davidgerard.co.uk/blockchain/table-of-contents/"><strong>Attack
|
||
of the 50 Foot Blockchain: Bitcoin, Blockchain, Ethereum & Smart
|
||
Contracts</strong></a> by David Gerard, London, 2017 – <em>What is a
|
||
bitcoin? ++ The Bitcoin ideology ++ The incredible promises of Bitcoin!
|
||
++ Early Bitcoin: the rise to the first bubble ++ How Bitcoin mining
|
||
centralised ++ Who is Satoshi Nakamoto? ++ Spending bitcoins in 2017 ++
|
||
Trading bitcoins in 2017: the second crypto bubble ++ Altcoins ++ Smart
|
||
contracts, stupid humans ++ Business bafflegab, but on the Blockchain ++
|
||
Case study: Why you can’t put the music industry on a
|
||
blockchain</em></p>
|
||
<p><a
|
||
href="https://github.com/bitcoinbook/bitcoinbook/blob/second_edition/ch09.asciidoc"><strong>Mastering
|
||
Bitcoin - Programming the Open Blockchain</strong></a> 2nd Edition, by
|
||
Andreas M. Antonopoulos, 2017 - FREE (Online Source Version) – <em>What
|
||
Is Bitcoin? ++ How Bitcoin Works ++ Bitcoin Core: The Reference
|
||
Implementation ++ Keys, Addresses ++ Wallets ++ Transactions ++ Advanced
|
||
Transactions and Scripting ++ The Bitcoin Network ++ The Blockchain ++
|
||
Mining and Consensus ++ Bitcoin Security ++ Blockchain
|
||
Applications</em></p>
|
||
<hr />
|
||
<p><img src="i/trolly-ponzi.png" /></p>
|
||
<p><strong>BEWARE: Bitcoin is a gigantic ponzi scheme¹. To the moon!?
|
||
The new gold standard!? Do NOT “invest” trying to get-rich-quick
|
||
HODLing. Why not? The bitcoin code is archaic and out-of-date. Burn,
|
||
baby, burn! Proof-of-work / waste is a global energy environmental
|
||
disaster using 300 kW/h per bitcoin transaction (!) that’s about 179
|
||
kilograms of CO₂ emissions². Programmable money (or the internet of
|
||
value) for all future generations with (bitcoin) script without loops
|
||
and jumps (gotos) and all “stateless”!? LOL.</strong></p>
|
||
<p>¹: (Source: <a
|
||
href="https://bitsblocks.github.io/bitcoin-maximalist">Best of Bitcoin
|
||
Maximalist - Scammers, Morons, Clowns, Shills & BagHODLers - Inside
|
||
The New New Crypto Ponzi Economics</a>)</p>
|
||
<p>²: Assuming let’s say 0.596 kilograms of CO₂ per kW/h (that’s the
|
||
energy efficiency in Germany) that’s about 179 kilograms of CO₂ per
|
||
bitcoin transaction (300 kW/h × 0.596 kg). For more insights see the <a
|
||
href="https://digiconomist.net/bitcoin-energy-consumption">Bitcoin
|
||
Energy Consumption Index</a>.</p>
|
||
<hr />
|
||
<p><a
|
||
href="https://github.com/jimmysong/programmingbitcoin"><strong>Programming
|
||
Bitcoin from Scratch</strong></a> by Jimmy Song, 2019 - FREE (Online
|
||
Source Version) – <em><a
|
||
href="https://github.com/jimmysong/programmingbitcoin/blob/master/ch06.asciidoc">Chapter
|
||
6 - Script</a> - How Script Works • Example Operations • Parsing the
|
||
Script Fields • Combining the Script Fields • Standard Scripts • p2pk •
|
||
Problems with p2pk • Solving the Problems with p2pkh • Scripts Can Be
|
||
Arbitrarily Constructed • Conclusion ++</em> <em><a
|
||
href="https://github.com/jimmysong/programmingbitcoin/blob/master/ch08.asciidoc">Chapter
|
||
8 - Pay-to-Script Hash</a> - Bare Multisig • Coding OP_CHECKMULTISIG •
|
||
Problems with Bare Multisig • Pay-to-Script-Hash (p2sh) • Coding p2sh •
|
||
Conclusion ++</em> <em><a
|
||
href="https://github.com/jimmysong/programmingbitcoin/blob/master/ch13.asciidoc">Chapter
|
||
13 - Segregated Witness</a> - Pay-to-Witness-Pubkey-Hash (p2wpkh) •
|
||
p2wpkh Transactions • p2sh-p2wpkh • Coding p2wpkh and p2sh-p2wpkh •
|
||
Pay-to-Witness-Script-Hash (p2wsh) • p2sh-p2wsh • Coding p2wsh and
|
||
p2sh-p2wsh • Other Improvements • Conclusion</em></p>
|
||
<p><a
|
||
href="https://github.com/openblockchains/programming-bitcoin-script"><strong>Programming
|
||
Bitcoin Script Transaction (Crypto) Contracts Step-by-Step ( Beta /
|
||
Rough Draft )</strong></a> by Gerald Bauer et al, 2019 - FREE (Online
|
||
Version) – <em>Let’s start with building your own bitcoin stack machine
|
||
from zero / scratch and let’s run your own bitcoin ops
|
||
(operations)…</em></p>
|
||
<p><a
|
||
href="https://github.com/yukimotopress/programming-blockchains-step-by-step"><strong>Programming
|
||
Blockchains in Ruby from Scratch Step-by-Step Starting w/ Crypto Hashes…
|
||
( Beta / Rough Draft )</strong></a> by Gerald Bauer et al, 2018 - FREE
|
||
(Online Version) – <em>(Crypto) Hash ++ (Crypto) Block ++ (Crypto) Block
|
||
with Proof-of-Work ++ Blockchain! Blockchain! Blockchain! ++ Blockchain
|
||
Broken? ++ Timestamping ++ Mining, Mining, Mining - What’s Your Hash
|
||
Rate? ++ Bitcoin, Bitcoin, Bitcoin ++ (Crypto) Block with Transactions
|
||
(Tx)</em></p>
|
||
<p><a
|
||
href="https://github.com/ethereumbook/ethereumbook"><strong>Mastering
|
||
Ethereum - Building Contract Services and Decentralized Apps on the
|
||
Blockchain</strong></a> - by Andreas M. Antonopoulos, Gavin Wood, 2018 -
|
||
FREE (Online Source Version) <em>What is Ethereum ++ Introduction ++
|
||
Ethereum Clients ++ Ethereum Testnets ++ Keys and Addresses ++ Wallets
|
||
++ Transactions ++ Contract Services ++ Tokens ++ Oracles ++ Accounting
|
||
& Gas ++ EVM (Ethereum Virtual Machine) ++ Consensus ++ DevP2P
|
||
(Peer-To-Peer) Protocol ++ Dev Tools and Frameworks ++ Decentralized
|
||
Apps ++ Ethereum Standards (EIPs/ERCs)</em></p>
|
||
<p><a
|
||
href="https://www.manning.com/books/building-ethereum-dapps"><strong>Building
|
||
Decentralized Apps on the Ethereum Blockchain</strong></a> by Roberto
|
||
Infante, 2018 - FREE chapter 1 – <em>Understanding decentralized
|
||
applications ++ The Ethereum blockchain ++ Building contract services in
|
||
(JavaScript-like) Solidity ++ Running contract services on the Ethereum
|
||
blockchain ++ Developing Ethereum Decentralized apps with Truffle ++
|
||
Best design and security practice</em></p>
|
||
<p><a
|
||
href="https://github.com/openblockchains/programming-cryptocontracts"><strong>Programming
|
||
Crypto Blockchain Contracts Step-by-Step Book / Guide ( Beta / Rough
|
||
Draft )</strong></a> by Gerald Bauer et al, 2019 - FREE (Online Version)
|
||
– <em>Let’s Start with Ponzi & Pyramid Schemes. Run Your Own
|
||
Lotteries, Gambling Casinos and more on the Blockchain World
|
||
Computer…</em></p>
|
||
<p><a
|
||
href="http://yukimotopress.github.io/blockchains"><strong>Programming
|
||
Cryptocurrencies and Blockchains in Ruby ( Beta / Rough Draft
|
||
)</strong></a> by Gerald Bauer et al, 2018 - FREE (Online Version) @
|
||
Yuki & Moto Press Bookshelf – <em>Digital <span
|
||
class="math display">$$$ Alchemy - What's a Blockchain? -
|
||
How-To Turn Digital Bits Into $$</span>$ or €€€? • Decentralize
|
||
Payments. Decentralize Transactions. Decentralize Blockchains. • The
|
||
Proof of the Pudding is … The Bitcoin (BTC) Blockchain(s) ++ Building
|
||
Blockchains from Scratch - A Blockchain in Ruby in 20 Lines! A
|
||
Blockchain is a Data Structure • What about Proof-of-Work? What about
|
||
Consensus? • Find the Lucky Number - Nonce == Number Used Once ++ Adding
|
||
Transactions - The World’s Worst Database - Bitcoin Blockchain Mining •
|
||
Tulips on the Blockchain! Adding Transactions ++ Blockchain Lite - Basic
|
||
Blocks • Proof-of-Work Blocks • Transactions ++ Merkle Tree - Build Your
|
||
Own Crypto Hash Trees; Grow Your Own Money on Trees • What’s a Merkle
|
||
Tree? • Transactions ++ Central Bank - Run Your Own Federated Central
|
||
Bank Nodes on the Blockchain Peer-to-Peer over HTTP • Inside Mining -
|
||
Printing Cryptos, Cryptos, Cryptos on the Blockchain ++ Awesome Crypto
|
||
++ Case Studies - Dutch Gulden • Shilling • CryptoKitties (and
|
||
CryptoCopycats)</em></p>
|
||
<p><a
|
||
href="https://www.ibm.com/blockchain/what-is-blockchain.html"><strong>Blockchain
|
||
for Dummies, IBM Limited Edition</strong></a> by Manav Gupta, 2017 -
|
||
FREE (Digital Download w/ Email) – <em>Grasping Blockchain Fundamentals
|
||
++ Taking a Look at How Blockchain Works ++ Propelling Business with
|
||
Blockchains ++ Blockchain in Action: Use Cases ++ Hyperledger, a Linux
|
||
Foundation Project ++ Ten Steps to Your First Blockchain
|
||
application</em></p>
|
||
<p><a
|
||
href="https://github.com/bitsblocks/get-rich-quick-bible"><strong>Get
|
||
Rich Quick “Business Blockchain” Bible - The Secrets of Free Easy
|
||
Money</strong></a>, 2018 - FREE – <em>Step 1: Sell hot air. How? ++ Step
|
||
2: Pump up your tokens. How? ++ Step 3: Revolutionize the World.
|
||
How?</em></p>
|
||
<p><a
|
||
href="https://github.com/bitsblocks/bitcoin-maximalist"><strong>Best of
|
||
Bitcoin Maximalist - Scammers, Morons, Clowns, Shills & BagHODLers -
|
||
Inside The New New Crypto Ponzi Economics</strong></a> by Trolly
|
||
McTrollface, et al, 2018 - FREE</p>
|
||
<p><a href="https://github.com/bitsblocks/crypto-facts"><strong>Crypto
|
||
Facts - Decentralize Payments - Efficient, Low Cost, Fair, Clean - True
|
||
or False?</strong></a> by Nouriel Roubini, David Gerard, et al, 2018 -
|
||
FREE</p>
|
||
<p><a href="https://github.com/bitsblocks/crypto-bubbles"><strong>Crypto
|
||
is the Mother of All Scams and (Now Busted) Bubbles - While Blockchain
|
||
Is The Most Over-Hyped Technology Ever, No Better than a
|
||
Spreadsheet/Database</strong></a> by Nouriel Roubini, 2018 - FREE</p>
|
||
<p><a
|
||
href="https://github.com/bitsblocks/islandcoin-whitepaper"><strong>IslandCoin
|
||
White Paper - A Pen and Paper Cash System - How to Run a Blockchain on a
|
||
Deserted Island</strong></a> by Tal Kol – <em>Motivation ++ Consensus ++
|
||
Transaction and Block Specification - Transaction format • Block format
|
||
• Genesis block ++ References</em></p>
|
||
<h2 id="blockchain-lite-crypto-hash-libraries">Blockchain (Lite) Crypto
|
||
Hash Libraries</h2>
|
||
<p><a href="#ruby">Ruby</a> • <a href="#javascript">JavaScript</a></p>
|
||
<h3 id="ruby-1">Ruby</h3>
|
||
<p><strong>blockchain.lite</strong> (github: <a
|
||
href="https://github.com/openblockchains/blockchain.lite.rb">openblockchains/blockchain.lite.rb</a>,
|
||
gem: <a
|
||
href="https://rubygems.org/gems/blockchain-lite">blockchain-lite</a>) -
|
||
build your own blockchain with crypto hashes - revolutionize the world
|
||
with blockchains, blockchains, blockchains one block at a time</p>
|
||
<div class="sourceCode" id="cb10"><pre
|
||
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span> <span class="vs">'blockchain-lite'</span></span>
|
||
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a>b0 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.first</span>( <span class="st">"Genesis"</span> )</span>
|
||
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a>b1 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.next</span>( b0, <span class="st">"Transaction Data..."</span> )</span>
|
||
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a>b2 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.next</span>( b1, <span class="st">"Transaction Data......"</span> )</span>
|
||
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a>b3 <span class="kw">=</span> <span class="dt">Block</span><span class="at">.next</span>( b2, <span class="st">"More Transaction Data..."</span> )</span>
|
||
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a>blockchain <span class="kw">=</span> <span class="kw">[</span>b0, b1, b2, b3<span class="kw">]</span></span>
|
||
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a>pp blockchain</span></code></pre></div>
|
||
<p>will pretty print (pp) something like:</p>
|
||
<pre><code>[#<Block:0x1eed2a0
|
||
@timestamp = 1637-09-15 20:52:38,
|
||
@data = "Genesis",
|
||
@previous_hash = "0000000000000000000000000000000000000000000000000000000000000000",
|
||
@hash = "edbd4e11e69bc399a9ccd8faaea44fb27410fe8e3023bb9462450a0a9c4caa1b">,
|
||
#<Block:0x1eec9a0
|
||
@timestamp = 1637-09-15 21:02:38,
|
||
@data = "Transaction Data...",
|
||
@hash = "eb8ecbf6d5870763ae246e37539d82e37052cb32f88bb8c59971f9978e437743",
|
||
@previous_hash = "edbd4e11e69bc399a9ccd8faaea44fb27410fe8e3023bb9462450a0a9c4caa1b">,
|
||
...</code></pre>
|
||
<h3 id="javascript-1">JavaScript</h3>
|
||
<p><strong>blockchain.lite</strong> (github: <a
|
||
href="https://github.com/openblockchains/blockchain.lite.js">openblockchains/blockchain.lite.js</a>,
|
||
npm: <a
|
||
href="https://www.npmjs.com/package/blockchain-lite">blockchain-lite</a>)
|
||
- build your own blockchain with crypto hashes - revolutionize the world
|
||
with blockchains, blockchains, blockchains one block at a time</p>
|
||
<div class="sourceCode" id="cb12"><pre
|
||
class="sourceCode js"><code class="sourceCode javascript"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="kw">const</span> Blocks <span class="op">=</span> <span class="pp">require</span>( <span class="st">"blockchain-lite"</span> )</span>
|
||
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="co">// use basic block</span></span>
|
||
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> Block <span class="op">=</span> Blocks<span class="op">.</span><span class="at">basic</span></span>
|
||
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> b0 <span class="op">=</span> Block<span class="op">.</span><span class="fu">first</span>( <span class="st">'Genesis'</span> )</span>
|
||
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> b1 <span class="op">=</span> Block<span class="op">.</span><span class="fu">next</span>( b0<span class="op">,</span> <span class="st">'Transaction Data...'</span> )</span>
|
||
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> b2 <span class="op">=</span> Block<span class="op">.</span><span class="fu">next</span>( b1<span class="op">,</span> <span class="st">'Transaction Data......'</span> )</span>
|
||
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> b3 <span class="op">=</span> Block<span class="op">.</span><span class="fu">next</span>( b2<span class="op">,</span> <span class="st">'More Transaction Data...'</span> )</span>
|
||
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> blockchain <span class="op">=</span> [b0<span class="op">,</span> b1<span class="op">,</span> b2<span class="op">,</span> b3]</span>
|
||
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a><span class="bu">console</span><span class="op">.</span><span class="fu">log</span>( blockchain )</span></code></pre></div>
|
||
<p>will log something like:</p>
|
||
<pre><code>[ Block {
|
||
timestamp: 2017-09-25 17:03:38,
|
||
data: 'Genesis',
|
||
previousHash: '0000000000000000000000000000000000000000000000000000000000000000',
|
||
hash: '08f4fa71628c5bc6b430228738bc8c41afaf508ece0b1cf9c9cac53d02e11829' },
|
||
Block {
|
||
timestamp: 2017-09-25 17:13:38,
|
||
data: 'Transaction Data...',
|
||
previousHash: '08f4fa71628c5bc6b430228738bc8c41afaf508ece0b1cf9c9cac53d02e11829',
|
||
hash: '740a4aeb3441484c96d1e7f63d31b716220ccee3b6fe94547cae2afbb6010626' },
|
||
Block {
|
||
timestamp: 2017-09-25 17:23:38,
|
||
data: 'Transaction Data......',
|
||
previousHash: '740a4aeb3441484c96d1e7f63d31b716220ccee3b6fe94547cae2afbb6010626',
|
||
hash: '28b6892a069e2ff7f1c3128ab495d7cd9b9b1636a51a7f69db93a14b1ee6b1a7' },
|
||
Block {
|
||
timestamp: 2017-09-25 17:33:38,
|
||
data: 'More Transaction Data...',
|
||
previousHash: '28b6892a069e2ff7f1c3128ab495d7cd9b9b1636a51a7f69db93a14b1ee6b1a7',
|
||
hash: '4cc0329b2c0cb32e0451fa3179bd944d4cd0fcf410939172f979e9fd2aa9f5f3' } ]</code></pre>
|
||
<h2
|
||
id="git-git-git---the-stupid-content-tracker-with-crypto-hashes">Git,
|
||
Git, Git - The Stupid Content Tracker with Crypto Hashes</h2>
|
||
<p><em>Everything is local. Distributed is the new centralized.</em></p>
|
||
<p><img src="i/xkcd1597.png" /></p>
|
||
<h3 id="quotes---blockchains-and-git">Quotes - Blockchains and Git</h3>
|
||
<blockquote>
|
||
<p>Yep, that’s the joke. Nobody has been able to explain to me how the
|
||
“blockchain” buzzword is significantly different to “git repo”. – <a
|
||
href="https://twitter.com/yaakov_h/status/902659507255312384">Yaakov</a></p>
|
||
<p>But if you said “let’s build a currency where all transactions are
|
||
stored in a git repo” you wouldn’t be taken seriously for even 24 hrs. –
|
||
<a
|
||
href="https://twitter.com/yaakov_h/status/902659847224664064">Yaakov</a></p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>Soon explaining git like “a git repo is like a blockchain with
|
||
commits instead of blocks”. – <a
|
||
href="https://twitter.com/nicoberger/status/901776907418697729">Nicolás
|
||
Berger</a></p>
|
||
<p>“A local branch is like a state channel. It can be pushed and merged
|
||
into the master blockchain at any moment.” – <a
|
||
href="https://twitter.com/nicoberger/status/901777571456614400">Nicolás
|
||
Berger</a></p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>The #Blockchain has changed the world. Here I make the argument that
|
||
the #Blockchain is just like #git. – <a
|
||
href="https://twitter.com/sjkelleyjr/status/901464041163341824">Jackson
|
||
Kelley</a></p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p><code>git merge [-m REF] [-g BLOB] --push</code> Merge and push all
|
||
signed commits to the blockchain. – <a
|
||
href="https://twitter.com/git_commands/status/935574015015612416">Git
|
||
Commands</a></p>
|
||
</blockquote>
|
||
<h3 id="books">Books</h3>
|
||
<p><a href="https://learnenough.com/git-tutorial"><strong>Learn Enough
|
||
Git to Be Dangerous</strong></a> by Michael Hartl - FREE (Online
|
||
Version) – <em>Getting started ++ Backing up and sharing ++ Intermediate
|
||
workflow ++ Collaborating ++ Conclusion ++ Advanced setup</em></p>
|
||
<p><a href="https://git-scm.com/book"><strong>Pro Git</strong></a> by
|
||
Scott Chacon and Ben Straub, 2nd Edition, 2014 - FREE (Online Version) –
|
||
<em>Getting Started ++ Git Basics ++ Git Branching ++ Git on the Server
|
||
++ Distributed Git ++ GitHub ++ Git Tools ++ Customizing Git ++ Git and
|
||
Other Systems ++ Git Internals ++ A1: Git in Other Environments ++ A2:
|
||
Embedding Git in your Applications ++ A3: Git Commands</em></p>
|
||
<blockquote>
|
||
<p>Git gets easier once you get the basic idea that branches are
|
||
homeomorphic endofunctors mapping submanifolds of a Hilbert space. –
|
||
Anonymous</p>
|
||
</blockquote>
|
||
<h3 id="open-distributed-databases-on-git">Open Distributed Databases on
|
||
Git</h3>
|
||
<p><a
|
||
href="https://github.com/openfootball"><strong>football.db</strong></a>
|
||
- open public domain football datasets (incl. clubs, national teams,
|
||
leagues, match schedules, etc.)</p>
|
||
<p><a href="https://github.com/openmundi"><strong>world.db</strong></a>
|
||
- open public domain world (country) datasets</p>
|
||
<p><a href="https://github.com/openbeer"><strong>beer.db</strong></a> -
|
||
open public domain beer & brewery datasets</p>
|
||
<blockquote>
|
||
<p>Add a beer transaction to the #blockchain on #git and win a free
|
||
Wiener Lager beer! Cheers. Prost. – <a
|
||
href="https://twitter.com/austriacodes/status/907240018435088384">Gerald
|
||
Bauer @ Austria Codes</a></p>
|
||
</blockquote>
|
||
<h3 id="open-distributed-hyper-ledger-books-on-git">Open Distributed
|
||
(Hyper) Ledger Books on Git</h3>
|
||
<p><a href="https://github.com/bitshilling/bitshilling"><strong>Shilling
|
||
(or Schilling)</strong></a> - Shilling on the Blockchain! - Rock-Solid
|
||
Alpine Dollar from Austria</p>
|
||
<p><a href="TULIPS.md"><strong>Tulips</strong></a> - Tulips on the
|
||
Blockchain! - Learn by Example from the Real World (Anno 1637) - Buy!
|
||
Sell! Hold! Enjoy the Beauty of Admiral of Admirals, Semper Augustus,
|
||
and More</p>
|
||
<h2 id="classic-tulip-mania">Classic Tulip Mania</h2>
|
||
<p><em>A period in the Dutch Golden Age during which contract prices for
|
||
bulbs of the recently introduced tulip reached extraordinarily high
|
||
levels and then dramatically collapsed in February 1637.</em></p>
|
||
<p><img src="i/tulipmania-ii.png" /></p>
|
||
<h3 id="quotes---blockchains-are-the-next-internets-tulips">Quotes -
|
||
Blockchains are the next Internets / Tulips</h3>
|
||
<blockquote>
|
||
<p>People who compare digital tokens to tulips are essentially saying
|
||
digital tokens are a bubble backed by nothing but pure hype and
|
||
speculation.</p>
|
||
<p>What they fail to understand is that tulips come from dirt, not a
|
||
blockchain.</p>
|
||
<p>And as we all know, blockchain is possibly the best technological
|
||
innovation since the internet. It will have a tremendous impact on
|
||
global business and society in general. – <a
|
||
href="http://tuliptoken.com">TulipToken</a></p>
|
||
</blockquote>
|
||
<h3 id="books-1">Books</h3>
|
||
<p><strong>Tulipomania: The Story of the World’s Most Coveted Flower
|
||
& the Extraordinary Passions It Aroused</strong> by Mike Dash, 2001
|
||
– <em>A Mania for Tulips ++ The Valley of Tien Shan ++ Within the Abode
|
||
of Bliss ++ Stranger from the East ++ Clusius ++ Leiden ++ An Adornment
|
||
to the Cleavage ++ The Tulip in the Mirror ++ Florists ++ Boom ++ At the
|
||
Sign of the Golden Grape ++ The Orphans of Wouter Winkel ++ Bust ++
|
||
Goddess of Whores ++ At the Court of the Tulip King ++ Late
|
||
Flowering</em></p>
|
||
<p><strong>Tulipmania: Money, Honor, and Knowledge in the Dutch Golden
|
||
Age</strong> by Anne Goldgar, 2007 – <em>Something Strange ++ Art &
|
||
Flowers ++ Bloemisten ++ Grieving Money ++ Bad Faith ++ Cabbage Fever ++
|
||
Glossary ++ A Note on Money</em></p>
|
||
<p><img src="i/tulipmania.png" /></p>
|
||
<h2
|
||
id="breaking-news-cryptokitties-yes-cute-little-cartoon-cats-on-the-blockchain">Breaking
|
||
News: CryptoKitties (Yes, Cute Little Cartoon Cats) on the
|
||
Blockchain!</h2>
|
||
<p>Collectible. Breedable. Adorable.</p>
|
||
<p>Collect and breed digital cats. Start meow. Buy! Sell! Hold!</p>
|
||
<p>Learn more @ <a
|
||
href="https://cryptokitties.co">cryptokitties.co</a></p>
|
||
<p><img src="i/cryptokitties-top10-sales.png" /></p>
|
||
<!-- note: changed pic; was:
|
||

|
||
-->
|
||
<p>Latest (and Greatest) Investment Opportunity!</p>
|
||
<blockquote>
|
||
<p>Blockchain has unlocked the magic of digital scarcity, and combining
|
||
that with the power of making the digital goods persistent gives them a
|
||
potential value that is only limited by how much prestige a wealthy
|
||
person might place on ownership of the item.</p>
|
||
<p>– <a
|
||
href="https://twitter.com/tokenizedcap/status/938460753589424128">Justin
|
||
Poirier</a></p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>All I want for Christmas is a CryptoKitty.</p>
|
||
<p>– <a
|
||
href="https://twitter.com/kaylaw/status/938590748655550464">Kayla
|
||
Williams</a></p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>I got a fever. And the only prescription is more CryptoKitties.</p>
|
||
<p>– <a
|
||
href="https://twitter.com/ceduardosalazar/status/938558630663634944">Eduardo
|
||
Salazar</a></p>
|
||
</blockquote>
|
||
<blockquote>
|
||
<p>My Gen 7 CryptoKitty #104375. The Future is Meow.</p>
|
||
<p>– <a
|
||
href="https://twitter.com/TheAnshulDhawan/status/938551642202324993">Anshul
|
||
Dhawan</a></p>
|
||
</blockquote>
|
||
<p><img src="i/cryptokitties-genes01.png" /></p>
|
||
<blockquote>
|
||
<ul>
|
||
<li>Fabulous Persian Spock Gerbil Gold Cottoncandy - Extremely rare gen
|
||
5 swift virgin | 2.9 ETH</li>
|
||
<li>Rarity: 0.00264% Gen 5 JAGUAR FABULOUS GOLD DALI!! VIRGIN!</li>
|
||
<li>Rarity: 0.0015% Princess Bubblegum is now for sale! Gen 12 | Brisk |
|
||
Virgin | Chartreux | Bubblegum | Otaku | Emeraldgreen | Saycheese |
|
||
Mauveover | Spock - Starts ETH 20/Ends ETH 10</li>
|
||
<li>Gold ducat, Gen 5, Virgin, Swift. Very cheap</li>
|
||
<li>Cheap Gen 1 cute kittie with rare genes! Only 0.125 ETH</li>
|
||
<li>UNIQUE Virgin Peach Googly Gold Mauveover gen:2 cooldown:1 0.87992%
|
||
RARE</li>
|
||
<li>SUPER CHEAP: Gerbil, Ragdoll, Scarlet, Chestnut, Cotton Candy!!!
|
||
0.02 ETH (~$14)</li>
|
||
<li>I’m giving away a Gen 1 FAST Gold for free…</li>
|
||
</ul>
|
||
<p>– <a
|
||
href="https://www.reddit.com/r/CryptoKittiesMarket">CrypoKittiesMarket</a></p>
|
||
</blockquote>
|
||
<h3 id="awesome-cryptokitties-and-cryptocopycats">Awesome CryptoKitties
|
||
(and CryptoCopycats)</h3>
|
||
<p><img src="i/cryptokitties-modernart-paintings.png" /></p>
|
||
<p>A collection about Awesome CryptoKitties (Yes, Cute Little Cartoon
|
||
Cats) on the Blockchain! and CryptoCopycats - digital collectibles
|
||
secured on a distributed public databases w/ crypto hashes. Are
|
||
CryptoPuppies the new CryptoKitties? Learn by Example from the Real
|
||
World (Anno 2017) - Buy! Sell! Hodl!</p>
|
||
<p>More @ <a
|
||
href="https://github.com/cryptocopycats/awesome-cryptokitties">cryptocopycats/awesome-cryptokitties</a></p>
|
||
<p><img src="i/cryptokitties-modernart-paintings-iii.png" /></p>
|
||
<h2 id="events-meetups-orgs">Events, Meetups, Orgs</h2>
|
||
<p><em>Revolutionize the world one country at a time. Blockchainers of
|
||
the world, unite!</em></p>
|
||
<ul>
|
||
<li><a
|
||
href="https://github.com/austriacodes/blockchain-austria"><strong>Blockchain
|
||
Austria • Blockkette Österreich</strong></a> – distributed centralized
|
||
page for blockchain meetups & orgs in Austria (Central Europe)</li>
|
||
</ul>
|
||
<h2 id="awesome-awesomeness">Awesome Awesomeness</h2>
|
||
<p><em>A curated list of awesome lists.</em></p>
|
||
<ul>
|
||
<li><a href="https://github.com/Xel/Blockchain-stuff"><strong>Blockchain
|
||
Stuff</strong></a> – a curated list of blockchain and general
|
||
cryptocurrency resources</li>
|
||
<li><a href="https://roadmap.sh/blockchain"><strong>Blockchain
|
||
Roadmap</strong></a> – a step-by-step roadmap / guide to become a
|
||
blockchain programmer</li>
|
||
<li><a
|
||
href="https://github.com/igorbarinov/awesome-blockchain"><strong>Awesome
|
||
Blockchain</strong></a> by Igor Barinov et al – a curated list of the
|
||
bitcoin blockchain services</li>
|
||
<li><a
|
||
href="https://github.com/imbaniac/awesome-blockchain"><strong>Awesome
|
||
Blockchain</strong></a> by Tim Reznich et al – a curated list of
|
||
blockchain services and exchanges</li>
|
||
<li><a
|
||
href="https://github.com/istinspring/awesome-blockchain"><strong>Awesome
|
||
Blockchain</strong></a> by <code>istinspring</code> et al – a curated
|
||
list of awesome projects and services based on blockchain
|
||
technology</li>
|
||
<li><a
|
||
href="https://github.com/kennethreitz/awesome-coins"><strong>Awesome
|
||
Coins</strong></a> by Kenneth Reitz et al – a guide to crypto-currencies
|
||
and their algos</li>
|
||
<li><a
|
||
href="https://github.com/openblockchains/awesome-cryptokitties"><strong>Awesome
|
||
CryptoKitties (and CryptoCopycats)</strong></a> by Gerald Bauer et al –
|
||
a curated list about the awesome crypto kitties and copycats</li>
|
||
<li><a href="https://github.com/dictcp/awesome-git"><strong>Awesome
|
||
Git</strong></a> by Dick Tang et al – a curated list of amazingly
|
||
awesome Git tools, resources and shiny things</li>
|
||
<li><a
|
||
href="https://github.com/sindresorhus/awesome"><strong>Awesome</strong></a>
|
||
by Sindre Sorhus et al – a curated list of awesome lists</li>
|
||
</ul>
|
||
<h2 id="meta">Meta</h2>
|
||
<p><strong>License</strong></p>
|
||
<p><img
|
||
src="https://publicdomainworks.github.io/buttons/zero88x31.png" /></p>
|
||
<p>The awesome list is dedicated to the public domain. Use it as you
|
||
please with no restrictions whatsoever.</p>
|