Setting up a Mithril Signer
The Mithril project implements Stake-based Threshold Multisignatures on the Cardano network. The Mithril protocol allows individual stakeholders in the Cardano blockchain network to sign messages aggregated into a multi-signature, guaranteeing that the stakeholders represent a minimum share of the total stake.
To set up a Mithril Signer, you need to:
Install Mithril Signer on the block-producing node for your stake pool.
Implement Squid as a forward proxy on one the relays for your stake pool.
Implementing a Mithril Signer and Relay enables your stake pool to contribute to securing the integrity of Mithril snapshots available on the Cardano network.
Mithril has numerous potential applications, including synchronizing data for both light and full-node wallets, as well as facilitating data exchanges with layer 2 solutions such as bridges, sidechains, rollups and state channels. For most stake pools, implementing a Mithril client to bootstrap a Cardano Node using a Mithril snapshot is not necessary.
Installing Mithril Signer on Your Block Producer
To install Rust:
Using a terminal window on your block producer, type the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shWhen prompted, press 1 to proceed with a standard installation
To set up the current shell session, type:
source "$HOME/.cargo/env"To verify the Rust version, type:
rustc --versionTo install Mithril:
To download Mithril, using a terminal window on your block producer, type:
To identify the latest Mithril version available, visit the Latest Release page in the Mithril GitHub repository.
To select the latest version, type the following command where is the version that you identified in step 2
To build Mithril Signer, type:
To verify that Mithril compiled successfully, type:
To move the mithril-signer binary to a dedicated folder, type:
To configure environment variables, type the following command where
<SquidRelayIPAddress>is the IP address of the relay in your stake pool configuration where you plan to implement the Squid forward proxy:
To create a systemd service to manage Mithril, type:
In the
mithril-signer.servicefile, copy and paste the following lines where<UserName>is the user under which to execute the processes of the service,<EnvFilePath>is the full path to themithril-signer.envfile, and<ExecFilePath>is the full path to themithril-signerbinary executable file.
To move the
mithril-signer.servicefile and set file permissions, type:
To enable the service to start when the block producer boots, type:
To start the service, type:
To verify that the service is running, type:
Optionally, to remove the Mithril source files, type:
Implementing Squid on a Relay Node
Configuring Squid as a forward proxy on a relay node in your stake pool configuration handles network traffic between a Mithril Signer and Mithril Aggregator securely. Mithril Aggregator is responsible for collecting and aggregating individual signatures from Mithril Signers into a multi-signature. To protect the security of your block-producing node, use the following Squid configuration.
To configure Squid:
On the relay node where you want to set up a forward proxy to protect your Mithril Signer, type:
To configure Squid, type:
In the
squid.conffile, copy and paste the following lines where<SquidRelayIPAddress>is the IP address where the relay hosting Squid listens, and<BlockProducerIPAddress>is the IP address of the block-producing node hosting Mithril Signer:
To configure UFW firewall rules for Squid, type the following command where
<BlockProducerIPAddress>is the IP address of your block-producing node hosting Mithril Signer, and<SquidRelayIPAddress>is the IP address of the relay node hosting Squid:
To restart Squid, type:
Verifying Your Mithril Signer Implementation
To verify that your Mithril Signer is registered:
Type the following commands to download the
verify_signer_registration.shscript:
To run the script, type the following command where is your stake pool ID using Bech32 format:
If your Mithril Signer is registered, then the script displays:
To verify manually that your Mithril Signer is registered, visit the URL https://aggregator.release-mainnet.api.mithril.network/aggregator/signers/registered/<CurrentEpoch> using a Web browser, where is the current Cardano epoch, and then search the Web page for your stake pool ID in Bech32 format.
After waiting two epochs, you can verify that your Mithril Signer signs certificates.
To verify that your Mithril Signer signs certificates:
Type the following commands to download the
verify_signer_signature.shscript:
To run the script, type the following command where is your stake pool ID using Bech32 format:
If your Mithril signer signs certificates, then the verify_signer_signature.sh script displays a list of certificates that your Mithril Signer signed.
Last updated