This is a minimal example project that demonstrates how to use two Vertex servers to generate a keypair between them. This process ensures that each Vertex has a unique secret share. Once the keypair is generated, both servers can utilize MPC to sign messages securely. Vertex servers can be deployed across different cloud accounts/providers, with support for AWS, Azure and GCP.
This example goes through a simple keygen and then sign flow in order to show how keys can be created in a distributed manner across different Vertex servers.
In index.js
there is a main
function.
The main
function details the high-level flow that uses the Sodot-hosted demo Vertex servers to:
- Generate a keypair across the 2 different Vertex servers (in practice these can be hosted by 2 different entities).
- Use BIP-32 non-hardened derivation to derive a public key for signing. Which it then converts to an EVM address.
- Sign an Ethereum signed message. The signature can then be verified on Etherscan.
To view the full details regarding the Vertex REST API used by this project, see the docs here.
To run this example project, follow these steps:
- Clone the repository:
git clone https://github.com/sodot-rs/sodot-vertex-to-vertex-example.git
- Install the required dependencies:
npm install
- Create a
.env
file with at least 2 API keys for either demo or production Vertex servers. - (Optional) Configure the
VERTICES
variable at the top ofindex.js
in case you are running your own Vertex servers. - Run the example:
node index.js