Everything is an identity. Be it a natural or legal person, a switch, a router, a contract, etc. This means identities are at the core of each and every interaction.
While the required level of trust between identities can vary from one interaction to another, the necessity to exchange it in a secure and privacy preserving manner is universal.
Our system supports various methods to create a Self-Sovereign Identity. You can do that from the mobile wallet, the server based wallet or directly via our Web Service based APIs.
This example uses our WebSocket to show how easy it is to create a SSI. If you want an even more easy example have a look at out CodeB Authenticator App on https://www.codeb.io/authenticator. The Authenticator converts your mobile into the identity able to logon to systems via OpenID Connect, Sign Documents und much more.
First you need to open a websocket connection to our test socket: ws://coin.codeb.io:2012 (make sure your firewall allows port 2012)
You can also use our simple websocket client on: http://coin.codeb.io/websocket.aspx
As a first step you have to unlock your key. To do so you need to send a JSON Message in the form:
{ “@type”: “specs/jwt”, “@id”: “29227ad7-8b7c-4c60-93f0-b26094cafce1”, “ktype”: “1”, “exp”: 1598350381, “authentication”: { “type”: “passwordauth”, “encrypted”: “eyJhbGciOiJFQ0RILUVTIiwiZW5jIjoiQTI1NkdDTSIsImVjY3B1YiI6IlJVTkxNU0FBQUFDV0g1dGJfQ0Q4RTJnNDRqaU5SVDZMNG9Zd2tNeVlNM0loNE1HYW9Hb0dNRHZVYW1RbWRnSVl2dEtVSWJ5WXN0ZWlwRWlnbUpkZFJDU1VQN2kwZjlZNCIsImVwayI6eyJrdHkiOiJFQyIsIngiOiJxWDRBZ2lBT2JTV0poWGZuT2tjZENvUkdhWVFMNEN3NVdKbVNqd25PaGJzIiwieSI6Ii1oN2NXQWt4akJLNW9uUUU5V2JCU3dUUG5RcThrYnJlUnRBVXRrVS1OeXMiLCJjcnYiOiJQLTI1NiJ9fQ..0UO1MJ5q6R2FY6OG.DwdmaSV3mVvJSwBrv0QzAx0Qkc220n19E3pryHJynICg-Ib-AzQS0BichiYBz78PL7KOZcssBb2DpINKT7RC2M-SU0pRn1rTKcv4oN2B7NU.Ga0E6NeGVJANoD3xH23Ltg” } }
To create the above packet you can use our WebService API EncryptedPasswordJSONToken on: https://coin.codeb.io/json.asmx?op=EncryptedPasswordJSONToken (Username: 0x9166b9fEC04DB238C6f11752a3cC2DA7348305C6 and Password: aloaha123)
You now send the above JSON Message to the web service.
After a few seconds it will respond with a JSON-WT encoded answer:
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImVjY3B1YiI6IlJVTkxNU0FBQUFDV0g1dGJfQ0Q4RTJnNDRqaU5SVDZMNG9Zd2tNeVlNM0loNE1HYW9Hb0dNRHZVYW1RbWRnSVl2dEtVSWJ5WXN0ZWlwRWlnbUpkZFJDU1VQN2kwZjlZNCJ9.eyJsb2dnZWRJbkFzIjoiMHg5MTY2YjlmRUMwNERCMjM4QzZmMTE3NTJhM2NDMkRBNzM0ODMwNUM2IiwiaWF0IjoiMTU5ODM0NzY1OSIsImV4cCI6IjE1OTgzNTEyNTAiLCJ-dGhyZWFkIjp7InRoaWQiOiJmNTllMjk2NC1jZTFkLTQ0ZGItYjNlZC0wYTE0ZjkzY2I1MWUifSwiQGlkIjoiZDMwYzNmMDctMzgzZS00YmU4LThhYmQtNDBmOTBiNzg3Y2VhIiwic2Vzc2lvbmlkIjoiY2E5NjhhYjYtOTU3My00MTQ3LWE1M2YtYjQ2MWJlNWFlMWJjIn0.aJAb_uA8HPsRlxCyyNEB1lxGKfVkNlEvjSxxMjC7h2VYXH4KoX6QXhnl0qVgxIM7IaNvMZ_EJ1T3DV30yh34wQ
The answer are three Base64 encoded messages joined together but separated by a full stop. You can easily decode it with our Web Service decoder DecodeJWT: https://coin.codeb.io/json.asmx?op=DecodeJWT
The decoded result is:
{“alg”:”ES256″,”typ”:”JWT”,”eccpub”:”RUNLMSAAAACWH5tb_CD8E2g44jiNRT6L4oYwkMyYM3Ih4MGaoGoGMDvUamQmdgIYvtKUIbyYsteipEigmJddRCSUP7i0f9Y4″} {“loggedInAs”:”0x9166b9fEC04DB238C6f11752a3cC2DA7348305C6″,”iat”:”1598347659″,”exp”:”1598351250″,”~thread”:{“thid”:”f59e2964-ce1d-44db-b3ed-0a14f93cb51e”},”@id”:”d30c3f07-383e-4be8-8abd-40f90b787cea”,”sessionid”:”ca968ab6-9573-4147-a53f-b461be5ae1bc”} aJAb_uA8HPsRlxCyyNEB1lxGKfVkNlEvjSxxMjC7h2VYXH4KoX6QXhnl0qVgxIM7IaNvMZ_EJ1T3DV30yh34wQ
Now that your key is unlocked you can send the following command to create your Self-Sovereign Identity (SSI):
{“@type”:”specs/commands”,”@command”:”createidentity”,”thid”:”2ba1c50d-c0ab-4ed9-a035-4ffe06519178″,”myaddress”:”0x9166b9fEC04DB238C6f11752a3cC2DA7348305C6″}
Again we have a helper function available to create the JSON Message on: https://coin.codeb.io/json.asmx?op=CreateSimpleCommand
After you sent the above message to the web socket you receive:
eyJhbGciOiJFUzI1NiIsImVjY3B1YiI6IlJVTkxNU0FBQUFDV0g1dGJfQ0Q4RTJnNDRqaU5SVDZMNG9Zd2tNeVlNM0loNE1HYW9Hb0dNRHZVYW1RbWRnSVl2dEtVSWJ5WXN0ZWlwRWlnbUpkZFJDU1VQN2kwZjlZNCJ9.eyJTZXNzaW9uSUQiOiJjYTk2OGFiNi05NTczLTQxNDctYTUzZi1iNDYxYmU1YWUxYmMiLCJyZXN1bHQiOiIweDA2M2ZiYjBkNTIzNzE2ZjU4M2NiMGNiZTAzZmE4MjZiM2VlMmE0ZTIiLCJ-dGhyZWFkIjp7InRoaWQiOiIyYmExYzUwZC1jMGFiLTRlZDktYTAzNS00ZmZlMDY1MTkxNzgifX0.IEvi9og3UfNerC_YvOScXpGIkKBMksLxwid9SKt3m27GcVhfSnZLLxj6hNdhbEWCIUgnYUwYa5YtlMOgXoBI3g
Decoded:
{“alg”:”ES256″,”eccpub”:”RUNLMSAAAACWH5tb_CD8E2g44jiNRT6L4oYwkMyYM3Ih4MGaoGoGMDvUamQmdgIYvtKUIbyYsteipEigmJddRCSUP7i0f9Y4″} {“SessionID”:”ca968ab6-9573-4147-a53f-b461be5ae1bc”,”result”:”0x063fbb0d523716f583cb0cbe03fa826b3ee2a4e2″,”~thread”:{“thid”:”2ba1c50d-c0ab-4ed9-a035-4ffe06519178″}} IEvi9og3UfNerC_YvOScXpGIkKBMksLxwid9SKt3m27GcVhfSnZLLxj6hNdhbEWCIUgnYUwYa5YtlMOgXoBI3g
The result field contains the address of your new Self-Sovereign Identity! In this sample it is: 0x063fbb0d523716f583cb0cbe03fa826b3ee2a4e2