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

Reduce WASM build size #427

Merged
merged 2 commits into from
Oct 14, 2021
Merged

Reduce WASM build size #427

merged 2 commits into from
Oct 14, 2021

Conversation

Thoralf-M
Copy link
Member

@Thoralf-M Thoralf-M commented Oct 5, 2021

Description of change

With these changes the wasm file size should be reduced from 4,26 MB to 2,59 MB

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

Executed an example

@cycraig
Copy link
Contributor

cycraig commented Oct 10, 2021

Thanks for the PR!

Short version

  • we lose debug symbols in stack traces but the reduction in size is worth it,
  • there is a slight reduction in runtime performance but it's still more than "fast enough" in my opinion,
  • enabling full link-time-optimisation would help slightly,
  • there may be issues with wasm-opt binaries not being pre-built for M1 Mac,

Overall looks good to me! Would merge as-is.

Long version

I wonder if there was any reason for wasm-opt = false in the first place? It's been set from the inception of the wasm bindings:

499db7c#diff-c3457202cbb77c82da5b8f2b6dcdc50b85bd7e343832927909ff1f0049b4f1bdR15

# TODO: Discover this:
[package.metadata.wasm-pack.profile.release]
wasm-opt = false

Perhaps there was/is an issue with wasm-opt lacking binaries for certain targets/architectures? Most likely Macintosh (M1 chip or not), similar to wasm-pack in #415. The npm package is built and published using Ubuntu in GitHub Actions, so releases are not a problem, but for local development we could introduce build-dev/run-dev steps to avoid any issues with wasm-opt and debug symbols.

Size Comparison

Out of interest, I tested the effects of different compilation options on both size and runtime performance. I included different combinations of lto options since it was recommended at https://rustwasm.github.io/book/reference/code-size.html

The options tested are:

  • wasm-opt ∈ [false, true],
  • opt-level ∈ [3 (default), 's', 'z'],
  • lto ∈ [false, "thin", true].

The compressed and unpacked sizes are gathered from npm pack. Build time is measured from a clean wasm target directory with cargo clean && rm -r node && rm -r web && (Measure-Command { npm run build | Out-Default }).ToString().

wasm-opt opt-level lto wasm size (MB) compressed size (MB) unpacked size (MB) build time (s)
1 (current) false 3 false 4.46 2.7 9.3 56
2 true 3 false 3.57 2.3 7.5 93
3 true 3 "thin" 3.57 2.3 7.5 90
4 true 3 true 3.57 2.3 7.5 91
5 (this PR) true s false 2.71 1.9 5.8 62
6 true s "thin" 2.71 1.9 5.8 65
7 true s true 2.72 1.9 5.8 64
8 true z false 2.61 1.8 5.6 61
9 true z "thin" 2.61 1.8 5.6 62
10 true z true *2.60 1.8 5.6 67

