rollupnc / RollupNC

non-custodial exchange build with rollup
GNU Affero General Public License v3.0
104 stars 28 forks source link

Add withdraw circuit, check both x and y in pubkeys #24

Closed therealyingtong closed 5 years ago

therealyingtong commented 5 years ago

i made some design decisions which i’d like some feedback on:

barryWhiteHat commented 5 years ago

We spoke at the last meeting about stopping committing json or other automatically generated code as its makes the repo frow really big and means we need to download.

defined zero account as account generated by “0x0000…” public key

That makes sense.

made zero account an actual account in the balance tree, occupying the zero index.

Sounds good. We need to make sure the operator cannot deposit coins to this leaf. Perhaps a good idea to make the public key "0x00000...0001" to prevent this.

zero account balance and nonce never increase

I like this defense in depth. Tho lets require that the nonce == 0 as this will mean that even if someone generates the private key their transactions will fail.

zero account token type is 0, which is the only time it’s legal for token_to and token_from to be different

We need to make sure that token type 0 is impossible to withdraw and does not map to a "real" token. This needs to happen in the "create_token" logic.

therealyingtong commented 5 years ago

outdated, closing