Compete on the fastest replication algorithm - Participate here!
What is this "game"? The Replication Game is a competition where participants compete to outperform the default implementation of Proof-of-Replication. To participate in the game, you can run the current replication algorithm (or your own implementation) and post your proof on our server.
What is Proof-of-Replication? Proof of Replication is the proof that: (1) the Filecoin Storage Market is secure: it ensures that miners cannot lie about storing users' data, (2) the Filecoin Blockchain is secure: it ensures that miners cannot lie about the amount of storage they have (remember, miners win blocks based on their storage power!). In Filecoin, we use the Proof of Replication inside "Sealing" during mining.
How does Proof of Replication work? The intuition behind Proof of Replication is the following: the data from the Filecoin market is encoded via a slow sequential computation that cannot be parallelized.
How can I climb up in the leaderboard? There are some strategies to replicate "faster", some are practical (software and hardware optimizations), some are believe to be impractical or impossible (get ready to win a price and be remembered in the history of cryptography if you do so!)
This executes an actual game, using rust-proofs, feel free to implement your own version.
Make sure you have all required dependencies installed:
rustup install nightly
)From the replication-game/ directory, compile the game binary:
cargo +nightly build --release --bin replication-game
There are two ways to play:
play
helper scriptplay
helper scriptFrom the replication-game/ directory, run the play
helper script in bin/
, specifying:
NAME
: your player nameSIZE
: the size in KB of the data you want to replicateTYPE
: the type of algorithm you want to run (current options are zigzag
and drgporep
)# Run like this:
# bin/play NAME SIZE TYPE
# E.g.
# Zigzag 10MiB
bin/play NAME 10240 zigzag
# Zigzag 1GiB
bin/play NAME 1048576 zigzag
# DrgPoRep 10MiB
bin/play NAME 10240 drgporep
# DrgPoRep 1GiB
bin/play NAME 1048576 drgporep
The play
script will retrieve the seed from the game server, replicate the data, generate a proof, and then post that proof to the game server. The script runs each of the commands in Method 2, but wraps them in an easy-to-use shell script.
Set your player name:
export REPL_GAME_ID="ReadyPlayerOne"
Get the seed from our server:
curl https://replication-game.herokuapp.com/api/seed > seed.json
export REPL_GAME_SEED=$(cat seed.json| jq -r '.seed')
export REPL_GAME_TIMESTAMP=$(cat seed.json| jq -r '.timestamp')
Play the game:
./target/release/replication-game \
--prover $REPL_GAME_ID \
--seed $REPL_GAME_SEED \
--timestamp $REPL_GAME_TIMESTAMP \
--size 10240 \
zigzag > proof.json
Send your proof:
curl -X POST -H "Content-Type: application/json" -d @./proof.json https://replication-game.herokuapp.com/api/proof
There are three ways to check the leaderboard, two from the command line and one from the browser:
show-leaderboard
helper scriptshow-leaderboard
helper scriptFrom the replication-game/ directory, run the show-leaderboard
helper script in bin/
, specifying SIZE
, which is the size in KB by which you want to filter the leaderboard results. The leaderboard shows all results across all parameters in a single list, so filtering by SIZE
allows you to see only those results that match a particular size.
bin/show-leaderboard SIZE
To check the current leaderboard using curl
:
curl https://replication-game.herokuapp.com/api/leaderboard | jq
You can also directly view the leaderboard in the browser at https://replication-game.herokuapp.com/.
What parameters should I be using for the replication?
Our leaderboard will track the parameters you will be using, feel free to experiment with many. We are targeting powers of two, in particular: 1GiB (--size 1048576
), 16GiB (--size 16777216
), 1TB (--size 1073741824
)
How do I know what the parameters mean?
./target/debug/replication-game --help
What do I win if I am first?
So far, we have no bounty set up for this, but we are planning on doing so. If you beat the replication game (and you can prove it by being in the leaderboard), reach out to filecoin-research@protocol.ai.
$ cargo +nightly run --bin replication-game-server
This server requires Postgresql to work. The details of the expected configuration can be found in Rocket.toml
. The default environment is development
.
/api/seed
:
timestamp
(unix time) and a seed
to be used as replica_id
in the proof of replication/api/proof
timestamp
, seed
, prover_id
and proof
proof
is correctreplication_time = timestamp - current_time
replication_time < times[prover_id]
, then times[prover_id] = replication_time
/api/leaderboard
:
The Filecoin Project is dual-licensed under Apache 2.0 and MIT terms: