Michelson中的key,key_hash,地址,合同和签名之间有什么区别?
2 个回答
- 投票数
-
- 2020-03-10
-
key_hash
是公钥的blake2b哈希,以base58编码的形式只能以tz
开头,但是address
更通用,它也可以拥有KT
帐户; - 对此没有任何说明,可能是因为这是一种罕见且可争论的情况.编辑:正如Raphaël所指出的,您可以使用
IMPLICIT_ACCOUNT;将
key_hash
转换为contract
,然后转换为address
;地址 - 如前所述,
key_hash
是key
的blake2b哈希.您将需要key
来检查实例签名; - 允许我链接维基百科 https://ru.wikipedia.org/wiki/EdDSA.一个很好的例子是多重签名合同;
- 查看新的迈克尔逊文档 https://michelson.nomadic-labs.com/
总结:
-
key
表示公共密钥(椭圆曲线上的一个点) -
key_hash
是key
的blake2b哈希
-
地址
是Tezos帐户的一般表示,包括-tz
和KT
地址 -
签名
是使用椭圆曲线数字签名方案使用私钥对邮件进行签名的结果.
key_hash
is blake2b hash of a public key, in the base58 encoded form it can start only withtz
, butaddress
is more general, it can also holdKT
accounts;- There are no instructions for that, probably because it's a rare and arguable case; EDIT: as pointed out by Raphaël, you can convert
key_hash
tocontract
and then toaddress
usingIMPLICIT_ACCOUNT ; ADDRESS
- As was mentioned,
key_hash
is blake2b hash ofkey
. You would need akey
for checking a signature for instance; - Allow me to link wikipedia https://ru.wikipedia.org/wiki/EdDSA. A bright example is a multisig contract;
- Check out the new Michelson documentation https://michelson.nomadic-labs.com/
To sum up:
key
represents a public key (a point on the elliptic curve)key_hash
is blake2b hash ofkey
address
is a general representation of Tezos accounts, including both -tz
andKT
addressessignature
is a result of signing a message with a private key using the elliptic curve digital signature scheme.
-
- 2020-03-10
为什么我可以在地址和合同之间转换.但是不在address和key_hash之间吗?
有(
IMPLICIT_ACCOUNT
的说明从key_hash
转到address
.对于另一个方向,存在(功能请求),但是已关闭,因为没有提出用例来激发它.Why can I convert between address and contract. But not between address and key_hash?
There is the (
IMPLICIT_ACCOUNT
) instruction to go fromkey_hash
toaddress
. For the other direction, there was (a feature request) but it was closed because no use case has been presented to motivate it.
有一个与相关的问题,但区别尚不清楚. Michelson whitedoc 中用以下定义提到了这五种类型:
address
:无类型的地址(隐式帐户或智能合约).contract 'param
:一种合同,其代码类型为隐性帐户的合同单位.key
:公共密码密钥.key_hash
:公共密码密钥的哈希值.signature
:加密签名.key_hash
和address
有什么区别?似乎对于我来说,我都可以使用相同的字符串文字来执行PUSH address "tz1..."
和PUSH key_hash "tz1..."
.我记得看到过一些有关揭示的东西.显示是什么意思?为什么可以在
address
和contract
之间进行转换.但是不是在address
和key_hash
之间吗?key
和key_hash
有什么区别?我什么时候有一个key
,但没有一个key_hash
?什么是密码签名?迈克尔逊中的一些用例是什么?
有关这些数据类型的其他重要信息.