Given that the current idea of StoffelMPC is to support just the HoneyBadgerMPC protocol, this PR aims to change the skeleton of the library in order to reduce the complexity and to add functionalities specific to the HoneyBadgerMPC protocol. Also, I changed the skeleton, so that the components of the VM resemble something that is more traditional according to other MPC VMs like SCALE-MAMBA and MP-SDPZ.
Changelog
November 17, 2023
Moved the memory from ArithmeticCore to StoffelVM according to SCALE-MAMBA specification (Section 5.1). In such framework, there is no private memory for each thread.
Deleted types Public , Secret , and VmType , from the MPCProtocol trait and added the type Domain, which is the underlying domain of computation of the protocol.
Deleted into_vm_type from the trait MPCProtocol.
November 20, 2023
Created a Share struct to hold the share that each party has.
Changed trait Number to MpcType that will be the trait that groups all the types held by the VM. In particular Share<T> and the field of the curve BLS12_381 implement the MpcType trait.
Memory now allows MpcTypes. The rationale behind this is that the memory will hold types Share<T> (for the secret values) and Field types (for the clear values).
The above point also holds for registers and stack.
Updated ark dependencies.
November 22, 2023
Added MemoryAddr as a new type for indexing memory positions.
Removed processor field from Instruction struct. Now Instruction does not have a generic.
code has been removed from StoffelVM struct and it was replaced by programs: Vec<Program>. Remmeber that we need an Schedule to manage all the programs that are being executed.
Added an Schedule struct to manage the prgrams. However, according to SCALE-MAMBA, the programs vector are inside the Schedule struct.
Created a Memory to represent the global memory, and the different arrays for each data type are MemoryArrays aiming for a better modularity during the execution.
December 1, 2023
Added implementations for new instructions.
Added tests for some of the instructions.
Overloaded the +/-/* operators between secret/secret and clear/secret values.
From December 4, 2023 to December 7, 2023
Added register for register addresses, which is a mimic for regint.
Added implementations for new instructions following the SCALE-MAMBA.
Using num-bigint crate to perform the arithmetic between BigIntegers given that this crate supports way more arithmetic operations than the library from ark-ff. I added two functions from_domain_to_bigint<T>() and from_domain_to_bigint<T>() to perform this task. We should consider if this is enough or if it needs a better level of abstraction.
Added tests for instructions.
December 11, 2023 to December 15, 2023.
Added error handling for VM operations and instructions.
Include the updates from arkworks-rs/algebra into about the bitwise operations to avoid a transition using BigUint. From this task, there were two PRs created for arkworks-rs/algebra:
General idea
Given that the current idea of StoffelMPC is to support just the HoneyBadgerMPC protocol, this PR aims to change the skeleton of the library in order to reduce the complexity and to add functionalities specific to the HoneyBadgerMPC protocol. Also, I changed the skeleton, so that the components of the VM resemble something that is more traditional according to other MPC VMs like SCALE-MAMBA and MP-SDPZ.
Changelog
November 17, 2023
ArithmeticCore
toStoffelVM
according to SCALE-MAMBA specification (Section 5.1). In such framework, there is no private memory for each thread.Public
,Secret
, andVmType
, from theMPCProtocol
trait and added the typeDomain
, which is the underlying domain of computation of the protocol.into_vm_type
from the traitMPCProtocol
.November 20, 2023
Share
struct to hold the share that each party has.Number
toMpcType
that will be the trait that groups all the types held by the VM. In particularShare<T>
and the field of the curve BLS12_381 implement theMpcType
trait.MpcTypes
. The rationale behind this is that the memory will hold typesShare<T>
(for the secret values) andField
types (for the clear values).ark
dependencies.November 22, 2023
MemoryAddr
as a new type for indexing memory positions.processor
field fromInstruction
struct. Now Instruction does not have a generic.code
has been removed fromStoffelVM
struct and it was replaced byprograms: Vec<Program>
. Remmeber that we need an Schedule to manage all the programs that are being executed.Schedule
struct to manage the prgrams. However, according to SCALE-MAMBA, the programs vector are inside theSchedule
struct.Memory
to represent the global memory, and the different arrays for each data type areMemoryArrays
aiming for a better modularity during the execution.December 1, 2023
From December 4, 2023 to December 7, 2023
num-bigint
crate to perform the arithmetic betweenBigIntegers
given that this crate supports way more arithmetic operations than the library fromark-ff
. I added two functionsfrom_domain_to_bigint<T>()
andfrom_domain_to_bigint<T>()
to perform this task. We should consider if this is enough or if it needs a better level of abstraction.December 11, 2023 to December 15, 2023.