dsys / cleargraph

⛓ Cleargraph is a GraphQL runtime for decentralized applications
Other
254 stars 14 forks source link

Implement registerKeyPair() flow in API #15

Open kern opened 6 years ago

kern commented 6 years ago

type Query {
  keyPairChallenge(publicKey: String!): String!
  keyPair(publicKey: String!, network: ETHEREUM_NETWORK): KeyPair
}

type Mutation {
  registerKeyPair(
    publicKey: String!
    name: String
    deviceType: DEVICE_TYPE
    challenge: String!
    signature: String!
  ): KeyPair!
}

type KeyPair {
  publicKey: String!
  name: String
  deviceType: DEVICE_TYPE
}

enum DEVICE_TYPE {
  DESKTOP
  IOS
  ANDROID
  OTHER
}
kern commented 6 years ago

concern: everyone can read everyone else's key pair information, which is obviously not ideal. perhaps there's an access token system that uses the key pair challenge, which can be used to detect if a key pair should be accessible or not? or perhaps if the key pair's metadata is accessible?

kern commented 6 years ago

possible solution: whenever registering a keypair, associate it with an identity contract as well. that way, each keypair is only associated with the intended identity, as opposed to any identity (which could lead to information leakage).

kern commented 6 years ago

putting this on the backlog until we have better support for multi-device identities