Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of v1.0 of Hedera DID Method (HIP-27) #164

Open
wants to merge 168 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
8fab531
- HcsDid uses new DID string format;
linasi Jan 26, 2022
4932013
fill in missing didRootKey information
Jan 27, 2022
a92dd73
added package lock
Jan 27, 2022
1bf7f9f
remove public_key from did document
Jan 27, 2022
593d0ce
topic id can not be optional
Jan 27, 2022
c3338e4
addressbook and appnet no loger required
Jan 27, 2022
895d10e
removed unwanted DID Method specificaitons prams and DidSyntax
Jan 27, 2022
d39a504
removed hcs did creation without topic id
Jan 27, 2022
54e4808
removed code idStringToPublicKey buggy code
Jan 27, 2022
ea35da6
fix hcs did test and added hedera network constant
Jan 27, 2022
0917aa8
fix did creation and message creation tests
Jan 27, 2022
5ceac76
fix more tests
Jan 27, 2022
201a4a9
fix identity network and related tests
Jan 27, 2022
bf34218
Remove left references to the AddressBook, make sure package builds, …
linasi Jan 27, 2022
713d881
Add basic prettier configuration and format the source
linasi Jan 27, 2022
cb8aed5
Merge pull request #1 from Meeco/feature/setup-prettier
vijayshiyani Jan 28, 2022
6b66a70
added minimum node version
Jan 28, 2022
ad3c8ca
adding demo page to test did and did document creation
Jan 28, 2022
c34bb36
added property assertion method to did-doc
Jan 28, 2022
3f8f5de
Merge pull request #2 from Meeco/feature/fix-node-version
linasi Jan 28, 2022
1748dd2
Merge pull request #3 from Meeco/task/demo-page
linasi Jan 28, 2022
590a8da
Merge pull request #4 from Meeco/feature/add-assertion-method-to-did-doc
linasi Jan 28, 2022
fe6e1e9
added multibase support for public key
Jan 31, 2022
1a13f94
updated did document to have publicKeyMultibase prop
Jan 31, 2022
c52ff34
test fixies
Jan 31, 2022
60cb638
Merge pull request #5 from Meeco/featuer/add-multibase-encoding
linasi Jan 31, 2022
0420c9b
Did event models
linasi Jan 31, 2022
fc4b94c
Trying to integrate events
linasi Jan 31, 2022
1c02712
added support for Multicodec with Ed25519pub codec
Feb 1, 2022
0116729
added a test
Feb 1, 2022
4600ce7
Merge pull request #7 from Meeco/feature/add-multi-codec-Ed25519
linasi Feb 1, 2022
6a1718f
Merge feature/upgrade-did in
linasi Feb 1, 2022
149f00e
Demo flows; No public key is required to build HcsDid; Introduce HcsD…
linasi Feb 1, 2022
6a232cd
apply events and resolve did
Feb 2, 2022
1691e56
added multiple services event
Feb 2, 2022
edee336
added dragonglass explorer link
Feb 2, 2022
4ed8bbf
Reading does not need private keys
linasi Feb 2, 2022
3ef7562
MEE-3130 / 32 remove all code related to VC & appnet
Feb 3, 2022
cbb0105
Merge pull request #8 from Meeco/task/cleanup
linasi Feb 3, 2022
116e908
New DID class; #register implementation
linasi Feb 3, 2022
3980fa4
Implement first version of resolve method
linasi Feb 3, 2022
378d377
removed hcs identity network
Feb 4, 2022
481d628
rename HscDidv2 to HscDid removed hcs-did-root-key classes and test fix
Feb 4, 2022
df53fb4
fix the demo with new hsc did api
Feb 4, 2022
89b0e0f
added add service method to DID
Feb 4, 2022
e4895e6
added add verification method event message
Feb 4, 2022
b1c5562
added add verification relationship event
Feb 4, 2022
3e546a0
Merge pull request #9 from Meeco/feature/new-did-api
linasi Feb 4, 2022
e193ec9
Merge pull request #6 from Meeco/feature/events
linasi Feb 4, 2022
ec8e47d
Move some code around; Fix a few tests; Disable no longer relevant te…
linasi Feb 4, 2022
c4f7d6c
Fix submitTransaction to return Promise other function can await for
linasi Feb 4, 2022
18d7720
Cleanup of unused code; Change HcsDidResolver API
linasi Feb 4, 2022
fac644d
Resolve other item CREATE events
linasi Feb 4, 2022
3f7c6d9
updating, revoking and deleting event message write to hedera
Feb 7, 2022
6ccea6d
renaming and fixing tests
Feb 7, 2022
51d4f71
changing it to jest test from mocha
Feb 7, 2022
b381e91
Merge pull request #10 from Meeco/feature/resolve-add-events
linasi Feb 7, 2022
fc8872a
Fix jest configuration
linasi Feb 7, 2022
daf09b9
fix demo
Feb 7, 2022
1bd8df5
Drop MessageMode; Code style fixes; Renamings
linasi Feb 7, 2022
58c1f53
Service or Key ID is set by user. Fixing some tests. Adding ID valida…
linasi Feb 7, 2022
5621a88
Update and revoke logic for Services, VerificationMethods and Verific…
linasi Feb 7, 2022
ba87293
Bug fixes; Success scenario tests for DidDocument
linasi Feb 7, 2022
63d107b
Task/multiple event classes (#11)
vijayshiyani Feb 8, 2022
c10e726
Implementation of did delete event
linasi Feb 8, 2022
5f5aee9
Cleanup; fixes; renamings
linasi Feb 8, 2022
208d511
Event tests; bug fixes
linasi Feb 8, 2022
f98c20c
Better handling of invalid/non-did related events that might to appea…
linasi Feb 8, 2022
dea71cf
git actions to run test on develop branch and main branch and for rel…
Feb 8, 2022
87f5d35
fix npm command
Feb 8, 2022
0df675f
updated read me and added demo files for add update and revoke events
Feb 9, 2022
df2d606
added DELETE DID to READ ME
Feb 9, 2022
19cfc14
fix some typos
Feb 9, 2022
1e11f8d
jest config to setup env var
Feb 9, 2022
dd4ed24
updated read me on how to run integration test
Feb 9, 2022
a82e927
added signature varificaiton back to topic listner (#12)
vijayshiyani Feb 9, 2022
8c1653f
Logic to handle UPDATE DID_OWNER event
linasi Feb 9, 2022
798dd06
HcsDid changeOwner API method
linasi Feb 9, 2022
8fe4bd5
Add some tests for HcsDidMessage
linasi Feb 9, 2022
38bab75
added integration test for revoke and re-add service with same id
Feb 10, 2022
3294662
style: Fix some typos(MEE-3046).
Feb 10, 2022
e4fc373
Merge pull request #13 from Meeco/MEE-3046_Small_fixes
vijayshiyani Feb 10, 2022
26d9e70
minor fixies and added tests
Feb 10, 2022
e534b68
fix has owner bug
Feb 10, 2022
22bd57b
added few more tests
Feb 10, 2022
e3ff20b
Set submitKey to topic; Implemented change topic ownership logic; Mor…
linasi Feb 10, 2022
771a39b
Fetch receipt after the transaction to make sure message was successf…
linasi Feb 10, 2022
52b0508
Move some event validation logic to Event classes; Add tests;
linasi Feb 10, 2022
280da4d
Change the way errors are tested. Don't do validation in catch{} bloc…
linasi Feb 10, 2022
144c915
Make all imports target specific files
linasi Feb 10, 2022
db5c289
Merge pull request #14 from Meeco/feature/change-did-owner
vijayshiyani Feb 10, 2022
3a5cc09
updated demo files and added change did owner step (#15)
vijayshiyani Feb 11, 2022
93937f9
Task/more tests (#17)
vijayshiyani Feb 11, 2022
98b991b
Task/update demo files (#19)
vijayshiyani Feb 11, 2022
5392566
Ignore event if operation or target type was not recognised without t…
linasi Feb 11, 2022
8c391cd
Get rid of unnecessary hierarcy structure
linasi Feb 11, 2022
753e69b
Move a few demo flow variables to config.js file
linasi Feb 11, 2022
89b93c0
#changeOwner method no longer requires did of the current did owner
linasi Feb 11, 2022
4a3819c
Refactoring
linasi Feb 11, 2022
2950389
Upgrade @hashgraph/sdk dependency
javereec Feb 13, 2022
dd41723
Merge pull request #20 from Meeco/feature/cleanup
vijayshiyani Feb 13, 2022
2cf1eeb
Update did resolve result to be more inline with https://w3c-ccg.gith…
linasi Feb 14, 2022
b192a60
added change log and bump up package version
Feb 15, 2022
331c867
added did resolver package and resolver for universal resolver driver
Feb 15, 2022
a740bc0
added resolver to index
Feb 15, 2022
93284c3
Merge pull request #23 from Meeco/task/changelog-version-bump
vijayshiyani Feb 15, 2022
c09669b
Introduce DidError; Resolver makes better decisions on error types; C…
linasi Feb 15, 2022
d3a77be
Handle possible case when created and updated timestamps are not present
linasi Feb 15, 2022
8d5fecb
DID resolver client param is optional. If not passed, client is chose…
linasi Feb 15, 2022
9f4ffa4
Merge pull request #21 from Meeco/feature/did-resolve-map-to-spec
vijayshiyani Feb 15, 2022
0eb10c4
style: Fix some typos(MEE-3046).
Feb 16, 2022
65d9d02
Merge pull request #24 from Meeco/Fix_some_typos_
vijayshiyani Feb 17, 2022
b3bc43b
style: Change 'Private Topic' to 'Restricted Topic' in the readme fil…
Feb 18, 2022
e2b6dff
refactor: Change conf.js to .env file for demo. (MEE-3225).
Feb 18, 2022
67f71a7
refactor: Change conf.js to .env in readme file. (MEE-3225).
Feb 18, 2022
aa403c2
refactor: Fix some typos. (MEE-3225).
Feb 21, 2022
67d04a2
refactor: Remove dotenv package and rename .env file to .env.json. (M…
Feb 21, 2022
47a2468
refactor: Rename .env file to .env.json. (MEE-3225).
Feb 21, 2022
bfe0936
refactor: Rename .env file to .env.json in README. (MEE-3225).
Feb 21, 2022
c81ccc3
refactor: Use `ledgerId` instead of deprecated 'networkName'. (MEE-32…
Feb 21, 2022
c6a3488
Add option to pass onMessageConfirmed callback to HcsDid constructor
linasi Feb 21, 2022
9f0569a
read did messages from timestamp
Feb 22, 2022
12947d5
Merge pull request #26 from Meeco/feature/message-submit-callback
vijayshiyani Feb 22, 2022
9778b6b
Merge branch 'develop' into MEE-3225_Small_fixes
vijayshiyani Feb 22, 2022
26e74b9
Merge pull request #25 from Meeco/MEE-3225_Small_fixes
vijayshiyani Feb 22, 2022
f635e73
minor fixies
Feb 22, 2022
8b6147d
added async to read messages method
Feb 22, 2022
fdbf10a
HcsDidEventMessageResolver always gives back envelopes; Remove HcsDid…
linasi Feb 22, 2022
93394be
Missing import fix
linasi Feb 22, 2022
63a0351
Use TopicMessageQuery completion handler
linasi Feb 22, 2022
a8c4b62
Use existing helper function instead of building manual values map
linasi Feb 22, 2022
4eef575
Merge pull request #27 from Meeco/feature/consistent-result-from-mess…
vijayshiyani Feb 23, 2022
b0e64cb
updated package-lock file
Feb 24, 2022
b14b933
style: Fix some typos and add some small fixes. (MEE-3225).
Mar 8, 2022
e195025
Merge pull request #28 from Meeco/Small_fixes
emurova Mar 8, 2022
61634ba
docs: Add a few diagrams.
Mar 9, 2022
1e29753
Merge pull request #29 from Meeco/docs/Add_a_few_diagrams
linasi Mar 29, 2022
f0ac8bb
Update sequence diagrams
linasi Apr 7, 2022
9db85b1
Merge pull request #30 from Meeco/fix/update-diagrams
vijayshiyani Apr 7, 2022
883c4e9
Merge pull request #31 from Meeco/develop
linasi May 27, 2022
445ed75
fix hashgraph SDK version to last stable version 2.15.0. Version 2.16…
Jun 24, 2022
803be12
updated hashgraph sdk to only have patch release
Jun 24, 2022
e851980
Squashed commit of the following:
Jun 24, 2022
658b6bf
update hashgraph SDK to latest, as previous issue was with mirror nod…
Jun 24, 2022
52d0c66
Merge branch 'main' into develop
vijayshiyani Jun 24, 2022
cd79c20
Merge pull request #32 from Meeco/develop
vijayshiyani Jun 24, 2022
c02279f
updated package lock file
Jun 24, 2022
cf3174f
Merge pull request #33 from Meeco/develop
vijayshiyani Jun 24, 2022
c98beb5
Don't apply key codec before encoding with multibase
Feb 23, 2023
9f5ae54
Upgrade @hashgraph/sdk. Fix tests
Feb 27, 2023
c6ca9e1
fixing integration test and small
Feb 28, 2023
08a350f
Merge pull request #34 from Meeco/feature/no-public-key-codec-applied
derek-meeco Jul 3, 2023
36800b8
Upgrade @hashgraph/sdk to 2.28.0; publicKeyMultibase is replaced with…
Jul 17, 2023
ae1e94d
Use default mirror nodes that sdk provides
Jul 17, 2023
0f31056
Update tests with better logic to read mirror nodes
Jul 17, 2023
deedaa8
Add delayUntil for test checking already registered DID flow
Jul 17, 2023
34bd2f3
Merge pull request #36 from Meeco/feature/sdk-upgrade
derek-meeco Jul 17, 2023
fdf6247
Merge pull request #1 from Meeco/main
nextalias Jul 19, 2023
54325c1
Add support for resolving DID documents from IPFS
zbarbuto Jun 30, 2023
e672138
Switch returns to continues
zbarbuto Jul 20, 2023
9285f50
Merge pull request #35 from NextFaze/feature/ipfs-did-resolution
linasi Jul 20, 2023
e8c6312
Update few integration tests
Jul 20, 2023
df17ba6
Fix some issues resolving IPFS DIDs
zbarbuto Aug 17, 2023
fe6027c
Merge pull request #37 from NextFaze/fix/ipfs-resolve-bugs
linasi Aug 18, 2023
4464d9a
Update issue templates
derek-meeco Jan 24, 2024
7bf279e
Update README
derek-meeco May 17, 2024
92612f8
Bump @hashgraph/sdk to 2.32.0
derek-meeco Jun 12, 2024
a6c467f
Merge branch 'main' into v1_0-signoff
derek-meeco Jul 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: [self-hosted, Linux, medium, ephemeral]
strategy:
matrix:
node: [ '14', '16' ]
node: [ '16' ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/test.unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches:
- develop
push:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '16' ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: install dependencies
run: npm ci
- name: build
run: npm run build --if-present
- name: run unit test
run: npm run test:unit

8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Test

on:
pull_request:
branches: [ main ]
branches:
- main
push:
branches: [ main ]
branches:
- main

defaults:
run:
Expand All @@ -18,7 +20,7 @@ jobs:
runs-on: [self-hosted, Linux, medium, ephemeral]
strategy:
matrix:
node: [ '14', '16' ]
node: [ '16' ]
steps:
- name: Checkout Code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/
/dist/
.idea
/demo/.env.json
.idea
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist/
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": false,
"printWidth": 120,
"tabWidth": 4,
"trailingComma": "es5"
}
126 changes: 126 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# v1.0.0

## Removed

* Generation of decentralized identifiers and creation of DID documents based on old [Hedera DID Method][did-method-spec]
* Creation of `identity networks` within `appnets`.
* Address book - a file on `Hedera File Service` that provides information about HCS topics and `appnet servers`.
* Creation and initialization of the `VC topic` - an HCS topic playing a role of verifiable credentials' registry.
* Creation (publishing), update, deletion and resolution of DID documents in `appnet identity networks`.
* Issuance, revocation and status verification of `Verifiable Credentials`.

## Added

* Generation of decentralized identifiers and creation of DID documents based on new [Hedera DID Method][did-method-spec]
Creation and initialization of the DID registration on `HCS Private Topic`
* Create, update, revoke, deletion, and resolution of DID documents based on [DID Document Core Properties][did-core-prop] `event/log messages` recorded on `HCS Topic`
* Transferring ownership of DID identifier and DID Document to another party.
* Publishing **DID Events Messages** to resolve and validate **DID Document**

[did-core-prop]: https://w3c.github.io/did-core/#core-properties
[did-method-spec]: https://github.com/hashgraph/did-method

### DID API's

* Generate & Register

```js
...
const registeredDid = await did.register();
```

* Resolve

```js
...
const didDoc = await registeredDid.resolve();
```

* Change Ownership

```js
...
await registeredDid.changeOwner({
controller: newOwnerIdentifier,
newPrivateKey: newOwnerDidPrivateKey,
});
```

* Create, Update and Revoke [DID Document Core Properties][did-core-prop]
* Service

```js
...
await registeredDid.addService({
id: serviceIdentifier + "#service-1",
type: "LinkedDomains",
serviceEndpoint: "https://example.com/vcs",
});
...
await registeredDid.updateService({
id: serviceIdentifier + "#service-1",
type: "LinkedDomains",
serviceEndpoint: "https://test.com/did",
});
...
await registeredDid.revokeService({
id: serviceIdentifier + "#service-1",
});
```

* Verification Method

```js
...
await registeredDid.addVerificationMethod({
id: verificationMethodIdentifier + "#key-1",
type: "Ed25519VerificationKey2018",
controller: registeredDid.getIdentifier(),
publicKey: verificationMethodPublicKey,
});
...
await registeredDid.updateVerificationMethod({
id: verificationMethodIdentifier + "#key-1",
type: "Ed25519VerificationKey2018",
controller: registeredDid.getIdentifier(),
publicKey: updatedVerificationMethodPublicKey,
});
...
await registeredDid.revokeVerificationMethod({
id: verificationMethodIdentifier + "#key-1",
});
```

* Verification Relationship

```js
...
await registeredDid.addVerificationRelationship({
id: verificationRelationshipIdentifier + "#key-1",
relationshipType: verificationRelationshipType,
type: "Ed25519VerificationKey2018",
controller: registeredDid.getIdentifier(),
publicKey: verificationRelationshipPublicKey,
});
...
await registeredDid.updateVerificationRelationship({
id: verificationRelationshipIdentifier + "#key-1",
relationshipType: verificationRelationshipType,
type: "Ed25519VerificationKey2018",
controller: registeredDid.getIdentifier(),
publicKey: updatedVerificationRelationshipPublicKey,
});
...
await registeredDid.revokeVerificationRelationship({
id: verificationRelationshipIdentifier + "#key-1",
relationshipType: verificationRelationshipType,
});
```
Loading