I might be wrong in some of the facts that I state here, so please correct me if necessary.
My understanding:
- Private key - 256 bits
- Public key - 256 bits
- Public address - the last 160 bits of a public key
- Every private key is mapped to a public key, and hence to a public address
The facts above imply that some private keys are mapped to the same public address, but they do not imply that some private keys are mapped to the same public key.
I would like to ask the following questions:
Do we have any other knowledge as to whether or not some private keys are mapped to the same public key, and hence, some public keys have no private key which is mapped to them?
If the answer to the above question is yes, then there's a possibility that some public addresses have no private key which is mapped to them. Do we know of any such addresses, or if they even exist?
My motivation for asking this, is that I have an ERC20 contract which sometimes (depending on the current state) mints an additional amount of tokens which will later be distributed among (i.e., transferred to) some users.
Now, I need some address to hold these tokens, but I wish to avoid the case where someone has the private key of this address (as slim a chance as it may be).
At present, I am generating this address as follows:
address public constant MINTING_ACCOUNT = address(keccak256("MINTING_ACCOUNT"));
Ideally, I would like to replace this with a constant address which has no private key.
Thank you!
2 ** 96public addresses (I think I wrote it in a comment to one of the answers above here). I just thought I'd check to see if there was a "bullet proof" choice of a public address. – goodvibration Dec 17 '18 at 20:070doesn't work for some reason, you can always use1. But general best practice in this space is to use0for the"impossible" address, because everyone will understand immediately what you are using it for. – Tjaden Hess Dec 17 '18 at 20:09The chance is lower than...argument - I'm sure someone once said that about SHA-128. Then within a few years time, computing power has increased by several magnitudes, some people (or more precisely, agencies) pre-generated huge tables with hash info, and made this algorithm compromised to the point where it had to be replaced. But of course, if that ever happens tokeccak256, then I guess my choice for a public address would be the least of my worries here. – goodvibration Dec 17 '18 at 20:10keccak256is not broken, i.e. there are no attacks for this sort of thing that are faster than brute-force. As for computing power, this kind of argument is exactly why I say there is no chance. There is not enough energy in the universe to carry out a brute-force attack like this, it doesn't matter how fast our computers get. The collision-security of sha-1 is only 80 bits. That's why it is depreciated. The preimage security is still 160 bits, which is perfectly fine. SHA-128 isn't a real thing AFAIK. – Tjaden Hess Dec 17 '18 at 20:14