Skip to content

Commit

Permalink
Defer key formats to controller document specification.
Browse files Browse the repository at this point in the history
  • Loading branch information
msporny committed Sep 30, 2024
1 parent 0501cfd commit 5a21251
Showing 1 changed file with 18 additions and 33 deletions.
51 changes: 18 additions & 33 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ <h3>Verification Methods</h3>
<h4>Multikey</h4>

<p>
The <a data-cite="controller-document#multikey">Multikey format</a>, as defined in
[[controller-document]], is used to express public keys for the cryptographic
The <a data-cite="controller-document#multikey">Multikey format</a>, defined in
[[[controller-document]]], is used to express public keys for the cryptographic
suites defined in this specification.
</p>

Expand All @@ -325,23 +325,13 @@ <h4>Multikey</h4>
</p>

<p>
The Multikey encoding of a P-256
public key MUST start with the two-byte prefix `0x8024` (the varint expression
of `0x1200`) followed by the 33-byte compressed public key data. The resulting
35-byte value MUST then be encoded using the base-58-btc alphabet, according to
the <a data-cite="controller-document#multibase-0">Multibase</a> section in the
[[controller-document]] specification, and then prepended with the base-58-btc
Multibase header (`z`).
</p>

<p>
The encoding of a P-384 public key MUST start with the
two-byte prefix `0x8124` (the varint expression of `0x1201`) followed by the
49-byte compressed public key data. The resulting 51-byte value is then encoded
using the base-58-btc alphabet, according to the
<a data-cite="controller-document#multibase-0">Multibase</a> section in the
[[controller-document]] specification, and then prepended with the base-58-btc
Multibase header (`z`). Any other encodings MUST NOT be allowed.
The `publicKeyMultibase` value of the verification method MUST start with the
base-58-btc prefix (`z`), as defined in the
<a data-cite="controller-document#multibase-0">Multibase section</a> of
[[[controller-document]]]. A Multibase-encoded ECDSA 256-bit public key value or
an ECDSA 384-bit public key value follows, as defined in the
<a data-cite="controller-document#Multikey">Multikey section</a> of
[[[controller-document]]]. Any other encoding MUST NOT be allowed.
</p>

<p class="advisement">
Expand Down Expand Up @@ -412,23 +402,18 @@ <h4>Multikey</h4>
expression of a P-256 or P-384 secret key (also sometimes referred to as a
private key).
</p>

<p>
The encoding of a P-256 secret key MUST start with the two-byte prefix `0x8626`
(the varint expression of `0x1306`) followed by the 32-byte secret key data. The
34-byte value MUST then be encoded using the base-58-btc alphabet, according to
the <a data-cite="controller-document#multibase-0">Multibase</a> section in the
[[controller-document]] specification, and then prepended with the base-58-btc
Multibase header (`z`). Any other encodings MUST NOT be allowed.
</p>
<p>
The encoding of a P-384 secret key is the two-byte prefix `0x8726` (the varint
expression of `0x1307`) followed by the 48-byte secret key data. The 50-byte
value MUST then be encoded using the base-58-btc alphabet, according to the
<a data-cite="controller-document#multibase-0">Multibase</a> section in the
[[controller-document]] specification, and then prepended with the base-58-btc
Multibase header (`z`). Any other encodings MUST NOT be allowed.
The `secretKeyMultibase` value of the verification method MUST start with the
base-58-btc prefix (`z`), as defined in the
<a data-cite="controller-document#multibase-0">Multibase section</a> of
[[[controller-document]]]. A Multibase-encoded ECDSA 256-bit secret key value or
an ECDSA 384-bit secret key value follows, as defined in the
<a data-cite="controller-document#Multikey">Multikey section</a> of
[[[controller-document]]]. Any other encoding MUST NOT be allowed.
</p>


<p class="advisement">
Developers are advised to prevent accidental publication of a representation of a secret
key, and to not export the `secretKeyMultibase` property by default, when serializing
Expand Down

0 comments on commit 5a21251

Please sign in to comment.