<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: David Craven</title>
    <description>The latest articles on Forem by David Craven (@dvc94ch).</description>
    <link>https://forem.com/dvc94ch</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F397260%2F2f7fa46a-b99a-419d-8f71-309057ac09b7.jpeg</url>
      <title>Forem: David Craven</title>
      <link>https://forem.com/dvc94ch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dvc94ch"/>
    <language>en</language>
    <item>
      <title>Convenient substrate identity solution</title>
      <dc:creator>David Craven</dc:creator>
      <pubDate>Sat, 06 Jun 2020 15:08:04 +0000</pubDate>
      <link>https://forem.com/sunshine-chain/convenient-substrate-identity-solution-3in4</link>
      <guid>https://forem.com/sunshine-chain/convenient-substrate-identity-solution-3in4</guid>
      <description>&lt;p&gt;For our &lt;a href="https://dev.to/sunshine-chain/introducing-sunshine-2o53"&gt;sunshine-dao&lt;/a&gt; we wanted a convenient easy and secure identity solution, that doesn't require centralized key management.&lt;/p&gt;

&lt;p&gt;The requirements were that we wanted the users to have per device keys they didn't have to copy around and that they should be able to associate their github account, so that users can bring their reputation to our bounty management platform.&lt;/p&gt;

&lt;p&gt;I already heard about keybase and had briefly used it. When I set out to build &lt;a href="https://github.com/sunshine-protocol/substrate-identity"&gt;substrate-identity&lt;/a&gt; I played around with it and read their technical documentation. A really interesting one for me was &lt;a href="https://book.keybase.io/docs/crypto/local-key-security"&gt;local-key-security&lt;/a&gt;. I had written a quick and dirty keystore before for the &lt;a href="https://sunshine-protocol/sunshine-flutter"&gt;sunshine-flutter&lt;/a&gt;, but that had a lot of interesting things in it. I decided to reimplement our keystore based on the keybase keystore. A particularly interesting feature is that it will allow password changes on one device to reencrypt the keys using the public xor of the old password with the new one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup your account
&lt;/h2&gt;

&lt;p&gt;Set your device key to &lt;code&gt;//Alice&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity key &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;--suri&lt;/span&gt; //Alice
Please enter a new password &lt;span class="o"&gt;(&lt;/span&gt;8+ characters&lt;span class="o"&gt;)&lt;/span&gt;:

Your device &lt;span class="nb"&gt;id &lt;/span&gt;is 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
Your user &lt;span class="nb"&gt;id &lt;/span&gt;is 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Add a paper backup for your account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity device paperkey
Generating a new paper key.
Here is your secret paper key phrase:

mandate robust earth scan shrimp second pipe pitch eternal snap glare tooth
bean crucial river bar crash &lt;span class="nb"&gt;nice &lt;/span&gt;sorry laundry oppose filter aunt swear

Write it down and keep somewhere safe.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;and list your device keys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity device list
5Fe8Da8o2TQY6heaopRA9Zs2dpiJ2GFtvWThnd89uxYEXK1q
5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Prove your online identity
&lt;/h2&gt;

&lt;p&gt;Add a new online identity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity &lt;span class="nb"&gt;id &lt;/span&gt;prove dvc94ch@github
Claiming dvc94ch@github...
Please &lt;span class="k"&gt;*&lt;/span&gt;publicly&lt;span class="k"&gt;*&lt;/span&gt; post the following Gist, and name it &lt;span class="s1"&gt;'substrate-identity-proof.md'&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="c"&gt;### substrate identity proof&lt;/span&gt;

I hereby claim:

  &lt;span class="k"&gt;*&lt;/span&gt; I am dvc94ch on github.
  &lt;span class="k"&gt;*&lt;/span&gt; I am 0 on the substrate chain with genesis &lt;span class="nb"&gt;hash &lt;/span&gt;mzyTJZVm7IXDUBeZwyWk6rG1YGIt8BQnNzrshKJCalYI.
  &lt;span class="k"&gt;*&lt;/span&gt; I have a public key 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY valid at block with &lt;span class="nb"&gt;hash &lt;/span&gt;mfBFseDYNX31Poqei8A/9teYmxJIj4PFROoKLKEPaStE.

To claim this, I am signing this object:

&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"block"&lt;/span&gt;:[124,17,108,120,54,13,95,125,79,162,167,162,240,15,253,181,230,38,196,146,35,224,241,81,58,130,139,40,67,218,74,209],&lt;span class="s2"&gt;"body"&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Ownership"&lt;/span&gt;:[&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Github"&lt;/span&gt;:[&lt;span class="s2"&gt;"dvc94ch"&lt;/span&gt;&lt;span class="o"&gt;]}]}&lt;/span&gt;,&lt;span class="s2"&gt;"ctime"&lt;/span&gt;:1591448931056,&lt;span class="s2"&gt;"expire_in"&lt;/span&gt;:18446744073709551615,&lt;span class="s2"&gt;"genesis"&lt;/span&gt;:[207,36,201,101,89,187,33,112,212,5,230,112,201,105,58,172,109,88,24,139,124,5,9,205,206,187,33,40,144,154,149,130],&lt;span class="s2"&gt;"prev"&lt;/span&gt;:null,&lt;span class="s2"&gt;"public"&lt;/span&gt;:&lt;span class="s2"&gt;"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"&lt;/span&gt;,&lt;span class="s2"&gt;"seqno"&lt;/span&gt;:1,&lt;span class="s2"&gt;"uid"&lt;/span&gt;:0&lt;span class="o"&gt;}&lt;/span&gt;

with the key 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY, yielding the signature:

mAU6Gon1dqctnS/zPKHd9gWFvEJBqADvgYQy0OFuamA5CwVQk7papR0xBq8DijRqSXVGpJtNFmy7aYJk5cGLxv4c

And finally, I am proving ownership of the github account by posting this as a gist.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;and list your identities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity &lt;span class="nb"&gt;id &lt;/span&gt;list
Your user &lt;span class="nb"&gt;id &lt;/span&gt;is 0
dvc94ch@github https://gist.github.com/da8bbf9c69976a3d750e2c433126852b
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Receive payments to your public identity
&lt;/h2&gt;

&lt;p&gt;Transfer a balance from &lt;code&gt;//Bob&lt;/code&gt; to &lt;code&gt;dvc94ch@github&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity &lt;span class="nt"&gt;--path&lt;/span&gt; /tmp/bob key &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;--suri&lt;/span&gt; //Bob
Please enter a new password &lt;span class="o"&gt;(&lt;/span&gt;8+ characters&lt;span class="o"&gt;)&lt;/span&gt;:

Your device &lt;span class="nb"&gt;id &lt;/span&gt;is 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty
Your user &lt;span class="nb"&gt;id &lt;/span&gt;is 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;make sure ipfs is running so that &lt;code&gt;//Bob&lt;/code&gt; can fetch &lt;code&gt;//Alice&lt;/code&gt;'s identity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;finally make the transfer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;cli-identity &lt;span class="nt"&gt;--path&lt;/span&gt; /tmp/bob wallet transfer dvc94ch@github 10000
transfered 10000 to 5Fe8Da8o2TQY6heaopRA9Zs2dpiJ2GFtvWThnd89uxYEXK1q
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>rust</category>
      <category>substrate</category>
      <category>polkadot</category>
      <category>identity</category>
    </item>
  </channel>
</rss>
