hyperledger / indy-did-method

Indy DID Method Specification
https://hyperledger.github.io/indy-did-method/
Creative Commons Attribution 4.0 International
18 stars 14 forks source link

Storage of diddocContent and size limit #20

Closed domwoe closed 2 years ago

domwoe commented 3 years ago

Looking at the current implementation of the ATTRIB transaction in indy node, there are two things that caught my attention.

  1. The actual ATTRIB data is not stored in the ledger, but each node keeps an additional store (See also here)
  2. There's a default size limit of 5*1024 Byte (5kB) for ATTRIB data, which can be set as a configuration parameter (in Plenum). didDocContent will need a sensible limit as well.

Concerning 1: Is there a need to handle didDocContent data similarly?

dbluhm commented 2 years ago

As a quick experiment, I did a quick scan for the longest DID Doc content in the example DIDs on https://dev.uniresolver.io (was not super thorough) and did a quick analysis of the size. DID I used was did:eosio:eos:eoscanadacom and when formatted as a json string (in compact form, no whitespace), it totalled 7330 bytes.

dbluhm commented 2 years ago

For some more "real world numbers," recommended RSA key size is 4096 bits == 512 bytes. You can fit around 8-9 RSA 4096 keys in a single DID Document at the 5KiB size limit.

swcurran commented 2 years ago

This issue was assessed by @dbluhm and team. The comparison that is relevant is the size of the Cred Defs, as they are much larger than the NYMs are currently, and are likely much larger than any diddocContent that we would expect to see. As such, the NYMs with the new items will go on the ledger.

@dbluhm will there be a set size limit defined?

Are we good to close this issue?

dbluhm commented 2 years ago

We briefly discussed this today during the Indy DID Method Call. The implementation team here at Indicio recommends that we set a size limit at 10 KiB. This value is somewhat arbitrarily selected, as are other transaction size limits currently set in Indy Node/Plenum. At some stage in the future, we see this (and the other transaction size limits) as being potentially configurable via config transaction.

dbluhm commented 2 years ago

This has been captured in implementation and docs. If further discussion is needed on storage limitations, we can open a new issue. Closing :slightly_smiling_face: