Sunday, March 20, 2016

Gas is first

Working on our REGA Risk-Sharing project we are facing several issues but the first one is the transaction gas. In Ethereum everyone who send message changing the state must pay for this action in units calling gas. Let’s assume you have a prospective client who downloaded your mobile app or web page and you would like this client to start interaction with Ethereum. But here we’ve got a problem - the client does not have any Ether to send a ‘non constant’ messages. If the very first message is the ‘buy message’ then it’s not a problem (or almost, see below) but in our case before we decided can we have this potential client as our pool member we must score him and calculate a tariff. So, for this purpose we must provide a the client with small amount in Wei to make any changing states call possible.  But if client has decides to exit app and did not spend provided funds? Can we have them back - small amount multiple by large number of clients and we will finish spending our money for nothing. Solution is to control client account - not very nice solution for the client then. We decided that it’s better for client to have two accounts - one with his own money and another one with money provided by service for initial interaction with REGA. The last one we can control having its private key.
Now we moved to another issue. If you client is ready to buy your service and send the money to your smart contract, can we calculate the exact amount before the call? Unfortunately no. We can estimate the maximum price of transaction and include it in the tariff but as result the client will finish with a balance with a little bit more Wei then expected. Another solution to calculate the tariff with minimum gas price and then send the funds back to client account covering additional gas cost if any. More simple solution is send value from client personal account and pay gas from our gas account but it looks like it’s not possible.
But the most impotent question question is can I prove to my client that this amount in his transaction is spent for gas. It looks like the answer is no. We can't find in transaction history the gas spendings for particular transaction but only for the block. Can you imagine a financial service that can't say  how much you spend on fee and commission?




No comments:

Post a Comment