Mizuhiki DID Method Draft Specification [v0.0.1]
NOTE: This draft specification has not been submitted to W3C or other bodies. We will continue to update this specification throughout the duration of the private Kaigan testnet. Please check back for updates.
注:この仕様書は W3C または他の機関に提出されていません。Kaigan テストネットの期間中、この仕様書を継続的に更新していきます。更新情報をご確認ください。
注:この仕様書は、DID Methods W3C レジストリへの提出準備のため、現在英語のみでの提供となっています。
- A "Mizuhiki DID" or "Mizuhiki DID Method" refers to the syntax, resolution, verification
and authorisation of DIDs and DID documents that begin point to
did:mizuhiki. - A Mizuhiki DID registry is an EVM smart contract registry which issues unique DIDs to users who have undergone KYC requirements under Japan AML law (Act on the Prevention of Transfer of Criminal Proceeds). - KYC is performed by a "Mizuhiki Controller", which must be a registered JPKI Service Provider.
Method Syntax
method-name
- The
method-namethat shall identify this DID Method ismizuhiki. - A DID that uses this method MUST begin with the prefix
did:. Themethod-namemizuhikifollows the first colon and terminates with a second colon, e.g.,did:mizuhiki:
method-specific-id
- The
method-specific-idis composed of an EVM blockchain network string identifier where the respective Mizuhiki DID registry lives - As of
v1.0, the Mizuhiki DID method only supports the Kaigan testnet with themethod-specific-idaskaigan. kaiganrefers to the ephemeral Japan Smart Chain private testnet with RPC endpoint000005826- The
method-specific-idproceeds the second colon aftermethod-nameand terminates with a colon. - Normalisation is supported by the DID resolver. The
didprefix,method-nameandmethod-specific-idshall all be resolved to lowercase by default.
did:mizuhiki:kaigan:{subjectID}
Uniqueness of method-specific-id
- The
method-specific-idis to be unique within the Mizuhiki DID method and map 1:1 with the stringname of a blockchain network. - The supported smart contract registries maintained will be explicitly stated in future versions of the specification, along with their respective globally unique RPC endpoints.
DID generation
- The DID's
{subjectID}parameter (i.e., a subject's unique identifier) generated by the Mizuhiki method conforms to the ULID specification to ensure uniqueness and sortability. - The first 48 bits of the DID are generated by the UNIX time in millseconds at the time of the user's KYC through a Mizuhiki controller's endpoint.
- The latter 80 bits are generated by a source of randomness determined by the Mizuhiki controller.
- DIDs issued within the same millisecond can be lexicographically sorted with
ulid.Monotonicwhich monotonically increases the entropy bytes for the sasme ULID timestamp.
01AN4Z07BY 79KA1307SR9X4MV3
|----------| |----------------|
Timestamp Entropy
10 chars 16 chars
48bits 80bits
base32 base32
method-name registration in [DID-SPEC-REGISTRIES]
The method-name is to be registered under the DID Methods W3C registry in the immediate future.
method-specific-id formatting
- Currently, this specification only actively supports the Japan Smart Chain private testnet
kaigan. - As DID issuance is limited to those who have undergone a specific KYC verification determined by a Mizuhiki
controller. As thecontrollerhas authority over which blockchains a Mizuhiki DID smart contract registry lives, the controller also determinesmethod-specific-ids for each DID. - Future supported blockchain networks supported by Mizuhiki should have a
method-specific-idthat ONLY INCLUDES%X61-7A(lowercase ASCII letters) and DIGIT (numbers0-9) - A colon must proceed the
method-specific-idand is to be immediately followed by the userID. Amethod-specific-namewithout a proceeding colon and userID is not considered a valid DID.
Path
- Path rules are to conform to the generic rules defined by
path-abemptyABNF rule in RFC 3986, section 3.3.
did:mizuhiki:kaigan:{subjectID}/path
Query
- Query rules are to conform to the generic rules defined by the
queryABNF rule in RFC 3986, section 3.4.
did:mizuhiki:kaigan:{subjectID}?versionId=1
Fragments
- DID fragments are to conform to the generic rules defined by the
fragmentABNF rule from RFC 3986, section 3.5.
did:mizuhiki:kaigan:{subjectID}#public-key-0
Method Operations
DID method authorization
- A Mizuhiki DID controller is a limited set of EVM addresses (addresses derived from an ECDSA public key) stored in the smart contract registry. The Mizuhiki DID smart contract defines two roles: CONTROLLER (
admin) and SUBJECT (public): A CONTROLLER is able to update the content of the resource returned from dereferencing a DID. Mizuhiki roles are defined inMizuhikiAccessManager.sol, based on theAccessManager(v5.x) standard by OpenZeppelin . - Any one keypair of the CONTROLLER set have the ability to issue DIDs on behalf of subjects. This function is limited to the CONTROLLER set.
- Thus, any holder of the private key to one of the keypairs contained in the CONTROLLER set is able to make changes to a DID document.
- Issuance, updates and invalidation of DIDs are performed on the respective blockchain registry's Mizuhiki
DID.solsmart contract.
DID and DID Document creation
Mizuhiki DID Contract Deployment
- Upon deployment of the Mizuhiki DID smart contract, a
did:mizuhiki:{method-specific-id}:controller string array is initialized. - This
did:mizuhiki:{method-specific-id}:controllerarray initially maps to the address of the contract deployer (msg.sender). - The deployer's address is automatically assigned the CONTROLLER role within the smart contract. This role grants access to restricted functions, such as:
- Issuing DIDs and DID Documents.
- Updating DID Documents.
- Adding or removing other EVM addresses from the CONTROLLER array.
- An address with the role CONTROLLER must be authenticated in order to access the restricted functions using a private key corresponding to an EVM address that maps to the CONTROLLER role.
- Mizuhiki Controller EVM addresses are subject to change, thus the
did:mizuhiki:{method-specific-id}:controllerarray allows Mizuhiki DID resolvers to query the latest set of trusted Mizuhiki controller's when verifying Mizuhiki subject DIDs.
Issuance of a Mizuhiki Subject DID
- A Mizuhiki controller must be a JPKI Service Operator in order to perform KYC and receive authorisation to be a "Mizuhiki Attestor" by the Japan Smart Chain Foundation.
- A Mizuhiki subject must undergo KYC using a valid My Number Card, which the Mizuhiki controller must verify.
- Upon successful verification, the Mizuhiki controller calls the
registerDID()function with the following parameters, which form the basis of a Mizuhiki DID document:string memory diduint256 expiryDatebool existsbool deactivated
- The provided
didandexpiryDateparameters, along with the caller's address (msg.sender- which, by definition, is the Mizuhiki controller's address), are then persistently stored. Theexistsanddeactivatedstatus are respectively set totrueandfalseby default; these values are only able to be changed by calling theupdateDIDValidity()function contained in the samrt contract and again restricted to the Mizuhiki controller set. Specifically, DID document details are recorded in a mapping (or hash map) within the Mizuhiki smart contract: theexistsparameter enables the contract to be more easily resolved by thegetDIDDocument()function (described below). Thedidstring serves as the unique key, pointing to a data structure (e.g., a struct) that holds theexpiryDateand themsg.senderaddress. - Mizuhiki Subject DID issuance may be updated later to add verification method(s) by calling
addVerificationMethod(), restricted to a Mizuhiki controller.
DID Method resolution
As per the W3C DID Resolution working draft, a conforming DID resolver is any algorithm realized as software and/or hardware that complies with the relevant normative statements under 4. DID Resolution.
A conforming DID URL dereferencer is any algorithm realised as software and/or hardware that complies with the relevant normative statements in 5. DID URL Dereferencing
The getDIDDocument() function on any given valid Mizuhiki DID.sol smart contract returns the verificationMethods, expiryDate, and deactivation status.