Friday, February 5, 2021

How to install indy-cli from a bare Ubuntu 16.04 Instance

How to install indy-cli from a bare Ubuntu 16.04 Instance :
 






sudo chmod 777 /var/cache/app-info/xapian/default -R
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"
sudo add-apt-repository "deb https://repo.sovrin.org/deb xenial stable"
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main universe"
sudo add-apt-repository "deb http://cz.archive.ubuntu.com/ubuntu xenial main universe"
sudo apt-get update
sudo apt-get install indy-cli


then use:

https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template


Hyperledger Indy introduction with Indy Agents Demo
https://www.youtube.com/watch?v=llwfb5Ut5sg


there are lot of different videos. try to find hyperledger indy tech stuff.

side note:
Michael Seibel - How to Plan an MVP
https://www.youtube.com/watch?v=1hHMwLxN6EM

Michael Seibel - Building Product
https://www.youtube.com/watch?v=C27RVio2rOs



Tuesday, February 2, 2021

I ran through these instructions
https://sovrin.org/wp-content/uploads/Token-Test-Instructions.pdf

I used Ubuntu 16.04 running from Virtualbox. All seemed fine until I got to this instruction:

ubuntu@ubuntu:~$ sudo apt-get install -y indy-cli libsovtoken
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 indy-cli : Depends: libindy (= 1.15.0)
 libsovtoken : Depends: libindy (>= 1.14.0)
E: Unable to correct problems, you have held broken packages.

I found: https://lib.rs/gh/hyperledger/indy-sdk/libindy
(however, I did not find that it was up to date?)

I found this: https://github.com/hyperledger/indy-sdk
and this: https://github.com/hyperledger/indy-sdk/blob/master/docs/how-tos/write-did-and-query-verkey/README.md

https://github.com/hyperledger/indy-sdk/blob/master/docs/getting-started/indy-walkthrough.md

https://github.com/Microsoft/WSL/issues/640 (fix error with apt-get)
https://github.com/hyperledger/indy-sdk/blob/master/docs/build-guides/ubuntu-build.md
https://www.rust-lang.org/tools/install 


I need to also install this for the rest of ubuntu-build to work:

sudo add-apt-repository "https://packages.ubuntu.com/xenial/amd64/libzmq3-dev/download" in

https://packages.ubuntu.com/xenial/amd64/libzmq3-dev/download
sudo add-apt-repository 
"
deb http://cz.archive.ubuntu.com/ubuntu xenial main universe"
sudo apt-get install cargo


----
I think that this needs libindy installed first:
https://sovrin.org/wp-content/uploads/Token-Test-Instructions.pdf
-------

steps to run when starting from a blank ubuntu 16.04 instance
sudo chmod 777 /var/cache/app-info/xapian/default -R
sudo apt-get update
sudo chmod 777 /var/cache/app-info/xapian/default -R

sudo apt-get update
sudo apt-get install curl

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main universe"

sudo add-apt-repository "deb http://cz.archive.ubuntu.com/ubuntu xenial main universe"

sudo apt-get update

sudo chmod 777 /var/cache/app-info/xapian/default -R

sudo apt-get update

sudo apt-get install cargo
 sudo su

instructions here: https://github.com/hyperledger/indy-sdk/blob/master/docs/build-guides/ubuntu-build.md

sudo apt install git

exit root

Build libindy


This seems to be a hassle. I ran out of memory on my virtual machine and it took forever to complete the steps.

How about trying docker???
How to start local nodes on docker:

https://github.com/hyperledger/indy-sdk/blob/master/README.md#how-to-start-local-nodes-pool-with-docker



https://sovrin.org/wp-content/uploads/Token-Test-Instructions.pdf


48 sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main universe"
49 sudo add-apt-repository "deb http://cz.archive.ubuntu.com/ubuntu xenial main universe"
50 sudo apt-get update
51 sudo apt-get install indy-cli

--------------------
start by creating a verinym:
https://myhsts.org/tutorial-learn-how-to-work-with-hyperledger-indy-command-line-interface.php


