Tezos Reward Distributor: Introduction

Key Features

  • Batch payments: Payments are split into batches due to block size limitations. Each batch is paid independent of another.
  • Linux service: It is possible and advisable to configure TRD run as a systemctl daemon. service_add.py is there to make this setup a breeze. Once service is configured and launched it will silently run in the background and do its work. It will remind himself from payment to payment via report emails.
  • Reliability: Each batch is tried persistently until it is paid. Payments are logged to avoid double/repeated payments. Multiple instance lock to avoid unintended payment activity.
  • Multiple backends: Delegator data can be taken from RPC API or Tzscan API. Even though Tzscan API is not very reliable, TRD Tzscan backed is advanced enough to search for live mirrors and retry silently until delegator data is retrieved completely.
  • Custom payments: Ability to exclude delegators, apply special service fees and set a minimum delegation amount. Share of uneligible delegators can be shared among other delegators, or founders or can be left at staking balance. Ability to pay to a custom address other than delegator’s address. Payments to a single address are merged into a single payment to pay less transfer fee.
  • Custom baker policy: The transfer fee can be paid by the delegator or the delegate. Ability to choose after how many cycles following the baking should payments go. Paying for unfrozen cycles is possible. Ability to set a minimum delegation amount. Founders and their shares of the baking fee are configurable. Staking balance owners and their shares of the baking reward are also configurable. It is possible to leave the share of owners and founders to staking balance.
  • Baker configuration: Baker configuration is kept in a yaml file which is easy to edit and view. An interactive command line tool can be used to generate/edit a configuration file. Before each launch of TRD, the baking configuration is validated to ensure input data is valid. Input validation is an important part to improve user experience by avoiding hard to trace errors due to incorrect input.
  • Traceability: TRD keeps delegator data and calculation details in CSV files, calculation reports, for each cycle. Calculation reports are detailed enough to understand and verify. Payment activity is also kept in CSV files, payment reports. Payment reports show batch contents, their final status, and the hash of the operations. Payment reports are also important to prevent double/repetitive payments. CSV files can be opened with any spreadsheet application which makes it possible to run extensive analysis on them.
  • Phased calculation logic: Reward calculations are done is so-called phases. Phase 0: raw data from tzscan/rpc. Phase 1: Calculate the total rewards. Phase 2: Calculate the reward ratio of each delegator. Phase 3: Calculate the reward ratio of founders as a whole. Phase 4: if configured for payment, calculate the reward ratio of each founders/owners. Phase 5: If there are custom payment destinations apply them. Phase 6: If there are multiple payments to an address, merge them. Final Phase: Convert ratios to actual payment amounts. This phased approach makes calculations easier to understand and customize. More phases e.g. taxation can easily be added.
  • Battle tested: TRD is not a new application. It has been actively used and developed since the past 10 (as of writing this article) months. Some of the major bakers relies on TRD for their reward distribution.

Open Source

TRD is developed using python programming language. Python is widely known and very easy to understand. Choice of Python makes TRD source base open to a large audience. It is neatly coded.

Simple To Use

TRD is designed to require a very little technical background. A configuration tool can be used to generate baking configuration. Once the configuration file is present, TRD can be either run in background service mode or in regular mode.

Run&Forget

TRD is here to take reward distribution burden from your shoulders. Try TRD now, ask questions, create issue reports and feature requests in GitHub. Once satisfied with it, setup Linux service and forget about it. Just check report emails and make deposit to your wallet.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store