Skip to content

Instantly share code, notes, and snippets.

Last active June 19, 2020 12:15
Show Gist options
  • Save coranos/08816c7c423cbf507069dc9913142085 to your computer and use it in GitHub Desktop.
Save coranos/08816c7c423cbf507069dc9913142085 to your computer and use it in GitHub Desktop.
Camo Banano v1.19 (secret amounts)


  1. camo 1.0 implemented.
  2. amount field (32 bytes) restricted to 4 bytes.
  3. top 7 representative accounts (top 7 weight delegated to them) have camo reps (i.e. do not delegate their weight)



when sending or recieving a 4 byte amount

  1. divide 32 byte amount into 8 'bins', each 4 bytes long.
  2. set first 4 bytes to a nonce that makes the amount exceeds the max supply of the coin.
    This nonce helps protect the ECDH shared secret.
    Setting it to exceed max supply ensures the encrypted amount is never mistaken for an unencrypted amount.
    (then, for each of the seven reps)
    1. calculate the ECDH shared secret
    2. blake hash (nonce + shared secret) to get a bit mask.
    3. XOR actual amount with bit mask to get masked amount.
    4. put masked amount in one of the seven remaining bins.


when verifying a send or receive block.

  1. if the amount is under max supply, do the usual calculation.
  2. if the amount is over max supply, use the ECDH shared secret and nonce to calculate the bitmask.
  3. do the usual calculation with each of the seven amounts.
    If one of them calculates correctly, accept the calculation.
  4. a block is accepted if a 33% majority of the voting weight accepts the calculations.


  1. only 4 bytes of entropy.
  2. a collusion of all network owners (top 7 representatives) can reveal all amounts.
  3. if the top 7 reps change to 7 completely different reps, nobody can accept the calculations.
  4. if a new rep gets over 33% majority, nobody can accept the calculations.
    this can be mitigated by having a 'rep bootstrap' where a new rep can request the unencrypted frontiers.
    the assumption is if you are willing to spend enough to buy a 33% stake in the network, you can buy the unencrypted amounts as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment