Become an Amplifier Verifier

💡

The Quantum Portal Virtual Machine (AVM) and Amplifier are currently under active development, so these instructions are likely to change. Please check back frequently for updates.

By running a verifier for a chain integration with Quantum Portal’s Amplifier, you will be responsible for voting on the validity of transactions on the Quantum Portal network and signing command batches for a given chain.

tofnd and ampd

A verifier uses ampd, an off-chain daemon responsible for voting and signing with the Amplifier protocol, and tofnd, a threshold cryptography library that ampd depends on.

There are three ways to set up and run a verifier:

  • Option 1: Source — Clone and build directly from the GitHub source code.
  • Option 2: Binaries — This method requires you to install and run the tofnd and ampd binaries on your local machine.
  • Option 3: Docker — Use Docker to set up tofnd and ampd.

Set up tofnd

ampd needs access to a locally running tofnd instance in order to onboard as a verifier or run the daemon. See the tofnd repository for more information.

Install tofnd from source by cloning and building the tofnd repository.

Create a default mneumonic and configuration in ~/.tofnd/ with:

~/Downloads/tofnd*-v0.10.5 -m create

Download the tofnd binary depending on the type of machine you have:

Create a default mneumonic and configuration in ~/.tofnd/ with:

~/Downloads/tofnd*-v0.10.5 -m create

Pull and run the latest version of tofnd from Docker:

docker pull QPnet/tofnd:v0.10.5
docker run -p 50051:50051 --env MNEMONIC_CMD=auto --env NOPASSWORD=true --env ADDRESS=0.0.0.0 -v tofnd:/.tofnd QPnet/tofnd:v0.10.5

Leave this process running in the background, and perform additional commands in a new terminal window or shell.

Set up ampd

Install ampd from source by cloning and building the QP-amplifier repository.

Download the ampd binary depending on the type of machine you have:

From Docker, pull and run the 0.5.0 version of ampd:

docker pull QPnet/QP-ampd:v0.5.0
docker run QPnet/QP-ampd:v0.5.0 verifier-address

Add ampd to your PATH

This will allow you to begin commands with ampd. If you set up ampd through source or Docker, you can skip this step.

  1. Add a symbolic link named ampd in your binaries folder.:

    sudo ln -s ~/Downloads/ampd-*-v0.5.0 /usr/local/bin/ampd
    
  2. Make the binary executable:

    chmod a+x ~/Downloads/ampd-*-v0.5.0
    
  3. Restart your terminal.

  4. Run ampd --version to make sure that the right version of ampd is being used. It should be ampd 0.5.0.

💡

Replace ampd-darwin-arm64-v0.5.0 with the ampd binary you downloaded.

  1. Add an alias to ampd at the end of the .bashrc file on your machine:

    echo "ampd=~/Downloads/ampd-darwin-arm64-v0.5.0" >> ~/.bashrc
    
  2. Save and close the file.

  3. Reload the file to apply all changes:

    source ~/.bashrc
    
  4. Restart your terminal.

  5. Run ampd --version to make sure that the right version of ampd was installed on your machine. It should be ampd 0.5.0.

💡

Replace ampd-darwin-arm64-v0.5.0 with the ampd binary you downloaded.

  1. Add an alias to ampd at the end of the .zshrc file on your machine:

    echo "ampd=~/Downloads/ampd-darwin-arm64-v0.5.0" >> ~/.zshrc
    
  2. Save and close the file.

  3. Reload the file to apply all changes:

    source ~/.zshrc
    
  4. Restart your terminal.

  5. Run ampd --version to make sure that the right version of ampd was installed on your machine. It should be ampd 0.5.0.

Configure the verifier

Create an ampd configuration file at ~/.ampd/config.toml.

This configuration file tells ampd how to connect to your local tofnd, how to talk to the devnet and the Amplifier smart contracts, and includes a default configuration for verifying transactions on the Avalanche testnet.

