Monday, February 22, 2021

multiformats and ceramic links

https://www.youtube.com/watch?v=HpmM-4LG0nY
(1 - CBOR encoding and refactoring to use multiformats)

https://multiformats.io/#what-are-multiformats

https://proto.school/anatomy-of-a-cid/01

https://cid.ipfs.io/

https://proto.school/merkle-dags

https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-79/CIP-79.md

https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-59/CIP-59.md

https://github.com/multiformats/js-multiformats

https://github.com/multiformats/cid

https://github.com/multiformats/multibase

https://gateway-clay.ceramic.network/api/v0/documents/k3y52l7qbv1fryquw7e2dvh0da7ty5vdxu15ova82f73nbtif0fps502utn8o18g0

 

https://gateway-clay.ceramic.network/api/v0/documents/k6zn3rc3v8qin211rjoeqxwsrvo3vfnrfhhszu1i2xl4qhi4elnsrwcqzm3o51al62d5os3c4f63jn158g9mjjdhjdcyv5stuzqa593xnqergt9rh4wg2wi
https://gateway-clay.ceramic.network/api/v0/documents/kjzl6cwe1jw145tj6ebx9fpg0v61v9snls5tksca8krr0k90qampmwfrfse3kcw
https://gateway-clay.ceramic.network/api/v0/documents/k3y52l7qbv1fry9bohg9oijypusv7l2arvp3xw9nrphaq7vxtsnic6snufi68xbsw
https://gateway-clay.ceramic.network/api/v0/documents/k3y52l7qbv1fry9bohg9oijypusv7l2arvp3xw9nrphaq7vxtsnic6snufi68xbsw
https://gateway-clay.ceramic.network/api/v0/documents/k6zn3rc3v8qin211rjoeqxwsrvo3vfnrfhhszu1i2xl4qhi4elnsrwcqzm3o51al62d5os3c4f63jn158g9mjjdhjdcyv5stuzqa593xnqergt9rh4wg2wi
https://gateway-clay.ceramic.network/api/v0/documents/kjzl6cwe1jw149kkymqdf4aas5jsml90n9fy94v0nnpkduz104ilf22ws9zimro
https://gateway-clay.ceramic.network/api/v0/documents/kjzl6cwe1jw146s19unpt2f2fd242q1t937bkea3zssmlnqpgz6je3d58n9drmg
https://gateway-clay.ceramic.network/api/v0/documents/k2t6wyfsu4pfxmv4076gobzgrl9w95pr48pjmabajc80nxyhy0o2ebwg7tyb3q
https://gateway-clay.ceramic.network/api/v0/documents/k3y52l7qbv1fry9bohg9oijypusv7l2arvp3xw9nrphaq7vxtsnic6snufi68xbsw


Compare https://github.com/multiformats/cid (with https://github.com/multiformats/js-cid) to https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-59/CIP-59.md  (for DocID)

<cidv1> ::= <mb><multicodec-cidv1><mc><mh>
# or, expanded:
<cidv1> ::= <multibase-prefix><multicodec-cidv1><multicodec-content-type><multihash-content-address>

vs

<docid> ::= <multibase-prefix><multicodec-docid><doctype><genesis-cid-bytes>

# e.g. using CIDv1
<docid> ::= <multibase-prefix><multicodec-docid><doctype><multicodec-cidv1><multicodec-content-type><multihash-content-address>



Thursday, February 18, 2021

Creating Schema with Ceramic

 ceramic create tile --content ' {                                            
     "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Reward",
    "type": "object",
    "properties": {
       "title": { "type": "string" },
       "message": { "type": "string" }
     },
     "required": [
       "message",
       "title"
     ]
}'
DocID(kjzl6cwe1jw149garm97dhntc1en53c6o0xywsq5dcmkigdvfro10vem5qexpqx)
{
  "type": "object",
  "title": "Reward",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "message",
    "title"
  ],
  "properties": {
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  }
}

ceramic commits kjzl6cwe1jw149garm97dhntc1en53c6o0xywsq5dcmkigdvfro10vem5qexpqx
[
  "k3y52l7qbv1fryb7wke9gfxlclm04k7qneupk989y6xshv8ink4qva7bxkru7r3eo"
]

ceramic create tile --content '{
    "title": "My first document with schema",
    "message": "Hello World"
  }' --schema k3y52l7qbv1fryb7wke9gfxlclm04k7qneupk989y6xshv8ink4qva7bxkru7r3eo
