Skip to content

Permacoin Implementation

Alexander Chepurnoy edited this page Feb 25, 2016 · 28 revisions

Permacoin whitepaper describes how to use non-interactive Proof-of-Retrievability scheme to build a consensus protocol for a blockchain-based system thus repurposing miners work for data preservation. This article describes how Permacoin concept is implemented as Scorex module. Please note,there are some improvements known, e.g. Retricoin, and they are not considered for inclusion yet.

How Permacoin Is Implemented

All the Scala code implementing Permacoin is located within scorex-perma/src/main/scala/scorex/perma/consensus folder. Other parts of the module are describing storage, settings, API, network protocol additions. Functions are defined in PermaConsensusModule.scala. An algorithm is based on "Local-POR lottery"(Fig. 2, p. 7 in the paper) and works as follows:

  1. Trusted system setup. No maximum-distance-separable encoding has been implemented. So trusted dealer just breaks dataset into chunks and then builds . A Merkle tree root hash is then hardcoded into a node settings.

  2. Mining setup.

Blake is used for hashing, Ed25519 for signing.

Possible Attack Vectors and Open Problems

Testnet Constants

Clone this wiki locally