Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v3-operator-go

A Go implementation of the StakeWise V3 Operator — the service a StakeWise Vault operator runs to register validators, rotate exit signatures, process withdrawals and update vault state.

Status: early work in progress. Only the init command is implemented; run is a skeleton. Use the Python operator for anything real.

The goal is to cover the core operator features, taking advantage of Go's concurrency model: CPU-bound work such as key generation and BLS signature verification parallelises with goroutines, without the memory cost of the Python version's multiprocessing.

Requirements

  • Go 1.23 or later
  • A C compiler — BLS operations use herumi/bls-eth-go-binary, so builds require cgo (CGO_ENABLED=1, the default); cross-compiling needs a matching C toolchain.

Build

go build -o v3-operator ./cmd

Usage

init

Generates a BIP39 mnemonic and creates the vault configuration directory.

./v3-operator init --vault 0xYourVaultAddress

The mnemonic is printed once and you are asked to type it back to confirm it was recorded. It is the only way to recover your validator keys — write it down and store it safely. Pass --no-verify to skip the confirmation step.

Flag Default Description
--vault (required) Vault address
--network mainnet Network of your vault
--data-dir $HOME/.stakewise Where keystores and config are stored
--no-verify false Skip mnemonic verification

This writes <data-dir>/<vault-address-lowercase>/config.json:

{
  "network": "mainnet",
  "mnemonic_next_index": 0,
  "first_public_key": "0xb3e445d43871965d890a398f719348a1405ac72e35b92727cc570026f54471af7ea7b2040622a8fd0b5bfb2a209b5911"
}

The file format matches the Python operator, so the two implementations read the same configuration. Validator keys are BLS12-381 keys derived per EIP-2333 along the EIP-2334 path m/12381/3600/<index>/0/0.

Unlike the Python operator, mnemonics are generated from the English wordlist only.

run

Starts the background worker. Currently a skeleton that idles until interrupted.

./v3-operator run

Development

go test ./...
go vet ./...
gofmt -l .

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages