#encoder #permutation #sloth

spartan-codec

A proof-of-concept encoder for the Subspace Network Blockchain based on the SLOTH permutation

1 unstable release

0.1.0 Apr 18, 2021

#1155 in Math

26 downloads per month
Used in spartan-farmer

MIT and LGPL-3.0+

20KB
343 lines

spartan-codec

A proof-of-concept encoder for the Subspace Network Blockchain based on the SLOTH permutation

CI Crates.io Docs License

Overview

Notes: The code is un-audited and not production ready, use it at your own risk.

Subspace is a proof-of-storage blockchain that resolves the farmer's dilemma, to learn more read our whitepaper.

This is an adaptation of SLOTH (slow-timed hash function) into a time-asymmetric permutation using a standard CBC block cipher. This code is largely based on the C implementation used in PySloth which is the same as used in the paper.

Install

This crate requires Rust 1.51 or newer to compile.

If you have not previously installed the gmp_mpfr_sys crate, follow these instructions.

git clone https://github.com/subspace/spartan-codec.git
cd spartan-codec
cargo build

Run Tests

cargo test

Run Benches

TODO

Benches single block encode/decode time and full piece encode/decode time for each prime size.

Dependencies

~3MB
~52K SLoC