BTW, I checked the source code and it appears to be as expected.
The client libraries set the address to a public key derived from the private key owner:
While the client code to actually set the address could be overridden, the ant node code checks that the owner.public_key is the address:
After checking the signature here:
And in ant protocol, the pointer address is derived from the owner public key again:
Also, the address is not actually stored, which means it must be derived from owner:
Given the signature of the owner is being checked, I think the assertions here feel correct: Revisiting the initial Safecoin Design for native Token - #15 by Traktion
So, I guess the question is, would it be easy to change and is it necessary?
On the ease of change front, it would seem relatively straightforward. You’d just store the address in the struct, then only validate it is a valid address (i.e. a public key length/format).
Is it necessary?
Perhaps this is the core of it, but the code could still derive a public key for the address. On creation, a mnemonic could be used as a seed, for example.
So, I’m not sure why this constraint is present. It feels unnecessary at this point, but would love some feedback from the team.
Another change would be to allow the owner to mutate, as well as the data. This would require some changes to ant node to handle that, presumably much like the PUT validation/store, including a mechanism to check the old owner signature. If that code needs to be stateless, a ‘next_owner’ field may need to be populated, which is then stored in ‘owner’, for example.