Highlights:

  • 'z' reduces the size by another ~100KB compared to 's'
  • lto has a negligible effect on wasm size, ~10KB at most
  • wasm-opt adds ~35s to the build time, but changing the opt-level offsets this (compilation time was measured in case we have any significant increase in CI time, it doesn't really matter how long release builds take compared to package size and speed)

Performance Comparison

Unfortunately we don't have proper benchmarks for the wasm bindings: there are issues with running criterion.rs for wasm and the runtime of examples varies wildly due to network calls and remote proof-of-work. So I settled on the following micro-benchmark to avoid wasting too much time:

benchmark.js:

const LIMIT = 10000;

// Time generating a new Ed25519 keypair and document, signing and verifying it
console.time('generate, sign, verify document');
for (let i = 0; i < LIMIT; i++) {
    let key = new KeyPair(KeyType.Ed25519);
    let doc = new Document(key, "main");
    doc.sign(key);
    console.assert(doc.verify())
}
console.timeEnd('generate, sign, verify document');

npm run build && node benchmark/benchmark.js:

wasm-opt opt-level lto mean time (ms) total time (s)
1 (current) false 3 false 0.862 8.631
2 true 3 false 0.841 8.420
3 true 3 "thin" 0.841 8.417
4 true 3 true 0.857 8.580
5 (this PR) true s false 1.041 10.415
6 true s "thin" 0.989 9.898
7 true s true 0.988 9.882
8 true z false 1.077 10.770
9 true z "thin" 1.087 10.872
10 true z true 1.065 10.658

Highlights:

  • 's' increases runtime by ~20% but overall still ~1ms so it's fine,
  • lto = true very slightly reduces runtime for 's' and 'z'

Debug Symbols

Lastly, it's important to note that the size reduction from wasm-opt is in large part due to stripping out the debug info symbols. This removes Rust function names from error stack traces, but the Javascript wrapper entry-point is still output so it's probably good enough. The "-g" flag can be passed to wasm-opt to preserve debug symbols but then there is almost no reduction in package size.

Example Stack Trace

Generate an error by running

let key = new KeyPair(KeyType.Ed25519);
let doc = new Document(key, "Invalid;Network{}Name!");
  1. Current wasm-opt = false:
InvalidNetworkName: Invalid Network Name
    at module.exports.__wbg_new_342a24ca698edd87 (C:\Work\iota\tmp\identity.rs\bindings\wasm\node\identity_wasm.js:3981:15)
    at js_sys::Error::new::ha2f916f5a59a175d (<anonymous>:wasm-function[5350]:0x31b609)
    at identity_wasm::error::wasm_error::h62760bc7e7cb9ef0 (<anonymous>:wasm-function[1637]:0x27a46c)
    at identity_wasm::did::wasm_document::WasmDocument::new::h513b33a29593d84d (<anonymous>:wasm-function[677]:0x1d5461)
    at document_new (<anonymous>:wasm-function[2851]:0x2e4107)
    at new Document (C:\Work\iota\tmp\identity.rs\bindings\wasm\node\identity_wasm.js:1373:24)
    at Object.<anonymous> (C:\Work\iota\tmp\identity.rs\bindings\wasm\benchmark\benchmark.js:53:15)
  1. This PR wasm-opt = true, function names are stripped:
InvalidNetworkName: Invalid Network Name
    at module.exports.__wbg_new_342a24ca698edd87 (C:\Work\iota\tmp\identity.rs\bindings\wasm\node\identity_wasm.js:3981:15)
    at <anonymous>:wasm-function[4319]:0x2b617b
    at <anonymous>:wasm-function[1566]:0x237218
    at <anonymous>:wasm-function[665]:0x1a79c3
    at document_new (<anonymous>:wasm-function[2615]:0x28d9a0)
    at new Document (C:\Work\iota\tmp\identity.rs\bindings\wasm\node\identity_wasm.js:1373:24)
    at Object.<anonymous> (C:\Work\iota\tmp\identity.rs\bindings\wasm\benchmark\benchmark.js:53:15)
  1. Preserve debug symbols with wasm-opt = ["-g"]:
InvalidNetworkName: Invalid Network Name
    at module.exports.__wbg_new_342a24ca698edd87 (C:\Work\iota\tmp\identity.rs\bindings\wasm\node\identity_wasm.js:3966:15)
    at js_sys::Error::new::h105995e043d6d4ab (<anonymous>:wasm-function[8784]:0x23648e)
    at identity_wasm::error::<impl core::convert::From<identity_wasm::error::WasmError> for js_sys::Error>::from::h0ec0dcb249a1399f (<anonymous>:wasm-function[4613]:0x2052e0)
    at identity_wasm::error::wasm_error::h679364300396755a (<anonymous>:wasm-function[3832]:0x1ee266)
    at identity_wasm::did::wasm_document::WasmDocument::new::ha412fd768f0c1591 (<anonymous>:wasm-function[994]:0x13497f)
    at document_new (<anonymous>:wasm-function[1504]:0x16a021)
    at new Document (C:\Work\iota\tmp\identity.rs\bindings\wasm\node\identity_wasm.js:1373:24)
    at Object.<anonymous> (C:\Work\iota\tmp\identity.rs\bindings\wasm\benchmark\benchmark.js:53:15)

Unfortunately using "-g" to retain/add debug symbols barely reduces the size at all:

wasm-opt opt-level wasm size (MB) package size (MB) unpacked size (MB)
1 (current) false 3 4.46 2.7 9.3
5 (this PR) true s 2.71 1.9 5.8
8 true z 2.61 1.8 5.6
11 ["-g"] s 3.93 2.3 8.6
12 ["-g"] z 4.21 2.4 8.8

@Thoralf-M
Copy link
Member Author

Thanks for this extensive overview of the different optimization levels!

Add `build-dev` task for Wasm for debugging.
@cycraig cycraig requested a review from eike-hass October 14, 2021 07:08
@cycraig
Copy link
Contributor

cycraig commented Oct 14, 2021

Enabled lto and added a build-dev task to bypass wasm-opt and retain symbols for debugging locally following internal discussions.

@eike-hass Please sanity-check the build-dev task.

@eike-hass
Copy link
Collaborator

Enabled lto and added a build-dev task to bypass wasm-opt and retain symbols for debugging locally following internal discussions.

@eike-hass Please sanity-check the build-dev task.

Tested on WSL 2 / Ubuntu 20, LGTM

@cycraig cycraig merged commit 196ddfd into dev Oct 14, 2021
@cycraig cycraig deleted the feat/wasm-build-size branch October 14, 2021 11:21
PhilippGackstatter pushed a commit that referenced this pull request Oct 15, 2021
* reduce wasm build size

* Enable lto for Wasm release

Add `build-dev` task for Wasm for debugging.

Co-authored-by: Craig Bester <craig.bester@iota.org>
PhilippGackstatter added a commit that referenced this pull request Oct 25, 2021
* Partial impl to use did as storage identifier

* Move `CreateIdentity` into a separate type

Update Account API to return IdentityState from find_identity and create_identity (#414)

* Update Account::create_identity() to return IdentityState.

* Update Account::find_identity() to return IdentityState.

Update `IdentityUpdater` to only use account ref

Remove resolve, find and list

Replace `IdentityId` with `IotaDID` in account

Use `IotaDID` over `IdentityId` in stronghold

More replacement of id with did

Remove index from account

Fix stream impl

Fix stronghold impl, migrate `MemStore`

Re-add `resolve_identity` so tests can run

Fix Wasm network calls, pin reqwest to 0.11.4 (#439)

Rename `Command` -> `Update`

Rearrange `process_update`

* Fix clippy lints in memstore

* Let `RemoteKey` take a `dyn Storage`

* Implement `AccountConfig`

* Impl create_identity and load_identity in builder

* Rename JSON serialization field name to match spec. (#412)

* Rename JSON serialization field name to match spec.

* Rename notSupported -> representationNotSupported

* Reduce WASM build size (#427)

* reduce wasm build size

* Enable lto for Wasm release

Add `build-dev` task for Wasm for debugging.

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Chore/combine examples (#420)

* Merged Stronghold with basic examples in account

* Updated explorer to identity resolver

* Added explorer URL after basic example

* Renamed examples

* Completed manipulate did example

* Fixed suggestions, removed replaced examples.

* Improved example readme

* Consistently use Stronghold and Resolver URL

* Fix examples

* Merged config example with private tangle

* low-level-api private-network example runs

* cargo fmt

* cargo fmt with nightly

* Impl suggestions

* Refactor config once more

* Update examples to use single-id account

* Don't pass did into `load_snapshot`

* Fix clippy lints

* Partially update `update` tests

* Fix update tests

* Ensure did exists in storage in `load`

* Remote `State` in account

* Rename `load` -> `load_identity`

* Remove `Identity{Id,Index,Key,Name,Tag}`

* Let `update_identity` take `&mut self`

* Document new and existing types

* Update top-level README example

* Fix visibility on `CreateIdentity`

* Add try_from implementation for ed25519 keypair

* Combine account tests

* Rename updates > commands for better reviewability

* Also rename in mod.rs

* Impl `AccountBuilder` without pub async fns

* Update README example with latest builder change

* Change visibility of setup, config, constructors

* Revert to the old `create_did` example

* Save to disk when creating identity, fix doc fmt

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Use `authority` instead of `tag` in stronghold

* Rename `Config` -> `AccountConfig`

* Prevent two accounts from managing the same did

* Impl `IdentityBuilder`

* Only impl `IdentityCreate` under `#[cfg(test)]`

* Use `IdentityBuilder` in examples

* Remove unused `name` field

* Run workflow for `epic/*` branches

* Relase the lease in account tests

* Also run format, clippy and coverage workflows

* Revert "Use `IdentityBuilder` in examples"

This reverts commit 3d1b716.

* Revert "Only impl `IdentityCreate` under `#[cfg(test)]`"

This reverts commit 08ada09.

* Revert "Impl `IdentityBuilder`"

This reverts commit 1a5d645.

* Rename `IdentityCreate` -> `IdentitySetup`

* Add multi-identity example

* Simplify README example

* Rename `identity_setup` module

* Implement the `IdentityLease` newtype

* Rename `IdentityLease` -> `DIDLease`

* Update `resolve_identity` docstring

Co-authored-by: Matt Renaud <matt@m-renaud.com>
Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com>
Co-authored-by: Craig Bester <craig.bester@iota.org>
Co-authored-by: Jelle Femmo Millenaar <jelle.millenaar@iota.org>
olivereanderson pushed a commit that referenced this pull request Oct 25, 2021
* reduce wasm build size

* Enable lto for Wasm release

Add `build-dev` task for Wasm for debugging.

Co-authored-by: Craig Bester <craig.bester@iota.org>
JelleMillenaar pushed a commit that referenced this pull request Nov 1, 2021
* Docs/readme improvs (#257)

* Update main readme

* WASM readme update

* Updated example with account

* Rust examples readme

* Bump wasm version

* Revert "Bump wasm version"

This reverts commit 73d9d66.

* consistent node version

* Bump wasm version

* Expand unit test coverage in bitset.rs, iota_did.rs, and iota_document.rs (#265)

* Add some tests

* Add IotaDocument::try_from_core() unit tests

* Fix clippy error

* read indexation payload from transaction payloads

* Remove IotaDID->DID Deref anti-pattern. (#269)

* Remove IotaDID->DID Deref anti-pattern.

* Address l1h3r review comments.

* Rework WASM examples to explicitly use client configs. (#275)

* Rework WASM examples to explicitly use client configs.

* Add explorer_util.js adn fix typo.

* Fix explorer URL construction.

Inlined the prefix since it is no longer exported.

* Bump dns-packet from 1.3.1 to 1.3.4 in /bindings/wasm (#277)

Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](mafintosh/dns-packet@v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump browserslist from 4.16.3 to 4.16.6 in /bindings/wasm (#278)

Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](browserslist/browserslist@4.16.3...4.16.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add IotaDocument::from_keypair_with_network() and WASM binding. (#276)

* Add IotaDocument::from_keypair_with_network() and WASM binding.

* Undo unintentional formatting in README.

* Add optional network arg to from_keypair WASM binding.

* Update API reference for fromKeyPair.

* Update README.

* Update bindings/wasm/src/wasm_document.rs

* Use u32 for message delays (#281)

* Use u32 for message delays

* Update docs

* Update version

* Bump ws from 6.2.1 to 6.2.2 in /bindings/wasm (#282)

Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: Fix some typos in the method spec

* docs: Describe build process for wasm bindings

* Update iota-client (#270)

* Update iota-client

* Fix features

* New client builder

* New wasm client

* Update examples

* More common types (#283)

* Fragment/UnixTimestamp -> core::common

* clippy

* Timestamp::now -> Timestamp::now_utc

* Remove shard from DIDs (#280)

* Remove shard from DIDs

* wasm fixes

* update yarn.lock

* doctest

* Version Bump

* Restore checkCredential/checkPresentation WASM functions (#287)

* Restore client.checkCredential/checkPresentation

* doc: Serialize `message_id` for `IotaDocument`s

* wasm: Fix incorrect path in example imports

* client: Rename `read_document` to `resolve`

* Revert "doc: Serialize `message_id` for `IotaDocument`s"

This reverts commit 26e2dcd.

* wasm: Serialize `message_id` for resolve method

Co-authored-by: PhilippGackstatter <philipp.gackstatter@iota.org>

* Add blake2b to wasm bindings (#288)

* Add blake2b to wasm bindings

* docs

* core: Reimpl `Key` with generics

* replace deleted method readDocument(id) with resolve(id) (#294)

* account: Disable custom riker logging

* Docs/setup docusaurus (#298)

* setup docusarus template

* add iota style and identity content

* add gh deploy action

* fix sidebar and titles

* change build dir

* fix folder name

* add specs, fix links

* fix images

* fix base path and github link

* add cname for security

* Add `publicKeyMultibase` (#307)

* Add publicKeyMultibase support

Add and expand base-encoding tests.

* Remove publicKeyHex

* Add verification method publicKeyMultibase test

* Ignore wasm lint warning

* setup documentation file structure in docusaurus

* Example Cleanup (#292)

* Default Network should be Mainnet

* Use remote PoW by default

* Always set a primary node

* Client updates

- Add TangleResolve for generic client implementations
- Add Receipt return value with additional txn info
- Rename `Client::transaction_url` -> `Client::message_url`

* Appease clippy

* Update examples

* Add ability to configure account clients (#293)

* Add ability to configure account clients

* rename

* stricter bound

* Use dashmap

* Explicit account test mode

* Fix missed method

* Ignore lint

* faster tests

* Minutes/2021 14 07 (#316)

* 2021-07-14

* 2021-07-14

* final

* Rename

Co-authored-by: HackMD <no-reply@hackmd.io>

* add codeSnippet component

* Update actions to pin Rust nightly version (#318)

Fix attempt for inconsistent Github Actions failures.

* Wasm examples browser (#317)

* create did through browser

* add examples to create and resolve DID

* add manipulate_did and create_vc

* and merkle key and revocation

* add missing index.html

* move node examples to separate folder

* update readme file

* remove web.js and format browser examples

* include node examples in git

* update readme links of node examples

* account: Add stronghold and re-export wasm feature (#291)

Signed-off-by: PhilippGackstatter <philipp.gackstatter@iota.org>

account: Complete stronghold feature integration

account: Enable new resolver to fix wasm target

account: Use tokio 1.5 & split async feature

account: Add note on `Stronghold` availability

builder: Apply cargo fmt
Signed-off-by: PhilippGackstatter <philipp.gackstatter@iota.org>

* Fix cyclic dependency (#319)

Remove unused preserve_order serde_json feature flag.

* update file paths

* add remark-import-partial plugin

* add missing doc files

* update landing page

* Fix inconsistent stronghold storage tests (#320)

Raise test timeouts and improve handling on slow systems.

* update footer/add empty team page

* remember selected programming language

* fix rust Replit

* change height of code snippet

* add teams page

* adjust team page

* minor edits to landing page

* Added DID Intro text

* Moved meeting minutes

* Remove mdbook docs

* Renamed DocOps -> documentation

* Updated deploy workflow documentation

* Updated blogs

* signature: Impl thread-safe `Cell` (#329)

Signed-off-by: PhilippGackstatter <philipp.gackstatter@iota.org>

* update docusaurus.config.js

* Docs/docusaurus (#324)

* Docs/setup docusaurus (#298)

* setup docusarus template

* add iota style and identity content

* add gh deploy action

* fix sidebar and titles

* change build dir

* fix folder name

* add specs, fix links

* fix images

* fix base path and github link

* add cname for security

* setup documentation file structure in docusaurus

* add codeSnippet component

* update file paths

* add remark-import-partial plugin

* add missing doc files

* update landing page

* update footer/add empty team page

* remember selected programming language

* fix rust Replit

* change height of code snippet

* add teams page

* adjust team page

* minor edits to landing page

* Added DID Intro text

* Moved meeting minutes

* Remove mdbook docs

* Renamed DocOps -> documentation

* Updated deploy workflow documentation

* Updated blogs

* update docusaurus.config.js

Co-authored-by: huhn511 <sehe89@gmail.com>
Co-authored-by: JelleMillenaar <Jelle.millenaar@iota.org>

* Fix workflow

* Trigger workflow if itself changes

* Moved latest meeting notes

* Docs/docusaurus (#331)

* Docs/setup docusaurus (#298)

* setup docusarus template

* add iota style and identity content

* add gh deploy action

* fix sidebar and titles

* change build dir

* fix folder name

* add specs, fix links

* fix images

* fix base path and github link

* add cname for security

* setup documentation file structure in docusaurus

* add codeSnippet component

* update file paths

* add remark-import-partial plugin

* add missing doc files

* update landing page

* update footer/add empty team page

* remember selected programming language

* fix rust Replit

* change height of code snippet

* add teams page

* adjust team page

* minor edits to landing page

* Added DID Intro text

* Moved meeting minutes

* Remove mdbook docs

* Renamed DocOps -> documentation

* Updated deploy workflow documentation

* Updated blogs

* update docusaurus.config.js

* Fix workflow

* Trigger workflow if itself changes

* Moved latest meeting notes

Co-authored-by: huhn511 <sehe89@gmail.com>
Co-authored-by: Abdulrahim Al Methiab <abdulrahim.almethiab@iota.org>

* replace package-lock

* prevent broken links from failing the build

* fix docusaurus base URL

* Bump prismjs from 1.23.0 to 1.24.1 in /documentation (#330)

Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.1.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.23.0...v1.24.1)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add sccache to pipeline (#335)

* Add sccache to pipeline

* Fix Github Actions build-and-test include path

CI checks should correctly run if the build-and-test.yml definition changes
now.

* Fix sccache installation on Linux, Windows

* Debug Windows sccache path

* Add cache steps to all build CI jobs

Fix cache restore keys.

* Fix sccache restore keys

* * Upgraded docusaurus to improve mobile nav
* Fixed docs edit url

* * Fixed broken link

* Fix import.meta error (#340)

* Fix import.meta error

Update our workaround for webpack not supporting import.meta properly,
which causes an error when trying to use the Wasm web bindings with some
frameworks, e.g. React.

* Improve workaround regex

* Fix wasm examples (#337)

* Use camel case for JSON

* Fix messageId extraction

* Use explicit receipt var in examples

* Fix web explorer url

* Update yarn.lock

* Bump tar from 5.0.5 to 5.0.7 in /bindings/wasm (#346)

Bumps [tar](https://github.com/npm/node-tar) from 5.0.5 to 5.0.7.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v5.0.5...v5.0.7)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix libjose clippy lint (#348)

Remove needless borrow in libjose

* Add Wasm examples to CI (#345)

* Fix Wasm README.md example

Add Wasm examples CI job.
Update build-and-test CI to run wasm_bindgen annotated tests.

* Add txm annotations to test Wasm README.md example

Add txm to examples CI job.

* Fix Wasm node and README.md examples tests

The examples will now throw error codes on unsuccessful termination.

* Enable wasm examples CI job on PR temporarily

* Add configurable branch/ref for example CI

* Disable examples CI job on pull requests

* Rename Wasm Examples CI job

* Switch to jest for testing node bindings examples

* Add wasm browser example tests with cypress

Fix broken browser examples, doc strings.
Update example CI job with browser tests.
Temporarily enable examples CI job on PR for testing.

* Disable examples CI on PR

Update yarn.lock to include cypress

* improve node tests reliability

* improve browser test reliability

Co-authored-by: Abdulrahim Al Methiab <abdulrahim.almethiab@iota.org>

* Bump version to 0.3.5 for @iota/identity-wasm@dev (#351)

Update package-lock.json

* Improve Wasm error handling (#344)

* Add WasmError

Enables idiomatic Javascript error handling with js_sys::Error which
includes error enum variant names.

* Add WasmError test

* remove book.toml (#341)

* Fix low-level links (#353)

Some of them were pointing to the wrong file.

* Update documentation links (#354)

* Update doc links

* Updated remaining incorrect links

Co-authored-by: JelleMillenaar <Jelle.millenaar@iota.org>

* Add integration chain history/diff chain API (#347)

* Retrieve basic message history

* add Client::resolve_diffs

* Add WASM support/example

* Remove needless borrow

* cargo clean

* cargo fmt

* add did-history node example

* fix did-history node example

* add did-history browser example

* start implementing create_diff example for browser

* add create_diff examples

* fix revocation

* Address comments

Add clarifying comments to resolve history example.
Add wasm bindings equivalents for the resolve history example.
Add diff_chain example to base examples.
Add authorisation method to WasmDocument in order to use resolveDiffs.
Improve rustdoc comments.
Fix base example README.md references.

* Fix merge.

Fix clippy lint warnings.
Fix formatting.

* Remove leftover file from merge conflict.

* Fix format

* Fix wasm examples README.md

* Add Wasm binding history types

Add bridging Wasm structs for MessageHistory, DiffSet, DocumentDiff,
DiffChain, IntegrationChain.
Update client methods to return the briding structs where possible
instead of a serialized JsValue.
Improve error ergonomics in Wasm bindings by replacing
`.map_err(wasm_error)` with `.wasm_result()` and define a custom Result
type for JsValue errors.
Rename integration, diff chain `is_valid`/`check_validity` methods to
`is_valid_addition`/`check_valid_addition` to reduce ambiguity.
Add an extra check for the `message_id` in `check_valid_addition`.

* Export more functions to wasm bindings

Add publish_json, diff_address, integration_address to wasm bindings.
Update resolve_history example to include diff chain spam.
Remove message_id check from check_valid_addition added in previous
commit which was causing a test to fail.

* Export more structs to Wasm and update examples.

Export Timestamp and associated timestamp fields from IotaDocument to
Wasm bindings.
Update examples for parity between Rust, Nodejs, and browser versions.
Add revoke_vc Rust example.
Fix examples where from_keypair is used incorrectly to add new
verification methods.
Fix examples not setting the updated timestamp.
Fix printing nested JSON in examples/node/resolve_history.

* Fix README.md spelling.

* Fix broken Wasm examples

Fix merkle_key revocation example.
Fix invalid README.md references.

* Fix clippy, fmt warnings

* Refactor MessageHistory to DocumentHistory

Remove duplicate logic.
Remove Wasm bindings for DiffChain, IntegrationChain as per discussions
that those structures should be reserved for internal use and to keep
the external Wasm API cleaner.
Change `resolve_diff` to require a document previously published on the
integration change to avoid issues with validation.

* Export DocumentHistory to Wasm bindings

Fix spam messages returning the wrong message ids.
Change DocumentHistory structure due to Wasm binding limitations on
generics.
Update Wasm resolve_history examples.

* Update bindings/wasm/src/did/wasm_document.rs

Co-authored-by: Philipp <philipp.gackstatter@iota.org>

* Update bindings/wasm/examples/browser/mainpulate_did.js

Co-authored-by: Philipp <philipp.gackstatter@iota.org>

* Update identity-iota/src/chain/document_chain.rs

Co-authored-by: Philipp <philipp.gackstatter@iota.org>

* Update document_chain.rs

Add doc comment for DocumentChain.

* Update document_chain.rs

Fix formatting.

* Fix whitespace formatting to satisfy CI

* Rename address to index

Corrects integrationAddress -> integrationIndex, diffAddress ->
diffIndex.

Co-authored-by: Abdulrahim Al Methiab <abdulrahim.almethiab@iota.org>
Co-authored-by: Craig Bester <craig.bester@iota.org>
Co-authored-by: Philipp <philipp.gackstatter@iota.org>

* Bump version to 0.3.6 for @iota/identity-wasm@dev (#363)

* added cargo example build and dummy run

* added parallel execution for js and rust examples

* added actual cargo example run

* fixed cargo example run

* added output cache, changed cache key, reordering

* use jq instead of python

* use matrix build, caching for web examples

* use current branch

* Improve `Network` type to better support private tangles (#360)

* Make `Network` not `Copy`

This is in preparation for adding another
non-`Copy` variant later.

* Add `Other` variant in `Network`

* Add node.js DID creation on private tangle example

* Add `from_name` in Wasm and fix absence of `Copy`

* Remove superfluous imports

* Add browser Wasm example

* Remove old variable

* Add low-level Rust API example

* Format Wasm network source code

* Add account Rust API example

* Use same ideas for account & low-level examples

* Rename `Network::as_str` to `name`

* Impl spec compliance check for `Network` names

* Change `IotaDID::network` return type to `Result`

* Change bindings according to new return type

* Improve Wasm examples with resolution step

* Add private tangle test

* Add cypress browser test

* Use `?` instead of `unwrap` where possible

* Add explorer url to `Network::Other` variant

* Add explorer_url tests

* Merge branch 'dev' into feat/private-tangle-network

* Fix `explorer_url` conversion

* Fix `message_url` in new examples

* Fix network names in Rust private tangle examples

* Update bindings/wasm/examples/node/test.js

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Update bindings/wasm/cypress/integration/browser_test.js

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Update bindings/wasm/examples/node/private_tangle.js

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Update bindings/wasm/examples/browser/private_tangle.js

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Update examples/account/private_tangle.rs

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Update examples/low-level-api/private_tangle.rs

Co-authored-by: Craig Bester <craig.bester@iota.org>

Co-authored-by: Craig Bester <craig.bester@iota.org>

* remove target cache

* added exit condition

* improved naming

* changed sccache key

* use release mode to build examples

* renamed workflow

* Add HTML remove comments remark plugin (#366)

* Remove `toUnix` and `fromUnix` methods in `WasmTimestamp` (#365)

* Remove unix methods in Timestamp due to #362

* Add lint to avoid future reintroduction of i64/u64

* Update Wasm docs

* Link the relevant issue in the lint

* Bump version to 0.3.7 for @iota/identity-wasm@dev (#368)

* Bump url-parse from 1.5.1 to 1.5.3 in /documentation (#356)

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump url-parse from 1.5.1 to 1.5.3 in /bindings/wasm (#357)

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix iota-client dependency (#371)

* Update dependency versions

Fix iota-client dependency resolution error in GitHub Actions.
Update minor dependencies.

* Fix Rust examples CI failures

Prevent private_tangle examples returning an error on publish when no
private Tangle is running locally.

* Update wasm bindings resolver to version 2

Removes mio dependency which cannot be compiled to the wasm target. It
was brought in by tokio features in dev-dependencies, hence why the new
resolver works.

* Update iota-client dependency pinned commit

Fix Wasm compilation.

* Migrate riker stronghold to actix version (#370)

Move password expiration to the stronghold thread

Asyncify the tests

Fix "unnecessary let binding"-lint

Update to latest stronghold & crypto.rs

Fix clippy "let binding returned" lint

Improve unwrap safety documentation

Improve error handling in stronghold init

Simplify stronghold init statement

Upgrade all crates to iota-crypto 0.7

Improve error handling and use `expect` everywhere

Alphabetize `Cargo.toml`

Fix "block in if condition" clippy lint

* Bump to 0.3.8 for @iota/identity-wasm@dev, add set_message_id (#373)

* Add set_message_id to WasmDocument

Allow setting the message_id on DID documents in the wasm bindings.

* Bump version to 0.3.8 for @iota/identity-wasm@dev

* Fix messageId in create_did Wasm examples

* Make sccache installation a bit faster on macOS (#374)

* Bump to 0.3.9 for @iota/identity-wasm@dev, fix messageId  (#376)

* Fix WasmDocumentDiff message_id

Fix message_id incorrectly returning the previous_message_id.

* Bump version to 0.3.9 for @iota/identity-wasm@dev

* Enable the creation of an identity from a `KeyPair` in the `Account` (#352)

* Add `key_insert` function in `Storage` trait

* account: Impl keygen from bytes for `MemStore`

* account: Remove unused imports

* account: Document key size for Ed25519

* account: Fix clippy dereference lint

* account: Remove unnecessary comment

* account: Document `secret_key` better

* account: Fix ed25519 key size doc comment

* Add optional `secret_key` to `CreateMethod`

* Use renamed crypto methods in `MemStore`

* Add creating id from secret key tests

* Update stronghold to bug-fixed version

* Add stronghold insertion test

* Return proper error on invalid key length

* Implement method_secret for `CreateMethod`

* Add key size check in `CreateIdentity`

* Don't test error message itself

* Use `MethodSecret` in `IdentityCreate`

* Test type/secret mismatch

* Move insertion logic to new method

* Refactor `NetworkName` (#375)

* Add NetworkName

Use a newtype wrapper for network names to enforce spec compliance.
Fix potential bug with ClientMap theoretically having duplicate network
clients when custom explorer URLs are set.

* Update IotaDID to validate network name

Rename `with_network` to `new_with_network`.

* Fix Wasm bindings

Add `Network::name_str` to avoid cloning the `NetworkName`.

* Remove did! macro

The did! macro was unused and just converted the errors from try_did!
into panics.
Add network validation tests for Account::create_identity.

* Address comments

Rename Network::from_name to Network::try_from_name
Rename NetworkName::try_from_name to NetworkName::try_from
Rename try_did! to try_construct_did!

* Fix compilation

* Bump tar from 5.0.7 to 5.0.11 in /bindings/wasm (#378)

Bumps [tar](https://github.com/npm/node-tar) from 5.0.7 to 5.0.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v5.0.7...v5.0.11)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Extend Network doc comment for other networks (#382)

* extend doc comment

* Fix spelling

* Add build step for Wasm examples (#369)

* added build step for examples

* enable more examples

* enabled more examples, cleaned up utils

* removed platform specific examples

* fixed node tests

* copy index.html to dist

* enable all examples

* changed example server root

* fixed browser test

* fixed wasm path

* enabled all node tests

* added example build to workflow

* renamed build step

* fixed tests

* added example build to README

* fixed example path

* added sourcemap option to build step

* removed redundant try catch

* added WASM example build to build and test

* fixed Readme links

* changed test command

* added signature for linkify method

* minor rework of resolution workflow

* Use a network name that matches part of the private tangle network id (#383)

* Fix private tangle examples

* Fix Wasm private tangle examples

* * Removed comment about txm which causes a compilation error upon importing from the wiki (#384)

* Change build workflow step to avoid recompilation (#386)

* Fix Wasm private-tangle example (#389)

Fixes failing example tests when nothing (undefined) is passed to the function.

* Revert "* Removed comment about txm which causes a compilation error upon importing from the wiki (#384)" (#385)

This reverts commit 0f5be7e.

* Docs - Improve SEO (#380)

* * Browser friendly descriptive urls
* Removed duplicate onBrokenLinks declaration in config

* * Removed Docusarus assets.
* Added description, image and keywords for all docs.
* Added alt attribute to images
* Upgraded to docusarus beta 4
* Added png identity icon

* Apply suggestions from code review

Co-authored-by: charlesthompson3 <74603461+charlesthompson3@users.noreply.github.com>

Co-authored-by: charlesthompson3 <74603461+charlesthompson3@users.noreply.github.com>

* Content for create did, replit improvements (#372)

* Content for create did, replit improvements

* md

* Improved phrasing based on suggestions

* use Cargo.lock for caches, remove libjose caches (#390)

* use Cargo.lock for caches, remove libjose caches

* fix sccache env

* Update .github/workflows/build-and-test.yml

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Update .github/workflows/build-and-test.yml

Co-authored-by: Craig Bester <craig.bester@iota.org>

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Enable lazy tangle updates in the `Account` (#377)

* Implement pushing unpublished commits to tangle

* Improve methods added to the storage interface

* Bail early if no commits to publish

* Implement new storage methods for `Stronghold`

* Implement clippy suggestions

* Add lazy publish example

* Add lazy publish test

* Apply format

* Replace `unwrap` with `?`

* Implement a "network-resilient" test runner

* Make identity updates thread-safe

* Expand docs, fix nitpicks

* Add lock to `publish_changes`

* Return locks lazily in `get_lock`

* Remove lock when deleting from index

* Clone locks when cloning the index

* Rename document to did in all examples

* Fix spelling, docs, naming

* Improve docs, simplify code

* Add `IdentityLock` type

* Rename `publish_changes` -> `publish_updates`

* Internalize `Account` commands (#391)

* Impl basic `account.new_command` idea

* Fix apply impl

* Enable multiple updates on an updater

* Flesh out `IdentityUpdater` impl

* Fix command tests

* Rename document to did in all examples

* Update examples to use new update syntax

* Add documentation

* Remove Default impl, use proper macro path for key

* Document `IdentityUpdater`, derive basic traits

* Update recently added tests

* Roll back name change

* Reference `key` to get rid of `Clone` requirement

* Remove `CreateIdentityBuilder`

* Call `update_identity` on each update

* Move tests inside the account crate

* Document `IdentityUpdater` methods

* Rename `CommandError` -> `UpdateError`

Avoids having `Command` in the public interface.

* Update stray occurrence of `CommandError`

* Use better name for captured attribute in macro

* Move lazy test inside the crate & update syntax

* Remove `Clone` bound

* Rename `CommandError` -> `UpdateError` in account

* Make `resolve_id` method signatures consistent

* Move builder doc to the fn instead of the impl

* Replace yarn with npm (#394)

* Replace yarn with npm

* Fix npm publish included files

Exclude examples from published wasm bindings package.

* Update wasm bindings README.md

Add link to examples.
Add note on import statements.
Improve formatting.

* Add toml formatting (#393)

* Add dprint for Cargo.toml formatting

Add dprint check to format CI action.

* Format toml files

* Fix format workflow

* Use pre-packaged dprint from npm

* Disable incremental compilation in CI

Attempt to reduce cache size.

* Fix rustdoc lint warnings

Re-enable incremental cargo compilation in CI except for build-and-test-wasm.

* Remove redundant format check

* Add composite action to CI (#392)

* Add IOTA wiki CLI (#381)

* Add document merge to wasm bindings (#401)

* Update document merge functions in wasm bindings

Add WasmDocumentDiff::merge()
Update parameter of WasmDocument::merge()

* Fix formatting

* Fix IntegrationChainHistory, DiffChainHistory bindings

* Remove redundant js_class, js_name attributes

* Bump version to 0.3.10 for @iota/identity-wasm@dev (#402)

* Rename document1 to did1 in README example. (#400)

* Rename document1 to did1 in README example.

Previously, the example used `document1` to refer to the DID, whereas the "document" isn't resolved until `account.resolve_identity()` is called.

* Apply suggestions

* Fix wasm compilation (#404)

Explicitly enable tokio "rt" feature to fix compilation of bee-runtime
dependency.

* Replace `testnet` with `devnet` (#405)

* Replace testnet with devnet

* Update documentation

* Small wiki content tweaks. (#399)

- Fix "_Rust_ API Reference" title
- Some acronym expansions
- Consistently hyphenate Self-Sovereign Identity
- Link to Rust and WASM API reference (they're still stubs though)
- Some small wording tweaks

* Bump version to 0.3.11 for @iota/identity-wasm@dev (#416)

Add `proof` field getter for WasmDocumentDiff.

* Initial content for VC Wiki Overview page (#407)

* Initial content for VC Wiki Overview page

* Address Jelle's review comments (round 1).

* Update README.md (#413)

changed links for documentation to wiki.iota.org links

* Bump tmpl from 1.0.4 to 1.0.5 in /bindings/wasm (#410)

Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Rename SecretKey to PrivateKey throughout identity.rs code base. (#409)

* Rename SecretKey to PrivateKey throughout identity.rs codebase.

* Fix formatting issues.

* Resolve cycraig review (more secret->private renamings)

* Add stub content to IOTA DID Resolution wiki page. (#406)

* Add stub content to IOTA DID Resolution wiki page.

* Address Jelle's review comments (explorer, wording, etc.)

* Add default signing key as a generic verification method (#421)

* Rename auth to int chain everywhere

* Create verification method with attached auth

* Fix generations in tests

* Update remaining generations in tests

* Remove outdated TODO

* Impl generic verif method in low level API

* Use 'integration' instead of 'int'

* Add test that verifies number of verif. methods

* Assert the authentication relationship

* Fix Document constructor Typescript bindings (#423)

* Fix WasmDocument constructor Typescript bindings

Replace IotaDocument `from_keypair()`, `from_keypair_with_network()` with `new()`.
Update Wasm binding examples to be more consistent with Rust.

* Fix test and benchmark compilation

* Fix benchmark compilation

* Apply suggestions from code review

* Add Document::new_with_options constructor

Allow default verification method fragment to be specified.
Add doc, unit tests.

* Use NetworkName instead of &str

Remove IotaDID::from_components.
Remove specific InvalidNetworkName strings for consistency with other errors and to use with TryInto.
Allow Network::try_from_name to take an actual NetworkName as well as a
string.

Co-authored-by: Philipp <philipp.gackstatter@iota.org>

* Fix example dependencies in Readme (#430)

Account feature has to be added to the identity dependencies to use identity::account::*.

* Update Account API to return IdentityState from find_identity and create_identity (#414)

* Update Account::create_identity() to return IdentityState.

* Update Account::find_identity() to return IdentityState.

* Fix Wasm network calls, pin reqwest to 0.11.4 (#439)

* Rename JSON serialization field name to match spec. (#412)

* Rename JSON serialization field name to match spec.

* Rename notSupported -> representationNotSupported

* Reduce WASM build size (#427)

* reduce wasm build size

* Enable lto for Wasm release

Add `build-dev` task for Wasm for debugging.

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Chore/combine examples (#420)

* Merged Stronghold with basic examples in account

* Updated explorer to identity resolver

* Added explorer URL after basic example

* Renamed examples

* Completed manipulate did example

* Fixed suggestions, removed replaced examples.

* Improved example readme

* Consistently use Stronghold and Resolver URL

* Fix examples

* Merged config example with private tangle

* low-level-api private-network example runs

* cargo fmt

* cargo fmt with nightly

* Impl suggestions

* Docs - Reogranize Docs, Add Examples & Cheat Sheet (#425)

* Reorganized files

* Renamed .md files to .mdx (see https://docusaurus.io/docs/next/markdown-features/react)
Added examples
Deleted unused files
Updated sidebar
Added 20px margin bottom for replit embedded object
Removed redundant units and props in styles.css

* added NLOF

* Apply suggestions from code review

Co-authored-by: charlesthompson3 <74603461+charlesthompson3@users.noreply.github.com>

* Added Wasm Cheat and Rust Cheat sheet skeleton

* Apply suggestions from code review

Co-authored-by: charlesthompson3 <74603461+charlesthompson3@users.noreply.github.com>

* fix typo

* Fixed links
ADded first draft of rust cheat sheet
Changed extension in verifiable_presentations.md to mdx

* Added example output for all functions in the WASM cheat_sheet.md

* Added example JSON output for all functions in the Rust cheat_sheet.md

* Added tutorial

* Formatted tutorial

* Addressing comments:
* Added instructions and descriptions on installing both main and dev branches.
* Removed low level API items from rust cheat sheet and added Account modules examples where possible.
* Added stronghold, private tangle and vp account module examples

* * added branch specific installation instructions
* fixed html in cheat_sheet.md

Co-authored-by: charlesthompson3 <74603461+charlesthompson3@users.noreply.github.com>

* Update CI cache action versions (#435)

* updated cache action versions

* added actions to watched paths

* updated cache version for examples workflow

* Docs - Fix build (#445)

* * Replaced imported account module stronghold example with basic example.
* Removed reference to deleted account module examples
* Added test action to catch future include issues

* testing action

* removed action as I wasn't being successful at all

* Added combined examples as suggested by @cycraig

* Added missing include statements (#446)

* Update TimeCop to avoid Into<SystemTime> (#444)

Out of an abundance of caution. Not an actual vulnerability since
`set_current` is unused and we don't use any SystemTime conversions
affected by a known vulnerability.

* Update methods to default to `PublicKeyMultibase` (#443)

* Update methods to default to PublicKeyMultibase

* Update documentation to use PublicKeyMultibase

* Separate `DID`, `DIDUrl` constructs (#428)

* Add separate DID, DIDUrl constructs

Add DID trait.
Add CoreDID, IotaDID structs.
Add DIDUrl generic struct.
Update various structs and functions to use a DID instead of a DIDUrl
where appropriate.

* Implement RelativeDIDUrl

Add extra CoreDID validation.
Add RelativeDIDUrl doctests.
Update tests, examples.

* Add DID Url unit tests.

Handle relative DID Url edge-cases.
Remove uriparse dependency.

* Fix formatting

* Fix clippy lint warnings

* Fix dereference_document

Add dereference unit tests.

* Fix formatting, clippy lint warnings

Add missing licence headers.

* Fix tests, benchmarks

* Remove unsafe cast in IotaVerificationMethod

* Add WasmDIDUrl

Update Wasm examples.

* Fix wasm formatting

* Improve RelativeDIDUrl comparisons

* Improve DIDUrl parsing

Re-export BaseDIDUrl to satisfy TryFrom<BaseDIDUrl> without adding the
`did_url` crate dependency to other projects.

* Remove resolution metadata check

Fix formatting.

* Change remove_service, remove_method parameters

Add doc comments.

* improved documentation

* fixed formatting

* Set `explorer_url` in private Tangle example (#454)

* Use explorer_url from custom network

* Use devnet explorer url

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Fix explorer url formatting

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Fix low-level private tangle example (#461)

* Fix low-level private tangle example

* Keep discussion on network name requirements

* Fix links in documentation (#450)

* Fix links in create.mdx

* Fix links in validate_university_degree.mdx

* Add dark image (#469)

* Clean up Documentation (#463)

* Removed meeting minutes

* Removed copy

* Fixing some links

* Removed Blog

* Add IOTA DIDComm protocols specification (#379)

* [WIP] Add DIDComm protocol specifications

* [WIP] Describe presentation messages

* [WIP] enhanced presentation protocol

* [WIP] enhanced presentation protocol

* [WIP] enhanced presentation protocol

* [WIP] enhanced presentation protocol

* [WIP] Add alternative presentation diagrams

* [WIP] further work on presentation

* [WIP] added signing protocol

* [WIP] further signing protocol

* [WIP] further signing protocol

* [WIP] fixed presentation

* [WIP] added issuance

* [WIP] further issuance

* [WIP] added credential-types, renamed problem-reports

* [WIP] minor cleanup

* [WIP] furthr work on issuance

* [WIP] further work on issuance

* [WIP] further work on issuance

* [WIP] further work on issuance

* [WIP] further work on issuance

* [WIP] further work on issuance

* [WIP] added revocation

* [WIP] added revocation diagram

* [WIP] added revocation-options, further revocation

* [WIP] further revocation-options, further revocation

* [WIP]further revocation

* [WIP]further revocation and revocation-options

* [WIP]further revocation and revocation-options

* [WIP] added termination

* [WIP] reference external flows

* [WIP] add presentation-exchange to presentation

* [WIP] further revocation

* [WIP] further revocation

* [WIP] further revocation

* added connection

* [WIP] further connection

* [WIP] further connection

* [WIP] further connection

* [WIP] further connection, added authetication

* [WIP] further authetication

* [WIP] fixed typos

* [WIP] further auth]

* [WIP] further auth

* [WIP] further auth

* [WIP] further auth

* fixed typo

* [WIP] problem reports

* problem reports

* further problem reports

* further problem reports

* problem reports, added 'post' protocol

* added post

* type negotiation, reworked revocation

* type negotiation

* cleanup

* added introduction

* editing

* editing

* editing

* Update issuance.md

fixed grammar.

* added potential future CrendentialInfo methods

* Fix Credential Kinds links

Minor formatting.

* First 3 files review, typos and extra info

* Update DIDComm spec introduction slightly

* Change DIDComm spec sidebar ordering

* Edit trust paragraph in authentication

Remove redundant authentication example.

* Update connection->feature discovery relationship

* Minor changes to presentation

* Spelling fixes

* Reorder resources section to after protocols in overview

* Reorder revocation to before revocation options

* Improve credential links in presentation

* Fix footnote numbering in signing

* Update signing authorisation consideration

* added description to sections

* fix sidebar links

* added diagram section

* Deduplicate authentication protocol links

* Deduplicate connection protocol links

* Deduplicate issuance protocol links

* Deduplicate presentation protocol links

* Deduplicate signing protocol links

* changed intro text

* further presentation

* cleaned up presentation

* further overview

* further authentication

* renamed Credential Kinds, added description for trust considerations

* further authentication

* reworked presentation

* updated changelog

* removed TODO

* fixed links

* added disclaimer and changed headline structure

* updated 'last updated'

Co-authored-by: Eike Haß <eike-hass@web.de>
Co-authored-by: Oliver Anderson <oliver.anderson@iota.org>
Co-authored-by: JelleMillenaar <Jelle.millenaar@iota.org>

* Restrict KeyCollection sizes (#411)

* add an upper limit to the amount o keys that can be generated

* comment count new behavior

* fix pre-existing test to adjust to next power of two policy

* set upper limit to 2^32

* define an upper limit of 2^12 for key collection

* add check before allocating vec

* throw error when trying to create a KeyCollection with 0 keys, improve comments

* fix comment

* run cargo fmt

* add const MAX_PROOF_NODES for limiting the amount of nodes in a Proof

* fix fmt

* Clean up previous didcomm impl (#470)

* Removed messages from the wasm bindings

* Revert "Removed messages from the wasm bindings"

This reverts commit e66cf82.

* cleaned up identity-comm/src/messages and identity-comm/src/tests (#467)

* deleted bindings/wasm/src/message (#468)

* build api-reference

Co-authored-by: Oliver Anderson <oliver.anderson@iota.org>
Co-authored-by: Eike Haß <eike-hass@web.de>

* bump wasm to v0.4.0 (#472)

* Bump crate versions to `0.4.0` (#471)

* Bump crate versions to `0.4.0`

* Bump `identity-wasm`, too!

* Bump `identity-wasm` itself, too.

Co-authored-by: l1h3r <devin.turner@iota.org>
Co-authored-by: Devin Turner <5410284+l1h3r@users.noreply.github.com>
Co-authored-by: Matt Renaud <matt@m-renaud.com>
Co-authored-by: Thoralf-M <thoralf.mue@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: PhilippGackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Abdulrahim Al Methiab <31316147+abdulmth@users.noreply.github.com>
Co-authored-by: huhn511 <sehe89@gmail.com>
Co-authored-by: Craig Bester <cycraig33@gmail.com>
Co-authored-by: Abdulrahim Al Methiab <abdulrahim.almethiab@iota.org>
Co-authored-by: HackMD <no-reply@hackmd.io>
Co-authored-by: Craig Bester <craig.bester@iota.org>
Co-authored-by: lucastortora <lucas.tortora@iota.org>
Co-authored-by: eGarciaR <e.garcia.ribera@gmail.com>
Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com>
Co-authored-by: Eike Haß <eike-hass@web.de>
Co-authored-by: Rajiv Shah <rajivshah1@icloud.com>
Co-authored-by: lucas-tortora <85233773+lucas-tortora@users.noreply.github.com>
Co-authored-by: charlesthompson3 <74603461+charlesthompson3@users.noreply.github.com>
Co-authored-by: Phyloiota <77154511+Phyloiota@users.noreply.github.com>
Co-authored-by: Christian M <7541795+chriamue@users.noreply.github.com>
Co-authored-by: Oliver Anderson <oliver.anderson@iota.org>
Co-authored-by: Dr-Electron <dr-electr0n@protonmail.com>
Co-authored-by: Henrique Nogara <nogara.henrique@gmail.com>
PhilippGackstatter added a commit that referenced this pull request Nov 18, 2021
* Refactor `Account` to handle just one identity (#436)

* Partial impl to use did as storage identifier

* Move `CreateIdentity` into a separate type

Update Account API to return IdentityState from find_identity and create_identity (#414)

* Update Account::create_identity() to return IdentityState.

* Update Account::find_identity() to return IdentityState.

Update `IdentityUpdater` to only use account ref

Remove resolve, find and list

Replace `IdentityId` with `IotaDID` in account

Use `IotaDID` over `IdentityId` in stronghold

More replacement of id with did

Remove index from account

Fix stream impl

Fix stronghold impl, migrate `MemStore`

Re-add `resolve_identity` so tests can run

Fix Wasm network calls, pin reqwest to 0.11.4 (#439)

Rename `Command` -> `Update`

Rearrange `process_update`

* Fix clippy lints in memstore

* Let `RemoteKey` take a `dyn Storage`

* Implement `AccountConfig`

* Impl create_identity and load_identity in builder

* Rename JSON serialization field name to match spec. (#412)

* Rename JSON serialization field name to match spec.

* Rename notSupported -> representationNotSupported

* Reduce WASM build size (#427)

* reduce wasm build size

* Enable lto for Wasm release

Add `build-dev` task for Wasm for debugging.

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Chore/combine examples (#420)

* Merged Stronghold with basic examples in account

* Updated explorer to identity resolver

* Added explorer URL after basic example

* Renamed examples

* Completed manipulate did example

* Fixed suggestions, removed replaced examples.

* Improved example readme

* Consistently use Stronghold and Resolver URL

* Fix examples

* Merged config example with private tangle

* low-level-api private-network example runs

* cargo fmt

* cargo fmt with nightly

* Impl suggestions

* Refactor config once more

* Update examples to use single-id account

* Don't pass did into `load_snapshot`

* Fix clippy lints

* Partially update `update` tests

* Fix update tests

* Ensure did exists in storage in `load`

* Remote `State` in account

* Rename `load` -> `load_identity`

* Remove `Identity{Id,Index,Key,Name,Tag}`

* Let `update_identity` take `&mut self`

* Document new and existing types

* Update top-level README example

* Fix visibility on `CreateIdentity`

* Add try_from implementation for ed25519 keypair

* Combine account tests

* Rename updates > commands for better reviewability

* Also rename in mod.rs

* Impl `AccountBuilder` without pub async fns

* Update README example with latest builder change

* Change visibility of setup, config, constructors

* Revert to the old `create_did` example

* Save to disk when creating identity, fix doc fmt

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Use `authority` instead of `tag` in stronghold

* Rename `Config` -> `AccountConfig`

* Prevent two accounts from managing the same did

* Impl `IdentityBuilder`

* Only impl `IdentityCreate` under `#[cfg(test)]`

* Use `IdentityBuilder` in examples

* Remove unused `name` field

* Run workflow for `epic/*` branches

* Relase the lease in account tests

* Also run format, clippy and coverage workflows

* Revert "Use `IdentityBuilder` in examples"

This reverts commit 3d1b716.

* Revert "Only impl `IdentityCreate` under `#[cfg(test)]`"

This reverts commit 08ada09.

* Revert "Impl `IdentityBuilder`"

This reverts commit 1a5d645.

* Rename `IdentityCreate` -> `IdentitySetup`

* Add multi-identity example

* Simplify README example

* Rename `identity_setup` module

* Implement the `IdentityLease` newtype

* Rename `IdentityLease` -> `DIDLease`

* Update `resolve_identity` docstring

Co-authored-by: Matt Renaud <matt@m-renaud.com>
Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com>
Co-authored-by: Craig Bester <craig.bester@iota.org>
Co-authored-by: Jelle Femmo Millenaar <jelle.millenaar@iota.org>

* Apply new fmt granularity

* Refactor the `Account` state (#462)

* Get rid of `IdentitySnapshot`

* Start replacing parts of `IdentityState`

* Create identity document from core structures

* Impl int/diff update determination

* Remove `Deref` impls for IdentityState

* Implement `CreateMethod` update

* Impl attach/detach `MethodRelationship`

* Update to cap inv refactor

* Use `IotaDocument` directly to construct the doc

* Update tests for account updates

* Remove unused types & variables

* Return to unified publish method

* Implement & test attaching relationships

* Fix attach/detach tests post-merge

* Implement detach relationship test

* Implement insert and remove service

* Move `Publish` to low-level API

* Remove did field from account

* Refactor publishing & storing

* Rename int/diff generations

* Change fresh id detection & fix `store_state` call

* Factor out `ChainState` from `IdentityState`

* Remove `this_message_id` from chain state

* Test the chain state

* Fix some error TODOs

* Fix some TODOs

* Fix some storage todos/errors

* Make `IotaDocument::remove_method` fallible again

* Use name instead of identifier to call from_did

* Move state loading into the else clause

* Remove `persist` flag on `process_update`

* Remove unnecessary cloning

* Rename `as_document` -> `document`

* Improve `ChainState` docs

* Fix post-merge things & clippy lint

* Remove `Tiny*` and other unused state types

* `InvalidMethodTarget` -> `InvalidTargetMethod`

* `as_document_mut` -> `document_mut`

* Expand lazy test

* Rename impl_command_builder to update

* Remove event context

* Rename `events` module to `updates`

* Apply fmt

* Rename `commands` -> `updates`

* Remove `UnixTimestamp`

* Remove unused errors in account & update

* Change `fromDID` method in Wasm

* Return `Option<Publish>` from constructor

* Use strum, add todo!(), rename `PublishType`

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Move attach/detach relationship to `CoreDocument`

* Return bool from `detach_method_relationship`

* Use `MethodQuery` in attach/detach

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Revert "Change `fromDID` method in Wasm"

This reverts commit cb0cf35.

* Nest `MethodRelationship` in `MethodScope`

* Move some chain state logic to publish_diff_change

* Don't expect, bubble up

* Return early if there's nothing to publish

* Add todo about error handling

* Remove mut state methods

* Move account constructors to the top

* Use `try_resolve_method_with_scope` in tests

* Remove todos, inline code, explicitly ignore res.

* Remove todo comments, `unwrap`

* Rename chain state fields to `last_*`

* Improve `InvalidTargetMethod` Error name

* Increment actions when updating

* check for updated referenced method in publish

* Enable diff updates for merkle cap. inv. methods

* Only attach relationship on non-embedded methods

* Add proper type annotations in publish

* Improve chain state docs & variable naming

Co-authored-by: Craig Bester <craig.bester@iota.org>

* Fix READMEs

* Deduplicate setup code in builder

* Remove tangle dependency in autopublish test

* Add docs for attach/detach relationship

* Deduplicate signing key extraction

* Fix documentation & annotate types in examples

Co-authored-by: Matt Renaud <matt@m-renaud.com>
Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com>
Co-authored-by: Craig Bester <craig.bester@iota.org>
Co-authored-by: Jelle Femmo Millenaar <jelle.millenaar@iota.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants