GithubHelp home page GithubHelp logo

arsh-sandhu / signify-ts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from weboftrust/signify-ts

0.0 0.0 0.0 4.03 MB

Typescript prototype of Simple KERI for Web Apps

License: Apache License 2.0

TypeScript 99.71% Mermaid 0.29%

signify-ts's Introduction

TypeScript implementation of Signify

Project Name: signify-ts

TypeScript Tests codecov Documentation

Signify - KERI Signing at the Edge

Of the five functions in a KERI agent,

  1. Key generation
  2. Encrypted key storage
  3. Event generation
  4. Event signing
  5. Event Validation

Signify-TS splits off two, key generation and event signing into a TypeScript library to provide "signing at the edge". It accomplishes this by using libsodium to generate ed25519 key pairs for signing and x25519 key pairs for encrypting the private keys, next public keys and salts used to generate the private keys. The encrypted private key and salts are then stored on a remote cloud agent that never has access to the decryption keys. New key pair sets (current and next) will be generated for inception and rotation events with only the public keys and blake3 hash of the next keys made available to the agent.

The communication protocol between a Signify client and KERI agent will encode all cryptographic primitives as CESR base64 encoded strings for the initial implementation. Support for binary CESR can be added in the future.

Environment Setup

The code is built using Typescript and running code locally requires a Mac or Linux OS.

  • Install Node.js

  • Install dependencies:

    npm install

Typescript source files needs to be transpiled before running scripts or integration tests

  • Build:
    npm run build

Unit testing

To run unit tests

npm test

Integration testing

The integration tests depends on a local instance of KERIA, vLEI-Server and Witness Demo. These are specified in the Docker Compose file. To start the dependencies, use docker compose:

docker compose up deps

If successful, it should print someting like this:

$ docker compose up deps
[+] Running 5/4
 ✔ Network signify-ts_default           Created                                           0.0s
 ✔ Container signify-ts-vlei-server-1   Created                                           0.1s
 ✔ Container signify-ts-keria-1         Created                                           0.1s
 ✔ Container signify-ts-witness-demo-1  Created                                           0.1s
 ✔ Container signify-ts-deps-1          Created                                           0.0s
Attaching to signify-ts-deps-1
signify-ts-deps-1  | Dependencies running
signify-ts-deps-1 exited with code 0

Important! The integration tests runs on the build output in dist/ directory. Make sure to run build before running the integration tests.

npm run build

Use the npm script "test:integration" to run all integration tests in sequence:

npm run test:integration

Or, use execute jest directly to run a specific integration test, for example:

npx jest examples/integration-scripts/credentials.test.ts

It is also possible to run the tests using local instances of vLEI, Keria, and witness network. Set the environment variable TEST_ENVIRONMENT to local, e.g:

TEST_ENVIRONMENT=local npx jest examples/integration-scripts/credentials.test.ts

This changes the discovery urls to use localhost instead of the hostnames inside the docker network.

Old integration scripts

To run any of the old integration scripts that has not yet been converted to an integration test. Use ts-node-esm

npx ts-node-esm examples/integration-scripts/challenge.ts

Diagrams

Account Creation Workflow

Account Creation

Account Creation Webpage

signify-ts's People

Contributors

2byrds avatar alexandrei98 avatar arsh-sandhu avatar daidoji avatar github-actions[bot] avatar kentbull avatar lenkan avatar m00sey avatar nkongsuwan avatar pfeairheller avatar psteniusubi avatar rodolfomiranda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.