Related to https://github.com/neo-project/neo/pull/771#discussion_r287259745
We should decide what the best amount of gas is so that it is an allowed "tax free" transaction.
We have recently decreased a lot the gas prices so the execution will be cheaper. In my opinion, we should reduce to one the maximum fee or calculate the minimum required for a regular nep5 transfer, because I think that removing free transactions could be detrimental to NEO's ecosystem.
Exactly, this should be kept, not only for NEP5 transfers.
We should ensure that NEO Blockchain can handle other type of applications.
Many people want to develop simple but useful Smart Contracts. The free TX's are part of it.
Furthermore, for future cross chain certificates persisting it would be also good to free txs.
In addition, as already mentioned by @igormcoelho, I think that addresses staking NEO should also have another quota for publishing free txs. It will include both addresses and contracts.
We could create a formula that increases free txs capacity according to the amount available at the address, considering plausible and safe limits.
I think that @canesin probably do not like these free txs, right?
I partially agree. However, the free txs are also a PoW nowadays.
If all txs set the fees to the lower limit for being free a PoW against their Hash will naturally happen by the ordering mechanism.
I think that addresses staking NEO should also have another quota for publishing free txs.
Holding NEO will get free GAS. In this case, why should we allow NEO holders to send free txs?
Many people want to develop simple but useful Smart Contracts. The free TX's are part of it.
What about attacts?
~The attacks are limited to an increase in Blockchain size to BlockTime x MaxFreeTxSize x NFreeTxs. How much will this be in one year?~
~However, attacks are kind of eliminated by the time that wallets implement a minor PoW. I remember that we ensured that the sorting of free txs is done by PoW. In this sense, those that want free txs should just perform a minor computational effort.~
~I believe that if we are already aware and agree in giving a free space of the blockchain to attackers, there is no problem. Others may benefit more from this than those wanting to disturb the system.~
PS: I believe I changed my opnion, considering Erik's comment above about NEO generating GAS is enough to be.
I think that Free txs are not necessary.
Sorting free txs by PoW will leads to that mobile wallets cannot send transactions.
Nowadays it is already sorted.
It is an option for those that want it, it is not compulsory. If mobile do not want to attack PoW they should not enable a checkbox, for example.
The feature is that (current implemented):
* if transactions have similar amount of fee and fee per byte, hash is considered.
Thus, attacks are limited to the the minimumthreehold for being free (currently set to 0.001 GAS, right?).
I think that free with a threshold as nowadays is enough. It is safe and when we are not under attack it works.
Yes @vncoelho you are right I don't like free txs, I believe that they are fundamentally impossible to protect against abuse. Don't have any time to devote to a mathematical proof but I am sure it can be built, so I am much more aligned with @erikzhang opinions here. Regarding NEOs ecosystem, I completely understand your point of view and I think that there should be a mechanism were business can subsidize addresses for actions on their smart contracts, but even so the user will need to pay the cost for verifying if they have a subsidized account, as there is a non-zero cost of looking into storage of a smart contract to define if the address issuing the transaction has any allowance.
Thanks for giving us this hint, @canesin, we gonna keep you in touch during development for us to align this in the most prominent manner, thinking in a long-term use.
Hi @shargon , what if we could make the smart contract owner to pay for the smart contract usage? I think it should be free for new users too, somehow we need to pay for their fees.
Removing the free 10 gas is reasonable, but now we need a way to keep this free for the user.
@lock9 the problem I elude to in my previous comment is the case of a business subsidizing the transactions on behalf of users, the NEO node will need to perform at least one query and one compare operations to see if the user is subsidized. This cost cannot pushed to be on the company since if it is one can do an attack where multiple accounts not permitted just issue useless transactions, in my view it appears that the minimum fee a transaction must have is the cost to determine if it is to be subsidized. Have not seem any proposal that solves this chicken and egg issue.
@canesin the problem is:
How new users interact with dApps? I supposed that without this, they will have to trust a "centralized service" to pay for his fees? Instead of the user registering itself, we register him using our server. This works, but is 'centralized'.
I think that a Smart Contract could have allowance for scripthashes.
So it would work like this (example):
1 - User try to register. Send offchain server data with his address;
2 - Offchain server sends to the blockchain "AllowanceInNextBlocks(userScripthash, 0.5, 5)"
3 - dApp allows up to 0.5 gas to be used by 'userScripthash' in the next 1 minute (5 blocks);
4 - User sends the transaction to the blockchain. It's fees are paid by the contract if CheckWitness(userScripthash) is true and the block is inside the interval we desire (5 blocks from initial request).
We need a way to make developers pay for their customers usage, but also let them control who can use that gas.
Does this make sense @canesin ?
@lock9 that is exactly what I was referring to, the problem is in:
"4 - User sends the transaction to the blockchain. It's fees are paid by the contract if CheckWitness(userScripthash) is true and the block is inside the interval we desire (5 blocks from initial request)." > this has a non-zero cost for the network even if it is false, so one can just issue a infinite amount of false CheckWitness(userScripthash).
There must be ways to stop those transactions at the edge of the network.
@canesin, I also modified my view, nowadays I am more in favor of not having free txs.
I am more aligned with Erik idea's as well of NEO generating GAS being enough.
Our proposal was to, at least:
@canesin but why? Why are these transactions propagated if they fail verification?
@vncoelho that is a good feature, not sure about the complexity and gains of that, but it definitely could be something to be discussed...
@neo-project/core is this required? Isn't free tx discarded already?
There must be ways to stop those transactions at the edge of the network.
@canesin fortunately, all these tx are natively stopped on the edge of network, because they fail verification. If they don't fail, but are useless, they will be charged network fee now (by size and computation), so that's the price they will get.
This is different from situations that happened on Neo2, because some computationally expensive tx actually passed p2p, without any fee. Neo3 is very constrained in this respect, so only network edge is "exposed" due to "useless" requests, that need to be processed... and even this "useless" processing will be very limited, as long as no loops will exist, and only few ecdsa calculations will fit in limited witness size. This is good enough for all existing and future applications on Neo 3, and will give us a very fast and stable network.
@neo-project/core is this required? Isn't free tx discarded already?
@lock9 no free tx anymore, or 10 gas limit. I still think that system fees should be handled on a contract, so we update them in time, without breaking the chain. Let's think about it, please (on another issue).
If https://github.com/neo-project/neo/pull/837 is accepted, we can definitely close this. Otherwise, some limit may still be necessary.
Most helpful comment
Yes @vncoelho you are right I don't like free txs, I believe that they are fundamentally impossible to protect against abuse. Don't have any time to devote to a mathematical proof but I am sure it can be built, so I am much more aligned with @erikzhang opinions here. Regarding NEOs ecosystem, I completely understand your point of view and I think that there should be a mechanism were business can subsidize addresses for actions on their smart contracts, but even so the user will need to pay the cost for verifying if they have a subsidized account, as there is a non-zero cost of looking into storage of a smart contract to define if the address issuing the transaction has any allowance.