DID生成

作者: cw0925 | 来源:发表于2020-10-30 10:14 被阅读0次

DID生成

1、百度DID

DID格式:did:ccp:<method-specific-id>

其中<method-specific-id>=base58(ripemd160(sha256(<Base DID Document>))) (参考比特币,使用双 hash)。
其中<Base DID Document>:

  {
  "@context": "https://w3id.org/did/v1",
  "publicKey": [
    {
      "id": "#keys-1",
      "type": "Secp256k1",
      "publicKeyHex": "02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71"
    },
    {
      "id": "#keys-2",
      "type": "Secp256k1",
      "publicKeyHex": "4b4042665b3235a12fb49730ff620fef1c96e9efa5c90119abd2e8acfe856053"
    }
  ],
  "authentication": ["#key-1"],
  "recovery": ["#key-2"]
}

在<Base DID Document>中定义了两个公钥,#keys-1主私钥对应的公钥,#keys-2为备私钥对应的公钥。
生成秘钥的算法支持:

  • Secp256k1
  • RSA(TBD)

2、Ontology DID

DID格式:did:ont:idString

其中idString生成规则:

  1. 生成32字节的随机nonce,计算h = Hash160(nonce),data = VER || h;
  2. 对data计算两次SHA256,并取结果哈希的前4字节作为校验,即checksum = SHA256(SHA256(data))[0:4];
  3. 令idString = base58(data || checksum);
    上述过程中,|| 表示连接前后两个字节串,VER 是1个字节的标签位。

ONT ID需要在本体区块链上注册之后才能生效,可以在应用中使用。同一个ONT ID不能重复进行注册。

相关文章

  • DID生成

    DID生成 1、百度DID DID格式:did:ccp: 其中

  • DID

    与你的缘 存在于回忆 而今 站在你面前的我 让你选择 第一个我,怯懦软弱,但真实无比 第二个我,暴躁易怒,但为你而...

  • DID

    一、解释 DID也叫多重人格障碍,是分离性身份识别障碍(Dissociative Identity Disorde...

  • DID

    人的精神是很容易出问题的,问题或大或小,大的问题不见得解决不了,小问题也有可能要了你的命。 X先生不知道从什么时候...

  • Did

    Dmvkc

  • 无题

    Why did you touch me Why did you kiss me Why did you hug me

  • day14_Did you get out ~ing

    一.句子:Did you get out ~ing?Did you get out shopping?Did yo...

  • [14] Did you get out shopping?

    Did you get out shopping? Did的末尾d和you的y连读,发/dʒ/ Did you ...

  • 英语流利说-懂你英语-Level2-Unit2-Part5

    Listening: What Did Lisa Do Today? This is what Lisa did ...

  • Cora的ScalersTalk第四轮新概念朗读持续力训练Day

    lesson 48 did you want to tell me something? Why did the ...

网友评论

      本文标题:DID生成

      本文链接:https://www.haomeiwen.com/subject/ovwrvktx.html