Coder Social home page Coder Social logo

decentralized-identity / sidetree Goto Github PK

View Code? Open in Web Editor NEW
437.0 40.0 111.0 9.57 MB

Sidetree Specification and Reference Implementation

Home Page: https://identity.foundation/sidetree/spec

License: Apache License 2.0

TypeScript 0.24% JavaScript 0.05% HTML 99.71%
wg-sidetree did decentralized-identifiers

sidetree's Introduction

Sidetree

This repository contains both the blockchain-agnostic Sidetree specification. A reference implementation can be found here.

Specification

See the latest spec for the full Sidetree specification.

See the API spec for the full API specification to interact with a Sidetree node.

Specification Editing/Contributions:

  1. Clone the repo.
  2. Create a topic branch for your spec contributions.
  3. run npm install
  4. run npm run spec:edit
  5. If you see errors like UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open './www/spec/index.html'... create the missing directories and files and try again (they will be overwritten).
  6. Type npx serve . in the root directory and open http://localhost:5000/www/spec.
  7. Modify files in the spec/markdown/ directory to make changes, refresh to see changes.
  8. Do not commit build assets.
  9. Try and make blocks of text small so that changes can be suggested easily on specific lines.
  10. When you are happy with your changes, commit to your topic branch and open a Pull Request on GitHub and reviewers will be alerted to review for a potential merge.
  11. Make sure to tag people continuously to ensure your PR is reviewed in a timely manner.
  12. PRs that sit open without comments / reviews, will be closed at the editors discretion.

sidetree's People

Contributors

arvinda avatar atul9 avatar azuchi avatar clehner avatar csuwildcat avatar dependabot[bot] avatar gjgd avatar hawkmauk avatar isaacjchen avatar jmandel avatar kdenhartog avatar lionello avatar logangirvin avatar mudiali avatar nembal avatar nissimsan avatar or13 avatar preetirastogi avatar rado0x54 avatar sambarnes avatar srinathsetty avatar sylar217 avatar thehenrytsai avatar tiago154 avatar tmarkovski avatar tplooker avatar troyronda avatar viathefalcon avatar vihanda avatar xinaxu 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sidetree's Issues

Create sidetree-specific DID Document constraints

Because storage size could potentially limit the ability for folks to run full nodes at scale, we need to create a more strict set of sidetree-specific DID Document constraints that limit the size and use of props/values. Here are a few possible constraints we may want to enforce:

  1. Limit size/content of DID Fragment Identifiers
  2. Limit key size/content to a whitelist of recognized schemes
  3. Fail an op/batch for inclusion of non-standard props

Fix numerous Node crypto library deprecation warnings

There are numerous Node crypto library deprecation warnings when running the node:

(node:19808) [DEP0091] DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated.
(node:19808) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
(node:19808) [DEP0011] DeprecationWarning: crypto.Credentials is deprecated. Use tls.SecureContext instead.

Improve OperationProcessor tests

Improvements:

  1. Create a chain of updates to a DID to more closely resemble real world scenarios.
  2. Verify what content in the DidDocument, even if it's just DID and public keys.
  3. Modify/update DidDcoument and submit PR to did-common-typescript as needed.

DID Cache - Address PR comments

  1. Logic seems to be incorrect/incomplete to put signature verification in apply(). What happens if the operation to apply back-points to a unresolvable operation? Currently it doesn't look like there will be another chance/location where signature is verified again.

  2. getHash() - Can't hard-code hash function to use, has to depend on protocol version ie. Protocol.getProtocol(...), this means either the operationHash or blockNumber needs to be given in the WriteOperation.

  3. Decide if OperationInfo should contain operationHash or not.

  4. resolve() should take in a DID string not a versionId as suggested by this issue

  5. applyVersionChainUpdates() - Need to make sure timestamp of opHash is greater than timestamp of preVersionId, in case of an invalid operation pointing to an operation further down the chain from it.

  6. Design: seems to me that with the approach of evaluating operations at the time of lookup, all the possible links needs to be preserved, not just the one with lower timestamp. For instance signature verification can't be performed if there is a missing parent operation while there is a fork.

Implement/use a faster Base58 encoder

The current popular bs58 npm package performs horribly, it takes milliseconds to encode buffer under 1KB.

This resulted in severe perf implication in my load testing. Need to find a better library or implement one.

Fix test code coverage execution

Currently getting the following error when running code coverage:

Error: Cannot find module './json/didDocumentTemplate.json'

Enable runtime configuration of what the sidetree is persisting

There has been some discussion around extending the sidetree model to allow for storing more than DIDs. Example, storing attestations / claims.

The underlying requirements of batching transactions and persisting an anchor hash would be the same, but the processing of each item would be unique, eg for DIDs we'd need to validate the change, whereas for an attestation it'd probably be more of a straightforward save.

As far as implementation, this could be a run time config that swaps in the appropriate module based on what it is being instantiated for.

Update the trace API documentation

The /trace API exposed by the blockchain service layer has a different request/response semantics. Creating an issue to track this discrepancy. I'll go ahead and submit a PR.

Logger support

Requirements:

  1. Each log will use the following schema:
{
    "correlationId": "Given as an optional request header.",
    "requestId": "Auto-generated globally unique ID",
    "highResolutionTime": "Timestamp",
    "level": "Log level",
    "message": "Log message",
    "callStack": "Will only log callstack when log level is error.",
    "additionalInfo": "Additional info to be logged.",
}
  1. When logging, only level, message, and optional additionalInfo is needed, everything else is automatically populated for the developer. e.g:
log.error('Something bad happened', 'Additional info');

HINT: might need to use ths npm pacakge if koa doesn't have similar support for it.

  1. Ability to pipe logs to different/multiple locations (files, console, etc) depending on environment/configuration.

  2. Ability to format the output in format other than JSON strings.

Transaction Pagination on the Blockchain Sidetree

This is a question around pagination of the GET /v1.0/transactions endpoint.

https://github.com/decentralized-identity/sidetree-core/blob/master/docs/implementation.md#request-example

The sidetree protocol includes a afterBlockNumber field for paginating through GET transactions requests. This is specific to Bitcoin as the Ethereum Sidetree will be using other methods for specifying pagination location.

Could we rename that field to a more generic name? Fwiw, on Ethereum the anchor file hashes will all be saved in one smart contract and stored within an array. So the pagination value would point to an index within that array.

anchorFileJson contains unencoded buffer

{"batchFileHash":"EiBz-l5-pd0K9ZipVI_GMBaXmY1r9BCVNM5z18Sl7Jyx7Q","merkleRoot":{"type":"Buffer","data":[55,11,216,118,62,67,205,215,207,35,44,11,221,166,254,81,225,55,96,166,78,121,190,167,195,37,87,154,145,186,102,62]}}

merkleRoot should be string encoded as hex or base64.

Can we store any DID method in any sidetree?

The way the spec is currently written it seems like each DID method will be persisted in a specific sidetree.

However, since all DIDs follow the same spec, shouldn't any sidetree be able to store any DID. eg, a bitcoin DID like did:btc:hashxyz could be included in a batch sent to the Ethereum sidetree, which would in turn know how to process that DID and its deltas, since it'd be the same way of parsing it for did:eth:hashxyx.

Implement recover operations

Recovery mechanism will dictate how signature verification will be performed for delete and recovery operations.

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.