unconditional-mpc is an MPC framework.
It contains a compiler, written in Python, for translating programs in a simple imperative language into a list of instructions.
It contains a runtime, written in Golang, which allows several parties to run the protocol specified by such a list of instructions.
First install Python and Go, and clone repository.
To run the compiler, the package 'ply' must be installed. First install pip, if not done already. Then run the following:
python -m pip install plyTo compile a program, the general command is:
python compile_script.py input_path -o output_pathTo test that this works, try running the following:
python compile_script.py example_programs/input.txt -o instructions.txtThis should result in the following appearing in instructions.txt:
INPUT 1 a
INPUT 2 b
PLUS a b sum
OUTPUT sum outputFor each party that provides an input to the protocol, the input must be stored in a file of the format:
a = 42The runtime can be executed from the src directory using the command:
go run main.go program_path input_path_prefix config_pathWhere program_path is the path to the instructions generated by the compiler, input_path_prefix is a prefix of the path to the file storing a node's input using the convention that each node's input file has the index of the node appended to it.
config_path is an optional path to a file specifying the parameters of the secret sharing scheme, i.e. the number of participants, the threshold and the prime defining the field. They are specified in the format:
p 4001
n 11
t 5Not providing any arguments to the runtime will run a test specified in main.go equivalent of providing the arguments:
go run main.go player/tests/compiled/prog player/tests/compiled/input player/tests/compiled/configFor a specification of the source language used for writing programs to the compiler, please see the project report pdf.