├── bindings
├── wasm
│ ├── identity_wasm
│ │ ├── cypress
│ │ │ ├── fixtures
│ │ │ │ └── .gitkeep
│ │ │ ├── plugins
│ │ │ │ └── .gitkeep
│ │ │ ├── support
│ │ │ │ └── .gitkeep
│ │ │ ├── app
│ │ │ │ ├── src
│ │ │ │ │ ├── main.ts
│ │ │ │ │ ├── vite-env.d.ts
│ │ │ │ │ └── identity.ts
│ │ │ │ ├── package.json
│ │ │ │ └── tsconfig.json
│ │ │ ├── Dockerfile
│ │ │ └── e2e
│ │ │ │ └── tests.cy.js
│ │ ├── .dockerignore
│ │ ├── .cargo
│ │ │ └── config.toml
│ │ ├── tsconfig.typedoc.json
│ │ ├── rust-toolchain.toml
│ │ ├── tsconfig.node.json
│ │ ├── src
│ │ │ ├── revocation
│ │ │ │ └── mod.rs
│ │ │ ├── credential
│ │ │ │ ├── revocation
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ ├── validity_timeframe_2024
│ │ │ │ │ │ └── mod.rs
│ │ │ │ │ └── status_list_2021
│ │ │ │ │ │ └── mod.rs
│ │ │ │ ├── presentation
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── jwt_presentation_validation
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── jpt_presentiation_validation
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── jpt_credential_validator
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── jwt_credential_validation
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── jws.rs
│ │ │ │ └── jpt.rs
│ │ │ ├── sd_jwt_vc
│ │ │ │ ├── metadata
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── sd_jwt_v2
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── status.rs
│ │ │ │ └── claims.rs
│ │ │ ├── sd_jwt
│ │ │ │ └── mod.rs
│ │ │ ├── resolver
│ │ │ │ ├── mod.rs
│ │ │ │ └── resolver_types.rs
│ │ │ ├── jose
│ │ │ │ ├── mod.rs
│ │ │ │ └── jwu.rs
│ │ │ ├── common
│ │ │ │ ├── mod.rs
│ │ │ │ └── utils.rs
│ │ │ ├── rebased
│ │ │ │ └── mod.rs
│ │ │ ├── iota
│ │ │ │ ├── mod.rs
│ │ │ │ └── iota_metadata_encoding.rs
│ │ │ ├── jpt
│ │ │ │ ├── mod.rs
│ │ │ │ ├── jpt_claims.rs
│ │ │ │ └── encoding.rs
│ │ │ ├── verification
│ │ │ │ ├── mod.rs
│ │ │ │ └── wasm_method_relationship.rs
│ │ │ ├── storage
│ │ │ │ └── mod.rs
│ │ │ └── did
│ │ │ │ └── mod.rs
│ │ ├── tsconfig.json
│ │ ├── lib
│ │ │ ├── jose
│ │ │ │ ├── index.ts
│ │ │ │ ├── jwk_use.ts
│ │ │ │ ├── ed_curve.ts
│ │ │ │ ├── ec_curve.ts
│ │ │ │ ├── composite_jwk.ts
│ │ │ │ ├── jwk_type.ts
│ │ │ │ └── jwk_operation.ts
│ │ │ ├── tsconfig.json
│ │ │ ├── tsconfig.web.json
│ │ │ ├── index.ts
│ │ │ └── controller.ts
│ │ ├── typedoc.json
│ │ ├── examples
│ │ │ ├── src
│ │ │ │ └── tests
│ │ │ │ │ ├── 8_zkp.ts
│ │ │ │ │ ├── 6_sd_jwt.ts
│ │ │ │ │ ├── 5_create_vc.ts
│ │ │ │ │ ├── 6_create_vp.ts
│ │ │ │ │ ├── 7_revoke_vc.ts
│ │ │ │ │ ├── 10_sd_jwt_vc.ts
│ │ │ │ │ ├── 0_create_did.ts
│ │ │ │ │ ├── 1_update_did.ts
│ │ │ │ │ ├── 2_resolve_did.ts
│ │ │ │ │ ├── 4_delete_did.ts
│ │ │ │ │ ├── 5_domain_linkage.ts
│ │ │ │ │ ├── 9_zkp_revocation.ts
│ │ │ │ │ ├── 7_status_list_2021.ts
│ │ │ │ │ ├── 3_deactivate_did.ts
│ │ │ │ │ ├── 4_custom_resolution.ts
│ │ │ │ │ └── 12_iota_keytool_integration.ts
│ │ │ └── tsconfig.web.json
│ │ ├── .github_changelog_generator
│ │ ├── tests
│ │ │ ├── txm_readme.js
│ │ │ └── txm_readme_rust.js
│ │ └── proc_typescript
│ │ │ └── Cargo.toml
│ ├── .cargo
│ │ └── config.toml
│ ├── .license_template
│ ├── .gitignore
│ ├── tsconfig.json
│ ├── typedoc.json
│ └── build
│ │ └── utils
│ │ └── generatePackage.js
└── grpc
│ ├── tooling
│ ├── start-rpc-server.sh
│ ├── domain-linkage-test-server
│ │ └── .well-known
│ │ │ └── did-configuration.json
│ └── start-http-server.sh
│ ├── src
│ ├── lib.rs
│ ├── services
│ │ ├── credential
│ │ │ └── mod.rs
│ │ ├── mod.rs
│ │ └── health_check.rs
│ └── server.rs
│ ├── rustfmt.toml
│ ├── proto
│ ├── health_check.proto
│ ├── utils.proto
│ ├── document.proto
│ └── sd_jwt.proto
│ ├── build.rs
│ ├── tests
│ └── api
│ │ ├── main.rs
│ │ ├── health_check.rs
│ │ └── did_document_creation.rs
│ └── Dockerfile
├── .license_template_ignore
├── .dockerignore
├── identity_credential
├── tests
│ └── fixtures
│ │ ├── issuer-1.json
│ │ ├── subject-3.json
│ │ ├── status-1.json
│ │ ├── subject-6.json
│ │ ├── issuer-2.json
│ │ ├── refresh-1.json
│ │ ├── schema-2.json
│ │ ├── schema-1.json
│ │ ├── subject-4.json
│ │ ├── subject-8.json
│ │ ├── schema-3.json
│ │ ├── subject-2.json
│ │ ├── subject-7.json
│ │ ├── subject-5.json
│ │ ├── evidence-1.json
│ │ ├── evidence-2.json
│ │ ├── subject-1.json
│ │ ├── policy-1.json
│ │ ├── subject-9.json
│ │ ├── policy-2.json
│ │ ├── subject-10.json
│ │ ├── credential-2.json
│ │ ├── credential-3.json
│ │ ├── credential-4.json
│ │ ├── credential-6.json
│ │ ├── credential-7.json
│ │ ├── credential-10.json
│ │ ├── credential-8.json
│ │ ├── domain-config-valid.json
│ │ ├── domain-config-invalid-context.json
│ │ ├── credential-9.json
│ │ ├── domain-config-extra-property.json
│ │ ├── credential-1.json
│ │ ├── credential-11.json
│ │ ├── credential-5.json
│ │ └── credential-12.json
├── src
│ ├── revocation
│ │ ├── revocation_bitmap_2022
│ │ │ └── mod.rs
│ │ ├── validity_timeframe_2024
│ │ │ └── mod.rs
│ │ ├── status_list_2021
│ │ │ └── mod.rs
│ │ └── mod.rs
│ ├── validator
│ │ ├── sd_jwt
│ │ │ └── mod.rs
│ │ ├── jpt_credential_validation
│ │ │ ├── mod.rs
│ │ │ └── decoded_jpt_credential.rs
│ │ ├── jpt_presentation_validation
│ │ │ ├── mod.rs
│ │ │ └── decoded_jpt_presentation.rs
│ │ ├── jwt_presentation_validation
│ │ │ └── mod.rs
│ │ ├── jwt_credential_validation
│ │ │ └── mod.rs
│ │ └── mod.rs
│ ├── sd_jwt_vc
│ │ ├── metadata
│ │ │ ├── mod.rs
│ │ │ └── display.rs
│ │ ├── mod.rs
│ │ └── resolver.rs
│ ├── domain_linkage
│ │ └── mod.rs
│ ├── utils.rs
│ ├── credential
│ │ ├── jws.rs
│ │ ├── jpt.rs
│ │ └── jwp_credential_options.rs
│ ├── presentation
│ │ ├── mod.rs
│ │ └── jwp_presentation_options.rs
│ └── lib.rs
└── README.md
├── identity_verification
├── README.md
├── src
│ ├── jose
│ │ └── mod.rs
│ ├── lib.rs
│ └── verification_method
│ │ ├── method_relationship.rs
│ │ └── mod.rs
└── Cargo.toml
├── .github
├── banner_identity.png
├── releases
│ ├── v0.3.0.md
│ ├── v0.5.0-dev.1.md
│ ├── wasm-v0.5.0-dev.1.md
│ ├── v0.5.0-dev.3.md
│ ├── wasm-v0.5.0-dev.3.md
│ ├── v0.5.0-dev.5.md
│ ├── wasm-v0.5.0-dev.5.md
│ ├── v1.0.0-rc.1.md
│ ├── wasm-v1.0.0-rc.1.md
│ ├── v0.7.0-alpha.1.md
│ ├── wasm-v0.7.0-alpha.1.md
│ ├── v0.6.0.md
│ ├── wasm-v0.6.0.md
│ ├── v0.5.0-dev.6.md
│ └── wasm-v0.5.0-dev.6.md
├── workflows
│ ├── scripts
│ │ ├── array.sh
│ │ ├── updateVersion.sh
│ │ └── populate-changelog-descriptions.sh
│ ├── enforce-pr-labels.yml
│ ├── rust-create-hotfix-pr.yml
│ ├── audit.yml
│ ├── wasm-retag-npm.yml
│ ├── wasm-create-hotfix-pr.yml
│ ├── rust-publish-to-crates.yml
│ ├── build-and-test-grpc.yml
│ └── rust-automatic-release-and-publish.yml
├── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── documentation-task.md
│ ├── feature-request.md
│ └── bug_report.md
├── actions
│ ├── rust
│ │ └── sccache
│ │ │ └── stop-sccache
│ │ │ └── action.yml
│ └── publish
│ │ └── publish-rust
│ │ └── action.yml
├── .github_changelog_generator
├── CODEOWNERS
└── pull_request_template.md
├── rust-toolchain.toml
├── identity_eddsa_verifier
├── README.md
├── src
│ └── lib.rs
└── Cargo.toml
├── identity_storage
├── src
│ ├── key_id_storage
│ │ ├── tests
│ │ │ ├── mod.rs
│ │ │ └── memstore.rs
│ │ └── mod.rs
│ ├── key_storage
│ │ ├── tests
│ │ │ ├── mod.rs
│ │ │ └── memstore.rs
│ │ ├── jwk_gen_output.rs
│ │ ├── key_id.rs
│ │ └── jwk_storage_pqc.rs
│ ├── storage
│ │ └── tests
│ │ │ └── mod.rs
│ └── lib.rs
└── README.md
├── .license_template
├── identity_did
├── README.md
├── src
│ ├── lib.rs
│ └── error.rs
└── Cargo.toml
├── identity_document
├── README.md
├── src
│ ├── utils
│ │ └── mod.rs
│ ├── document
│ │ └── mod.rs
│ ├── verifiable
│ │ ├── mod.rs
│ │ └── jwp_verification_options.rs
│ ├── service
│ │ └── mod.rs
│ └── lib.rs
└── Cargo.toml
├── identity_ecdsa_verifier
├── README.md
├── src
│ ├── tests
│ │ └── mod.rs
│ └── lib.rs
└── Cargo.toml
├── identity_iota_core
├── src
│ ├── did
│ │ └── mod.rs
│ ├── did_resolution
│ │ └── mod.rs
│ ├── rebased
│ │ ├── assets
│ │ │ └── mod.rs
│ │ ├── client
│ │ │ └── mod.rs
│ │ ├── migration
│ │ │ └── mod.rs
│ │ ├── mod.rs
│ │ └── iota
│ │ │ ├── types
│ │ │ ├── mod.rs
│ │ │ └── number.rs
│ │ │ └── move_calls
│ │ │ └── mod.rs
│ ├── state_metadata
│ │ ├── mod.rs
│ │ ├── encoding.rs
│ │ └── version.rs
│ ├── document
│ │ ├── mod.rs
│ │ └── test_utils.rs
│ ├── iota_interaction_adapter.rs
│ └── lib.rs
├── tests
│ └── e2e
│ │ ├── main.rs
│ │ └── migration.rs
├── packages
│ └── iota_identity
│ │ ├── sources
│ │ ├── proposals
│ │ │ ├── delete.move
│ │ │ ├── upgrade.move
│ │ │ └── value.move
│ │ ├── public_vc.move
│ │ ├── utils.move
│ │ └── permissions.move
│ │ └── Move.toml
└── scripts
│ ├── publish_identity_package.sh
│ └── upgrade_identity_package.sh
├── identity_stronghold
├── README.md
└── src
│ ├── tests
│ └── mod.rs
│ └── lib.rs
├── identity_jose
├── README.md
└── src
│ ├── jws
│ ├── encoding
│ │ └── mod.rs
│ ├── custom_verification
│ │ └── mod.rs
│ ├── format.rs
│ ├── mod.rs
│ └── recipient.rs
│ ├── jose
│ ├── mod.rs
│ └── traits.rs
│ ├── jwu
│ └── mod.rs
│ ├── jwk
│ ├── conversion
│ │ ├── mod.rs
│ │ ├── secp256k1.rs
│ │ └── secp256r1.rs
│ ├── curve
│ │ ├── mod.rs
│ │ ├── ecx.rs
│ │ ├── ed.rs
│ │ └── ec.rs
│ ├── mod.rs
│ └── key_use.rs
│ ├── tests
│ ├── mod.rs
│ ├── rfc7638.rs
│ ├── fixtures
│ │ ├── rfc7638.rs
│ │ ├── rfc8037_ed25519.rs
│ │ └── rfc7797.rs
│ └── rfc7517.rs
│ ├── jwt
│ └── mod.rs
│ └── lib.rs
├── identity_resolver
├── README.md
└── src
│ ├── resolution
│ ├── tests
│ │ ├── mod.rs
│ │ └── send_sync.rs
│ └── mod.rs
│ └── lib.rs
├── rustfmt.toml
├── identity_pqc_verifier
├── src
│ └── lib.rs
├── README.md
└── Cargo.toml
├── identity_core
├── src
│ ├── convert
│ │ └── mod.rs
│ ├── lib.rs
│ └── common
│ │ ├── mod.rs
│ │ └── key_comparable.rs
└── tests
│ └── custom_time.rs
├── .cargo
└── audit.toml
├── dprint.json
├── .gitignore
└── examples
└── 0_basic
└── 0_create_did.rs
/bindings/wasm/identity_wasm/cypress/fixtures/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/plugins/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/support/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.license_template_ignore:
--------------------------------------------------------------------------------
1 | libjose/tests/fixtures/*.rs
2 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/.dockerignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | target
3 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | target/
2 | bindings/wasm/identity_wasm
3 | bindings/grpc/target/
4 |
--------------------------------------------------------------------------------
/bindings/wasm/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | target = "wasm32-unknown-unknown"
3 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/issuer-1.json:
--------------------------------------------------------------------------------
1 | "https://example.edu/issuers/14"
2 |
--------------------------------------------------------------------------------
/identity_verification/README.md:
--------------------------------------------------------------------------------
1 | Verification data types and functionality for use with `identity_document`.
--------------------------------------------------------------------------------
/.github/banner_identity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iotaledger/identity/HEAD/.github/banner_identity.png
--------------------------------------------------------------------------------
/rust-toolchain.toml:
--------------------------------------------------------------------------------
1 | [toolchain]
2 | channel = "stable"
3 | components = ["rustfmt"]
4 | profile = "minimal"
5 |
--------------------------------------------------------------------------------
/.github/releases/v0.3.0.md:
--------------------------------------------------------------------------------
1 | This release introduces the high-level `Account` API for creating and managing IOTA identities.
--------------------------------------------------------------------------------
/bindings/wasm/.license_template:
--------------------------------------------------------------------------------
1 | // Copyright {20\d{2}(-20\d{2})?} IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-3.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:abcdef1234567",
3 | "name": "Jane Doe"
4 | }
5 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/app/src/main.ts:
--------------------------------------------------------------------------------
1 | import { runTest } from "./identity.ts";
2 |
3 | globalThis.runTest = runTest;
4 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [target.wasm32-unknown-unknown]
2 | rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
3 |
--------------------------------------------------------------------------------
/.github/workflows/scripts/array.sh:
--------------------------------------------------------------------------------
1 | # joins an array with a delimiter
2 | joinBy() {
3 | local IFS="$1"; shift; echo "$*";
4 | }
5 |
6 | "$@"
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/status-1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "https://example.edu/status/24",
3 | "type": "CredentialStatusList2017"
4 | }
5 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-6.json:
--------------------------------------------------------------------------------
1 | {
2 | "degreeType": "BachelorDegree",
3 | "degreeSchool": "College of Engineering"
4 | }
5 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/tsconfig.typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.node.json",
3 | "include": [
4 | "node/**/*"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/issuer-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:76e12ec712ebc6f1c221ebfeb1f",
3 | "name": "Example University"
4 | }
5 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/refresh-1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "https://example.edu/refresh/3732",
3 | "type": "ManualRefreshService2018"
4 | }
5 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/schema-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "https://example.org/examples/degree.zkp",
3 | "type": "ZkpExampleSchema2018"
4 | }
5 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/schema-1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "https://example.org/examples/degree.json",
3 | "type": "JsonSchemaValidator2018"
4 | }
5 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-4.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:abcdef1234567",
3 | "name": "Jane Doe",
4 | "favoriteFood": "Papaya"
5 | }
6 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-8.json:
--------------------------------------------------------------------------------
1 | {
2 | "degree": {
3 | "type": "BachelorDegree",
4 | "name": "Bachelor of Science and Arts"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/identity_eddsa_verifier/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - EdDSA Verifier
2 | ===
3 |
4 | This crate implements a `JwsVerifier` capable of verifying EdDSA signatures.
5 |
6 |
--------------------------------------------------------------------------------
/identity_storage/src/key_id_storage/tests/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod memstore;
5 | mod utils;
6 |
--------------------------------------------------------------------------------
/.license_template:
--------------------------------------------------------------------------------
1 | {(\/\/ Copyright.*\n)*?}// {(Modifications )?}Copyright {(\(c\) )?}{20\d{2}(-20\d{2})?} IOTA Stiftung{(?:, .+)?}
2 | // SPDX-License-Identifier: Apache-2.0
3 |
--------------------------------------------------------------------------------
/identity_did/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - DID
2 | ===
3 |
4 | Types representing DIDs and DIDUrls as defined in the Decentralized Identifiers (DID) standard by the W3C.
5 |
6 |
--------------------------------------------------------------------------------
/identity_document/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - Document
2 | ===
3 |
4 | Method-agnostic implementation of DID Documents from the Decentralized Identifiers (DID) standard from W3C.
--------------------------------------------------------------------------------
/identity_ecdsa_verifier/README.md:
--------------------------------------------------------------------------------
1 | # ECDSA Verifier
2 |
3 | This crate implements a `JwsVerifier` capable of verifying EcDSA signatures with algorithms `ES256` and `ES256K`.
4 |
--------------------------------------------------------------------------------
/identity_iota_core/src/did/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub use iota_did::IotaDID;
5 |
6 | mod iota_did;
7 |
--------------------------------------------------------------------------------
/identity_stronghold/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - Stronghold
2 | ===
3 |
4 | This crate provides an implementation of `JwkStorage` and `KeyIdStorage` traits on top of `Stronghold`.
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/rust-toolchain.toml:
--------------------------------------------------------------------------------
1 | [toolchain]
2 | channel = "stable"
3 | components = ["rustfmt"]
4 | targets = ["wasm32-unknown-unknown"]
5 | profile = "minimal"
6 |
--------------------------------------------------------------------------------
/identity_ecdsa_verifier/src/tests/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung, Filancore GmbH
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod secp256;
5 | mod secp256k;
6 |
--------------------------------------------------------------------------------
/identity_jose/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - JOSE
2 | ===
3 |
4 | This crate provides a pluggable JSON Object Signing and Encryption (JOSE) implementation for use in IOTA Identity.
5 |
--------------------------------------------------------------------------------
/identity_jose/src/jws/encoding/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod encoder;
5 | mod utils;
6 |
7 | pub use encoder::*;
8 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "esModuleInterop": true,
5 | "module": "commonjs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/bindings/grpc/tooling/start-rpc-server.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | cd ..
3 |
4 | API_ENDPOINT=replace_me \
5 | STRONGHOLD_PWD=replace_me \
6 | SNAPSHOT_PATH=replace_me \
7 | cargo +nightly run --release
8 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/schema-3.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:cdf:35LB7w9ueWbagPL94T9bMLtyXDj9pX5o",
3 | "type": "did:example:schema:22KpkXgecryx9k7N6XN1QoN3gXwBkSU8SfyyYQG"
4 | }
5 |
--------------------------------------------------------------------------------
/identity_resolver/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - Resolver
2 | ===
3 |
4 | This crate provides a pluggable Resolver implementation that allows for abstracting over the resolution of different DID methods.
5 |
--------------------------------------------------------------------------------
/identity_resolver/src/resolution/tests/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use super::resolver::*;
5 | mod resolution;
6 | mod send_sync;
7 |
--------------------------------------------------------------------------------
/identity_storage/src/key_storage/tests/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod memstore;
5 |
6 | #[cfg(test)]
7 | pub(crate) mod utils;
8 |
--------------------------------------------------------------------------------
/bindings/grpc/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![allow(clippy::blocks_in_conditions)]
5 |
6 | pub mod server;
7 | pub mod services;
8 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/revocation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod bitmap;
5 |
6 | pub use self::bitmap::WasmRevocationBitmap;
7 |
--------------------------------------------------------------------------------
/identity_jose/src/jose/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Traits for JOSE headers.
5 |
6 | mod traits;
7 |
8 | pub use self::traits::*;
9 |
--------------------------------------------------------------------------------
/identity_iota_core/tests/e2e/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod asset;
5 | mod client;
6 | pub mod common;
7 | mod identity;
8 | mod migration;
9 |
--------------------------------------------------------------------------------
/identity_storage/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - Storage
2 | ===
3 |
4 | This crate provides high-level abstractions over key management systems for secure storage of cryptographic keys for use in IOTA Identity.
5 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/revocation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub mod status_list_2021;
5 | pub mod validity_timeframe_2024;
6 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/revocation/validity_timeframe_2024/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod status;
5 |
6 | pub use status::*;
7 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
3 | "degree": {
4 | "type": "BachelorDegree",
5 | "name": "Bachelor of Science and Arts"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/identity_iota_core/src/did_resolution/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub use did_resolution_handler::DidResolutionHandler;
5 |
6 | mod did_resolution_handler;
7 |
--------------------------------------------------------------------------------
/identity_jose/src/jws/custom_verification/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod error;
5 | mod jws_verifier;
6 | pub use error::*;
7 | pub use jws_verifier::*;
8 |
--------------------------------------------------------------------------------
/identity_stronghold/src/tests/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod test_bbs_ext;
5 | mod test_jwk_storage;
6 | mod test_key_id_storage;
7 | pub(crate) mod utils;
8 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-7.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "http://example.com/credentials/245",
3 | "currentStatus": "Disputed",
4 | "statusReason": {
5 | "value": "Address is out of date.",
6 | "lang": "en"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/identity_iota_core/src/rebased/assets/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod asset;
5 | mod public_available_vc;
6 |
7 | pub use asset::*;
8 | pub use public_available_vc::*;
9 |
--------------------------------------------------------------------------------
/rustfmt.toml:
--------------------------------------------------------------------------------
1 | comment_width = 120
2 | format_code_in_doc_comments = true
3 | max_width = 120
4 | normalize_comments = false
5 | normalize_doc_attributes = false
6 | tab_spaces = 2
7 | wrap_comments = true
8 | imports_granularity = "Item"
9 |
--------------------------------------------------------------------------------
/identity_credential/src/revocation/revocation_bitmap_2022/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod bitmap;
5 | mod document_ext;
6 |
7 | pub use bitmap::*;
8 | pub use document_ext::*;
9 |
--------------------------------------------------------------------------------
/identity_pqc_verifier/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione Links
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod oqs_verifier;
5 | mod pqc_verifier;
6 |
7 | pub use oqs_verifier::*;
8 | pub use pqc_verifier::*;
9 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Official IOTA Discord
4 | url: https://discord.iota.org/
5 | about: "Contact the maintainers by joining the #identity channel on the IOTA Discord."
6 |
--------------------------------------------------------------------------------
/bindings/grpc/rustfmt.toml:
--------------------------------------------------------------------------------
1 | comment_width = 120
2 | format_code_in_doc_comments = true
3 | max_width = 120
4 | normalize_comments = false
5 | normalize_doc_attributes = false
6 | tab_spaces = 2
7 | wrap_comments = true
8 | imports_granularity = "Item"
9 |
--------------------------------------------------------------------------------
/bindings/grpc/tooling/domain-linkage-test-server/.well-known/did-configuration.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://identity.foundation/.well-known/did-configuration/v1",
3 | "linked_dids": [
4 | "add your domain linkage credential here"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "paths": {
6 | "@iota/identity-wasm/*": [
7 | "./*"
8 | ]
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/identity_jose/src/jwu/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! JSON Web Utilities.
5 |
6 | mod base64;
7 | mod serde;
8 |
9 | pub use self::base64::*;
10 | pub(crate) use self::serde::*;
11 |
--------------------------------------------------------------------------------
/bindings/grpc/tooling/start-http-server.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | http-server ./domain-linkage-test-server &
3 | # replace or omint the --domain parameter if you don't have a static domain or don't want to use it
4 | ngrok http --domain=example-static-domain.ngrok-free.app 8080
--------------------------------------------------------------------------------
/identity_pqc_verifier/README.md:
--------------------------------------------------------------------------------
1 | IOTA Identity - PQC Verifier
2 | ===
3 |
4 | This crate implements a `JwsVerifier` capable of verifying Post-Quantum (PQ) signatures, based on [liboqs-rust](https://github.com/open-quantum-safe/liboqs-rust) signatures implementation.
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-5.json:
--------------------------------------------------------------------------------
1 | {
2 | "givenName": "Jane",
3 | "familyName": "Doe",
4 | "degree": {
5 | "type": "BachelorDegree",
6 | "name": "Bachelor of Science and Arts",
7 | "college": "College of Engineering"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/jose/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./composite_jwk";
2 | export * from "./ec_curve";
3 | export * from "./ed_curve";
4 | export * from "./jwk_operation";
5 | export * from "./jwk_type";
6 | export * from "./jwk_use";
7 | export * from "./jws_algorithm";
8 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/sd_jwt_vc/metadata/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod claim;
5 | mod issuer;
6 | mod vc_type;
7 |
8 | pub use claim::*;
9 | pub use issuer::*;
10 | pub use vc_type::*;
11 |
--------------------------------------------------------------------------------
/identity_iota_core/src/state_metadata/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod document;
5 | mod encoding;
6 | mod version;
7 |
8 | pub use document::*;
9 | pub use encoding::*;
10 | pub(crate) use version::*;
11 |
--------------------------------------------------------------------------------
/identity_jose/src/jwk/conversion/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod ed25519;
5 | mod from_jwk;
6 | mod secp256k1;
7 | mod secp256r1;
8 | mod to_jwk;
9 |
10 | pub use from_jwk::*;
11 | pub use to_jwk::*;
12 |
--------------------------------------------------------------------------------
/identity_jose/src/tests/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod ed25519;
5 | mod es256;
6 | mod hs256;
7 | mod rfc7515;
8 | mod rfc7517;
9 | mod rfc7638;
10 | mod rfc7797;
11 | mod rfc8037;
12 | mod roundtrip;
13 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/presentation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod presentation;
5 | mod presentation_builder;
6 |
7 | pub use self::presentation::*;
8 | pub use self::presentation_builder::*;
9 |
--------------------------------------------------------------------------------
/identity_storage/src/storage/tests/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod api;
5 | mod credential_jws;
6 | mod credential_validation;
7 | mod kb_jwt;
8 | mod presentation_validation;
9 | pub(crate) mod test_utils;
10 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/app/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | declare const IOTA_IDENTITY_PKG_ID: string;
3 | declare const NETWORK_NAME_FAUCET: string;
4 | declare const ENV_NETWORK_URL: string;
5 | declare const runTest: (example: string) => void;
6 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@iota/identity-wasm API documentation",
3 | "extends": [
4 | "../typedoc.json"
5 | ],
6 | "entryPoints": [
7 | "./node/"
8 | ],
9 | "tsconfig": "./tsconfig.typedoc.json",
10 | "out": "./docs/wasm"
11 | }
--------------------------------------------------------------------------------
/identity_jose/src/jwk/curve/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod bls;
5 | mod ec;
6 | mod ecx;
7 | mod ed;
8 |
9 | pub use self::bls::*;
10 | pub use self::ec::*;
11 | pub use self::ecx::*;
12 | pub use self::ed::*;
13 |
--------------------------------------------------------------------------------
/identity_jose/src/jwt/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! JSON Web Tokens ([JWT](https://tools.ietf.org/html/rfc7519))
5 |
6 | mod claims;
7 | mod header;
8 |
9 | pub use self::claims::*;
10 | pub use self::header::*;
11 |
--------------------------------------------------------------------------------
/identity_credential/src/validator/sd_jwt/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod error;
5 | mod kb_validation_options;
6 | mod validator;
7 |
8 | pub use error::*;
9 | pub use kb_validation_options::*;
10 | pub use validator::*;
11 |
--------------------------------------------------------------------------------
/identity_document/src/utils/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Functionality for Querying DID Urls.
5 | pub use did_url_query::DIDUrlQuery;
6 | pub use queryable::Queryable;
7 |
8 | mod did_url_query;
9 | mod queryable;
10 |
--------------------------------------------------------------------------------
/identity_iota_core/src/rebased/client/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod full_client;
5 | mod read_only;
6 |
7 | pub use full_client::*;
8 |
9 | pub use read_only::*;
10 |
11 | pub use iota_interaction::IotaKeySignature;
12 |
--------------------------------------------------------------------------------
/identity_eddsa_verifier/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #[cfg(feature = "ed25519")]
5 | mod ed25519_verifier;
6 | mod eddsa_verifier;
7 |
8 | #[cfg(feature = "ed25519")]
9 | pub use ed25519_verifier::*;
10 | pub use eddsa_verifier::*;
11 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/8_zkp.ts:
--------------------------------------------------------------------------------
1 | import { zkp } from "../1_advanced/8_zkp";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("zkp", async () => {
6 | await zkp();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/identity_iota_core/packages/iota_identity/sources/proposals/delete.move:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | module iota_identity::delete_proposal;
5 |
6 | public struct Delete has copy, drop, store {}
7 |
8 | public fun new(): Delete {
9 | Delete {}
10 | }
11 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/revocation/status_list_2021/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod credential;
5 | mod entry;
6 | mod status_list;
7 |
8 | pub use credential::*;
9 | pub use entry::*;
10 | pub use status_list::WasmStatusList2021;
11 |
--------------------------------------------------------------------------------
/identity_iota_core/packages/iota_identity/Move.toml:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024 IOTA Stiftung
2 | # SPDX-License-Identifier: Apache-2.0
3 |
4 | [package]
5 | name = "IotaIdentity"
6 | edition = "2024"
7 |
8 | [dependencies]
9 |
10 | [addresses]
11 | iota_identity = "0x0"
12 |
13 | [dev-dependencies]
14 |
15 | [dev-addresses]
16 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/6_sd_jwt.ts:
--------------------------------------------------------------------------------
1 | import { sdJwt } from "../1_advanced/6_sd_jwt";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Domain Linkage", async () => {
6 | await sdJwt();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/identity_stronghold/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub(crate) mod ed25519;
5 | mod storage;
6 | pub(crate) mod stronghold_key_type;
7 | #[cfg(test)]
8 | mod tests;
9 | pub(crate) mod utils;
10 |
11 | pub use storage::*;
12 | pub use stronghold_key_type::*;
13 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/5_create_vc.ts:
--------------------------------------------------------------------------------
1 | import { createVC } from "../0_basic/5_create_vc";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Create VC", async () => {
6 | await createVC();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/6_create_vp.ts:
--------------------------------------------------------------------------------
1 | import { createVP } from "../0_basic/6_create_vp";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Create VP", async () => {
6 | await createVP();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/7_revoke_vc.ts:
--------------------------------------------------------------------------------
1 | import { revokeVC } from "../0_basic/7_revoke_vc";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Revoke VC", async () => {
6 | await revokeVC();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/identity_credential/src/revocation/validity_timeframe_2024/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung, Fondazione Links
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Implementation of a new Revocation mechanism for ZK Verifiable Credentials.
5 |
6 | mod revocation_timeframe_status;
7 |
8 | pub use revocation_timeframe_status::*;
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/10_sd_jwt_vc.ts:
--------------------------------------------------------------------------------
1 | import { sdJwtVc } from "../1_advanced/10_sd_jwt_vc";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("SD-JWT VC", async () => {
6 | await sdJwtVc();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/evidence-1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "https://example.edu/evidence/f2aeec97-fc0d-42bf-8ca7-0548192d4231",
3 | "type": ["DocumentVerification"],
4 | "verifier": "https://example.edu/issuers/14",
5 | "evidenceDocument": "DriversLicense",
6 | "subjectPresence": "Physical",
7 | "documentPresence": "Physical"
8 | }
9 |
--------------------------------------------------------------------------------
/identity_iota_core/src/document/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub use iota_document::IotaDocument;
5 | pub use iota_document_metadata::IotaDocumentMetadata;
6 |
7 | mod iota_document;
8 | mod iota_document_metadata;
9 |
10 | #[cfg(test)]
11 | pub(crate) mod test_utils;
12 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/evidence-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "https://example.edu/evidence/f2aeec97-fc0d-42bf-8ca7-0548192dxyzab",
3 | "type": ["SupportingActivity"],
4 | "verifier": "https://example.edu/issuers/14",
5 | "evidenceDocument": "Fluid Dynamics Focus",
6 | "subjectPresence": "Digital",
7 | "documentPresence": "Digital"
8 | }
9 |
--------------------------------------------------------------------------------
/identity_credential/src/sd_jwt_vc/metadata/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod claim;
5 | mod display;
6 | mod integrity;
7 | mod issuer;
8 | mod vc_type;
9 |
10 | pub use claim::*;
11 | pub use display::*;
12 | pub use integrity::*;
13 | pub use issuer::*;
14 | pub use vc_type::*;
15 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/0_create_did.ts:
--------------------------------------------------------------------------------
1 | import { createIdentity } from "../0_basic/0_create_did";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Create Identity", async () => {
6 | await createIdentity();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/1_update_did.ts:
--------------------------------------------------------------------------------
1 | import { updateIdentity } from "../0_basic/1_update_did";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Update Identity", async () => {
6 | await updateIdentity();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/2_resolve_did.ts:
--------------------------------------------------------------------------------
1 | import { resolveIdentity } from "../0_basic/2_resolve_did";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Resolve Identity", async () => {
6 | await resolveIdentity();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/4_delete_did.ts:
--------------------------------------------------------------------------------
1 | import { deleteIdentityDID } from "../0_basic/4_delete_did";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Delete identity", async () => {
6 | await deleteIdentityDID();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/5_domain_linkage.ts:
--------------------------------------------------------------------------------
1 | import { domainLinkage } from "../1_advanced/5_domain_linkage";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Domain Linkage", async () => {
6 | await domainLinkage();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/9_zkp_revocation.ts:
--------------------------------------------------------------------------------
1 | import { zkp_revocation } from "../1_advanced/9_zkp_revocation";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("zkp_revocation", async () => {
6 | await zkp_revocation();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/jose/jwk_use.ts:
--------------------------------------------------------------------------------
1 | /** Supported algorithms for the JSON Web Key `use` property.
2 | *
3 | * [More Info](https://www.iana.org/assignments/jose/jose.xhtml#web-key-use) */
4 | export const enum JwkUse {
5 | /** Digital Signature or MAC. */
6 | Signature = "sig",
7 | /** Encryption. */
8 | Encryption = "enc",
9 | }
10 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/7_status_list_2021.ts:
--------------------------------------------------------------------------------
1 | import { statusList2021 } from "../1_advanced/7_status_list_2021";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("StatusList2021", async () => {
6 | await statusList2021();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/identity_core/src/convert/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2021 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Functionality for JSON conversion and Base de- and encoding.
5 |
6 | pub use self::json::FmtJson;
7 | pub use self::json::FromJson;
8 | pub use self::json::ToJson;
9 | pub use base_encoding::*;
10 |
11 | mod base_encoding;
12 | mod json;
13 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/3_deactivate_did.ts:
--------------------------------------------------------------------------------
1 | import { deactivateIdentity } from "../0_basic/3_deactivate_did";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Deactivate identity", async () => {
6 | await deactivateIdentity();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
3 | "alumniOf": {
4 | "id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
5 | "name": [{
6 | "value": "Example University",
7 | "lang": "en"
8 | }, {
9 | "value": "Exemple d'Université",
10 | "lang": "fr"
11 | }]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/.github/releases/v0.5.0-dev.1.md:
--------------------------------------------------------------------------------
1 | This release introduces multiple breaking changes to the structure of IOTA DID Documents and their Tangle messages, rendering any identity created with a prior version incompatible and unresolvable. A versioning system has been introduced so any new identities should hopefully be forward compatible with any future breaking changes to the message structure.
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/4_custom_resolution.ts:
--------------------------------------------------------------------------------
1 | import { customResolution } from "../1_advanced/4_custom_resolution";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("Custom Resolution", async () => {
6 | await customResolution();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/jose/ed_curve.ts:
--------------------------------------------------------------------------------
1 | /** Supported Elliptic Curves.
2 | *
3 | * [More Info](https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve) */
4 | export const enum EdCurve {
5 | /** Ed25519 signature algorithm key pairs. */
6 | Ed25519 = "Ed25519",
7 | /** Ed448 signature algorithm key pairs. */
8 | Ed448 = "Ed448",
9 | }
10 |
--------------------------------------------------------------------------------
/.github/releases/wasm-v0.5.0-dev.1.md:
--------------------------------------------------------------------------------
1 | This release introduces multiple breaking changes to the structure of IOTA DID Documents and their Tangle messages, rendering any identity created with a prior version incompatible and unresolvable. A versioning system has been introduced so any new identities should hopefully be forward compatible with any future breaking changes to the message structure.
--------------------------------------------------------------------------------
/identity_document/src/document/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Defines the core (implementation agnostic) DID Document type.
5 |
6 | #![allow(clippy::module_inception)]
7 |
8 | pub use self::builder::DocumentBuilder;
9 | pub use self::core_document::CoreDocument;
10 |
11 | mod builder;
12 | mod core_document;
13 |
--------------------------------------------------------------------------------
/identity_iota_core/src/rebased/migration/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod alias;
5 | mod controller_token;
6 | mod identity;
7 | mod multicontroller;
8 | mod registry;
9 |
10 | pub use alias::*;
11 | pub use controller_token::*;
12 | pub use identity::*;
13 | pub use multicontroller::*;
14 | pub use registry::*;
15 |
--------------------------------------------------------------------------------
/bindings/grpc/proto/health_check.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | syntax = "proto3";
5 | package health_check;
6 |
7 | message HealthCheckRequest {}
8 |
9 | message HealthCheckResponse {
10 | string status = 1;
11 | }
12 |
13 | service HealthCheck {
14 | rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
15 | }
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/sd_jwt/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoder;
5 | mod disclosure;
6 | mod encoder;
7 | mod key_binding_jwt_claims;
8 | mod wasm_sd_jwt;
9 |
10 | pub use decoder::*;
11 | pub use disclosure::*;
12 | pub use encoder::*;
13 | pub use key_binding_jwt_claims::*;
14 | pub use wasm_sd_jwt::*;
15 |
--------------------------------------------------------------------------------
/bindings/wasm/.gitignore:
--------------------------------------------------------------------------------
1 | # Rust
2 | target/
3 | Cargo.lock
4 |
5 | # npm / yarn
6 | node_modules/
7 |
8 | # Build artifacts
9 | web/
10 | node/
11 | pkg/
12 | **/dist/
13 |
14 | # cypress
15 | cypress/screenshots/
16 | cypress/videos/
17 |
18 | # files generated by cypress-parallel
19 | multi-reporter-config.json
20 | runner-results
21 | cypress/parallel-weights.json
22 |
23 | .DS_STORE
24 |
--------------------------------------------------------------------------------
/.github/actions/rust/sccache/stop-sccache/action.yml:
--------------------------------------------------------------------------------
1 | name: 'stop-sccache'
2 | description: 'Stop sccache.'
3 | inputs:
4 | os:
5 | description: 'OS of the runner, used for sccache installation and start.'
6 | required: true
7 | runs:
8 | using: "composite"
9 | steps:
10 |
11 | - name: Stop sccache
12 | shell: bash
13 | run: |
14 | sccache --stop-server || true
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/resolver/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod irl_resolver;
5 | mod resolver_config;
6 | mod resolver_types;
7 | mod wasm_did_resolution_handler;
8 | mod wasm_resolver;
9 |
10 | pub use irl_resolver::*;
11 | pub use resolver_types::*;
12 | pub use wasm_did_resolution_handler::WasmDidResolutionHandler;
13 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/sd_jwt_vc/sd_jwt_v2/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod builder;
5 | mod disclosure;
6 | mod hasher;
7 | mod kb_jwt;
8 | mod sd_jwt;
9 | mod signer;
10 |
11 | pub use builder::*;
12 | pub use disclosure::*;
13 | pub use hasher::*;
14 | pub use kb_jwt::*;
15 | pub use sd_jwt::*;
16 | pub use signer::*;
17 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/jose/ec_curve.ts:
--------------------------------------------------------------------------------
1 | /** Supported Elliptic Curves.
2 | *
3 | * [More Info](https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve) */
4 | export const enum EcCurve {
5 | /** P-256 Curve. */
6 | P256,
7 | /** P-384 Curve. */
8 | P384,
9 | /** P-521 Curve. */
10 | P521,
11 | /** SECG secp256k1 curve. */
12 | Secp256K1,
13 | }
14 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/jose/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione LINKS
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod compositejwk;
5 | mod decoded_jws;
6 | mod jwk;
7 | mod jws_header;
8 | mod jwu;
9 | mod types;
10 |
11 | pub use compositejwk::*;
12 | pub use decoded_jws::*;
13 | pub use jwk::*;
14 | pub use jws_header::*;
15 | pub use jwu::*;
16 | pub use types::*;
17 |
--------------------------------------------------------------------------------
/identity_document/src/verifiable/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Additional functionality for DID assisted digital signatures.
5 |
6 | pub use self::jwp_verification_options::JwpVerificationOptions;
7 | pub use self::jws_verification_options::JwsVerificationOptions;
8 |
9 | mod jwp_verification_options;
10 | mod jws_verification_options;
11 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/src/tests/12_iota_keytool_integration.ts:
--------------------------------------------------------------------------------
1 | import { iotaKeytoolIntegration } from "../1_advanced/12_iota_keytool_integration";
2 |
3 | // Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
4 | describe("Test node examples", function() {
5 | it("IOTA Keytool Integration", async () => {
6 | await iotaKeytoolIntegration();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/policy-1.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "IssuerPolicy",
3 | "id": "http://example.com/policies/credential/4",
4 | "profile": "http://example.com/profiles/credential",
5 | "prohibition": [{
6 | "assigner": "https://example.edu/issuers/14",
7 | "assignee": "AllVerifiers",
8 | "target": "http://example.edu/credentials/3732",
9 | "action": ["Archival"]
10 | }]
11 | }
12 |
--------------------------------------------------------------------------------
/.github/releases/v0.5.0-dev.3.md:
--------------------------------------------------------------------------------
1 | This release introduces a breaking change for diff updates created by versions `v0.5.0-dev.1` and `v0.5.0-dev.2` (previous diff updates from `<=v0.4.0` are already incompatible due to breaking changes to the document and message structure in `v0.5.0-dev.1`). To migrate, please publish an integration update containing all diff changes to prevent unexpected changes to resolved DID Documents.
2 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/sd_jwt_vc/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod builder;
5 | mod claims;
6 | pub mod metadata;
7 | mod presentation;
8 | mod resolver;
9 | pub mod sd_jwt_v2;
10 | mod status;
11 | mod token;
12 |
13 | pub use builder::*;
14 | pub use claims::*;
15 | pub use presentation::*;
16 | pub use status::*;
17 | pub use token::*;
18 |
--------------------------------------------------------------------------------
/.github/releases/wasm-v0.5.0-dev.3.md:
--------------------------------------------------------------------------------
1 | This release introduces a breaking change for diff updates created by versions `v0.5.0-dev.1` and `v0.5.0-dev.2` (previous diff updates from `<=v0.4.0` are already incompatible due to breaking changes to the document and message structure in `v0.5.0-dev.1`). To migrate, please publish an integration update containing all diff changes to prevent unexpected changes to resolved DID Documents.
2 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-9.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
3 | "image": "https://example.edu/images/58473",
4 | "alumniOf": {
5 | "id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
6 | "name": [{
7 | "value": "Example University",
8 | "lang": "en"
9 | }, {
10 | "value": "Exemple d'Université",
11 | "lang": "fr"
12 | }]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/identity_document/src/service/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Implements the DID Document Service specification.
5 | #![allow(clippy::module_inception)]
6 |
7 | mod builder;
8 | mod service;
9 | mod service_endpoint;
10 |
11 | pub use self::builder::ServiceBuilder;
12 | pub use self::service::Service;
13 | pub use self::service_endpoint::ServiceEndpoint;
14 |
--------------------------------------------------------------------------------
/identity_storage/src/key_id_storage/tests/memstore.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use crate::key_id_storage::memstore::KeyIdMemstore;
5 |
6 | use crate::key_id_storage::tests::utils::test_storage_operations;
7 |
8 | #[tokio::test]
9 | async fn test_memstore() {
10 | let memstore: KeyIdMemstore = KeyIdMemstore::new();
11 | test_storage_operations(memstore).await;
12 | }
13 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/common/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub use timestamp::*;
5 | pub use types::*;
6 | pub(crate) use utils::*;
7 |
8 | pub(crate) use self::imported_document_lock::ImportedDocumentLock;
9 | pub(crate) use self::imported_document_lock::ImportedDocumentReadGuard;
10 |
11 | mod imported_document_lock;
12 | mod timestamp;
13 | mod types;
14 | mod utils;
15 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/policy-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "HolderPolicy",
3 | "id": "http://example.com/policies/credential/6",
4 | "profile": "http://example.com/profiles/credential",
5 | "prohibition": [{
6 | "assigner": "did:example:ebfeb1f712ebc6f1c276e12ec21",
7 | "assignee": "https://wineonline.example.org/",
8 | "target": "http://example.edu/credentials/3732",
9 | "action": ["3rdPartyCorrelation"]
10 | }]
11 | }
12 |
--------------------------------------------------------------------------------
/identity_iota_core/packages/iota_identity/sources/proposals/upgrade.move:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | module iota_identity::upgrade_proposal;
5 |
6 | /// Proposal's action used to upgrade an `Identity` to the package's current version.
7 | public struct Upgrade has copy, drop, store {}
8 |
9 | /// Creates a new `Upgrade` action.
10 | public fun new(): Upgrade {
11 | Upgrade {}
12 | }
13 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/subject-10.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
3 | "image": "ipfs:/ipfs/QmXfrS3pHerg44zzK6QKQj6JDk8H6cMtQS7pdXbohwNQfK/image",
4 | "alumniOf": {
5 | "id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
6 | "name": [{
7 | "value": "Example University",
8 | "lang": "en"
9 | }, {
10 | "value": "Exemple d'Université",
11 | "lang": "fr"
12 | }]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/jose/composite_jwk.ts:
--------------------------------------------------------------------------------
1 | // Copyright 2024 Fondazione Links
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | export const enum CompositeAlgId {
5 | IdMldsa44Ed25519 = "id-MLDSA44-Ed25519",
6 |
7 | IdMldsa65Ed25519 = "id-MLDSA65-Ed25519",
8 | }
9 |
10 | export const enum CompositeAlgIdDomain {
11 | IdMldsa44Ed25519 = "060B6086480186FA6B5008013E",
12 |
13 | IdMldsa65Ed25519 = "060B6086480186FA6B50080147",
14 | }
15 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/examples/tsconfig.web.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2020",
4 | "outDir": "./dist/web",
5 | "baseUrl": "./",
6 | "lib": [
7 | "ES6",
8 | "dom"
9 | ],
10 | "esModuleInterop": true,
11 | "moduleResolution": "node",
12 | "paths": {
13 | "@iota/identity-wasm/node": [
14 | "../web"
15 | ]
16 | }
17 | },
18 | "exclude": [
19 | "tests"
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/.github/.github_changelog_generator:
--------------------------------------------------------------------------------
1 | issues=false
2 | pr-wo-labels=false
3 | author=false
4 | breaking-label=### Changed
5 | breaking-labels=Breaking change
6 | enhancement-label=### Added
7 | enhancement-labels=Added
8 | bugs-label=### Patch
9 | bug-labels=Patch
10 | deprecated-prefix=### Deprecated
11 | deprecated-labels=Deprecated
12 | removed-prefix=### Removed
13 | removed-labels=Removed
14 | exclude-labels=Documentation,No changelog
15 | include-labels=Rust
16 | verbose=true
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM cypress/browsers:latest
2 |
3 | ARG IOTA_IDENTITY_PKG_ID
4 |
5 | ENV IOTA_IDENTITY_PKG_ID=$IOTA_IDENTITY_PKG_ID
6 |
7 | ARG NETWORK_NAME_FAUCET
8 |
9 | ENV NETWORK_NAME_FAUCET=$NETWORK_NAME_FAUCET
10 |
11 | ARG NETWORK_URL
12 |
13 | ENV NETWORK_URL=$NETWORK_URL
14 |
15 | COPY ./ /e2e
16 |
17 | WORKDIR /e2e/identity_wasm
18 |
19 | RUN npm ci
20 |
21 | RUN npm run build:examples:web
22 |
23 | ENTRYPOINT [ "npm", "run" ]
--------------------------------------------------------------------------------
/bindings/grpc/build.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | fn main() -> Result<(), Box> {
5 | let proto_files = std::fs::read_dir("./proto")?
6 | .filter_map(|entry| entry.ok().map(|e| e.path()))
7 | .filter(|path| path.extension().and_then(|ext| ext.to_str()) == Some("proto"));
8 |
9 | for proto in proto_files {
10 | tonic_build::compile_protos(proto)?;
11 | }
12 |
13 | Ok(())
14 | }
15 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/rebased/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod controller;
5 | mod identity;
6 | mod proposals;
7 | mod wasm_identity_client;
8 | mod wasm_identity_client_read_only;
9 |
10 | pub use controller::*;
11 | pub use identity::*;
12 | pub use wasm_identity_client::*;
13 | pub use wasm_identity_client_read_only::*;
14 |
15 | pub type WasmIotaAddress = String;
16 | pub type WasmObjectID = String;
17 |
--------------------------------------------------------------------------------
/bindings/wasm/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": [
4 | "ES2020",
5 | "DOM"
6 | ],
7 | "target": "ES2022",
8 | "declaration": true,
9 | "sourceMap": true,
10 | "strict": true,
11 | "moduleResolution": "node",
12 | "noImplicitAny": true,
13 | "preserveConstEnums": true,
14 | "forceConsistentCasingInFileNames": true,
15 | "skipLibCheck": true
16 | },
17 | "exclude": [
18 | "node_modules"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/.github_changelog_generator:
--------------------------------------------------------------------------------
1 | issues=false
2 | pr-wo-labels=false
3 | author=false
4 | breaking-label=### Changed
5 | breaking-labels=Breaking change
6 | enhancement-label=### Added
7 | enhancement-labels=Added
8 | bugs-label=### Patch
9 | bug-labels=Patch
10 | deprecated-prefix=### Deprecated
11 | deprecated-labels=Deprecated
12 | removed-prefix=### Removed
13 | removed-labels=Removed
14 | exclude-labels=Documentation,No changelog
15 | include-labels=Wasm
16 | verbose=true
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vite-project",
3 | "private": true,
4 | "version": "0.0.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "tsc && vite build",
9 | "preview": "vite preview"
10 | },
11 | "devDependencies": {
12 | "typescript": "~5.7.2",
13 | "vite": "^6.2.0"
14 | },
15 | "dependencies": {
16 | "@iota/identity-wasm": "file:../..",
17 | "@iota/iota-sdk": "^1.0.0"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/jose/jwk_type.ts:
--------------------------------------------------------------------------------
1 | /** Supported types for the JSON Web Key `kty` property.
2 | *
3 | * [More Info](https://www.iana.org/assignments/jose/jose.xhtml#web-key-types) */
4 | export const enum JwkType {
5 | /** Elliptic Curve. */
6 | Ec = "EC",
7 | /** RSA. */
8 | Rsa = "RSA",
9 | /** Octet sequence. */
10 | Oct = "oct",
11 | /** Octet string key pairs. */
12 | Okp = "OKP",
13 | /** Algorithm key pair. */
14 | Akp = "AKP",
15 | }
16 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/jwt_presentation_validation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione LINKS
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoded_jwt_presentation;
5 | mod jwt_presentation_validator;
6 | mod jwt_presentation_validator_hybrid;
7 | mod options;
8 |
9 | pub use self::decoded_jwt_presentation::*;
10 | pub use self::jwt_presentation_validator::*;
11 | pub use self::jwt_presentation_validator_hybrid::*;
12 | pub use self::options::*;
13 |
--------------------------------------------------------------------------------
/identity_credential/src/validator/jpt_credential_validation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung, Fondazione Links
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoded_jpt_credential;
5 | mod jpt_credential_validation_options;
6 | mod jpt_credential_validator;
7 | mod jpt_credential_validator_utils;
8 |
9 | pub use decoded_jpt_credential::*;
10 | pub use jpt_credential_validation_options::*;
11 | pub use jpt_credential_validator::*;
12 | pub use jpt_credential_validator_utils::*;
13 |
--------------------------------------------------------------------------------
/identity_resolver/src/resolution/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod commands;
5 | mod resolver;
6 | #[cfg(test)]
7 | mod tests;
8 |
9 | use self::commands::SingleThreadedCommand;
10 | use identity_document::document::CoreDocument;
11 |
12 | pub use resolver::Resolver;
13 | /// Alias for a [`Resolver`] that is not [`Send`] + [`Sync`].
14 | pub type SingleThreadedResolver = Resolver>;
15 |
--------------------------------------------------------------------------------
/.github/workflows/scripts/updateVersion.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # takes a string and increments the last number
4 | # e.g. $(updateVersion 1.1.0) -> 1.1.1
5 | # e.g. $(updateVersion 1.1.0-dev.1) -> 1.1.0-dev.2
6 |
7 | [[ ${1} =~ ^(.*[^0-9])?([0-9]+)$ ]] && \
8 | [[ ${#BASH_REMATCH[1]} -gt 0 ]] && \
9 | printf "%s%0${#BASH_REMATCH[2]}d" "${BASH_REMATCH[1]}" "$((10#${BASH_REMATCH[2]} + 1 ))" || \
10 | printf "%0${#BASH_REMATCH[2]}d" "$((10#${BASH_REMATCH[2]} + 1))" || \
11 | printf "${1}"
12 |
--------------------------------------------------------------------------------
/identity_credential/src/validator/jpt_presentation_validation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung, Fondazione Links
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoded_jpt_presentation;
5 | mod jpt_presentation_validation_options;
6 | mod jpt_presentation_validator;
7 | mod jpt_presentation_validator_utils;
8 |
9 | pub use decoded_jpt_presentation::*;
10 | pub use jpt_presentation_validation_options::*;
11 | pub use jpt_presentation_validator::*;
12 | pub use jpt_presentation_validator_utils::*;
13 |
--------------------------------------------------------------------------------
/bindings/grpc/tests/api/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #[cfg(test)]
5 | mod credential_revocation_check;
6 | #[cfg(test)]
7 | mod credential_validation;
8 | #[cfg(test)]
9 | mod did_document_creation;
10 | #[cfg(test)]
11 | mod domain_linkage;
12 | #[cfg(test)]
13 | mod health_check;
14 | #[cfg(test)]
15 | mod helpers;
16 | #[cfg(test)]
17 | mod jwt;
18 | #[cfg(test)]
19 | mod sd_jwt_validation;
20 | #[cfg(test)]
21 | mod status_list_2021;
22 | mod utils;
23 |
--------------------------------------------------------------------------------
/identity_credential/src/revocation/status_list_2021/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Implementation of [StatusList2021](https://www.w3.org/TR/2023/WD-vc-status-list-20230427/).
5 |
6 | /// Implementation of [StatusList2021Credential](https://www.w3.org/TR/2023/WD-vc-status-list-20230427/#statuslist2021credential).
7 | mod credential;
8 | mod entry;
9 | mod status_list;
10 |
11 | pub use credential::*;
12 | pub use entry::*;
13 | pub use status_list::*;
14 |
--------------------------------------------------------------------------------
/.cargo/audit.toml:
--------------------------------------------------------------------------------
1 | [advisories]
2 | ignore = [
3 | "RUSTSEC-2024-0437", # protobuf uncontrolled recursion https://github.com/iotaledger/iota/issues/5861
4 | "RUSTSEC-2021-0127", # serde_cbor is unmaintained https://github.com/iotaledger/identity/issues/518
5 | "RUSTSEC-2023-0052", # temporary ignore until fix is provided
6 | "RUSTSEC-2023-0065", # temporary ignore until fix is provided
7 | "RUSTSEC-2023-0071", # temporary ignore until fix is provided
8 | "RUSTSEC-2024-0437", # temporary ignore until fix is provided
9 | ]
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation-task.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation Task
3 | about: Add a documentation task (Only use when agreed upon by maintainers)
4 | title: "[Doc] "
5 | labels: documentation
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Description
11 | Describe the documentation task.
12 |
13 | ## Reference material
14 | Links resources such as RFCs, specifications, and other documentation.
15 |
16 | ## To-do List
17 | Create a task-specific to-do list
18 |
19 | - [ ] Item one
20 | - [ ] Item two
21 | - [ ] Item three
22 |
--------------------------------------------------------------------------------
/identity_iota_core/packages/iota_identity/sources/public_vc.move:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | module iota_identity::public_vc;
5 |
6 | public struct PublicVc has store {
7 | data: vector,
8 | }
9 |
10 | public fun new(data: vector): PublicVc {
11 | PublicVc { data }
12 | }
13 |
14 | public fun data(self: &PublicVc): &vector {
15 | &self.data
16 | }
17 |
18 | public fun set_data(self: &mut PublicVc, data: vector) {
19 | self.data = data
20 | }
21 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/app/src/identity.ts:
--------------------------------------------------------------------------------
1 | import url from "@iota/identity-wasm/web/identity_wasm_bg.wasm?url";
2 |
3 | import { init } from "@iota/identity-wasm/web";
4 | import { main } from "../../../examples/dist/web/web-main";
5 |
6 | export const runTest = async (example: string) => {
7 | try {
8 | await main(example);
9 | console.log("success");
10 | } catch (error) {
11 | throw (error);
12 | }
13 | };
14 |
15 | init(url)
16 | .then(() => {
17 | console.log("init");
18 | });
19 |
--------------------------------------------------------------------------------
/.github/releases/v0.5.0-dev.5.md:
--------------------------------------------------------------------------------
1 | This release introduces a breaking change to the proof field of DID Documents created by versions `v0.5.0-dev.1` through `v0.5.0-dev.4`, making all prior documents incompatible. The main feature of this release is the introduction of WebAssembly (Wasm) bindings for the high-level `Account` API for Javascript/Typescript in both Node.js and the browser. This includes Stronghold storage support but only for Node.js, as it was determined that compiling Stronghold to Wasm for private key storage in the browser would not be sufficiently secure.
2 |
--------------------------------------------------------------------------------
/identity_credential/src/domain_linkage/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Implementation of [Domain Linkage](https://identity.foundation/.well-known/resources/did-configuration/).
5 |
6 | mod domain_linkage_configuration;
7 | mod domain_linkage_credential_builder;
8 | mod domain_linkage_validator;
9 | mod error;
10 |
11 | pub use self::domain_linkage_configuration::*;
12 | pub use self::domain_linkage_credential_builder::*;
13 | pub use self::domain_linkage_validator::*;
14 | pub use error::*;
15 |
--------------------------------------------------------------------------------
/.github/releases/wasm-v0.5.0-dev.5.md:
--------------------------------------------------------------------------------
1 | This release introduces a breaking change to the proof field of DID Documents created by versions `v0.5.0-dev.1` through `v0.5.0-dev.4`, making all prior documents incompatible. The main feature of this release is the introduction of WebAssembly (Wasm) bindings for the high-level `Account` API for Javascript/Typescript in both Node.js and the browser. This includes Stronghold storage support but only for Node.js, as it was determined that compiling Stronghold to Wasm for private key storage in the browser would not be sufficiently secure.
2 |
--------------------------------------------------------------------------------
/identity_pqc_verifier/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "identity_pqc_verifier"
3 | version = "1.8.0-beta.1"
4 | authors.workspace = true
5 | edition.workspace = true
6 | homepage.workspace = true
7 | keywords = ["iota", "identity", "jose", "jwk", "jws"]
8 | license.workspace = true
9 | readme = "./README.md"
10 | repository.workspace = true
11 |
12 | description = "JWS PQC signature verification for IOTA Identity"
13 |
14 | [dependencies]
15 | identity_jose = { version = "=1.8.0-beta.1", path = "../identity_jose", default-features = true }
16 | oqs.workspace = true
17 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/sd_jwt_vc/status.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use wasm_bindgen::prelude::wasm_bindgen;
5 |
6 | #[wasm_bindgen(typescript_custom_section)]
7 | const I_SD_JWT_VC_STATUS: &str = r#"
8 | interface SdJwtVcStatusListRef {
9 | uri: string;
10 | idx: number;
11 | }
12 |
13 | type SdJwtVcStatus = { status_list: SdJwtVcStatusListRef } | unknown;
14 | "#;
15 |
16 | #[wasm_bindgen]
17 | extern "C" {
18 | #[wasm_bindgen(js_name = "SdJwtVcStatus")]
19 | pub type WasmStatus;
20 | }
21 |
--------------------------------------------------------------------------------
/dprint.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://dprint.dev/schemas/v0.json",
3 | "incremental": true,
4 | "typescript": {
5 | "indentWidth": 4,
6 | "arrayExpression.preferHanging": true
7 | },
8 | "toml": {},
9 | "includes": [
10 | "**/*.{toml,js,ts}"
11 | ],
12 | "excludes": [
13 | "documentation",
14 | "**/{node_modules,target}",
15 | "bindings/wasm/identity_wasm/{node,web}/**/*.{js,ts}"
16 | ],
17 | "plugins": [
18 | "https://plugins.dprint.dev/toml-0.5.1.wasm",
19 | "https://plugins.dprint.dev/typescript-0.73.1.wasm"
20 | ]
21 | }
--------------------------------------------------------------------------------
/.github/releases/v1.0.0-rc.1.md:
--------------------------------------------------------------------------------
1 | This version introduces a new DID method targeting the IOTA UTXO ledger. This method works fundamentally differently from the previous method and introduces new capabilities to interact with Layer 1 assets like Native Tokens, NFTs and various Output types.
2 | \n
3 | This version changes the credential and presentation format to JWT, as specified by the [VC Data Model v1.1](https://www.w3.org/TR/vc-data-model/#json-web-token).
4 | \n\n
5 | Note: Identities and credentials created with the earlier versions cannot be resolved with this version of the library.
6 | \n\n
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.node.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "paths": {
6 | "~identity_wasm": [
7 | "../node/identity_wasm",
8 | "./identity_wasm.js"
9 | ],
10 | "@iota/iota-interaction-ts/*": [
11 | "../node_modules/@iota/iota-interaction-ts/node/*",
12 | "@iota/iota-interaction-ts/node/"
13 | ],
14 | "../lib": [
15 | "."
16 | ]
17 | },
18 | "outDir": "../node",
19 | "declarationDir": "../node"
20 | }
21 | }
--------------------------------------------------------------------------------
/identity_jose/src/tests/rfc7638.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use crate::jwk::Jwk;
5 |
6 | #[test]
7 | fn test_rfc7638() {
8 | struct TestVector {
9 | jwk_json: &'static str,
10 | thumbprint_b64: &'static str,
11 | }
12 |
13 | static TVS: &[TestVector] = &include!("fixtures/rfc7638.rs");
14 |
15 | for tv in TVS {
16 | let key: Jwk = serde_json::from_str(tv.jwk_json).unwrap();
17 | let kid: String = key.thumbprint_sha256_b64();
18 |
19 | assert_eq!(kid, tv.thumbprint_b64);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/.github/releases/wasm-v1.0.0-rc.1.md:
--------------------------------------------------------------------------------
1 | This version introduces a new DID method targeting the IOTA UTXO ledger. This method works fundamentally differently from the previous method and introduces new capabilities to interact with Layer 1 assets like Native Tokens, NFTs and various Output types.
2 | \n
3 | This version changes the credential and presentation format to JWT, as specified by the [VC Data Model v1.1](https://www.w3.org/TR/vc-data-model/#json-web-token).
4 | \n\n
5 | Note: Identities and credentials created with the earlier versions cannot be resolved with this version of the library.
6 | \n\n
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/jpt_presentiation_validation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoded_jpt_presentation;
5 | mod jpt_presentation_validation_options;
6 | mod jpt_presentation_validator;
7 | mod jpt_presentation_validator_utils;
8 | mod jwp_presentation_options;
9 |
10 | pub use decoded_jpt_presentation::*;
11 | pub use jpt_presentation_validation_options::*;
12 | pub use jpt_presentation_validator::*;
13 | pub use jpt_presentation_validator_utils::*;
14 | pub use jwp_presentation_options::*;
15 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/iota/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione LINKS
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub use iota_did::WasmIotaDID;
5 | pub(crate) use iota_document::IotaDocumentLock;
6 | pub use iota_document::PromiseIotaDocument;
7 | pub use iota_document::WasmIotaDocument;
8 | pub use iota_document_metadata::WasmIotaDocumentMetadata;
9 | pub use iota_metadata_encoding::WasmStateMetadataEncoding;
10 |
11 | mod iota_did;
12 | mod iota_document;
13 | mod iota_document_ext;
14 | mod iota_document_metadata;
15 | mod iota_metadata_encoding;
16 |
--------------------------------------------------------------------------------
/identity_iota_core/tests/e2e/migration.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use crate::common::get_funded_test_client;
5 | use identity_iota_core::rebased::migration;
6 | use iota_sdk::types::base_types::ObjectID;
7 |
8 | #[tokio::test]
9 | async fn migration_registry_is_found() -> anyhow::Result<()> {
10 | let client = get_funded_test_client().await?;
11 | let random_alias_id = ObjectID::random();
12 |
13 | let doc = migration::lookup(&client, random_alias_id).await?;
14 | assert!(doc.is_none());
15 |
16 | Ok(())
17 | }
18 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Lines starting with '#' are comments.
2 | # Each line is a file pattern followed by one or more owners.
3 |
4 | # More details are here: https://help.github.com/articles/about-codeowners/
5 |
6 | # The '*' pattern is global owners.
7 |
8 | # Order is important. The last matching pattern has the most precedence.
9 | # The folders are ordered as follows:
10 |
11 | # In each subsection folders are ordered first by depth, then alphabetically.
12 | # This should make it easy to add new rules without breaking existing ones.
13 |
14 | # Global rule:
15 | * @iotaledger/identity
--------------------------------------------------------------------------------
/bindings/grpc/proto/utils.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | syntax = "proto3";
5 | package utils;
6 |
7 | message DataSigningRequest {
8 | // Raw data that will be signed.
9 | bytes data = 1;
10 | // Signing key's ID.
11 | string key_id = 2;
12 | }
13 |
14 | message DataSigningResponse {
15 | // Raw data signature.
16 | bytes signature = 1;
17 | }
18 |
19 | // Service that handles signing operations on raw data.
20 | service Signing {
21 | rpc sign(DataSigningRequest) returns (DataSigningResponse);
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/tsconfig.web.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "paths": {
6 | "~identity_wasm": [
7 | "../web/identity_wasm",
8 | "./identity_wasm.js"
9 | ],
10 | "@iota/iota-interaction-ts/*": [
11 | "../node_modules/@iota/iota-interaction-ts/web/*",
12 | "@iota/iota-interaction-ts/web/"
13 | ],
14 | "../lib": [
15 | "."
16 | ]
17 | },
18 | "outDir": "../web",
19 | "declarationDir": "../web",
20 | "module": "ES2022"
21 | }
22 | }
--------------------------------------------------------------------------------
/identity_core/tests/custom_time.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use identity_core::common::Timestamp;
5 | use identity_core::register_custom_now_utc;
6 |
7 | const STATIC_TIME: i64 = 1724402964; // 2024-08-23T11:33:30+00:00
8 | pub fn static_now_utc() -> Timestamp {
9 | Timestamp::from_unix(STATIC_TIME).unwrap()
10 | }
11 |
12 | register_custom_now_utc!(static_now_utc);
13 |
14 | #[test]
15 | fn should_use_registered_static_time() {
16 | let timestamp = Timestamp::now_utc();
17 | assert_eq!(timestamp.to_unix(), STATIC_TIME)
18 | }
19 |
--------------------------------------------------------------------------------
/.github/releases/v0.7.0-alpha.1.md:
--------------------------------------------------------------------------------
1 | This version introduces a new DID method targeting the IOTA UTXO ledger. This method works fundamentally differently from the previous method and introduces new capabilities to interact with Layer 1 entities like native tokens, NFTs and smart contracts.
2 | \n\n
3 | This is an early alpha release, so there may be breaking changes in upcoming versions that invalidate DIDs created with this version. The method at this point is only intended for experimentation.
4 | \n\n
5 | Note: Identities created with the earlier versions cannot be resolved with this version of the library.
6 | \n\n
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/jpt/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod encoding;
5 | mod issuer_protected_header;
6 | mod jpt_claims;
7 | mod jwp_issued;
8 | mod jwp_presentation_builder;
9 | mod payload;
10 | mod presentation_protected_header;
11 | mod proof_algorithm;
12 |
13 | pub use encoding::*;
14 | pub use issuer_protected_header::*;
15 | pub use jpt_claims::*;
16 | pub use jwp_issued::*;
17 | pub use jwp_presentation_builder::*;
18 | pub use payload::*;
19 | pub use presentation_protected_header::*;
20 | pub use proof_algorithm::*;
21 |
--------------------------------------------------------------------------------
/.github/releases/wasm-v0.7.0-alpha.1.md:
--------------------------------------------------------------------------------
1 | This version introduces a new DID method targeting the IOTA UTXO ledger. This method works fundamentally differently from the previous method and introduces new capabilities to interact with Layer 1 entities like native tokens, NFTs and smart contracts.
2 | \n\n
3 | This is an early alpha release, so there may be breaking changes in upcoming versions that invalidate DIDs created with this version. The method at this point is only intended for experimentation.
4 | \n\n
5 | Note: Identities created with the earlier versions cannot be resolved with this version of the library.
6 | \n\n
--------------------------------------------------------------------------------
/.github/workflows/enforce-pr-labels.yml:
--------------------------------------------------------------------------------
1 | name: Enforce PR labels
2 |
3 | on:
4 | pull_request:
5 | types: [labeled, unlabeled, opened, reopened, edited, synchronize]
6 | jobs:
7 | enforce-label:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024
11 | with:
12 | REQUIRED_LABELS_ANY: "Rust,Wasm,Documentation,No changelog"
13 | - uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024
14 | with:
15 | REQUIRED_LABELS_ANY: "Breaking change,Added,Patch,Deprecated,Removed,Documentation,No changelog"
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/jpt_credential_validator/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoded_jpt_credential;
5 | mod jpt_credential_validation_options;
6 | mod jpt_credential_validator;
7 | mod jpt_credential_validator_utils;
8 | mod jwp_credential_options;
9 | mod jwp_verification_options;
10 |
11 | pub use decoded_jpt_credential::*;
12 | pub use jpt_credential_validation_options::*;
13 | pub use jpt_credential_validator::*;
14 | pub use jpt_credential_validator_utils::*;
15 | pub use jwp_credential_options::*;
16 | pub use jwp_verification_options::*;
17 |
--------------------------------------------------------------------------------
/identity_iota_core/src/iota_interaction_adapter.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | // The following platform compile switch provides all the
5 | // ...Adapter types from iota_interaction_rust or iota_interaction_ts
6 | // like IotaClientAdapter, AssetMoveCallsAdapter, IdentityMoveCallsAdapter,
7 | // TransactionBuilderAdapter, MigrationMoveCallsAdapter, ... and so on
8 |
9 | cfg_if::cfg_if! {
10 | if #[cfg(target_arch = "wasm32")] {
11 | pub(crate) use iota_interaction_ts::*;
12 | } else {
13 | pub(crate) use iota_interaction_rust::*;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/credential-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://www.w3.org/2018/credentials/v1",
4 | "https://www.w3.org/2018/credentials/examples/v1"
5 | ],
6 | "id": "http://example.edu/credentials/3732",
7 | "type": ["VerifiableCredential", "UniversityDegreeCredential"],
8 | "issuer": "https://example.edu/issuers/14",
9 | "issuanceDate": "2010-01-01T19:23:24Z",
10 | "credentialSubject": {
11 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
12 | "degree": {
13 | "type": "BachelorDegree",
14 | "name": "Bachelor of Science in Mechanical Engineering"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/credential-3.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://www.w3.org/2018/credentials/v1",
4 | "https://www.w3.org/2018/credentials/examples/v1"
5 | ],
6 | "id": "http://example.edu/credentials/3732",
7 | "type": ["VerifiableCredential", "UniversityDegreeCredential"],
8 | "issuer": "https://example.edu/issuers/14",
9 | "issuanceDate": "2010-01-01T19:23:24Z",
10 | "credentialSubject": {
11 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
12 | "degree": {
13 | "type": "BachelorDegree",
14 | "name": "Bachelor of Science in Mechanical Engineering"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/credential-4.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://www.w3.org/2018/credentials/v1",
4 | "https://www.w3.org/2018/credentials/examples/v1"
5 | ],
6 | "id": "http://example.edu/credentials/3732",
7 | "type": ["VerifiableCredential", "UniversityDegreeCredential"],
8 | "issuer": "https://example.edu/issuers/14",
9 | "issuanceDate": "2010-01-01T19:23:24Z",
10 | "credentialSubject": {
11 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
12 | "degree": {
13 | "type": "BachelorDegree",
14 | "name": "Bachelor of Science in Mechanical Engineering"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/identity_resolver/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![forbid(unsafe_code)]
5 | #![doc = include_str!("./../README.md")]
6 | #![warn(
7 | rust_2018_idioms,
8 | unreachable_pub,
9 | missing_docs,
10 | rustdoc::missing_crate_level_docs,
11 | rustdoc::broken_intra_doc_links,
12 | rustdoc::private_intra_doc_links,
13 | rustdoc::private_doc_tests,
14 | clippy::missing_safety_doc
15 | )]
16 |
17 | mod error;
18 | mod resolution;
19 |
20 | pub use self::error::Error;
21 | pub use self::error::ErrorCause;
22 | pub use self::error::Result;
23 | pub use resolution::*;
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Request a feature for IOTA Identity
4 | title: "[Request]"
5 | labels: Request
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Description
11 | Briefly describe the feature that you are requesting.
12 |
13 | ## Motivation
14 | Explain why this feature is needed.
15 |
16 | ## Requirements
17 | Write a list of what you want this feature to do.
18 |
19 | 1.
20 | 2.
21 | 3.
22 |
23 | ## Open questions (optional)
24 | Use this section to ask any questions that are related to the feature.
25 |
26 | ## Are you planning to do it yourself in a pull request?
27 |
28 | Yes/No
29 |
--------------------------------------------------------------------------------
/bindings/grpc/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rust:bookworm as builder
2 |
3 | # install protobuf
4 | RUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev musl-tools
5 |
6 | COPY . /usr/src/app/
7 | WORKDIR /usr/src/app/bindings/grpc
8 | RUN rustup target add x86_64-unknown-linux-musl
9 | RUN cargo build --target x86_64-unknown-linux-musl --release --bin identity-grpc
10 |
11 | FROM gcr.io/distroless/static-debian11 as runner
12 |
13 | # get binary
14 | COPY --from=builder /usr/src/app/bindings/grpc/target/x86_64-unknown-linux-musl/release/identity-grpc /
15 |
16 | # set run env
17 | EXPOSE 50051
18 |
19 | # run it
20 | CMD ["/identity-grpc"]
--------------------------------------------------------------------------------
/identity_storage/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![forbid(unsafe_code)]
5 | #![doc = include_str!("./../README.md")]
6 | #![warn(
7 | rust_2018_idioms,
8 | unreachable_pub,
9 | missing_docs,
10 | rustdoc::missing_crate_level_docs,
11 | rustdoc::broken_intra_doc_links,
12 | rustdoc::private_intra_doc_links,
13 | rustdoc::private_doc_tests,
14 | clippy::missing_safety_doc
15 | )]
16 |
17 | pub mod key_id_storage;
18 | pub mod key_storage;
19 | pub mod storage;
20 |
21 | pub use key_id_storage::*;
22 | pub use key_storage::public_modules::*;
23 | pub use storage::*;
24 |
--------------------------------------------------------------------------------
/bindings/grpc/src/services/credential/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | pub mod jwt;
5 | pub mod revocation;
6 | pub mod validation;
7 |
8 | use identity_stronghold::StrongholdStorage;
9 | use identity_iota::iota::rebased::client::IdentityClientReadOnly;
10 | use tonic::service::RoutesBuilder;
11 |
12 | pub fn init_services(routes: &mut RoutesBuilder, client: &IdentityClientReadOnly, stronghold: &StrongholdStorage) {
13 | routes.add_service(revocation::service(client));
14 | routes.add_service(jwt::service(client, stronghold));
15 | routes.add_service(validation::service(client));
16 | }
17 |
--------------------------------------------------------------------------------
/identity_jose/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![forbid(unsafe_code)]
5 | #![doc = include_str!("./../README.md")]
6 | #![allow(clippy::upper_case_acronyms)]
7 | #![warn(
8 | rust_2018_idioms,
9 | unreachable_pub,
10 | missing_docs,
11 | rustdoc::missing_crate_level_docs,
12 | rustdoc::broken_intra_doc_links,
13 | rustdoc::private_intra_doc_links,
14 | rustdoc::private_doc_tests,
15 | clippy::missing_safety_doc
16 | )]
17 |
18 | pub mod error;
19 | pub mod jose;
20 | pub mod jwk;
21 | pub mod jws;
22 | pub mod jwt;
23 | pub mod jwu;
24 |
25 | #[cfg(test)]
26 | mod tests;
27 |
--------------------------------------------------------------------------------
/identity_iota_core/packages/iota_identity/sources/utils.move:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | module iota_identity::utils;
5 |
6 | use iota::vec_map::{Self, VecMap};
7 |
8 | public fun vec_map_from_keys_values(
9 | keys: vector,
10 | values: vector,
11 | ): VecMap {
12 | vec_map::from_keys_values(keys, values)
13 | }
14 |
15 | #[test]
16 | fun from_keys_values_works() {
17 | let addresses = vector[@0x1, @0x2];
18 | let vps = vector[1, 1];
19 |
20 | let map = vec_map_from_keys_values(addresses, vps);
21 | assert!(map.size() == 2, 0);
22 | }
23 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/sd_jwt_vc/claims.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use wasm_bindgen::prelude::wasm_bindgen;
5 |
6 | #[wasm_bindgen(typescript_custom_section)]
7 | const I_SD_JWT_VC_CLAIMS: &str = r#"
8 | interface ISdJwtVcClaims {
9 | iss: string;
10 | vct: string;
11 | status: SdJwtVcStatus;
12 | nbf?: string;
13 | exp?: string;
14 | iat?: string;
15 | sub?: string;
16 | }
17 |
18 | type SdJwtVcClaims = ISdJwtVcClaims & SdJwtClaims;
19 | "#;
20 |
21 | #[wasm_bindgen]
22 | extern "C" {
23 | #[wasm_bindgen(typescript_type = "SdJwtVcClaims")]
24 | pub type WasmSdJwtVcClaims;
25 | }
26 |
--------------------------------------------------------------------------------
/identity_credential/src/revocation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Contains the implementations for all the credential revocation methods that can be used with IOTA's Identity
5 | //! framework.
6 |
7 | mod error;
8 | mod revocation_bitmap_2022;
9 | #[cfg(feature = "status-list-2021")]
10 | pub mod status_list_2021;
11 |
12 | #[cfg(feature = "jpt-bbs-plus")]
13 | pub mod validity_timeframe_2024;
14 |
15 | pub use self::error::RevocationError;
16 | pub use self::error::RevocationResult;
17 | pub use revocation_bitmap_2022::*;
18 | #[cfg(feature = "jpt-bbs-plus")]
19 | pub use validity_timeframe_2024::*;
20 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/jose/jwu.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use crate::error::Result;
5 | use crate::error::WasmResult;
6 | use identity_iota::verification::jose::jwu;
7 | use wasm_bindgen::prelude::*;
8 |
9 | /// Encode the given bytes in url-safe base64.
10 | #[wasm_bindgen(js_name = encodeB64)]
11 | pub fn encode_b64(data: &[u8]) -> String {
12 | jwu::encode_b64(data)
13 | }
14 |
15 | /// Decode the given url-safe base64-encoded slice into its raw bytes.
16 | #[wasm_bindgen(js_name = decodeB64)]
17 | pub fn decode_b64(data: &[u8]) -> Result> {
18 | jwu::decode_b64(data).wasm_result()
19 | }
20 |
--------------------------------------------------------------------------------
/identity_iota_core/src/rebased/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | /// Module for handling assets.
5 | pub mod assets;
6 | /// Module for handling client operations.
7 | pub mod client;
8 | mod error;
9 | mod iota;
10 | /// Module for handling migration operations.
11 | pub mod migration;
12 | /// Contains the operations of proposals.
13 | pub mod proposals;
14 | /// Contains utility functions.
15 | #[cfg(not(target_arch = "wasm32"))]
16 | pub mod utils;
17 |
18 | pub use assets::*;
19 | pub use error::*;
20 |
21 | /// Integration with IOTA's Keytool.
22 | #[cfg(feature = "keytool")]
23 | pub use iota_interaction::keytool;
24 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/index.ts:
--------------------------------------------------------------------------------
1 | // Copyright 2021-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | import "./append_functions.js";
5 |
6 | export * from "./jose";
7 | export * from "./jwk_storage";
8 | export * from "./key_id_storage";
9 |
10 | export * from "~identity_wasm";
11 |
12 | export * from "./controller";
13 | export * from "./proposal";
14 |
15 | export * from "@iota/iota-interaction-ts/transaction_internal";
16 |
17 | // keep this export last to override the original `Resolver` from `identity_wasm` in the exports
18 | export { Resolver } from "./resolver";
19 |
20 | export * from "./jwk_storage_pq.js";
21 | export * from "./pq_verifier.js";
22 |
--------------------------------------------------------------------------------
/identity_credential/src/sd_jwt_vc/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod builder;
5 | mod claims;
6 | mod error;
7 | /// Additional metadata defined by the SD-JWT VC specification
8 | /// such as issuer's metadata and credential type metadata.
9 | pub mod metadata;
10 | mod presentation;
11 | /// Resolver trait.
12 | pub mod resolver;
13 | mod status;
14 | #[cfg(test)]
15 | pub(crate) mod tests;
16 | mod token;
17 |
18 | pub use builder::*;
19 | pub use claims::*;
20 | pub use error::Error;
21 | pub use error::Result;
22 | pub use presentation::*;
23 | pub use resolver::Resolver;
24 | pub use status::*;
25 | pub use token::*;
26 |
--------------------------------------------------------------------------------
/identity_credential/src/utils.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use identity_core::common::Url;
5 |
6 | pub(crate) fn url_only_includes_origin(url: &Url) -> bool {
7 | url.path() == "/" && url.query().is_none() && url.fragment().is_none()
8 | }
9 |
10 | #[cfg(test)]
11 | mod tests {
12 | use super::url_only_includes_origin;
13 | use identity_core::common::Url;
14 |
15 | #[test]
16 | fn empty_path_and_root_are_valid_origins() {
17 | let urls = ["https://example.com", "https://example.com/"];
18 | for url in urls {
19 | assert!(url_only_includes_origin(&Url::parse(url).unwrap()));
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/credential-6.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://www.w3.org/2018/credentials/v1",
4 | "https://www.w3.org/2018/credentials/examples/v1"
5 | ],
6 | "id": "http://example.edu/credentials/3732",
7 | "type": ["VerifiableCredential", "UniversityDegreeCredential"],
8 | "issuer": "https://example.edu/issuers/14",
9 | "issuanceDate": "2010-01-01T19:23:24Z",
10 | "expirationDate": "2020-01-01T19:23:24Z",
11 | "credentialSubject": {
12 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
13 | "degree": {
14 | "type": "BachelorDegree",
15 | "name": "Bachelor of Science in Mechanical Engineering"
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/identity_storage/src/key_storage/jwk_gen_output.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use identity_verification::jose::jwk::Jwk;
5 |
6 | use super::KeyId;
7 |
8 | /// The output of a JWK key generation.
9 | #[non_exhaustive]
10 | #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
11 | pub struct JwkGenOutput {
12 | /// The key identifier of the generated JWK.
13 | pub key_id: KeyId,
14 | /// The generated JWK.
15 | pub jwk: Jwk,
16 | }
17 |
18 | impl JwkGenOutput {
19 | /// Constructs a new JWK generation output.
20 | pub fn new(key_id: KeyId, jwk: Jwk) -> Self {
21 | Self { key_id, jwk }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/.github/releases/v0.6.0.md:
--------------------------------------------------------------------------------
1 | The main feature of this release is the addition of the `RevocationBitmap2022` specification, offering efficient credential revocation on-Tangle. This is the replacement for the `MerkleKeyCollection` removed in v0.5.0, which offered similar functionality but fundamentally failed to scale beyond a few thousand revocations.
2 | \n\n
3 | Other changes include encryption support using Elliptic Curve Diffie-Hellman (ECDH) and quality of life improvements for verifiable credential and presentation types in the Wasm bindings.
4 | \n\n
5 | DID Documents created with v0.5.0 remain compatible with v0.6.0. This will be the last major release prior to changes for the Stardust update.
6 | \n\n
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/jwt_credential_validation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione LINKS
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoded_jwt_credential;
5 | mod jwt_credential_validator;
6 | mod jwt_credential_validator_hybrid;
7 | mod kb_validation_options;
8 | mod options;
9 | mod sd_jwt_validator;
10 | mod unknown_credential;
11 |
12 | pub use self::decoded_jwt_credential::*;
13 | pub use self::jwt_credential_validator::*;
14 | pub use self::jwt_credential_validator_hybrid::*;
15 | pub use self::kb_validation_options::*;
16 | pub use self::options::*;
17 | pub use self::sd_jwt_validator::*;
18 | pub use self::unknown_credential::*;
19 |
--------------------------------------------------------------------------------
/.github/releases/wasm-v0.6.0.md:
--------------------------------------------------------------------------------
1 | The main feature of this release is the addition of the `RevocationBitmap2022` specification, offering efficient credential revocation on-Tangle. This is the replacement for the `MerkleKeyCollection` removed in v0.5.0, which offered similar functionality but fundamentally failed to scale beyond a few thousand revocations.
2 | \n\n
3 | Other changes include encryption support using Elliptic Curve Diffie-Hellman (ECDH) and quality of life improvements for verifiable credential and presentation types in the Wasm bindings.
4 | \n\n
5 | DID Documents created with v0.5.0 remain compatible with v0.6.0. This will be the last major release prior to changes for the Stardust update.
6 | \n\n
--------------------------------------------------------------------------------
/bindings/wasm/typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://typedoc.org/schema.json",
3 | "disableSources": true,
4 | "excludePrivate": true,
5 | "excludeInternal": true,
6 | "excludeNotDocumented": true,
7 | "excludeExternals": true,
8 | "entryPointStrategy": "expand",
9 | "plugin": [
10 | "typedoc-plugin-markdown"
11 | ],
12 | "readme": "none",
13 | "githubPages": false,
14 | "theme": "markdown",
15 | "entryFileName": "api_ref.md",
16 | "hideBreadcrumbs": true,
17 | "hideGenerator": true,
18 | "sort": [
19 | "source-order"
20 | ],
21 | "compilerOptions": {
22 | "skipLibCheck": true
23 | },
24 | "validation": {
25 | "notDocumented": true,
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/identity_jose/src/jws/format.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | /// The serialization format used for the JWS.
5 | #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Default)]
6 | pub enum JwsFormat {
7 | /// JWS Compact Serialization ().
8 | #[default]
9 | Compact,
10 | /// General JWS JSON Serialization ().
11 | General,
12 | /// Flattened JWS JSON Serialization ().
13 | ///
14 | /// Should be used for single signature or MAC use cases.
15 | Flatten,
16 | }
17 |
--------------------------------------------------------------------------------
/identity_credential/src/validator/jwt_presentation_validation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione LINKS
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod decoded_jwt_presentation;
5 | mod error;
6 | mod jwt_presentation_validation_options;
7 | mod jwt_presentation_validator;
8 | #[cfg(feature = "hybrid")]
9 | mod jwt_presentation_validator_hybrid;
10 | mod jwt_presentation_validator_utils;
11 |
12 | pub use decoded_jwt_presentation::*;
13 | pub use error::*;
14 | pub use jwt_presentation_validation_options::*;
15 | pub use jwt_presentation_validator::*;
16 | #[cfg(feature = "hybrid")]
17 | pub use jwt_presentation_validator_hybrid::*;
18 | pub use jwt_presentation_validator_utils::*;
19 |
--------------------------------------------------------------------------------
/identity_iota_core/scripts/publish_identity_package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Copyright 2020-2024 IOTA Stiftung
4 | # SPDX-License-Identifier: Apache-2.0
5 |
6 | script_dir=$(cd "$(dirname $0)" && pwd)
7 | package_dir=$script_dir/../packages/iota_identity
8 |
9 | # echo "publishing package from $package_dir"
10 | RESPONSE=$(iota client publish --with-unpublished-dependencies --silence-warnings --json --gas-budget 500000000 $package_dir)
11 | { # try
12 | PACKAGE_ID=$(echo $RESPONSE | jq --raw-output '.objectChanges[] | select(.type | contains("published")) | .packageId')
13 | } || { # catch
14 | echo $RESPONSE
15 | }
16 |
17 | export IOTA_IDENTITY_PKG_ID=$PACKAGE_ID
18 | echo "${IOTA_IDENTITY_PKG_ID}"
19 |
--------------------------------------------------------------------------------
/identity_verification/src/jose/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 | //! Provides JWK and JWS types and functionality.
4 |
5 | // Re-export necessary types from `identity_jose`.
6 |
7 | pub mod jwk {
8 | //! Reexport of [identity_jose::jwk].
9 |
10 | pub use identity_jose::jwk::*;
11 | }
12 |
13 | pub mod jws {
14 | //! Reexport of [identity_jose::jwk].
15 |
16 | pub use identity_jose::jws::*;
17 | }
18 |
19 | pub mod jwu {
20 | //! Reexport of [identity_jose::jwu].
21 |
22 | pub use identity_jose::jwu::*;
23 | }
24 |
25 | pub mod error {
26 | //! Reexport of [identity_jose::error].
27 |
28 | pub use identity_jose::error::*;
29 | }
30 |
--------------------------------------------------------------------------------
/identity_credential/src/credential/jws.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | /// A wrapper around a JSON Web Signature (JWS).
5 | #[derive(Debug, Clone)]
6 | pub struct Jws(String);
7 |
8 | impl Jws {
9 | /// Creates a new `Jws` from the given string.
10 | pub fn new(jws_string: String) -> Self {
11 | Self(jws_string)
12 | }
13 |
14 | /// Returns a reference of the JWS string.
15 | pub fn as_str(&self) -> &str {
16 | &self.0
17 | }
18 | }
19 |
20 | impl From for Jws {
21 | fn from(jws: String) -> Self {
22 | Self::new(jws)
23 | }
24 | }
25 | impl From for String {
26 | fn from(jws: Jws) -> Self {
27 | jws.0
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/tests/txm_readme.js:
--------------------------------------------------------------------------------
1 | const assert = require("assert");
2 | const spawn = require("child_process").spawn;
3 |
4 | describe.skip("Test TXM", () => {
5 | before((done) => {
6 | let process = spawn("txm", ["README.md"]);
7 | process.stdout.on("data", function(data) {
8 | console.log(data.toString());
9 | });
10 | process.stderr.on("data", function(data) {
11 | console.log(data.toString());
12 | });
13 | process.on("exit", (code) => {
14 | exitCode = code;
15 | done();
16 | });
17 | });
18 | it("exit code should be zero", () => {
19 | assert.equal(exitCode, 0);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/identity_iota_core/src/rebased/iota/types/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod number;
5 |
6 | use iota_interaction::types::base_types::ObjectID;
7 | use iota_interaction::types::id::UID;
8 | pub(crate) use number::*;
9 | use serde::Deserialize;
10 | use serde::Serialize;
11 |
12 | #[derive(Clone, Debug, Serialize, Deserialize)]
13 | pub(crate) struct Bag {
14 | pub id: UID,
15 | #[serde(deserialize_with = "serde_aux::field_attributes::deserialize_number_from_string")]
16 | pub size: u64,
17 | }
18 |
19 | impl Default for Bag {
20 | fn default() -> Self {
21 | Self {
22 | id: UID::new(ObjectID::ZERO),
23 | size: 0,
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/bindings/wasm/build/utils/generatePackage.js:
--------------------------------------------------------------------------------
1 | module.exports = (options) => {
2 | const rootPackage = require(`../../${options.artifact}/package.json`);
3 | const newPackage = {
4 | name: rootPackage.name,
5 | description: rootPackage.description,
6 | version: rootPackage.version,
7 | license: rootPackage.license,
8 | homepage: rootPackage.homepage,
9 | repository: rootPackage.repository,
10 | module: options.module,
11 | main: options.main,
12 | types: options.types,
13 | };
14 |
15 | // remove empty keys
16 | Object.keys(newPackage).forEach(key => newPackage[key] === undefined && delete newPackage[key]);
17 |
18 | return newPackage;
19 | };
20 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/tests/txm_readme_rust.js:
--------------------------------------------------------------------------------
1 | const assert = require("assert");
2 | const spawn = require("child_process").spawn;
3 |
4 | describe("Test TXM", () => {
5 | before((done) => {
6 | let process = spawn("txm", ["../../../README.md"]);
7 | process.stdout.on("data", function(data) {
8 | console.log(data.toString());
9 | });
10 | process.stderr.on("data", function(data) {
11 | console.log(data.toString());
12 | });
13 | process.on("exit", (code) => {
14 | exitCode = code;
15 | done();
16 | });
17 | });
18 | it("exit code should be zero", () => {
19 | assert.equal(exitCode, 0);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/identity_jose/src/jose/traits.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use crate::jwt::JwtHeader;
5 |
6 | /// An abstraction over different JOSE headers.
7 | pub trait JoseHeader {
8 | /// Returns the header common to all [`JoseHeader`]s.
9 | fn common(&self) -> &JwtHeader;
10 |
11 | /// Returns `true` if the header has the given `claim`, `false` otherwise.
12 | fn has_claim(&self, claim: &str) -> bool;
13 | }
14 |
15 | impl<'a, T: 'a> JoseHeader for &'a T
16 | where
17 | T: JoseHeader,
18 | {
19 | fn common(&self) -> &JwtHeader {
20 | (**self).common()
21 | }
22 |
23 | fn has_claim(&self, claim: &str) -> bool {
24 | (**self).has_claim(claim)
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/controller.ts:
--------------------------------------------------------------------------------
1 | import { DelegationToken } from "~identity_wasm";
2 |
3 | /**
4 | * Permissions of a {@link DelegationToken}.
5 | */
6 | export enum DelegatePermissions {
7 | /** No permissions. */
8 | None = 0,
9 | /** Delegate can create new proposals. */
10 | CreateProposal = 1,
11 | /** Delegate can approve existing proposals. */
12 | ApproveProposal = 1 << 1,
13 | /** Delegate can execute proposals. */
14 | ExecuteProposal = 1 << 2,
15 | /** Delegate can delete proposals. */
16 | DeleteProposal = 1 << 3,
17 | /** Delegate can remove its controller's approval. */
18 | RemoveApproval = 1 << 4,
19 | /** All permissions. */
20 | All = 0xffffffff,
21 | }
22 |
--------------------------------------------------------------------------------
/identity_eddsa_verifier/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "identity_eddsa_verifier"
3 | version = "1.8.0-beta.1"
4 | authors.workspace = true
5 | edition.workspace = true
6 | homepage.workspace = true
7 | keywords = ["iota", "identity", "jose", "jwk", "jws"]
8 | license.workspace = true
9 | readme = "./README.md"
10 | repository.workspace = true
11 | description = "JWS EdDSA signature verification for IOTA Identity"
12 |
13 | [dependencies]
14 | identity_jose = { version = "=1.8.0-beta.1", path = "../identity_jose", default-features = false }
15 | iota-crypto = { version = "0.23.2", default-features = false, features = ["std"] }
16 |
17 | [features]
18 | ed25519 = ["iota-crypto/ed25519"]
19 | default = ["ed25519"]
20 |
21 | [lints]
22 | workspace = true
23 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/cypress/app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "useDefineForClassFields": true,
5 | "module": "ESNext",
6 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
7 | "skipLibCheck": true,
8 | "allowJs": true,
9 |
10 | /* Bundler mode */
11 | "moduleResolution": "bundler",
12 | "allowImportingTsExtensions": true,
13 | "isolatedModules": true,
14 | "moduleDetection": "force",
15 | "noEmit": true,
16 |
17 | /* Linting */
18 | "strict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noFallthroughCasesInSwitch": true,
22 | "noUncheckedSideEffectImports": true
23 | },
24 | "include": ["src"]
25 | }
26 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/resolver/resolver_types.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use wasm_bindgen::prelude::*;
5 |
6 | #[wasm_bindgen]
7 | extern "C" {
8 | #[wasm_bindgen(typescript_type = "Promise>")]
9 | pub type PromiseArrayIToCoreDocument;
10 |
11 | #[wasm_bindgen(typescript_type = "Promise")]
12 | pub type PromiseIToCoreDocument;
13 |
14 | #[wasm_bindgen(typescript_type = "CoreDocument | IToCoreDocument | undefined")]
15 | pub type OptionIToCoreDocument;
16 |
17 | #[wasm_bindgen(typescript_type = "Array | undefined")]
18 | pub type OptionArrayIToCoreDocument;
19 | }
20 |
--------------------------------------------------------------------------------
/identity_iota_core/scripts/upgrade_identity_package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Copyright 2020-2025 IOTA Stiftung
4 | # SPDX-License-Identifier: Apache-2.0
5 |
6 | script_dir=$(cd "$(dirname $0)" && pwd)
7 | package_dir=$script_dir/../packages/iota_identity
8 |
9 | chain_id=$(iota client chain-identifier)
10 | current_pkg_id=$(toml get "$package_dir/Move.lock" env | jq --raw-output "map(values | select(.[\"chain-id\"] == \"$chain_id\") .[\"latest-published-id\"]) | first")
11 | upgrade_cap_id=$(iota client objects --json | jq --raw-output "map(select(.data.type == \"0x2::package::UpgradeCap\" and .data.content.fields.package == \"$current_pkg_id\")) | first | .data.objectId")
12 |
13 | iota client upgrade --upgrade-capability $upgrade_cap_id $package_dir
14 |
--------------------------------------------------------------------------------
/bindings/grpc/proto/document.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | syntax = "proto3";
5 | package document;
6 |
7 | message CreateDIDRequest {
8 | // KeyID for getting the public key from stronghold.
9 | string key_id = 1;
10 | }
11 |
12 | message CreateDIDResponse {
13 | // The created DID document, encoded as JSON.
14 | string document_json = 1;
15 | // The stronghold's fragment for the generated document's auth method.
16 | string fragment = 2;
17 | // The DID of the created document.
18 | string did = 3;
19 | }
20 |
21 | service DocumentService {
22 | /// Creates a new DID document stored on Tangle.
23 | rpc create(CreateDIDRequest) returns (CreateDIDResponse);
24 | }
--------------------------------------------------------------------------------
/identity_credential/src/validator/jwt_credential_validation/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione LINKS
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! Contains functionality for validating credentials issued as JWTs.
5 | mod decoded_jwt_credential;
6 | mod error;
7 | mod jwt_credential_validation_options;
8 | mod jwt_credential_validator;
9 | #[cfg(feature = "hybrid")]
10 | mod jwt_credential_validator_hybrid;
11 | mod jwt_credential_validator_utils;
12 |
13 | pub use decoded_jwt_credential::*;
14 | pub use error::*;
15 | pub use jwt_credential_validation_options::*;
16 | pub use jwt_credential_validator::*;
17 | #[cfg(feature = "hybrid")]
18 | pub use jwt_credential_validator_hybrid::*;
19 | pub use jwt_credential_validator_utils::*;
20 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/credential-7.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://www.w3.org/2018/credentials/v1",
4 | "https://www.w3.org/2018/credentials/examples/v1"
5 | ],
6 | "id": "http://example.edu/credentials/3732",
7 | "type": ["VerifiableCredential", "UniversityDegreeCredential"],
8 | "issuer": "https://example.edu/issuers/14",
9 | "issuanceDate": "2010-01-01T19:23:24Z",
10 | "credentialSubject": {
11 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
12 | "degree": {
13 | "type": "BachelorDegree",
14 | "name": "Bachelor of Science in Mechanical Engineering"
15 | }
16 | },
17 | "credentialStatus": {
18 | "id": "https://example.edu/status/24",
19 | "type": "CredentialStatusList2017"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/credential-10.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://www.w3.org/2018/credentials/v1",
4 | "https://www.w3.org/2018/credentials/examples/v1"
5 | ],
6 | "id": "http://example.edu/credentials/3732",
7 | "type": ["VerifiableCredential", "UniversityDegreeCredential"],
8 | "issuer": "https://example.edu/issuers/14",
9 | "issuanceDate": "2010-01-01T19:23:24Z",
10 | "credentialSubject": {
11 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
12 | "degree": {
13 | "type": "BachelorDegree",
14 | "name": "Bachelor of Science in Mechanical Engineering"
15 | }
16 | },
17 | "refreshService": {
18 | "id": "https://example.edu/refresh/3732",
19 | "type": "ManualRefreshService2018"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/identity_iota_core/src/state_metadata/encoding.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use num_traits::FromPrimitive;
5 |
6 | use crate::Error;
7 |
8 | /// Indicates the encoding of a DID document in state metadata.
9 | #[derive(Copy, Clone, Debug, Default, Ord, PartialOrd, Eq, PartialEq, num_derive::FromPrimitive)]
10 | #[non_exhaustive]
11 | pub enum StateMetadataEncoding {
12 | /// State Metadata encoded as JSON.
13 | #[default]
14 | Json = 0,
15 | }
16 |
17 | impl TryFrom for StateMetadataEncoding {
18 | type Error = Error;
19 |
20 | fn try_from(value: u8) -> Result {
21 | FromPrimitive::from_u8(value).ok_or(Error::InvalidStateMetadata("unsupported encoding"))
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/.github/workflows/rust-create-hotfix-pr.yml:
--------------------------------------------------------------------------------
1 | name: Rust Create Hotfix PR
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | branch:
7 | description: 'Name of the support branch (e.g. `support/v1.2`)'
8 | required: true
9 |
10 | jobs:
11 | create-hotfix-pr:
12 | uses: './.github/workflows/shared-create-hotfix-pr.yml'
13 | with:
14 | branch: ${{ github.event.inputs.branch }}
15 | branch-regex: ^support\/v[0-9]+\.[0-9]+$
16 | tag-prefix: v
17 | main-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+$
18 | changelog-config-path: ./.github/.github_changelog_generator
19 | release-target: rust
20 | secrets:
21 | GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
22 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
23 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/proc_typescript/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "proc_typescript"
3 | version = "0.1.0"
4 | authors = ["IOTA Stiftung"]
5 | edition = "2021"
6 | homepage = "https://www.iota.org"
7 | license = "Apache-2.0"
8 | publish = false
9 | repository = "https://github.com/iotaledger/identity"
10 | description = "Annotate structs as TypeScript interfaces for wasm-bindgen."
11 |
12 | [lib]
13 | name = "proc_typescript"
14 | proc-macro = true
15 |
16 | [dependencies]
17 | darling = { version = "0.14.0", default-features = false, features = ["suggestions"] }
18 | proc-macro2 = { version = "1.0", default-features = false }
19 | quote = { version = "1.0", default-features = false }
20 | syn = { version = "1.0", default-features = false, features = ["parsing"] }
21 |
--------------------------------------------------------------------------------
/identity_credential/tests/fixtures/credential-8.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://www.w3.org/2018/credentials/v1",
4 | "https://www.w3.org/2018/credentials/examples/v1"
5 | ],
6 | "id": "http://example.edu/credentials/3732",
7 | "type": ["VerifiableCredential", "UniversityDegreeCredential"],
8 | "issuer": "https://example.edu/issuers/14",
9 | "issuanceDate": "2010-01-01T19:23:24Z",
10 | "credentialSubject": {
11 | "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
12 | "degree": {
13 | "type": "BachelorDegree",
14 | "name": "Bachelor of Science in Mechanical Engineering"
15 | }
16 | },
17 | "credentialSchema": {
18 | "id": "https://example.org/examples/degree.json",
19 | "type": "JsonSchemaValidator2018"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/identity_document/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![forbid(unsafe_code)]
5 | #![doc = include_str!("./../README.md")]
6 | #![allow(clippy::upper_case_acronyms)]
7 | #![warn(
8 | rust_2018_idioms,
9 | unreachable_pub,
10 | // missing_docs,
11 | rustdoc::missing_crate_level_docs,
12 | rustdoc::broken_intra_doc_links,
13 | rustdoc::private_intra_doc_links,
14 | rustdoc::private_doc_tests,
15 | clippy::missing_safety_doc,
16 | // clippy::missing_errors_doc
17 | )]
18 |
19 | #[macro_use]
20 | extern crate serde;
21 |
22 | pub mod document;
23 | pub mod error;
24 | pub mod service;
25 | pub mod utils;
26 | pub mod verifiable;
27 |
28 | pub use self::error::Error;
29 | pub use self::error::Result;
30 |
--------------------------------------------------------------------------------
/identity_ecdsa_verifier/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung, Filancore GmbH
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![doc = include_str!("./../README.md")]
5 | #![warn(
6 | rust_2018_idioms,
7 | unreachable_pub,
8 | missing_docs,
9 | rustdoc::missing_crate_level_docs,
10 | rustdoc::broken_intra_doc_links,
11 | rustdoc::private_intra_doc_links,
12 | rustdoc::private_doc_tests,
13 | clippy::missing_safety_doc
14 | )]
15 |
16 | mod ecdsa_jws_verifier;
17 | #[cfg(feature = "es256k")]
18 | mod secp256k1;
19 | #[cfg(feature = "es256")]
20 | mod secp256r1;
21 |
22 | pub use ecdsa_jws_verifier::*;
23 | #[cfg(feature = "es256k")]
24 | pub use secp256k1::*;
25 | #[cfg(feature = "es256")]
26 | pub use secp256r1::*;
27 |
28 | #[cfg(test)]
29 | mod tests;
30 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/verification/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | mod custom_verification;
5 |
6 | mod jws_verifier;
7 | mod wasm_method_data;
8 | mod wasm_method_relationship;
9 | mod wasm_method_scope;
10 | mod wasm_method_type;
11 | mod wasm_verification_method;
12 |
13 | pub use custom_verification::*;
14 |
15 | pub use self::wasm_method_data::WasmMethodData;
16 | pub use self::wasm_method_relationship::WasmMethodRelationship;
17 | pub use self::wasm_method_scope::OptionMethodScope;
18 | pub use self::wasm_method_scope::RefMethodScope;
19 | pub use self::wasm_method_scope::WasmMethodScope;
20 | pub use self::wasm_method_type::WasmMethodType;
21 | pub use self::wasm_verification_method::WasmVerificationMethod;
22 |
--------------------------------------------------------------------------------
/identity_verification/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![forbid(unsafe_code)]
5 | #![doc = include_str!("./../README.md")]
6 | #![allow(clippy::upper_case_acronyms)]
7 | #![warn(
8 | rust_2018_idioms,
9 | unreachable_pub,
10 | missing_docs,
11 | rustdoc::missing_crate_level_docs,
12 | rustdoc::broken_intra_doc_links,
13 | rustdoc::private_intra_doc_links,
14 | rustdoc::private_doc_tests,
15 | clippy::missing_safety_doc
16 | )]
17 |
18 | #[macro_use]
19 | extern crate serde;
20 |
21 | mod error;
22 | pub mod jose;
23 | pub mod verification_method;
24 | pub use error::Error;
25 | pub use error::Result;
26 | pub use jose::jwk;
27 | pub use jose::jws;
28 | pub use jose::jwu;
29 | pub use verification_method::*;
30 |
--------------------------------------------------------------------------------
/.github/workflows/audit.yml:
--------------------------------------------------------------------------------
1 | name: Audit
2 |
3 | on:
4 | schedule:
5 | - cron: '0 0 * * *' # run at midnight every day
6 | push:
7 | branches:
8 | - main
9 | paths:
10 | - "**/Cargo.lock"
11 | - "**/Cargo.toml"
12 | - ".github/workflows/audit.yml"
13 | - ".cargo/audit.toml"
14 | pull_request:
15 | branches:
16 | - main
17 | - 'feat/**'
18 | - 'support/**'
19 | paths:
20 | - "**/Cargo.lock"
21 | - "**/Cargo.toml"
22 | - ".github/workflows/audit.yml"
23 | - ".cargo/audit.toml"
24 |
25 | jobs:
26 | audit:
27 | runs-on: ubuntu-latest
28 | steps:
29 | - uses: actions/checkout@v3
30 | - uses: actions-rs/audit-check@v1
31 | with:
32 | token: ${{ secrets.GITHUB_TOKEN }}
33 |
--------------------------------------------------------------------------------
/identity_iota_core/src/state_metadata/version.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use num_traits::FromPrimitive;
5 |
6 | use crate::Error;
7 |
8 | /// Indicates the version of a DID document in state metadata.
9 | #[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, num_derive::FromPrimitive)]
10 | #[non_exhaustive]
11 | pub(crate) enum StateMetadataVersion {
12 | V1 = 1,
13 | }
14 |
15 | impl StateMetadataVersion {
16 | pub(crate) const CURRENT: Self = Self::V1;
17 | }
18 |
19 | impl TryFrom for StateMetadataVersion {
20 | type Error = Error;
21 |
22 | fn try_from(value: u8) -> Result {
23 | FromPrimitive::from_u8(value).ok_or(Error::InvalidStateMetadata("unsupported version number"))
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/identity_iota_core/src/rebased/iota/move_calls/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use iota_interaction::types::base_types::ObjectRef;
5 |
6 | pub(crate) mod asset;
7 | pub(crate) mod identity;
8 | pub(crate) mod migration;
9 | mod utils;
10 |
11 | #[derive(Debug, Clone, Copy)]
12 | pub(crate) enum ControllerTokenRef {
13 | Controller(ObjectRef),
14 | Delegate(ObjectRef),
15 | }
16 |
17 | impl ControllerTokenRef {
18 | pub(crate) fn object_ref(&self) -> ObjectRef {
19 | match self {
20 | Self::Controller(obj_ref) => *obj_ref,
21 | Self::Delegate(obj_ref) => *obj_ref,
22 | }
23 | }
24 |
25 | #[inline(always)]
26 | pub(crate) fn is_controller_cap(&self) -> bool {
27 | matches!(self, Self::Controller(_))
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/identity_resolver/src/resolution/tests/send_sync.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use super::*;
5 |
6 | use identity_did::DID;
7 | use identity_document::document::CoreDocument;
8 |
9 | fn is_send(_t: T) {}
10 | fn is_send_sync(_t: T) {}
11 |
12 | #[allow(dead_code)]
13 | fn default_resolver_is_send_sync + Send + Sync + 'static>() {
14 | let resolver = Resolver::::new();
15 | is_send_sync(resolver);
16 | }
17 |
18 | #[allow(dead_code)]
19 | fn resolver_methods_give_send_futures(did: D)
20 | where
21 | DOC: AsRef + Send + Sync + 'static,
22 | D: DID + Send + Sync + 'static,
23 | {
24 | let resolver = Resolver::::new();
25 | is_send(resolver.resolve(&did));
26 | }
27 |
--------------------------------------------------------------------------------
/.github/workflows/wasm-retag-npm.yml:
--------------------------------------------------------------------------------
1 | name: Wasm re-tag npm
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | tag:
7 | description: 'Tag to set'
8 | required: true
9 | version:
10 | description: 'version to set'
11 | required: true
12 |
13 | jobs:
14 | release-wasm:
15 | runs-on: ubuntu-latest
16 | steps:
17 | - name: Set up Node.js
18 | uses: actions/setup-node@v2
19 | with:
20 | node-version: '20.x'
21 | registry-url: 'https://registry.npmjs.org'
22 |
23 | - name: Run dist-tag
24 | shell: sh
25 | env:
26 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27 | run: |
28 | npm dist-tag add @iota/identity-wasm@${{ github.event.inputs.version }} ${{ github.event.inputs.tag }}
29 |
--------------------------------------------------------------------------------
/identity_jose/src/tests/fixtures/rfc7638.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 | [
4 | // https://tools.ietf.org/html/rfc7638#section-3.1
5 | TestVector {
6 | jwk_json: r#"
7 | {
8 | "kty": "RSA",
9 | "n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
10 | "e": "AQAB",
11 | "alg": "RS256",
12 | "kid": "2011-04-29"
13 | }
14 | "#,
15 | thumbprint_b64: "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs",
16 | },
17 | ]
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Generated by Cargo
2 | # Will have compiled files and executables
3 | /target/
4 | target/
5 |
6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8 | Cargo.lock
9 |
10 | # These are backup files generated by rustfmt
11 | **/*.rs.bk
12 |
13 | # Ignore IDE/editor files
14 | .idea/
15 | .vscode/
16 |
17 | # Ignore temporary test files
18 | test-storage/
19 |
20 | # remove book
21 | book
22 |
23 | # ignore files generated by example
24 | *.hodl
25 | *.hodl.*
26 |
27 | !/bindings/wasm/identity_wasm/static/index.html
28 |
29 | docs
30 | # ignore IOTA build artifacts & package locks
31 | build
32 |
33 | # ignore folder created in CI for downloaded iota binaries
34 | /iota/
35 | /toml-cli/
36 |
--------------------------------------------------------------------------------
/bindings/grpc/tests/api/health_check.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use _health_check::health_check_client::HealthCheckClient;
5 | use _health_check::HealthCheckRequest;
6 | use _health_check::HealthCheckResponse;
7 |
8 | use crate::helpers::TestServer;
9 |
10 | mod _health_check {
11 | tonic::include_proto!("health_check");
12 | }
13 |
14 | #[tokio::test]
15 | async fn health_check() -> anyhow::Result<()> {
16 | let server = TestServer::new().await;
17 | let mut grpc_client = HealthCheckClient::connect(server.endpoint()).await?;
18 | let request = tonic::Request::new(HealthCheckRequest {});
19 |
20 | let response = grpc_client.check(request).await?;
21 | assert_eq!(response.into_inner(), HealthCheckResponse { status: "OK".into() });
22 |
23 | Ok(())
24 | }
25 |
--------------------------------------------------------------------------------
/.github/releases/v0.5.0-dev.6.md:
--------------------------------------------------------------------------------
1 | Note that all features related to diff chain updates are now marked as deprecated. Diff chains are a useful optimisation when publishing many updates to a DID Document. However, their design may be incompatible with upcoming changes to the IOTA network and should be considered unstable.
2 |
3 | Another major change is the removal of the `MerkleKeyCollection` verification method type, which provided a compact representation for issuing and revoking Verifiable Credentials with multiple cryptographic keys. The `MerkleKeyCollection` suffered from disadvantages which limited scalability when managing more than a few thousand keys. While these disadvantages could be mitigated somewhat, the decision was made to replace it with one or more alternatives not affected by its fundamental limitations, upcoming in the next major release.
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/iota/iota_metadata_encoding.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2022 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use identity_iota::iota::StateMetadataEncoding;
5 | use serde_repr::Deserialize_repr;
6 | use serde_repr::Serialize_repr;
7 | use wasm_bindgen::prelude::*;
8 |
9 | /// Indicates the encoding of a DID document in state metadata.
10 | #[wasm_bindgen(js_name = StateMetadataEncoding)]
11 | #[derive(Serialize_repr, Deserialize_repr)]
12 | #[repr(u8)]
13 | pub enum WasmStateMetadataEncoding {
14 | /// State Metadata encoded as JSON.
15 | Json = 0,
16 | }
17 |
18 | impl From for StateMetadataEncoding {
19 | fn from(encoding: WasmStateMetadataEncoding) -> Self {
20 | match encoding {
21 | WasmStateMetadataEncoding::Json => Self::Json,
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/identity_verification/src/verification_method/method_relationship.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | /// Verification relationships.
5 | ///
6 | /// See also: .
7 | #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, strum::IntoStaticStr)]
8 | pub enum MethodRelationship {
9 | /// The authentication verification relationship.
10 | Authentication,
11 | /// The assertion method verification relationship.
12 | AssertionMethod,
13 | /// The key agreement verification relationship.
14 | KeyAgreement,
15 | /// The capability delegation verification relationship.
16 | CapabilityDelegation,
17 | /// The capability invocation verification relationship.
18 | CapabilityInvocation,
19 | }
20 |
--------------------------------------------------------------------------------
/identity_core/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2021 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | #![doc = include_str!("./../README.md")]
5 | #![allow(clippy::upper_case_acronyms)]
6 | #![warn(
7 | rust_2018_idioms,
8 | unreachable_pub,
9 | missing_docs,
10 | rustdoc::missing_crate_level_docs,
11 | rustdoc::broken_intra_doc_links,
12 | rustdoc::private_intra_doc_links,
13 | rustdoc::private_doc_tests,
14 | clippy::missing_safety_doc,
15 | // clippy::missing_errors_doc
16 | )]
17 |
18 | #[doc(inline)]
19 | pub use serde_json::json;
20 |
21 | #[forbid(unsafe_code)]
22 | pub mod common;
23 | #[forbid(unsafe_code)]
24 | pub mod convert;
25 | #[forbid(unsafe_code)]
26 | pub mod error;
27 |
28 | #[cfg(feature = "custom_time")]
29 | pub mod custom_time;
30 |
31 | pub use self::error::Error;
32 | pub use self::error::Result;
33 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/src/credential/jws.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2023 IOTA Stiftung
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use identity_iota::credential::Jws;
5 | use wasm_bindgen::prelude::*;
6 |
7 | /// A wrapper around a JSON Web Signature (JWS).
8 | #[wasm_bindgen(js_name = Jws)]
9 | pub struct WasmJws(pub(crate) Jws);
10 |
11 | #[wasm_bindgen(js_class = Jws)]
12 | impl WasmJws {
13 | pub(crate) fn new(jws: Jws) -> Self {
14 | WasmJws(jws)
15 | }
16 | /// Creates a new {@link Jws} from the given string.
17 | #[wasm_bindgen(constructor)]
18 | pub fn constructor(jws_string: String) -> Self {
19 | Self(Jws::new(jws_string))
20 | }
21 |
22 | /// Returns a clone of the JWS string.
23 | #[wasm_bindgen(js_name = toString)]
24 | pub fn to_string_clone(&self) -> String {
25 | self.0.as_str().to_owned()
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/identity_jose/src/jwk/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2025 IOTA Stiftung, Fondazione LINKS
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | //! JSON Web Keys ([JWK](https://tools.ietf.org/html/rfc7517))
5 |
6 | mod composite_jwk;
7 | #[cfg(feature = "jwk-conversion")]
8 | mod conversion;
9 | mod curve;
10 | mod jwk_akp;
11 | mod jwk_ext;
12 | mod key;
13 | mod key_hybrid;
14 | mod key_operation;
15 | mod key_params;
16 | mod key_set;
17 | mod key_type;
18 | mod key_use;
19 |
20 | pub use self::composite_jwk::*;
21 | #[cfg(feature = "jwk-conversion")]
22 | pub use self::conversion::*;
23 | pub use self::curve::*;
24 | pub use self::jwk_akp::*;
25 | pub use self::key::*;
26 | pub use self::key_hybrid::*;
27 | pub use self::key_operation::*;
28 | pub use self::key_params::*;
29 | pub use self::key_set::*;
30 | pub use self::key_type::*;
31 | pub use self::key_use::*;
32 |
--------------------------------------------------------------------------------
/bindings/wasm/identity_wasm/lib/jose/jwk_operation.ts:
--------------------------------------------------------------------------------
1 | /** Supported algorithms for the JSON Web Key `key_ops` property.
2 | *
3 | * [More Info](https://www.iana.org/assignments/jose/jose.xhtml#web-key-operations) */
4 | export const enum JwkOperation {
5 | /** Compute digital signature or MAC. */
6 | Sign = "sign",
7 | /** Verify digital signature or MAC. */
8 | Verify = "verify",
9 | /** Encrypt content. */
10 | Encrypt = "encrypt",
11 | /** Decrypt content and validate decryption, if applicable. */
12 | Decrypt = "decrypt",
13 | /** Encrypt key. */
14 | WrapKey = "wrapKey",
15 | /** Decrypt key and validate decryption, if applicable. */
16 | UnwrapKey = "unwrapKey",
17 | /** Derive key. */
18 | DeriveKey = "deriveKey",
19 | /** Derive bits not to be used as a key. */
20 | DeriveBits = "deriveBits",
21 | }
22 |
--------------------------------------------------------------------------------
/identity_credential/src/validator/jpt_credential_validation/decoded_jpt_credential.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020-2024 IOTA Stiftung, Fondazione Links
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | use identity_core::common::Object;
5 | use jsonprooftoken::jwp::issued::JwpIssued;
6 |
7 | use crate::credential::Credential;
8 |
9 | /// Decoded [`Credential`] from a cryptographically verified JWP.
10 | #[non_exhaustive]
11 | #[derive(Debug, Clone)]
12 | pub struct DecodedJptCredential {
13 | /// The decoded credential parsed to the [Verifiable Credentials Data model](https://www.w3.org/TR/vc-data-model/).
14 | pub credential: Credential,
15 | /// The custom claims parsed from the JPT.
16 | pub custom_claims: Option