++++++++++++++++++++++++++++++++++++++++++++++
To create DID document do this:

https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html


















Thursday, January 28, 2021

Links dumped for working with HashTable

 https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Set_a_breakpoint

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects

https://www.tutorialspoint.com/Creating-a-hash-table-using-Javascript

https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Set_a_breakpoint

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values

https://www.tutorialspoint.com/Creating-a-hash-table-using-Javascript

https://www.educative.io/blog/data-strucutres-hash-table-javascript

https://careerkarma.com/blog/javascript-object-keys/

https://usefulangle.com/post/189/javascript-array-intersection-difference

https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes

https://gist.github.com/bshambaugh/9d8095a6491dfb32bf8328bd21627e60

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map

https://usefulangle.com/post/189/javascript-array-intersection-difference

https://github.com/bshambaugh/BlinkyProject/blob/master/CubeCellandHeltecESP32_try5/esp8266_shop_websockets/custom/hashTable/HashTable.js

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

https://www.javascripttutorial.net/javascript-return-multiple-values/

https://www.tutorialspoint.com/Search-Element-in-an-Javascript-Hash-Table

https://www.tutorialspoint.com/Remove-elements-from-Javascript-Hash-Table

https://www.freecodecamp.org/news/how-to-implement-a-simple-hash-table-in-javascript-cb3b9c1f2997/

https://en.wikipedia.org/wiki/Hash_table

https://www.geeksforgeeks.org/how-to-create-hash-from-string-in-javascript/




Sunday, January 3, 2021

DID document to try

 DID document to try:

{
  "@context": "https://www.w3.org/ns/did/v1",
  "id": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
  "authentication": [{
    


    "id": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB#keys-1",
    "type": "JsonWebKey2020",
    "controller": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
     "publicKeyJwk": {
        "kty": "EC",
        "crv": "P-256",
        "x": "F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
        "y": "1CD36717B8AC5E4FEA8AD23DC8D0783C2318EE4AD7A80DB6E0026AD0B072A24F"
    }
  }],
  "service": [{
    
    "id":"did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB#vcss",
    "type": "VerifiableCredentialService",
    "serviceEndpoint": "https://example.com/vc/"
  }]
}

Possible Workflow. Create DID document with public key,hash with sha256, sign with the private key.
Send signed DID document and unsigned DID document to register with the service endpoint. Use the DID document
to get the public key to decrypt signed messages.

-----------------------------------------------------------------------------------------------------

Create a sha256 hash of this DID document. Sign the sha256 hash with the private key.
Compare the unsigned hash with the signed hash. (like you did with the message).
Figure out DLT later. I am not sure why BigChainDB isn't working.

References: https://www.youtube.com/watch?v=Uu651GJ5YY0
(Adventures in Self-Sovereign Identity: From...- June 28 | Identiverse 2019)

Can I advertise my DID with the device to look up my public key? Is that how it works?


Can I list my DID based on a P-256 key on a public ledger created with Ed25519 keys?

Perhaps it looks like this:

{
  "@context": "https://www.w3.org/ns/did/v1",
  "id": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
  "authentication": [{
    "id": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB#keys-1",
    "type": "JsonWebKey2020",
    "controller": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
     "publicKeyJwk": {
        "kty": "EC",
        "crv": "P-256",
        "x": "F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
        "y": "1CD36717B8AC5E4FEA8AD23DC8D0783C2318EE4AD7A80DB6E0026AD0B072A24F"
    }
  }],
  "verificationMethod": [{
    "id": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6#keys-2",
    "type": "Ed25519VerificationKey2018",
    "controller": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
    "publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
  }],
  "service": [{
    
    "id":"did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB#vcss",
    "type": "VerifiableCredentialService",
    "serviceEndpoint": "https://example.com/vc/"
  }]
}

Possible Workflow. Request Ed25519 key from another device, Put Ed25519 key in DID document along with P-256 key.
Sign the document with P-256 private key in program on edge device. Put the DID document on ledger with the Ed25519 key.