地址,密钥和密钥哈希
1 个回答
- 投票数
-
- 2019-03-15
key_hash只是地址,它是通过对密钥进行哈希处理而得出的.因此,如果您拥有密钥,则可以轻松生成key_hash/address.
您可能想要密钥的原因是因为您需要此密钥来验证由private_key签名的签名,该签名可以在dapp/智能合约中以多种方式使用(一个示例是基于智能合约的多签名钱包)).您不能从key_hash派生密钥(因为哈希是一种方法).
尽管有时候,公共密钥可能会被泄露,所以您有时可以使用管理者端点来查找这些密钥.
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.
-
我必须承认我不太理解第一句话……您可以将其结构化为:键,定义,参考;地址,定义,参考; ...;哈希(地址)=key_hash?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 ?
- 0
- 2019-03-16
- jdsika
-
您有一个公钥和私钥对-公钥是密钥,可以公开,并用于验证签名(使用私钥创建).每个私钥都有一个公钥对.通过哈希公钥来创建地址(tz *).You 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.
- 1
- 2019-03-16
- Stephen Andrews
我意识到这些都是紧密相关的,但是在开发应用程序时应何时使用它们?例如,很容易获得用户的地址,但是什么时候应该询问他们的key或key_hash,这是他们需要明确提供的吗?