From cd3364e01c1e9b6f6ff3e3de1c50ab6704e644ea Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Wed, 20 Jun 2018 09:52:10 -0400 Subject: [PATCH] Create pow.md moving from: https://lbry.io/faq/proof-algorithm --- content/resources/pow.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 content/resources/pow.md diff --git a/content/resources/pow.md b/content/resources/pow.md new file mode 100644 index 0000000..d2a7090 --- /dev/null +++ b/content/resources/pow.md @@ -0,0 +1,19 @@ +## The LBRY Proof of Work (POW) Algorithm + +LBRY uses [proof of work](https://en.bitcoin.it/wiki/Proof_of_work) the same way that Bitcoin does. The +only difference is the hash function. LBRY uses a slightly different algorithm that achieves the same ends but slightly delayed the development of a GPU miner and gave early adopters a chance to mine without specialized hardware. + +LBRY's algorithm is + +```python +intermediate = sha512(sha256(sha256(data))) # compute the sha512() of the double-sha256() of the data +left = ripemd(intermediate[:len(intermediate)/2]) # separately ripemd160 the left half +right = ripemd(intermediate[len(intermediate)/2:]) # and the right half +proof = sha256(sha256(left + right)) # concatenate the two halves, and double-sha256() it again +``` + +For comparison, Bitcoin's algorithm is + +```python +proof = sha256(sha256(data)) +```