Coder Social home page Coder Social logo

mnid's Issues

A few questions/thoughts

Hey, This is a great initiative 👍 to self describing opaque strings :)

@kumavis asked @diasdavid and I on IRC to take a look at this and give some feedback, so i figured i'd start an issue for discussion.

It seems what we're really doing here is coming up with a scheme for encoding PKI identities (an ethereum address being roughly the hash of a public key).

Some initial things i want to consider:

  • What would an address on bitcoin look like? How would that be represented?
  • How difficult would it be to represent an ipfs peer ID with this format?
  • Do you think the checksum could be optional? i.e. allow un-checksummed mnids ?
  • The version byte should probably be a varint, this allows future extensibility
  • The network IDs should be in a table somewhere, that way people using this spec don't overlap on their selections
  • Using a segment of the genesis block hash seems like a nice idea, but i would be worried about the possibility of a collision if this spec becomes more adopted. A global table seems the better approach
  • The hash function used for the checksum at the end should be specified by the version (version 1 == sha3, version2 maybe something different if sha3 breaks?). Hardcoding these things always makes me nervous
  • Consider using multibase instead of strictly base58. Some applications might want a case insensitive encoding (like filenames on non-linux OSes)

[BUG] MNID object is undefined using ES6/Webpack import

When the mnid object imported from the dependency I get undefined.

import mnid, {decode} from 'mnid'
console.log(mnid)
console.log(decode)

*console output*

undefined
ƒ decode(encoded) {
  var data = _buffer.Buffer.from(base58.decode(encoded));
  var netLength = data.length - 24;
  var version = data.slice(0, 1);
  var network = data.slice(1, netLength);
  var addre…

I presume this is just a Webpack/ES6 import bug for bundling (personally I don't feel digging in)? To be safe would it make sense to add export default object exporting the functions?

export default {
 checksum,
 encode,
 decode,
 isMNID
}

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.