Bank-of-JubJub / base

This repo includes the base contracts and circuits for the Bank of JubJub.
MIT License
12 stars 4 forks source link

add transferFrom functionality #4

Open critesjosh opened 11 months ago

critesjosh commented 11 months ago

so for instance, if the account is locked (but this is not strictly necessary, just the balance of from must stay the same between the approve and the transferFrom calls)

this would work like this : I approve X token to account A (address or public key), by proving in ZK that X is smaller than my unencrypted balance. (X is in clear text also) , then if A calls trnasferFrom with my account as from and a receiver account as to, he could homorphically substract X to my account while homomorphically add to the receiver's public key

as you see, my balance must not change between the approve and the transferFrom for this to work

or at least, my account must not intiate a transfer (but could receive additional tokens meanwhile)