FastMulThreshold-DSA

module
v0.0.0-...-1e2cef0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2023 License: GPL-2.0, GPL-3.0

README

Introduction

This is an implementation of multi-party threshold ECDSA (elliptic curve digital signature algorithm) based on GG20: One Round Threshold ECDSA with Identifiable Abort and eddsa (Edwards curve digital signature algorithm),including the implementation of approval list connected with upper layer business logic and channel broadcasting based on P2P protocol.

It includes three main functions:

(1) Key generation is used to create secret sharing ("keygen") without trusted dealers.

(2) Use secret sharing,Paillier encryption and decryption to generate a signature ("signing").

(3) Preprocessing data before generating signature.(“pre-sign”).

When issuing the keygen/signing request command, there are two modes to choose from:

(1) Each participant node needs to approve the request command with its own account.It will first get the request command from the local approval list, and then approve or disagree.

(2) Each participant node does not need to approve the request command,which is agreed by default.

In distributed computing,message communication is required between each participant node.Firstly,the selected participants will form a group,and then P2P communication will be carried out within the group to exchange the intermediate calculation results of FastMPC algorithm.

The implementation is mainly developed in golang language,with a small amount of shell and C language.Leveldb database is used for local data storage,and third-party library codes such as Ethereum source code P2P and RPC modules and golang crypto are cited.

The implementation provides a series of RPC interfaces for external applications,such as bridge / router,to call in an RPC driven manner.The external application initiates a keygen/signaling request(RPC call),and then calls another RPC interface to obtain the approval list for approval.When the distributed calculation is completed,it will continue to call the RPC interface to obtain the calculation results.

Note : fastMPC is considered beta software. We make no warranties or guarantees of its security or stability.

Install from code

Prerequisites

  1. VPS server with 1 CPU and 2G mem
  2. Static public IP
  3. Golang ^1.20

Setting Up

Clone The Repository

To get started, launch your terminal and download the latest version of the SDK.

git clone https://github.com/RWAValueRouter/FastMulThreshold-DSA.git

Build

Next compile the code. Make sure you are in FastMulThreshold-DSA directory.

cd FastMulThreshold-DSA && make all

Run By Default BootNode And Parametes

run the smpc node in the background:

nohup ./build/bin/gsmpc &

The gsmpc will provide rpc service, the default RPC port is port 4449.

Manually Set Parameter To Run Node And Self-test

keygen-and-sign-workflow

Local Test

It will take some time more than 15 minutes,please wait patiently!

make gsmpc-test

#Note

1.If you want to call RPC API, please wait at least 2 minutes after running the node.

2.If you want to call RPC API quickly more than once,please wait longer.

3.If you want to reboot a node, please wait 2 minute after closing node before restarting the node.

Directories

Path Synopsis
The ci command is called from Continuous Integration scripts.
The ci command is called from Continuous Integration scripts.
cmd
bootnode
bootnode runs a bootstrap node for the Ethereum Discovery Protocol.
bootnode runs a bootstrap node for the Ethereum Discovery Protocol.
gsmpc
Package main Gsmpc main program
Package main Gsmpc main program
gsmpc-client
Package main Gsmpc-client main program
Package main Gsmpc-client main program
secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
internal
common
Package common contains various helper functions.
Package common contains various helper functions.
common/hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.
common/math
Package math provides integer math utilities.
Package math provides integer math utilities.
common/mclock
Package mclock is a wrapper for a monotonic clock source
Package mclock is a wrapper for a monotonic clock source
Package log is a wrapper of logrus.
Package log is a wrapper of logrus.
Package node sets up multi-protocol Ethereum nodes.
Package node sets up multi-protocol Ethereum nodes.
p2p
Package p2p implements the Ethereum p2p network protocols.
Package p2p implements the Ethereum p2p network protocols.
discover
Package discover implements the Node Discovery Protocol.
Package discover implements the Node Discovery Protocol.
discv5
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
event
Package event deals with subscriptions to real-time events.
Package event deals with subscriptions to real-time events.
metrics
Go port of Coda Hale's Metrics library
Go port of Coda Hale's Metrics library
nat
Package nat provides access to common network port mapping protocols.
Package nat provides access to common network port mapping protocols.
netutil
Package netutil contains extensions to the net package.
Package netutil contains extensions to the net package.
protocols
Package protocols is an extension to p2p.
Package protocols is an extension to p2p.
rlp
Package rlp implements the RLP serialization format.
Package rlp implements the RLP serialization format.
simulations
Package simulations simulates p2p networks.
Package simulations simulates p2p networks.
rpc
Package rpc provides access to the exported methods of an object across a network or other I/O connection.
Package rpc provides access to the exported methods of an object across a network or other I/O connection.
smpc
Package smpc Gsmpc rpc interface
Package smpc Gsmpc rpc interface
Package smpc Keygen/Sign/Reshare,The complete implementation process includes receiving commands, selecting data packets, receiving and analyzing consent data, executing MPC process, database processing, P2P message analysis and processing, result return, etc
Package smpc Keygen/Sign/Reshare,The complete implementation process includes receiving commands, selecting data packets, receiving and analyzing consent data, executing MPC process, database processing, P2P message analysis and processing, result return, etc
smpc-lib
crypto/ec2
Package ec2 MPC gg18 algorithm
Package ec2 MPC gg18 algorithm
crypto/ed
Package ed MPC ed algorithm
Package ed MPC ed algorithm
ecdsa/keygen
Package keygen MPC implementation of generating pubkey
Package keygen MPC implementation of generating pubkey
ecdsa/reshare
Package reshare MPC implementation of reshare
Package reshare MPC implementation of reshare
ecdsa/signing
Package signing MPC implementation of signing
Package signing MPC implementation of signing
eddsa/keygen
Package keygen ED MPC implementation of generating pubkey
Package keygen ED MPC implementation of generating pubkey
eddsa/signing
Package signing ED MPC implementation of signing
Package signing ED MPC implementation of signing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL