Git Product home page Git Product logo

hyperledger / aries-framework-go Goto Github PK

View Code? Open in Web Editor NEW
241.0 20.0 158.0 14.68 MB

Hyperledger Aries Framework Go provides packages for building Agent / DIDComm services.

Home Page: https://wiki.hyperledger.org/display/ARIES/aries-framework-go

License: Apache License 2.0

Makefile 0.12% Go 95.47% Shell 0.26% Gherkin 1.83% Dockerfile 0.02% HTML 0.10% JavaScript 2.18% Vue 0.02%
didcomm decentralized-identifiers verifiable-credentials hyperledger-aries aries-framework go wasm

aries-framework-go's Introduction

Hyperledger AriesFramework Go

Aries Framework Go has been archived. The BBS code has been extracted to Aries BBS Go.

aries-framework-go's People

Contributors

abdulbois avatar adn-misa avatar aholovko avatar ale-linux avatar baha-ai avatar brownoxford avatar davidastark avatar dependabot[bot] avatar fqutishat avatar gnarula avatar happppyboy avatar heidihan0000 avatar jwagantall avatar kdimak avatar kukgini avatar llorllale avatar m00sey avatar mishasizov-sk avatar moopli avatar pfeairheller avatar phil-scoir avatar rolsonquadras avatar ryjones avatar sandrask avatar skynet2 avatar soluchok avatar sudeshrshetty avatar talwinder50 avatar troyronda avatar vkubiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aries-framework-go's Issues

Contents should be opaque to the did store and connection store

I just realized after we closed #22: the store implementation will be able to read all the DIDs, including the pairwise mappings. This could result in a breach of privacy in the case where the storage is an external service.

Ideally, no stores should know what DIDs I am interacting with. This could be uniformly enforced across all implementations by a change in API. For example, a K-V store:

// The layer that consumes this interface is responsible to 
// encrypting the data such that providers cannot interpret it.
// That layer remains secured in aries-framework-go.
type Store interface {
    Put(k string, v []byte)  error
    Get(k string) ([]byte, error)
}

See RFC 0050 - Wallets

@rolsonquadras @troyronda thoughts?

Peer DID: Backing Storage

The agent should provide a storage to save the Peer DID Docs.

The peer DID docs need to be associated with some type of backing storage that adds metadata and history (not raw documents). It should store a sequence of deltas and each delta is a JSON object.

Delta structure:


{ "change": <base64 encoding of a change fragment>, "by": [ 

{"key": <id of key>, "sig": <signature value>}

... ],
"when": <ISO8601 UTC timestamp with at least second precision>
}

Here, a change fragment is a sparse version of a DID doc that shows just the section being updated. Also, the agent should have the capability to construct a Peer DID Document from these deltas.

Create a new Package to support Chacha20/Poly1035 encryptions/authentication (in JWE format)

Standard JWE encryption/decryption operations does not support Chacha20 algorithm with Poly1035 authentication.

There are talks to update the JWE spec with this new addition. An IETF draft can be found here:
https://datatracker.ietf.org/doc/draft-amringer-jose-chacha/

The aim of this issue is to create a new package that will support this new JWE spec.

finally, for reference, Aries-rfc has an issue to update its spec using this new format:
hyperledger/aries-rfcs#133

A PHP example is found here:
https://github.com/gamringer/php-authcrypt

the task here is to follow the same format in Go

Part of #36

Add update logic to peer did store

As per the discussion in #47, the scope was reduced to implementing the backing storage without Conflict resolution. This issue is created to track the conflict resolution requirements.

Unit test - remove parallel flag

The parallel flag(maximum number of tests to run simultaneously) is set in unit-test to 1. This will result in running tests in sequence. If this flag is not present, it is set to the value of GOMAXPROCS. At this moment there is no need to set this to 1. By setting to default, we can decrease the test execution time.

Reference Agent Controller API

Need a REST API (Swagger) that allows the control of the reference agent.

Should be loosely based on hl/aries-cloudagent-python

peer.newDID method

Enhancement:

Implement a peer.NewDID constructor function that will create the peer DID.

Peer DIDs

Peer DIDs are non-anchored DIDs shared directly between N parties. The Peer DID specification reserves peer as the did method.

Peer DIDs are used to preserve privacy by making it harder for attackers to correlate your identity across interactions with different parties.

Agents need the ability to create and share Peer DIDs during the did-exchange protocol. They also need to synchronize state of these peer DIDs with each other:

  • state is managed as a sequence of signed patches
  • changes in state are communicated via the sync-state protocol

The Peer DIDs can be resolved in two ways:

  • Resolution can directly query the owning Agent with a "resolve" message
  • Resolution can query its local storage or cache

In all cases, the source against which the Peer DID will be resolved needs to maintain patches (as opposed to just keeping an "up-to-date" copy) because:

  • It's required to maintain proof of authority over the evolution of the DID document
  • Following from previous point: both the owning Agent and the Agent(s) to which it has been shared need to merge those patches and resolve any conflicts (there is a section on conflict resolution in the Peer DID spec).

(Interestingly, the peer DID spec defines several "levels of support" for peer DIDs)

References

Add project badges

Add following badges to the project

  • circle ci
  • release
  • licence
  • codecov
  • go report card

DID Resolution

Resolving DIDs is the act of fetching the DID document associated with the DID from a datasource identified by the DID's method (read the DID spec for details on the DID identifier format). If the DID has a fragment, then only the portion of the DID document identified by that fragment is returned.

The solution's architecture must support plugging in additional "drivers" for other DID methods.

Example: resolving a kid with value did:example:123456789abcdefghi#1 results in fetching the DID document associated to did:example:123456789abcdefghi and returning the element in the array of publicKey that has the id set to did:example:123456789abcdefghi#1. Note that the DID's context provides a hint as to where in the DID document to search for the element identified; in this case, kid implies that we are searching for a key, hence why in this case we would narrow the search to the publicKey array.

References

Build Reference Agent

New package: cmd/agent

  • template for building the reference agent
  • implements and exposes the controller API

How does an Agent identify the Sender of a DIDComm message?

This is to track issue hyperledger/aries-rfcs#104

It is currently unclear how to identify the Sender of a message with the current specs for DIDComm:

Right now the specs imply that the Agent identifies the Sender by their public key. This encroaches on DID territory, as DIDs are meant to be used as identifiers.

Doc/Connection Storage - Default Implementation

The Agent Framework should provide a default storage for Documents and Connections. The interfaces for these storages were defined in #22 and merged as part of #23.

The following requirement are considered for the default implementation.

  • No network call
  • Pure golang implementation
  • Backed by file system

The Golang LevelDB provider(based on lib https://github.com/syndtr/goleveldb) looks to be the best fit considering the above requirements.

Framework Init - base template with Outbound transport config

As part of the requirements in #74, the consumer of the lib should have the ability to initialize the framework and pass in different configuration options.

As part of this issue, build a template for framework initialization.

  • Add New(opts) function which takes in the options to configuration
  • Support outbound transport configuration

Doc Storage - Interface design

The Aries Framework should support pluggable storage(e.g file store, embedded db store, cloud store, etc.) for DID documents along with Connections(pairwise mapping).

Agent BDD Test Framework

Define test framework which will have basic steps for interaction with aries-agents.

This should include:

  • spinning up agents (wrapped in docker so as it runs in Circle CI)
  • integration tests for different DIDComm scenarios
    -- did exchange
  • reusable steps so that it can be reused in downstream demos/tests
  • document how to run BDD locally

Peer DID: Generate Identifier

Peer DID should have an identifier as defined in the Spec.

ABNF Syntax for Peer DID:

peer-did = "did:peer:" numalgo encalgo "-" numbasis 
numalgo = "1" 
encalgo = "1" 
numbasis = 64*HEXDIGCI 
HEXDIGCI = HEXDIG / "a" / "b" / "c" / "d" / "e" / "f"

The numbasis is generated from Genesis Version of the Peer DID. 

Agent Framework

  • Should be a framework package that glues together the chosen handlers, resolvers, stores, etc.
  • Protocols need to be implementable both inside the main Aries repo and outside by downstream repos. i.e., use decoupled patterns.
  • Should include a defaults Option that provides the (curated) default list of handlers, resolvers, stores, etc. to make a default instantiation of the framework easy.
  • Used by agent implementations (including reference agents).

did-exchange: exchange response needs to be signed

We should be signing the connection response. Specifically, the connection object needs to be replaced by connection-sig.

The reason for this is that the keys shared in the initial invitation to exchange will likely NOT be the keys present in the DID shared in the connection response:

  • The keys in the initial invitation to exchange will likely be ephemeral since they are sent in plaintext (by design) and because DIDComm uses keys as identifiers. Identifiers should not be revealed to outside parties.
  • The party has to prove that they own the DID that they are sharing and this is a mechanism to do so in a single message (as opposed to a later challenge-response protocol).

DID resolver - Validate input DID

Validate input DID conforms to the did rule of the Generic DID Syntax.

//////////////////////////////////////////////////
did = "did:" method-name ":" method-specific-id
method-name = 1*method-char
method-char = %x61-7A / DIGIT
method-specific-id = *idchar *( ":" *idchar )
idchar = ALPHA / DIGIT / "." / "-" / ""
did-url = did ( ";" param ) path-abempty [ "?" query ]
[ "#" fragment ]
param = param-name [ "=" param-value ]
param-name = 1param-char
param-value = *param-char
param-char = ALPHA / DIGIT / "." / "-" / "" / ":" /
pct-encoded

////////////////////////////////////////////////////

There is implementation in java

https://github.com/decentralized-identity/did-common-java/tree/master/src/main/java/did/parser

feat: add DIDComm HTTP transport

Add the capability for Aries Agents to safely communicate over HTTPS transport.

This implements the HTTP(S) Aries-RFC 25: https://github.com/hyperledger/aries-rfcs/tree/master/features/0025-didcomm-transports#https

Only HTTPS will be supported for secured communications.

And must support the DID Exchange Protocol 1.0 as per Aries-RFC 23: https://github.com/hyperledger/aries-rfcs/tree/master/features/0023-did-exchange

To complete transport security, future work (after this issue) will include the Pack/Unpack messaging capability as described in Aries-RFC 19 to encode/decode & authenticate senders and receivers: https://github.com/hyperledger/aries-rfcs/tree/master/features/0019-encryption-envelope

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.