The following is an example config.toml file for the verifier devnet:

tm_jsonrpc="http://devnet-verifiers.QP.dev:26657"
tm_grpc="tcp://devnet-verifiers.QP.dev:9090"
event_buffer_cap=1000

[service_registry]
cosmwasm_contract="QP1qk00h5atutpsv900x202pxx42npjr9thg58dnqpa72f2p7m2luas9x8txw"

[broadcast]
batch_gas_limit="1000000"
broadcast_interval="1s"
chain_id="devnet-verifiers"
gas_adjustment="2"
gas_price="0.00005uverifiers"
queue_cap="1000"
tx_fetch_interval="600ms"
tx_fetch_max_retries="10"

[tofnd_config]
batch_gas_limit="10000000"
key_uid="QP"
party_uid="ampd"
url="http://127.0.0.1:50051"

[[handlers]]
cosmwasm_contract="QP15nczwuqh0zcu6syeqsc4td6dphql7n2p7cgkl9raz97z5s3zdjrsc8we9y"
type="MultisigSigner"

[[handlers]]
chain_name="avalanche"
chain_rpc_url="https://avalanche-fuji-c-chain-rpc.publicnode.com"
cosmwasm_contract="QP1elaymnd2epmfr498h2x9p2nezc4eklv95uv92u9csfs8wl75w7yqdc0h67"
type="EvmMsgVerifier"

[[handlers]]
chain_name="ethereum-sepolia"
chain_rpc_url="https://rpc.ankr.com/eth_sepolia"
cosmwasm_contract="QP1sxujcvele5eqtx0xc4wuy6jr0m28y0yt8spn7efc3527vc2j2xrqk6wkay"
type="EvmMsgVerifier"

See the ampd README on GitHub for instructions on formatting a config file for your own projects.

💡

If you get a transport error with an ampd command, make sure that you have tofnd running in the background.

Fund your wallet

Prior to running the ampd daemon, you will need to set up your wallet with devnet funds.

  1. Determine your verifier address:

    ampd verifier-address
    
    💡

    If you get a security warning while trying to run ampd on an Apple Silicon Mac, you can disable the gatekeeper for a single binary with sudo xattr -d com.apple.quarantine ~/Downloads/ampd-darwin-arm64-v0.5.0 or disable gatekeeper globally with sudo spctl --master-disable.

  2. Fund your verifier address.

    1. Join the Quantum Portal Discord.

    2. Get the Developer Role.

    3. Go to the #faucet channel and submit a request with your account to get 100 test tokens:

      !faucet devnet-verifiers [my verifier address]
      

Activate and run the verifier

  1. Bond your verifier:

    ampd bond-verifier validators 100 uverifiers
    

    Bonded verifiers will stay bonded until they unbond or are removed by governance.

  2. Register your public key:

    ampd register-public-key
    
  3. Register support for desired chains, enabling ampd to participate in voting and signing for the specified chains. As our configuration only supports Avalanche, the command is:

    ampd register-chain-support validators avalanche
    

    Multiple chain names can be passed, separated by a space (ampd register-chain-support [service name] [chains]...). Note that any chain you want to support here must be configured in your ampd config.toml file.

  4. Authorize your verifier.

    This is dependent on the environment, and can be done via governance, or by the network operators.

    For devnet, fill out the Amplifier Verifier Onboarding Form for your address to be whitelisted.

  5. Run the ampd daemon.

    Running ampd without any command will run the daemon. A state file will be created if it doesn’t yet exist. Its default location is ~/.ampd/state.json, which can be overridden by passing --state [path].

Productionizing

As you move towards testnet and mainnet, you should switch to running your own full Quantum Portal node and your own full node or light client for any chains you are voting on.

Help

For more info about the available commands and options, run:

ampd --help

Feedback

If you have any feedback or would like to report a bug, please file an issue in the Quantum Portal Developer Support repository.

Edit this page