Remote Signing with Web3Signer
Web3Signer is a tool by Consensys which allows remote signing. Remote signing is when a Validator Client (VC) out-sources the signing of messages to a remote server (e.g., via HTTPS). This means that the VC does not hold the validator private keys.
Warnings
Using a remote signer comes with risks, please read the following two warnings before proceeding:
Remote signing is complex and risky
Remote signing is generally only desirable for enterprise users or users with unique security requirements. Most users will find the separation between the Beacon Node (BN) and VC to be sufficient without introducing a remote signer.
Using a remote signer introduces a new set of security and slashing risks and should only be undertaken by advanced users who fully understand the risks.
Web3Signer is not maintained by Lighthouse
The Web3Signer tool is maintained by Consensys, the same team that maintains Teku. The Lighthouse team (Sigma Prime) does not maintain Web3Signer or make any guarantees about its safety or effectiveness.
Usage
A remote signing validator is added to Lighthouse in much the same way as one that uses a local
keystore, via the validator_definitions.yml file or via the POST /lighthouse/validators/web3signer API endpoint.
Here is an example of a validator_definitions.yml file containing one validator which uses a
remote signer:
---
- enabled: true
voting_public_key: "0xa5566f9ec3c6e1fdf362634ebec9ef7aceb0e460e5079714808388e5d48f4ae1e12897fed1bea951c17fa389d511e477"
type: web3signer
url: "https://my-remote-signer.com:1234"
root_certificate_path: /home/paul/my-certificates/my-remote-signer.pem
client_identity_path: /home/paul/my-keys/my-identity-certificate.p12
client_identity_password: "password"
When using this file, the Lighthouse VC will perform duties for the 0xa5566.. validator and refer
to the https://my-remote-signer.com:1234 server to obtain any signatures. It will load a
“self-signed” SSL certificate from /home/paul/my-certificates/my-remote-signer.pem (on the
filesystem of the VC) to encrypt the communications between the VC and Web3Signer. It will use
SSL client authentication with the “self-signed” certificate in /home/paul/my-keys/my-identity-certificate.p12.
The
request_timeout_mskey can also be specified. Use this key to override the default timeout with a new timeout in milliseconds. This is the timeout before requests to Web3Signer are considered to be failures. Setting a value that is too long may create contention and late duties in the VC. Setting it too short will result in failed signatures and therefore missed duties.
System certificate authorities
The root_certificate_path key is only required for a certificate authority (CA) which Lighthouse
does not already trust. The Lighthouse VC will trust its bundled public roots as well as the
certificate authorities in the system trust store, so a CA which has been installed system-wide does
not need to be named in the validator_definitions.yml file.
The SSL_CERT_FILE environment variable can be used to name a file containing one or more
certificates in PEM format. The SSL_CERT_DIR environment variable can be used to name a
colon-separated list of directories containing certificate files.
Setting either of these variables will replace the system trust store rather than adding to it. If
SSL_CERT_FILEis already set (as it is in some container images) and a CA is mounted into a directory, thenSSL_CERT_DIRmust also be set, otherwise the mounted CA will be ignored. The bundled public roots will remain trusted in either case.
Slashing protection database
Web3signer can be configured with its own slashing protection database. This makes the local slashing protection database by Lighthouse redundant. To disable Lighthouse slashing protection database for web3signer keys, use the flag --disable-slashing-protection-web3signer on the validator client.
Note: DO NOT use this flag unless you are certain that slashing protection is enabled on web3signer.
The --init-slashing-protection flag is also required to initialize the slashing protection database locally.