XXX: DID:Indy Method

  • Author
  • Start Date: 2020-02-05

Status

  • Status: PROPOSED
  • Status Date: 2021-09-02
  • Status Note:

Summary

This HIPE describes the implementation of the did:indy concerning indy-node and indy-vdr according to the did:indy specification.
For motivation and more information please refer to the did:indy specification.

Transaction format

  • Needs new protocol version

Indy Node / Plenum

Indy VDR API

Reference

Drawbacks

Rationale and alternatives

Get specific version

https://github.com/hyperledger/indy-node/blob/master/docs/source/transactions.md#common-structure

{
    "ver": <...>,
    "txn": {
        ...
    },
    "txnMetadata": {
        "txnTime": <...>,
        "seqNo": <...>,
        "txnId": <...>
    },
    "reqSignature": {
       ...
    }
}

Indy Node and Indy Plenum

Write NYM

We need to adapt the schema of a write nym operation to include the optional diddoccontent attribut. The schema definition is part of Plenum

Should we adapt the existing class

class ClientNYMOperation(MessageValidator):
    schema = (
        (TXN_TYPE, ConstantField(NYM)),
        (ALIAS, LimitedLengthStringField(max_length=ALIAS_FIELD_LIMIT, optional=True)),
        (VERKEY, VerkeyField(optional=True, nullable=True)),
        (TARGET_NYM, DestNymField()),
        (ROLE, RoleField(optional=True)),
        (DIDDOC_CONTENT, JsonField(max_length=JSON_FIELD_LIMIT(optional=True)),
        
    )

or add another class?

class ClientNYMOperationV2(MessageValidator):

I don't see a reason currently to add another class.

JSON_FIELD_LIMIT is used for the raw content of an ATTRIB tx and is set here to 5*1024

It seems that we don't need to adapt the update_state function

An open question would be if store the diddoccontent directly or use dedicated store as is done in the attrib case.

Validation

Get NYM

No changes required?

Do we need new type/schemas of new version?

GET DIDdoc by timestamp

We can roughly follow the process outlined in RevocRegEntry

  1. Define get nym request and handler with additional timestamp New schema with (TIMESTAMP, IntegerField(optional=True))and enhanced logic to do the following
  2. Use NymHandler.make_state_path_for_nym(nym) as defined here
  3. Implement get_nym_by_timestamp(timestamp, path_to_nym_entry) similar to _get_reg_entry_by_timestamp(self, timestamp, path_to_reg_entry). More about timestamp storage can be found here

Get DIDdoc by version (==seqNo)

There seems to be no direct mapping between seqNo and state. Hence, I see the following options:

  1. Introduce a new mapping seqNo -> state and add an optional seqNo attribute to the get nym request.
  2. Use GET_TXN(seqId) internally, use state_root_hash which is part of the state_proof block to get_value_from_state. (Not sure if this the correct state root (More info))
  3. Use GET_TXN(seqId) internally, get the timestamp from this TX and use get_nym_by_timestamp

Noteworthy

Interesting Sources

ToDos and Open Questions

-[ ] Update Transactions documentation
-[x] How is get revocation registry state implemented?

/indy_common/constants.py Line 104 allOpKeys add diddoccontent ?

  • Do we need to register new handlers?

indy_node/test/nym_txn/test_nym_resend.py::test_nym_send_twice FAILED [ 98%]
indy_node/test/nym_txn/test_nym_resend.py::test_nym_resend FAILED [ 98%]
indy_node/test/nym_txn/test_send_nym_validation.py::testSendNymSucceedsForUuidIdentifierAnsdk_pool_handlemittedVerkey FAILED [ 98%]