Working with Licenses

The described flow will be applicable after the network is launched.

Obtaining License Owner Keys and License Contract Addresses

The License Owner registers in the dashboard using a third-party crypto wallet [1.1] that was used to purchase the license. Upon registration, the License Owner will receive a generated seed phrase and a corresponding key pair [1.2].

The public key from this pair must be sent to a GOSH representative via email [1.3]. This key will be used by the LicenseRoot system contract [1.4] to deploy the License contract [1.5].

A separate License contract is deployed for each license purchased.

Once the License contract is deployed, the GOSH representative will provide the License Owner with the contract address and License number [1.7].

Adding a License to a BK Wallet Whitelist

For the license to be delegated, its license number must be added to the BK wallet whitelist.

To do this, the License Owner must provide their License Number [2.1] to the Node Owner, who will then add it to their whitelist [2.2].

BK Wallet Deployment

The BK wallet is deployed by the Node Owner using the deployment script [3].

The wallet can be deployed with an empty whitelist or pre-filled with any number of licenses the Node Owner chooses to authorize. But only 20 (twenty) licenses of these can be delegated later.

The Node Owner can modify the whitelist at any time by using the setLicenseWhiteList(mapping(uint256 => bool) whiteListLicense) method in the AckiNackiBlockKeeperNodeWallet contract. Pass in the license numbers you received from the License Owners.

  • uint256 (key) – the license number.

  • bool (value) – set to true to add the license on the whitelist, or false to remove it.

Example command:

tvm-cli call BK_WALLET_ADDR setLicenseWhiteList '{"whiteListLicense": {"1": true, "2": true, "5": true}}' --abi acki-nacki/contracts/bksystem/AckiNackiBlockKeeperNodeWallet.abi.json --sign BK_NODE_OWNER_KEYS

You will need the ABI file AckiNackiBlockKeeperNodeWallet.abi.json to run this command.

Providing the BK Node Owner Public Key

To initiate delegation, the Node Owner must send their public key (BK_NODE_OWNER_PUBKEY) to the License Owner [4].

Delegating a License

To delegate a license to a specific node, the License Owner must call the addBKWallet(uint256 pubkey) method on their License contract [5.1]:


tvm-cli call <LICENSE_ADDRESS> addBKWallet '{"pubkey": "0x<BK_NODE_OWNER_PUBKEY>"}' --abi License.abi.json --sign License.keys.json

Where:

  • pubkey is the public key of the Node Owner received in step 4,

  • License.abi.json is the ABI of the License contract,

  • License.keys.json is the keys obtained by the License Owner during registration in the dashboard.

The License contract will send a request to the BK wallet contract [5.2], which will verify whether the License is included in its BK wallet whitelist. If the License is whitelisted, the BK wallet accepts the delegation. Otherwise, the delegation request is denied.

To check the current delegation status, the getBK() method can be called on the License contract:


tvm-cli -j runx --addr <LICENSE_ADDRESS> --abi acki-nacki/contracts/bksystem/License.abi.json --method getBK

It will return the address of the BK wallet to which the license has been delegated, or NULL if no delegation has taken place.

Staking

Only after successful delegation of at least 1 license can the Node Owner proceed to run the staking script [6].

Last updated