How to bond KDA in the Chain Relay

Thanos
KadenaCoin
Published in
5 min readJul 3, 2021

--

Kadena Chain Relay starts today! Bond your KDA to secure the bridge and earn fees from it.

Collect coins

First you need 50,000 KDA on chain 2 of the network. The 50k requirement is fixed but you will be able to bond in centralized services like CoinMetro if you cannot afford it. Coins are locked by interval of 30 days and you can decide if you want to renew or withdraw.

Create a new Bond

Go to https://relay.chainweb.com

Press connect wallet on the top and enter your public key in the designated space.

Enter your public key, press +, then click New Bond.

Move to your wallet and sign/send the transaction.

Keep your request key written somewhere and the name given to your bond. You will need the name to Renew or Unbound after 30 days.

Relay software

Ubuntu:

Get docker and docker-compose

sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg  echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null  sudo apt-get update  sudo apt-get install docker-ce docker-ce-cli containerd.io  sudo docker run hello-world  sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose  sudo chmod +x /usr/local/bin/docker-compose  docker–compose –version

Clone the relay Github and configure the relay

git clone https://github.com/kadena-io/chainweb-relay.git
cd chainweb-relay
nano app-test/.env

Enter your details in that .env file (Infura API is your project ID)

INFURA_API_TOKEN=

# First bonder
BOND_NAME=
PACT_PRIVATE_KEY=

# Second bonder
BOND_NAME_2=
PACT_PRIVATE_KEY_2=
# Third bonder
BOND_NAME_3=
PACT_PRIVATE_KEY_3=

Edit the docker-compose settings

rm app-test/docker-compose.yaml
nano app-test/docker-compose.yaml

Paste this in with your correct bonds information
Add or remove relays by copy-pasting relay-1 and relay-2 with different names and variables

version: "3.3"services:relay-1:  container_name: relay-1  build:    context: ..    dockerfile: Dockerfile  image: relay-app  restart: unless-stopped  environment:  - BOND_NAME=${BOND_NAME}  - PACT_PRIVATE_KEY=${PACT_PRIVATE_KEY}  - INFURA_API_TOKEN  - LOG_LEVEL
relay-2:
container_name: relay-2 build: context: .. dockerfile: Dockerfile image: relay-app restart: unless-stopped environment: - BOND_NAME=${BOND_NAME_2} - PACT_PRIVATE_KEY=${PACT_PRIVATE_KEY_2} - INFURA_API_TOKEN - LOG_LEVEL

Type `screen` and press enter, then run

docker-compose -f app-test/docker-compose.yaml --env-file=./app-test/.env up --build

If you don’t get any errors your relay is now active and you can close the console. To see logs type screen -r

Quick Bond FAQ:

Q: How long will 30% APY bonds be offered?
A: Up to the amount secured by 5MM reserve, or 8.3MM KDA TVL. At that point we will have achieved sufficient security to focus on launching the Ethereum/Kadena bridge so we will suspend new bonds until we get an idea how much additional security is needed for that bridge. At that point those new bonds will most likely get less than 30% APY. Bonds secured in the initial period will continue to receive 30% APY however.

Q: What’s the difference between the risk fee (APY) and the activity fee?
A: The risk fee is your reward for risking your bond to secure the relay and accrues over time (assuming you meet the activity requirement). Activity fees are paid per “activity” at 5 KDA each in addition to APY.

Q: What constitutes “activity”?
A: Endorsing an Ethereum header on Kadena, which will be automatically handled by the relay software.

Q: What is the “activity requirement” for the risk fee (APY)?
A: It is a minimum activity threshold that is required over a given month to receive the prorated APY for that month, tallied when you renew/unbond.

Q: How can I meet the activity requirement when the software isn’t available yet?
A: You can’t 🙂 that’s why the activity requirement for this first period is 0. You will receive APY when you renew with 0 activity this month only. After that the relay will be active and you will have to run the software and endorse headers in order to (a) receive the activity fees and (b) receive APY.

Q: Once the software is ready what do I do?
A: We will have various options available: Flux, solo docker, etc. You will probably want to rotate your bond key so that the software can use a key that doesn’t have access to your source KDA account. We will have instructions for doing all of this soon.

Q: Is the APY compounding?
A: No. It is paid monthly on renewal/unbond for the bond size which stays the same.

Q: Can I get slashed if I don’t run the software, or it crashes, or I’m offline, or …
A: No. The only penalty is if you don’t meet the minimum activity requirement. The good news is with the excellent response we will have low activity requirements so it will be easy to meet the activity requirement if you make a good faith effort to keep the software up and running.

Q: How can I get slashed?
A: If you actively defraud the relay by endorsing a fraudulent header. Once detected, a header has to be denounced and then that denouncement endorsed by 2x the number of bonders who endorsed the disputed header. At that point all of the original endorsers of the bad header will lose 50% of their bond. The important thing to note is fraud requires the initial fraud AND collusion with other bonders to fake Infura results etc, so normal users will never get ensnared.

Useful Links:

--

--