Skip to content

Expose caching ZK artifacts as an artifact source - #463

Open
Dzejkop wants to merge 3 commits into
mainfrom
agent/export-zk-artifact-source
Open

Expose caching ZK artifacts as an artifact source#463
Dzejkop wants to merge 3 commits into
mainfrom
agent/export-zk-artifact-source

Conversation

@Dzejkop

@Dzejkop Dzejkop commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What changed

  • add CachingZkArtifacts.as_zk_artifact_source
  • return the exported WalletKitZkArtifactSource trait object required by UniFFI consumers

Why

Rust blanket trait implementations are not represented as Swift or Kotlin class inheritance. The generated mobile bindings therefore could construct and preload CachingZkArtifacts, but could not pass it to authenticator initializers accepting WalletKitZkArtifactSource.

Impact

Swift and Kotlin consumers can now call asZkArtifactSource() after preloading and pass the result to authenticator initialization.

Validation

  • cargo +nightly fmt --all -- --check
  • nix develop --command cargo check -p walletkit-core --all-features
  • regenerated Swift and Kotlin UniFFI bindings and verified asZkArtifactSource() returns WalletKitZkArtifactSource

Note

Low Risk
Small FFI surface addition with no change to ZK loading, caching, or authenticator logic beyond how types are passed across bindings.

Overview
Adds as_zk_artifact_source() on CachingZkArtifacts and EmbeddedZkArtifacts, returning Arc<dyn WalletKitZkArtifactSource> so Swift and Kotlin can pass preloaded/cached sources into authenticator setup.

UniFFI does not surface Rust blanket WalletKitZkArtifactSource impls as subclassing, so mobile code could build and preload these types but could not satisfy APIs that take the trait object until this explicit conversion exists.

Reviewed by Cursor Bugbot for commit d7a5f09. Bugbot is set up for automated code reviews on this repo. Configure here.

@Dzejkop
Dzejkop marked this pull request as ready for review August 6, 2026 14:02
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.

2 participants