You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So what i was thinking was to include hte fee in the transfer digest and use the smart contract to pay that fee to each operator. We can also use a snark to merge these together to save gas.
Allow fees to be taken based upon the transfer. The operator create teh fee tree and passes it as a public input from the smart contract
Add a fee value to the signtuare
Subtract
sig.amount
from the sender leafAdd
sig.amount - sig.fee
to the recipient leaf (be careful about overflows)For each transaction the operator maintins a fee tree. With 8 layer.
Orginally each leaf is zero.
The oeprator can either add a leaf to that tree that represents a single fee in a token.
or
add fee to the balance of a leaf in that tree as long as it has the same token type.
This is passed as a public input to the snark.
Confirm that the final fee tree == the public input fee tree
Add smart contract functionality to allow the operator to withdraw these funds.
The text was updated successfully, but these errors were encountered: