uport-project / ethr-did

Create ethr DIDs
Apache License 2.0
268 stars 54 forks source link

Add the possibility to choose the gas limit for transactions to the registry #29

Closed gjgd closed 5 years ago

gjgd commented 5 years ago

Is your feature request related to a problem? Please describe. I want to add a RSA 4096 bit public key but cannot because its size makes the transaction go over the transaction gas limit. Example:

    const rsa4096PublicKey = `-----BEGIN PUBLIC KEY-----
            MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAolN9csarxOP++9pbjLE/
            /ybicmTGL0+or6LmLkos9YEXOb8w1RaoQoLuPNbCqfHlnbiPdvl9zdVHCswf9DwK
            Ba6ecs0Vr3OW3FTSyejHiqinkfmEgRKOoAf7S8nQcsiDzANPondL+1z+dgmo8nTK
            9806ei8LYzKzLjpi+SmdtTVvUQZGuxAT1GuzzT5jyE+MyR2zwSaCTyNC6zwnk51i
            z+zf8WRNe32WtBLhNbz6MKlwup1CSear9oeZQJRQspkud7b84Clv6QeOCPqMuRLy
            ibM8J+BC5cRyxVyV2rHshvD134cbR6uEIsggoC9NvvZcaJlcG25gA7rUrIJ8CGEG
            9WZsmqUfrykOJ3HFqGyJZlpVq0hHM6ikcexdbqPFcwj9Vcx3yecb6WABZCeYVHDw
            3AoGu/Y/m2xJ7L3iPCWcpB94y0e7Yp3M6S8Y4RpL2iEykCXd7CVYVV1QVPz4/5D8
            mT4S4PG0I0/yBbblUz9CcYSJ/9eFOekSRY7TAEEJcrBY7MkXZcNRwcFtgi9PWpaC
            XTsIYri2eBKqAgFT9xaPiFCFYJlpfUe81pgp+5mZsObYlB0AKJb7o0rRa5XLO4JL
            ZiovTaqHZW9gvO3KZyJNYx7XM9Vjwm4FB5NUxSvqHJyUgGC6H7jwK2wKtrThrjkt
            P9+7B63q+4nzilC9UUHEIosCAwEAAQ==
            -----END PUBLIC KEY-----`
      const rsa4096PublicKeyHex = Buffer.from(rsa4096PublicKey)
      await ethrDid.setAttribute('did/pub/Rsa/veriKey/pem', rsa4096PublicKeyHex)
    })

Gives the following error: VM Exception while processing transaction: out of gas because default transaction gas limit is 90000.

Describe the solution you'd like Add the possibility to choose the gas limit for transactions to the registry

Example: Add an optional gas parameter for setAttribute(), so that a user can increase the transaction gas limit when adding big keys

OR13 commented 5 years ago

It would be nice to support custom attributes, ideally we should be able to create DID Documents that match the spec, except for the the DID method.

https://w3c-ccg.github.io/did-spec/#ex-5-various-public-keys

OR13 commented 5 years ago

Any update on this? Being only able to support ethereum keys is a major limiting factor for a DID method, and prevents interoperability, especially with existing services that for the most part do not support secp256k1. @pelle