Worker Self Staking

Tutorial on using VideoCoin staker tool

VideoCoin workers can participate in transcode mining by self staking a minimum amount of their tokens. The transcoding work is distributed to workers in proportion to the total stake on each worker. The total stake of a worker includes the self stake and delegated stake by one or more delegators. The self stake can be withdrawn. However the VID tokens are transferred to the holder's account after expiry of the unbonding time which is currently set at 21 days.

Staking and withdraw can be performed through a command line tool that is currently supported on Linux platforms. Follow the below steps:

  • Download the command line tool staker (Contact VideoCoin support for the download link)

  • Sets up a configuration file in the format of Ethereum key store file that contains private key and public key (password protected).

  • Run the self stake or withdraw commands as shown in the following sections.

Setup

The staker tool needs to communicate with the Ethereum mainnet to access VID tokens. You can use a free or paid subscription from Infura to access Ethereum through web interace. Please visit the Infura website (https://infura.io/product) and obtain a your ID and make it available to the staker tool using an environment variable as follows.

export ETH_RPC_URL=https://mainnet.infura.io/v3/<Your Project ID>

Prepare an Ethereum key file that contains your private key in encrypted form. Following is a sample key file

{'address': 'fd41a83c713bd0d612c0ca0fd078ec6cc5d37cfb',
 'crypto': {'cipher': 'aes-128-ctr',
            'cipherparams': {'iv': '47db6518e4ecc7e8c5800722f173e214'},
            'ciphertext': '2d09d0c77a4a00cfb59fe5cbe0cf867c32b04e725ccacca52e96d3c1bb70a067',
            'kdf': 'scrypt',
            'kdfparams': {'dklen': 32,
                          'n': 4096,
                          'p': 6,
                          'r': 8,
                          'salt': '2f1790fe23a3a1957b75d73f1be8d4814129e512b9e9956687774b4471c3be7f'},
            'mac': '008c38f40bdb4c0d5faaa30f9e55c4798974447fdd9c7f8535914e323c2268d8'},
 'id': '23f7b36d-ff7b-4a9d-954e-06ed3fa7a1fa',
 'version': 3}

Self Staking Process

Before using the staker tool to self-stake the VID tokens, first step is to move erc-20 VID tokens form Ethereum main net to VideoCoin network. Then you can stake VID tokens as as described below. Use the following command to transfer VID tokens from Ethereum main net to VideoCoin network to use as transaction fee/gas:

$ staker fund <amount> -k <key file> -s <password>

Option

Description

amount

VID token amount to be transferred

Use the following command to self stake VID tokens:

$ staker stake add <amount> -k <key file> -s <password>

Option

Description

amount

Amount of VID for self staking

Example usage of the commands

Transfer VID tokens from Ethereum main net to VideoCoin network

$ staker fund 100 -k worker-0.json -s ""

Self stake VID

$ staker stake add 333000 -k worker-0.json -s ""

Withdraw Process

Currently withdraw is two step process. The fist step is issue a withdraw request(unbonding request). The second step is wait for unbonding period to elapse and issue a command to complete withdraw. Then native VID from VideoCoin network and trnasfer to ERC-20 VID tokens on Ethereum main net.

Use the following command to issue withdraw request:

$ staker stake withdraw <amount> -k <key file> -s <password>

Option

Description

amount

Amount of stake to withdraw

The withdrawn stake is deposited to worker's account only after expiry of unbonding period

Use the following command to complete pending unbonding request that transfer staked tokens to native VID:

$ staker stake withdraw complete -k <key file> -s <password>

Use the following command to check the staking balance

$ staker stake  -k <key file>

Transfer native VID from VideoCoin network to ERC-20 VID tokens on Ethereum main net.

staker withdraw <amount> -k <key file> -s <password>

Option

Description

amount

Amount of VID to be transferred to Ethereum main net from VideoCoin network

Last updated