How to mine on Tellor

J P
5 min readJan 23, 2020

--

Tellor solves the oracle problem, one of the most challenging questions for blockchain applications, using proof-of-work (PoW) mining architecture and clever game theory. This article explores the fundamental role that mining plays in producing high-quality decentralised data in Tellor and provides a guide to the simple installation of Tellor’s mining software in AWS. If you’re interested in learning more about how Tellor solved the oracle problem, check out this Tellor 101 article.

How mining supports the Tellor network

Mining is the key mechanism for protecting the Tellor network from adversarial attacks and the submission of bad data, and it provides an incentive for network participation and governance. It is the process through which new “Tributes” (TRB) — Tellor’s native cryptocurrency — are produced.

Tellor’s key value proposition is providing valid data in a decentralised way, which means there can’t be a single point of failure in the data provided by the oracle. Game theory dictates that, to ensure its long-term success, the network should be sufficiently expensive to attack and collusion between miners should be sufficiently disincentivized.

So how does mining achieve these game-theoretical goals in Tellor? Exploring the data-provisioning process (shown in the diagram) will help answer this question.

Moving through the diagram step by step:

  1. Data is requested from a smart contract — such as an Ethereum (ETH)/US dollar (USD) price feed.
  2. Data requests are added in a queue with a small TRB bounty to incentivise miners to provide requested data.
  3. Miners compete via PoW to provide the requested data.
  4. The Tellor oracle provides the requested data based on the median of the five fastest PoW miners.
  5. Data can be disputed.

Let’s unpack step 3 because it pertains directly to PoW mining.

A miner’s role in the Tellor system is to provide accurate data to fulfil data requests from applications. To obtain the right to fulfil data requests, miners must solve Tellor’s PoW algorithm, which is a computationally intensive mathematical problem. Miners are paid for their work with TRB, which are minted for each successful submission, and they also receive the bounty provided by the data requester. Data requesters must pay for data using TRB, which provides the supply side of the market and makes TRB’s value proportional to the volume of data being requested.

The more miners that compete to provide data, the harder the PoW problem becomes to solve, which requires miners to provide more computational power in order to be paid TRB. This simple feedback loop encourages competition between miners and the addition of mining power. The higher the mining power, or “hash rate”, of a blockchain, the more expensive it becomes to attack the network using overwhelming computational power (commonly referred to as a 51% attack).

Hash rate is a core component of security for PoW algorithms, but it is not the only method used by Tellor. Unlike other PoW systems, Tellor rewards the five fastest miners with TRB. Winners of the PoW competition are authorised to provide their data to the data requester under a smart contract and thereby fulfi–––l the request.

Interestingly, the median value is chosen from the five winners, rather than the average value, which significantly increases the cost of 51% attacks because an adversary would need to deploy three miners that can outcompete the rest of the network. Median value selection, as opposed to average value selection, also reduces the risk of manipulation by a single party submitting an enormous value.

How to mine

Mining on Tellor is easy to start and difficult to master. This section focuses on doing it the easy way (visit Tellor documentation for additional instructions).

Method

1. Create a new AWS Ubuntu/Linux box (t2.small minimum).

2. Connect to your AWS server via SSH.

3. Run the following commands to create a new folder called Tellor and download the latest Tellor Miner software from GitHub:

mkdir tellor
cd tellor
sudo apt-get update
wget https://github.com/tellor-io/TellorMiner/releases/latest/download/TellorMiner

If the file TellorMiner is not executable, adjust the permissions with the command: sudo chmod +x./TellorMiner

4. Run the following command to create a new file called config.json:
nano config.json

5. Copy and paste the following code into your new config.json file:

{
"contractAddress": "0x0ba45a8b5d5575935b8158a88c631e9f9c95a2e5",
"nodeURL": "https://mainnet.infura.io/v3/a28097c607364fafb8b73e530c076a07",
"privateKey": "n1234ca2d012EEE048035C3f55eBbXXXXXXXXXX",
"databaseURL":"http://localhost7545",
"publicAddress": "q123435C3f55eB0E04c8Eb12Ea2d0XXXXXXXXXX",
"serverHost": "localhost",
"serverPort": 5001,
"ethClientTimeout": 3000,
"trackerCycle": 22,
"requestData":12,
"gpuConfig":{
"foo":{
"groupSize":64,
"groups":128,
"count":256
}
},
"trackers": [
"balance",
"currentVariables",
"disputeStatus",
"gas",
"top50",
"tributeBalance",
"fetchData",
"psr"
],
"dbFile": "/tmp/tellor/tellor_db"
}

Note: You will need to update three values in the config.json file: nodeURL, privateKey, and publicAddress.
If you are running your miner without GPUs, delete the “
gpuConfig” variable.

6. Create a new Ethereum wallet on your local machine using a reputable provider, such as MetaMask.

7. Backup your wallet locally by writing down the recovery phrase or private key and storing it in a safe place.

8. Update the required fields in config.json .

  • nodeURL is the public URL of your Ethereum node. If you do not host your own node, Infura.io provides free accounts to point to their nodes.
    Note: make sure to add “https://” before the infura URL because it does not copy by default.
  • privateKey is the private key from your new Ethereum wallet.
  • publicAddress is the public key from your new Ethereum wallet.
    Note: neither privateKey nor publicAddress have the “0x” prefix.

9. Fund your account.

  • Deposit 1000 TRB into your new Ethereum wallet.
  • Deposit enough Ethereum to make several transactions from your new wallet.

10. Run the following command to download a new file called loggingConfig.json: wget https://raw.githubusercontent.com/tellor-io/TellorMiner/master/loggingConfig.json

11. Run the following command to download the latest psr.json file: wget https://raw.githubusercontent.com/tellor-io/TellorMiner/master/psr.json

12. Stake your 1000 TRB using the following command:

./TellorMiner -deposit -psrPath=./psr.json -config=./config.json -logConfig=./loggingConfig.json

13. Start your miner with the following command:

./TellorMiner -miner -dataServer -psrPath=./psr.json -config=./config.json -logConfig=./loggingConfig.json

What does the miner do?

Tellor miners fulfil data requests and are paid to do so. A miner will check the queue of data requests (e.g. an ETH/USD spot price) and provide the requested data from their source (e.g. an exchange API). Miners compete in the PoW competition and, when a successful solution to the PoW problem is found, the miner submits:

  • The successful PoW solution
  • Request ID from request queue
  • Value of requested data.

Successful miners are rewarded with TRB; DApps and DeFi applications receive valuable data; and the crypto-economy grows and expands.

Join the community!

For a more technical explanation of setup, further documentation, and discussion on GPU optimisation, please visit https://tellor.readthedocs.io/en/latest/MinerSetupTechnical/ and ask questions on Discord or Telegram.

The Tellor game theory and economic model is, of course, much more complex than outlined in this article. Stay tuned for the upcoming Tellor Tokenomics 201 article.

--

--