I realize these are all closely related, but when should you use these when developing an app? For example, it is easy to get a user's address, but when should you ask them for their key or key_hash, and is this something they need to explicitly provide?
1 Answer
The key_hash is just the address, which is derived from hashing the key. So if you have the key, you can easily generate the key_hash/address.
The reason you may want the key is because you need this to verify a signature signed by the private_key, which can be used in multiple ways within a dapp/smart contract (one example is a smart-contract based multi-sig wallet). You can't derive the key from a key_hash (as hashing is one way).
Some times though, public keys may be revealed so you can look these up at times using the manager endpoint.
-
I must admit I don't quite understand the first sentence... Can you structure it a bit like: key, definition, reference ; address, definition, reference;...; Hash(address) = key_hash ?– jdsikaCommented Mar 16, 2019 at 8:41
-
2You have a public key and private key pair - the public key is the key and can be made public, and is used to verify a signature (which is created using the private key). Every private key has a public key pair. The address (tz*) is created by hashing the public key. Commented Mar 16, 2019 at 9:14