KAS Anchoring
Last updated
Last updated
As explained in the design section, you can anchor your service chain data to Klaytn main chain. This page introduces how to enable data anchoring via KAS (Klaytn API Service).
Once it is turned on, a node in your service chain can periodically anchor its chain data (block data) to Cypress or Baobab as a proof of existence and immutability of the service chain. This ensures the security and credibility of the service chain.
This section introduces the pre-requisites to use KAS for data anchoring.
First, you need to sign up KAS on the KAS console website to get a KAS account. Please visit the website above and sign up in KAS.
After login, you can create your credential like below. The AccessKey ID
and Secret AccessKey
, or Authorization
will be used to call KAS APIs.
KAS provides Anchor API, which is designed for data anchoring and surely it is the one that you are going to use for anchoring task.
To anchor service chain data via KAS, there should be a Klaytn address, enrolled in KAS, that actually send anchoring transaction to Klaytn. So, before you set up your service node, you need to create an Klaytn account called "operator" via KAS. Please, use KAS console to create this account.
It is important to be noticed that you must first select the chain in Klaytn to which you want to anchor your data on the top right corner of the KAS console page. You should create an operator for each chain (Cypress/Baobab).
Create an operator as below.
Then, you can check your operator list like below. Please note that the address of an operator is required for setting your service chain node.
After obtaining API credentials, Anchor API information (API endpoint and parameters), and an operator account in KAS, then It is time to set up your service chain node. You need to edit the configuration file (kscnd.conf
, kspnd.conf
, ksend.conf
) of your service chain node like below.
You should set SC_SUB_BRIDGE=1
and all SC_KAS_
prefix items.
Now you are good to go. You can run your service chain node. You will see the log message related with KAS Anchor API like below.
In KAS console website, you can see the list of anchoring transactions that the operator of your service chain has sent at "KAS Console - Service - Anchor - Operators" menu like below.