Skip to content

circuit transfer fees #10

Description

@barryWhiteHat

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

  1. Add a fee value to the signtuare

  2. Subtract sig.amount from the sender leaf

  3. Add sig.amount - sig.fee to the recipient leaf (be careful about overflows)

  4. For each transaction the operator maintins a fee tree. With 8 layer.

  5. Orginally each leaf is zero.

  6. The oeprator can either add a leaf to that tree that represents a single fee in a token.
    or

  7. add fee to the balance of a leaf in that tree as long as it has the same token type.

  8. This is passed as a public input to the snark.

  9. Confirm that the final fee tree == the public input fee tree

  10. Add smart contract functionality to allow the operator to withdraw these funds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

circuitzksnark circuit issues

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions