Giter Club home page Giter Club logo

Comments (3)

rvalle avatar rvalle commented on June 28, 2024

On the other hand, the I cannot locate the implementation of the function, as this has been imported from WASM, and I cannot review what it actually does. I cannot find a function with that name neither in Substrate or Polkadot repositories.

Anybody knows where is encodePkcs8 implemented?

from common.

jacogr avatar jacogr commented on June 28, 2024

It is not a Polkadot/Substrate standard. It is purely a Polkadot Js function used to encode the keyring for internal usage and storage. It is always assumed that anything encoded with this will be decoded with the same (reverse) function.

As such there is no appetite to change it since -

  1. This would require a Polkadot JS ecosystem-wide upgrade to ensure that keypairs can be shared (an upgrade is planned for version 3 -> 4, but it will drop the current encoding format completely - obviously catering for old decoding as well, just new default encoding would be 4, not pkcs8-like, but rather different)
  2. It is an internal keyring function (obviously some people may have use for it elsewhere, in that case the limitiations needs to be kept in mind)

The Polkadot JS-specific encoding is handled here - https://github.com/polkadot-js/common/tree/master/packages/util-crypto/src/json

from common.

rvalle avatar rvalle commented on June 28, 2024

@jacogr Thanks, I can see where the issue may be coming from. It could be that the header used is actually for an RSA key, I will dig deeper.

As such there is no appetite to change it since ...

Well, at least we should add documentation if it turns out that PKCS8 is actually not PKCS8. Also I believe that adding an `encodeStandardPkcs8' would definitely not hurt. Even better and less confusing would be to add encodePEM() as implemented as Standard PKCS8 in PEM format, and ensuring interoperability at least with NodeJS crypto packages and OpenSSL.

ensure that keypairs can be shared (an upgrade is planned for version 3 -> 4

We are specifically looking into key interoperability as part of DINFRA project, which is in the Web3 Grants program. We are going to be attempting key interoperability with a number of other opensource projects, so we are happy contribute to this.

We are happy to participate in selecting which format/s would be nice to have for best interoperability.

from common.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.