Encode entity type into delegation signature #475
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've found 3 types of delegation signatures:
network id + account address + contract address-- delegate AENS and Oracle operationsnetwork id + account address + name hash + contract address-- delegate an AENS name to a contractnetwork id + query id + contract address-- delegate ability to reply to an oracle queryThe addresses and ids are encoded as raw data, losing information on the entity type. In existing combinations, I can re-encode the current account address as an oracle query id and request the wallet to sign an oracle query delegation (3) and get a general delegation (1) instead.
If later we would introduce additional delegation signatures like
network id + account address + channel address + contract addressthen functions signing a delegation of a new type can be misused to generate name delegation (2).Currently, implementing a wallet API the correct way to name methods would be "sign network id, account address, and 32 bytes" instead of "sign network id, account address, and contract address".
The above issues may be solved by encoding address the same way as in transactions, using this mapping https://github.com/aeternity/aeserialization/blob/177bf604b2a05e940f92cf00e96e6e269e708245/src/aeser_id.erl#L97-L102
Created by: hanssv
Again, good observation!
... and again - nothing really to do with the Sophia compiler.