Bakers on holiday

With TAPS self-driven Tezos rewards payment system

Luiz Milfont
5 min readFeb 13, 2019

What is TAPS?

TAPS is an acronym for “Tezos Automatic Payment System”. It is a software based solution created to automate Tezos network rewards payments to the baker’s delegators.

In Tezos blockchain network, block creation is done by bakers. Baking in Tezos is analog to mining in Bitcoin. Tezos blockchain distributes rewards as a mean of incentives for people to participate in the network security. These participants are known as bakers. If a baker doesn’t have enough XTZ to bake (the minimum being 10,000 XTZ to begin with), he can “borrow” more from other network participants who are willing to invest their own stake. These are known as delegators.

It happens that baking activity brings with it some responsabilities. The main one being to maintain a computer with Tezos node software always online. Also, Tezos network distributes rewards to the bakers after the end of each cycle (a period of approximately 3 days). These rewards shall be delivered to the baker’s delegators, after a baker’s fee had been discounted.

Although the distribution of rewards to the bakers is automatically done by the Tezos blockchain, the delivering of these rewards forward to the delegators is a baker’s task. This must be manually done, by typing commands in the computer prompt, or by the use of a Tezos wallet. Considering that the number of delegators grow in time, that procedure soon become a logistics problem.

And that was why quickly arose on Tezos community a demand for some kind of tool that automates these payments to the delegators.

Tezos.Rio, a team of software developers, designers and researchers based in Rio de Janeiro, Brazil, also a grantee from Tezos Foundation, decided to work on an open-source software solution and created TAPS.

How TAPS works?

TAPS basically works by integrating layers of software. It uses TzScan.io API to fetch information about Tezos blockchain state. Also, it controls the Tezos-client software installed in the node to manipulate transfers and payments. TAPS is web-based software that runs through a browser. It also needs an application-server to run. We decided to develop TAPS in CFML (Coldfusion Markup Language) using free, open-source, Lucee application server, because of its high performance, productivity and reliability.

TAPS software layer architecture

At first run, TAPS requires the user to fill a form to setup configuration parameters. User must inform its public baking address, alias, path to Tezos-client binaries and base directory. This will allow TAPS to dynamically build a command that will be forwarded to Tezos-client software to make transfers.

After setup has been done, a scheduled-task will be created on the application-server, which will be run once each hour to fetch TzScan API.

TAPS will store network fetched information locally in two ways: In memory caches and database tables. Memory caches will be a copy of the data grabbed from TzScan, holding information about rewards and baker’s delegators. Database tables will be used to store administrative information, like delegators fees (allowing the user to specify a different fee for each delegator), delegators payments (which represents a history of the payments ever made by TAPS to each delegator), and finally, the payments table, which has a key role in TAPS system: It holds the history of payments events ever made by TAPS. Every time a fetch runs, the pending rewards cycle of the network is compared to the pending rewards cycle stored in local database payments table. Most of the time they will be equal and nothing will happen. However, when the network pending rewards cycle changes, the system will consider that new rewards were delivered by the Tezos network, triggering a new reward distribution event on TAPS. That is a very basic description of how the TAPS system works.

What is TzScan.io?

TzScan.io ( https://tzscan.io/ ) is the most famous Tezos block explorer, a web site where one can go through the network blocks operations, check baking and endorsing rights, see future rewards, etc. TzScan offers an API, which allows to fetch data from it programmatically.

What is Tezos-client software?

Tezos-client ( https://tezos.com/ ) is the software installed in a Tezos-node machine, which allows one to participate in the network, baking blocks or endorsing operations. And managing funds.

What is Coldfusion/Lucee?

Coldfusion is a Rapid Application Development (RAD) environment, which consists in the CFML programming language and an application-server that compiles it and processes users request through a web-browser. Coldfusion was created in 1995 by the JJ and Jeremy Allaire brothers. In 2001 Coldfusion rights were aquired by Macromedia and then, in 2005 were acquired by Adobe Systems ( https://www.adobe.com/br/products/coldfusion-family.html ), held until today. Coldfusion is based in Java programming language, which means all CFML code gets compiled to Java and run in a Java Virtual Machine as bytecode.

Adobe Coldfusion Server is not a free product. To use the Coldfusion Enterprise Server, one have to purchase it from Adobe. Nevertheless there is a free, open-source version, called Lucee ( https://lucee.org/ ). Lucee is compatible with Coldfusion and highly optimized. Also, Lucee has dozens of extensions, which allow it to work with mySql, MongoDB, MSSQL, Sybase, Oracle, PostgreSQL, Microsoft SQL Server, Redis, H2 and so on.

Coldfusion and Lucee are state of the art tools to integrate systems, as they allow to create or consume APIs, connect to most of available databases, work with in-memory RAM caches to deliver lightning-fast query responses and also create scheduled-tasks that run in a frequency configured by the developer. TAPS is meant to run on Lucee application-server.

Future developments

We intend to add new administrative features to TAPS soon, if this tool is appreciated by the Tezos community, like the following:

  • PDF or Excel Reports (update: implemented on v1.0.0)
  • Email, Telegram, Twitter or SMS notifications
  • Paging
  • Blockchain-checked payments confirmation
  • Embedded wallet (making it independent from Tezos-client) (update: implemented on v1.0.0)

Conclusion

There is a huge demand on Tezos community for tools like TAPS, which automates rewards payments to delegators. Although there are already plenty of alternatives, the use of an application-server in conjunction with a powerful processing environment and a programming language is what makes the difference here, as it allows further improvements and integrations with other systems. Until now bakers had to do a tough job, dedicating much of their time to administrative tasks involved in the process. Now they can finally go on well-deserved holidays!

--

--