DocID(kjzl6cwe1jw1480d7lmk514goynopqjtdhv2j3b4lz9iec6c0nd9673qgcfx1yr)
{
  "title": "My first document with schema",
  "message": "Hello World"
}


------------------------------------------------------------------------------------------------------------------------
ceramic create tile --content '
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A basic DID document",
   "type" : "object",
   "title" : "basicDIDdocument",
   "properties" : {
     "@context" : {
       "type" : "string"
     },
     "id" : {
        "type" : "string"
     },
     "authentication" : {
         "type": "array",
         "items" : {
            "type" : "object",
            "properties" : {
               "id" : {
                   "type" : "string"
                },
               "type" : {
                  "type" : "string"
               },
               "controller" : {
                  "type" : "string"
               },
               "publicKeyKwk" : {
                  "type" : "object",
                     "properties" : {
                       "kty" : {
                         "type" : "string"
                       },
                       "crv" : {
                          "type" : "string"
                       },
                       "x" : {
                          "type" : "string"
                       },
                       "y" : {
                         "type" : "string"
                       }
                     }
               }
            }
        }
    }
  }
}'
DocID(kjzl6cwe1jw14bngwjeykqkv48z5d785bjad25dic9fp7ul5hhyk9pbngjkwmo9)
{
  "type": "object",
  "title": "basicDIDdocument",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "id": {
      "type": "string"
    },
    "@context": {
      "type": "string"
    },
    "authentication": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "controller": {
            "type": "string"
          },
          "publicKeyKwk": {
            "type": "object",
            "properties": {
              "x": {
                "type": "string"
              },
              "y": {
                "type": "string"
              },
              "crv": {
                "type": "string"
              },
              "kty": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "description": "A basic DID document"
}

ceramic commits kjzl6cwe1jw14bngwjeykqkv48z5d785bjad25dic9fp7ul5hhyk9pbngjkwmo9
[
  "k3y52l7qbv1fryquw7e2dvh0da7ty5vdxu15ova82f73nbtif0fps502utn8o18g0"
]


ceramic create tile --content '
{
  "@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"
    }
  }]
} '  --schema k3y52l7qbv1fryquw7e2dvh0da7ty5vdxu15ova82f73nbtif0fps502utn8o18g0


ceramic create tile --content '
> {
>   "@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"
>     }
>   }]
> } '  --schema k3y52l7qbv1fryquw7e2dvh0da7ty5vdxu15ova82f73nbtif0fps502utn8o18g0
DocID(kjzl6cwe1jw149ze5o87d55ooh4wmnwwrk0n0q2ng7a2im57ovp7njszqnlao56)
{
  "id": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
  "@context": "https://www.w3.org/ns/did/v1",
  "authentication": [
    {
      "id": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB#keys-1",
      "type": "JsonWebKey2020",
      "controller": "did:example:F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
      "publicKeyJwk": {
        "x": "F9C36F8964623378BDC068D4BCE07ED17C8FA486F9AC0C2613CA3C8C306D7BB6",
        "y": "1CD36717B8AC5E4FEA8AD23DC8D0783C2318EE4AD7A80DB6E0026AD0B072A24F",
        "crv": "P-256",
        "kty": "EC"
      }
    }
  ]
}

DID document resolvable at:
https://gateway-clay.ceramic.network/api/v0/documents/kjzl6cwe1jw149ze5o87d55ooh4wmnwwrk0n0q2ng7a2im57ovp7njszqnlao56

Basic DID document schema:
https://gateway-clay.ceramic.network/api/v0/documents/k3y52l7qbv1fryquw7e2dvh0da7ty5vdxu15ova82f73nbtif0fps502utn8o18g0

Make sure I have the DID document and DID right together:
https://w3c.github.io/did-core/#did-document-metadata

the did document is based on:

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"
    }
  }]
}

Wednesday, February 17, 2021

Working with FQL

 

https://www.youtube.com/watch?v=Q0m8baqBrk4

Presently I am trying to figure out how to use the Sigma operation, starting with this diagram.

Sunday, February 14, 2021

Notes for February 14th

 SkyDB is a decentralized database system built on Sia and IDX is a decentralized identity system built on Ceramic. By combining these two technologies, developers can easily build full-stack, data-rich applications that give users direct control and full ownership over their information — all without running servers or siloing information to a particular key pair, application, or database technology.

https://medium.com/ceramic/idx-and-skydb-joins-forces-for-a-future-of-web3-hackathon-83eff179a9a1 

Notes about promises:

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



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