Minimizing TCR Ethereum Transactions

A Guide for TCR Users and Developers to Pay Less in Gas when using TCRs

Eddy Muñoz
4 min readMar 11, 2018

--

PROBLEM

Token-Curated Registries (TCRs) are destined to become very popular in 2018. With the adChain Registry being the first TCR on the Ethereum Mainnet in April 2018, first-time users will come to the sudden realization that it’s expensive to interact with TCRs. Below is a list of the core interactions a user can perform and their respective number of transactions:

Applying a Candidate

  • TX 1: User approves the TCR smart contract to transfer funds from their wallet
  • TX 2: User submits the candidate for application into the registry

Challenging a Candidate

  • TX 1: User approves the TCR smart contract to transfer funds from their wallet
  • TX 2: User challenges the candidate’s application into the registry

Committing a Vote for a Candidate

  • TX 1: User approves the TCR’s PLCR smart contract to transfer funds from their wallet
  • TX 2: User requests voting rights from the PLCR smart contract
  • TX 3: User submits the committed vote to the PLCR smart contract

Revealing a Vote for a Candidate

  • TX 1: User submits the vote reveal hash to the PLCR smart contract

Although all ETH transactions can be processed with the SafeLow Cost for Transfer ($0.015 at the time of this publication), users will generally prefer instant transactions in order to minimize time spent interacting with the TCR. Therefore, the user will have to spend higher amounts in ETH gas fees in order to most efficiently interact with the TCR.

SOLUTION

In order to minimize ETH transactions within a TCR, the developers of the TCR have to provide users the ability to (1) approve tokens to be withdrawn by the TCR smart contract and (2) request voting rights from the TCR’s PLCR smart contract.

(1) Approving the TCR Smart Contract to Withdraw Tokens

Approving the TCR smart contract to withdraw tokens from your wallet allows you to eliminate the first transaction in both applying and challenging a candidate. If the TCR’s minDeposit is 100 tokens, you can approve the TCR smart contract to withdraw 1,000 tokens from your wallet address. This allows you up to 10 applications/challenges where you only need to sign one transaction, keeping in mind that minDeposit maintains the constant value of 100 tokens throughout the 10 applications/challenges. Approving the TCR contract to withdraw up to “X” number of tokens does not directly withdraw them upon approval, but instead grants permission for the smart contract to withdraw the number of tokens. Therefore, the tokens still remain in your wallet’s possession.

“PRE-APPROVE ADT TRANSFER” – My Dashboard, adChain Registry

(2) Requesting Voting Rights from the TCR’s PLCR Smart Contract

Requesting voting rights prior to the voting in the TCR minimizes the number of transactions needed to commit a vote from three to one. When you request voting rights, you sign two transactions where you approve the PLCR contract to withdraw tokens and you request voting rights. One voting right is equal to one token. When you request voting rights, you are essentially depositing those tokens in the PLCR contract for voting-purposes across an unlimited number of polls.

The first time you approve the PLCR contract to withdraw funds and request voting rights, you won’t need to do so as long as you vote with equal to or less than the number of voting rights. To clarify, if you approve and request 50 voting rights, every vote after the first will only require 1 transaction to commit the vote, compared to 3 the first time you vote. You can continue to vote with up to 50 votes simultaneously without the need to sign 3 transactions. You can continue to vote with only 1 transaction until you withdraw your voting rights. After you withdraw your voting rights, you’ll need to sign the 3 transactions once again to approve, request voting rights, and commit the vote.

“REQUEST VOTING RIGHTS” & “WITHDRAW VOTING RIGHTS” — My Dashboard, adChain Registry

Summary

Pre-approving the TCR smart contract to withdraw “X” number of tokens removes the need to sign the first transaction when applying/challenging a candidate. Pre-approving and requesting PLCR voting rights limits the number of transactions to 1 from 3 as long as the user is voting with an amount already approved.

If you found this article useful, feel free to find more like it in the TCR subreddit.

--

--