How does identity system work on dfinity

I just watched the talk from davos where the linkedup system was demoed by stanley and there was no password or login neccesary. Pretty cool stuff but I can’t find anything in the SDK docs about it. Would anybody care to elaborate how this identity system works and where it is stored?

Also given the huge amount of cryptographic knowledge on the team will there be some cool stuff with zero knowledge proofs in there where you can proof things about your identity without revealing it?

1 Like

Just saw that there is some more information on this in the Hackin’ on the internet computer | ep.2 from Hans. Hope that there is more info coming soon!


Basically in the browser it uses window.localStorage.getItem("dfinity-ic-user-identity");

If there is no value, it will generate a keypair ed25519.

An example of value for the keypair is (string):

You can make a new keypair using the function from ic:userlib makeKeyPair, generateKeyPair.

They serialize, deserialize respectively using JSON.parse JSON.stringify

In order to instantiate a new actor using js-user-library (using nodeJS or other) with a custom canisterId and custom keypair you can use this snippet:

// ../js-user-library can be replaced with $HOME/.cache/dfinity/versions/0.5.5/js-user-library

const { makeAuthTransform, makeKeyPair } = require("../js-user-library/src/auth");
const { makeNonceTransform } = require("../js-user-library/src/http_agent_transforms");
const { HttpAgent } = require("../js-user-library/src/http_agent");
const fetch = require("node-fetch");

const FTIDL = ({ IDL }) => {
  return IDL.Service({
    // the content of `canisters/{canisterName}/main.did.js`
    helloWorld: IDL.Func([IDL.Nat32], [IDL.Bool], []),

// host http://localhost:8000 or DFINITY API
// canisterId is `ic:xxxxx`
// keyPair is the keypair object (JSON.parse(window.localStorage.getItem("dfinity-ic-user-identity")))
function getActor(host, canisterId, keyPair) {
  const kp = makeKeyPair(,;
  const httpAgent = new HttpAgent({ host: host, fetch: fetch });
  httpAgent.addTransform(makeAuthTransform(kp)); // here you could use another middleware that would sign the request, HSM integration for example, etc
  const actor = httpAgent.makeActorFactory(FTIDL)({
    canisterId: canisterId,
    httpAgent: httpAgent
  return actor;

That’s awesome thank you for the elaborate reply!

1 Like