Skip to main content
Version: 23.8.0

Slashing protection

Teku implements slashing protection to prevent validators from signing incorrect blocks or attestations.

You can import and export the slashing protection file when migrating validator keys between validator clients. Teku supports the validator client interchange format when importing or exporting the slashing protection file.

note

If using an external signer that implements its own slashing protection (for example Web3Signer), then you can disable Teku's built-in slashing protection using the --validators-external-signer-slashing-protection-enabled command line option.

tip

You can also enable doppelganger detection to help prevent slashing. This is an early access feature.

Import a slashing protection file

When importing the slashing protection file, Teku imports the file to the <data-path>/validators/slashprotection/ directory in the format <validator-pubkey>.yml (with no 0x prefix).

Example
teku slashing-protection import --data-path=/home/me/me_node --from=/home/slash/slashing-interchange-format.json

In the command line:

  • --data-path specifies the location of the Teku data directory.
  • --from specifies the location of the slashing protection file.

In this example, Teku imports the file to the /home/me/me_node/data/validators/slashprotection/ directory.

Export a slashing protection file

Export the slashing protection file when migrating a validator to a different Teku, or non-Teku node.

Example
teku slashing-protection export --data-path=/home/me/me_node --to=/home/slash/slashing-interchange-format-minimal.json

In the command line:

  • --data-path specifies the location of the Teku data directory.
  • --to specifies the file to export the slashing protection data to.

You can now import the slashing protection file in a Teku, or non-Teku node.