Skip to content

Instantly share code, notes, and snippets.

@matiu
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matiu/036e8a3ccfb468c97a64 to your computer and use it in GitHub Desktop.
Save matiu/036e8a3ccfb468c97a64 to your computer and use it in GitHub Desktop.
Identity API
var opts = {
blockchain: new Blockchain(...),,
storage: localstorage / insight / drive,
networking: new Async(...),
};
Identity.create(email, password, opts, function(err, iden){
//
})
Identity.validate(email, password, authcode, function(err,iden){
//
})
Identity.open(email,password, opts, function(err, iden){
//
});
Identity.isAvailable(email, opts, function(err, iden){
//
});
iden.listWallets(function(err, list) {
});
iden.createWallet(opts, function(err,wallet){
})
iden.joinWallet(opts, function(err,wallet){
})
// to open a wallet
iden.getWallet(walletId, function(err,wallet){
})
//free mem
iden.disposeWallet(walletId, function(err,wallet){
});
iden.deleteWallet(walletId, function(err){
})
// to store to file, for example:
iden.getBackup(function(err, encryptedJSON) {
});
// to store to given storage.
iden.store(walletId?, function(err) {
});
iden.importWallet(encryptedJSON, password, function(err)){
});
iden.setPicture(base64Image*, function(err){
});
* format / size to be defined.
Insight Identity Services
=========================
PUT /identity/hash(email+password)
+ email address
+ blob (encrypted extended private key)
+ authcodeURI (e.g. `https:/pepe.com/confirm/` )
(expires in ~1hr)
server sends and email to 'email address' with authCode, and a link:
https:/pepe.com/confirm?code=<authCode>&hash=hash
wallet software should hit:
PUT /identity/<hash>?confirm=authCode
Then
----
GET /identity/hash
<- blob
PUT /identity/hash
<-- 401
Future:
POST /identity/hash
Could be used to add info to the indentity, but will require and new `/confirm` hit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment