Skip to content

product_core to be used with identity.rs #4

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 732 commits into from
May 22, 2025

Conversation

chrisgitiota
Copy link
Contributor

@chrisgitiota chrisgitiota commented Apr 28, 2025

Description of change

This PR

  • provides a version of iota_interaction, iota_interaction_rust and iota_interaction_ts that can be used to build identity.rs crates using the identity.rs chore branch chore/product-core-integration.
  • can be used to locally build identity_wasm for NodeJS and Web using the identity.rs chore branch described above. Further details are described below.
  • includes the latest changes of the develop branch and of the draft PRs feat: transaction interface and Add CoreClient trait and dependencies for core client functionality. These PRs can be closed after this PR has been merged to main.
  • includes the crate product_common which is currently only used by identity.rs to use two types from the product_common::object module which has been moved from identity.rs identity_core/src/common to product_core.
    • The crate product_common also provides several optional feature flags that can not be build at the moment (test-utils, core-client, transaction).
    • If we want to avoid "not builadable code" and "currently not used code" in our crates, we would need to remove the respective code files from product_core. Although we could remove product_common for the time being and build identiy.rs without it (using the old identity_core/src/common/object module) the crate will be needed after the CoreClient and Transaction traits have been moved from identity.rs to product_core, to give these traits a new home.

Links to any relevant issues

This PR is related to identity.rs [Task] New "product-core" Repository for IOTA Interaction, CoreClient, Transaction and additional shared code

Howto build identity.rs identity_wasm locally

  • Checkout the identity.rs chore branch chore/product-core-integration
  • Checkout this PR into a folder product_core neighboured to the identity.rs folder
  • In folder product_core/bindings/wasm/iota_interaction_ts:
    • npm install
    • npm run build
  • In the identity.rs folder, in subfolder bindings/wasm/identity_wasm
    • npm install
    • npm run build

In case of SSH authentication problems: Howto build identity.rs locally

As the product_core repository is still private, the cargo dependencies in identity. rs are using ssh URLs which can be used with ssh authentication in the shell used for building identity.rs like this:

ssh-agent bash
ssh-add ~/.ssh/id_ed25519
# Start my IDE here 

If you are not able to access the product_core repository from within the cargo build process, you can build identity.rs locally similar to the steps described above for the identity_wasm npmjs package.

The cargo files in the identity.rs chore branch chore/product-core-integration already includes commented variants to use local versions of product_core. Example:

iota_interaction = { git = "ssh://git@github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction" }
#iota_interaction = { path = "../product-core/iota_interaction" }
iota_interaction_ts = { git = "ssh://git@github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "iota_interaction_ts" }
#iota_interaction_ts = { path = "../product-core/bindings/wasm/iota_interaction_ts" }
product_common = { git = "ssh://git@github.com/iotaledger/product-core.git", branch = "feat/transaction-client-core-for-identity", package = "product_common" }
#product_common = { path = "../product-core/product_common" }

UMR1352 and others added 30 commits December 4, 2024 15:16
* network name is chain id

* add package metadata for devnet

* Update identity_iota_core/src/rebased/iota/well_known_networks.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* remove test that uses wrong identity

* add devnet connection test

---------

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>
* network name is chain id

* add package metadata for devnet

* Update identity_iota_core/src/rebased/iota/well_known_networks.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* remove test that uses wrong identity

* add devnet connection test

---------

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>
* fix formatting issue

* fix fmt and clippy issues
* fix dprint issue and add missing license header

* add missing license header
…etworks (#1482)

* fix did test, add optional network alias

* update tests for client connecting to well known networks
* add support for percent encoded characters in did url components

* cargo clippy

* cargo clippy

* wasm cargo clippy

* review comments

* Update identity_did/src/did_url.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* fmt & clippy

---------

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>
* Resolver trait and CompoundResolver macro

* invert Resolver type parameters

* associated type Target instead of type parameter T

* fix type issue in #[resolver(..)] annotation, support for multiple resolvers with the same signature

* resolver integration

* feature gate resolver-v2

* structures & basic operations

* SdJwtVc behaves as a superset of SdJwt

* issuer's metadata fetching & validation

* type metadata & credential verification

* change resolver's constraints

* integrity metadata

* display metadata

* claim metadata

* fetch issuer's JWK (to ease verification)

* validate claim disclosability

* add missing license header

* resolver change, validation

* SdJwtVcBuilder & tests

* validation test

* KB-JWT validation

* review comment

* undo resolver-v2

* fix CI errors

* make clippy happy

* add missing license headers

* add 'SdJwtVcBuilder::from_credential' to easily convert into a SD-JWT VC

* cargo clippy

* fix wasm compilation errors, clippy

* WASM Bindings for SD-JWT VC (#1493)

* reworked sd-jwt bindings

* SdJwtVc WASM bindings

* small example, many small fixes

* example & small fixes

* restore package.json

* Update bindings/wasm/src/sd_jwt_vc/builder.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* Update bindings/wasm/src/sd_jwt_vc/claims.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* Update bindings/wasm/src/sd_jwt_vc/metadata/vc_type.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* Update bindings/wasm/src/sd_jwt_vc/sd_jwt_v2/builder.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* Update bindings/wasm/src/sd_jwt_vc/sd_jwt_v2/sd_jwt.rs

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* review comments

---------

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>

* review comments

* clippy & fmt

* clippy & fmt

* dprint fmt

---------

Co-authored-by: wulfraem <wulfraem@users.noreply.github.com>
New feature flag in crate identity_wasm to control dependency identity_iota::resolver
Implement TsMoveCalls
* Move identity_wasm package into new folder bindings/wasm/identity_wasm

* Reorganize tsconfig and typedoc files

* Extend build scripts to handle multiple artifacts and add new bindings/wasm README.md

* Update identity_wasm/package.json to use shared build scripts

* Initial version of the identity_iota_interaction crate

* MoveType has been moved from identity_iota_core to identity_iota_interaction
* The identity_iota_interaction README has been updated to use the latest draft for folder and crate names

* Provide identity_iota_interaction crate types as `use identity_iota::iota_interaction::...`

* Initial version of iota_interactions_ts

* Prepare identity_iota_core/rebased for iota_interaction usage

* Minor README fixes

* Updated identity_interaction_rust MoveCalls to the latest identity_iota_core/rebase version

* First compilable but not successfully testable version of identity_iota_core for the redesigned crate structure

* Compiling identity_iota_core for wasm32 will result in one compiler error
  due to missing wasm-bindings for ProgrammableTransaction
  (TODO in identity_iota_core/src/rebased/transaction.rs)
* identity_iota_core and examples are compilable for non wasm32 platforms
  * Remaining compiler warnings should be investigated
* identity_iota_core e2e tests are compilable but will fail due to serialization/deserialization issues.
  For example:
    IotaTransactionBlockResponse bcs deserialization failed: NotSupported("deserialize_any")
    thread 'identity::adding_controller_works' panicked at /home/christof/Develop/iotaledger/identity.rs/identity_iota_core/src/rebased/transaction.rs:84:14:
    IotaTransactionBlockResponse bcs deserialization failed: NotSupported("deserialize_any")
    stack backtrace:
      0: rust_begin_unwind
      1: core::panicking::panic_fmt
      2: core::result::unwrap_failed
      3: <identity_iota_core::rebased::transaction::TransactionOutput<T> as core::convert::From<identity_iota_core::rebased::transaction::TransactionOutputInternal<T>>>::from
      4: <T as identity_iota_core::rebased::transaction::Transaction>::execute_with_opt_gas::{{closure}}
      5: identity_iota_core::rebased::transaction::Transaction::execute::{{closure}}
      6: e2e::identity::adding_controller_works::{{closure}}
      7: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
      8: tokio::runtime::runtime::Runtime::block_on
      9: e2e::identity::adding_controller_works
      10: core::ops::function::FnOnce::call_once
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

* add stubs for `ProgrammableTransaction` type chain

* re-add changes from `feat/add-iota_client_ts_sdk-impls` as closely as possible

* ts move calls

* Use cloned native IotaTransactionBlockResponse instead of a BCS deserialization

BCS deserialization is not available for IotaTransactionBlockResponse because the BCS format is not self describing and several struct fields of IotaTransactionBlockResponse are optionally skipped during serialization. JSON deserialization will probably be available but using a cloned instance to convert a TransactionOutputInternal into a TransactionOutput will have a much better efficiency.

* Fix build warnings and fix MoveType implementation for IotaVerifiableCredential

All tests running successfully for the first time now

* Fix & allow clippy errors

* Fix clippy error writing `&Vec` instead of `&[_]` involves a new object where a slice will do
* allow error clippy::too_many_arguments

* Fix even more clippy errors

* Elide superfluous explicit lifetimes

* Use rustfmt ignore to exclude identity_iota_interaction/src/sdk_types from format checks

* Fix rustfmt issues for identity_iota_core/src/iota_interaction_rust and identity_iota_interaction

* Fix rustfmt issues for bindings/wasm/iota_interaction_ts and identity_iota_core

* Update all paths for bindings/wasm/identity_wasm in al GH workflows files and add clippy + format steps for bindings/wasm/iota_interaction_ts

* Rollback removing bindings/wasm/iota_interaction_ts from the workspace members list

* Fix format issue for step "wasm fmt check identity_wasm"

* Fix issue "identity_iota_core not compilable using --no-default-features"

* Remove iota_interaction_ts related steps from github workflows as this crate is processed as workspace member

* Fix several dprint issues

* scratch

* Add iota_interaction_ts build products as 'excludes' to the dprint config

* Fixing paths to the bindings/wasm/identity_wasm crate in several READMEs and gitignore files

* fix dprint issue missing empty line at end  of file

* Update licence_template file to allow optional "Modifications", "(c)" words and specific contributor copyrights

* Add missing copyright license comments

* Narrowed the dockerignore filter down from "bindings/wasm" to "bindings/wasm/identity_wasm" because bindings/wasm/iota_interaction_ts is needed to build the docker image

* implement TsMoveCalls

* bindings/wasm projects identity_wasm and iota_interaction_ts can be build now and example bindings/wasm/identity_wasm/examples/src/0_basic/-1_test_api_call.ts can be started

* dprint refomated

* assets move calls

* avoid unsafe

* clippy

* Removed IntentFn adapters and fixed several issues reulting from last merged PR - identity_wasm rust toolchain set to "1.84.0"

* implement missing bindings

* make iota_interaction_ts a workspace member again

* TransactionBuilder adaptor

* TransactionBlockResponseAdapter

* fix merge issues

* fmt

* Update package.json

Removed superfluous @iota/iota-sdk dependency from iota_interaction_ts package

* fix formatting and re-add TS ProgrammableTransaction

* identity_wasm fmt

---------

Co-authored-by: chrisgitiota <christof.gerritsma@iota.org>
Co-authored-by: Sebastian Wolfram <wulfraem@users.noreply.github.com>
….1-rc (#1508)

* New feature flag in crate identity_wasm to control dependency identity_iota::resolver

* Updated sources contained in identity_iota_interaction/src/sdk_types to v0.8.1-rc version of the iotaledger/iota repository

* Changed iota dependencies to v0.8.1-rc
   fastcrypto dependency version remains the same with iota v0.8.1-rc
Merged upstream changes from iotaledger/iota v0.9.2-rc into identity_iota_interaction
Merged upstream changes from iotaledger/iota v0.9.2-rc into identity_iota_interaction
* fix typedoc issues after `wasm-bindgen` version bump
@UMR1352 UMR1352 merged commit a0ffdd7 into main May 22, 2025
9 checks passed
@UMR1352 UMR1352 deleted the feat/transaction-client-core-for-identity branch May 22, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants