openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
247 stars 185 forks source link

Add @aries-framework/browser package #1319

Open TimoGlastra opened 1 year ago

TimoGlastra commented 1 year ago

I think we're finally ready!

Probably want a LocalStorageWallet,and LocalStorageStorageService

We may even be able to use the browser kms

alberto-instnt commented 4 months ago

Hello @TimoGlastra was there ever a consensus on this? Was exploring recently the possibility of taking some of the original code base from Rust and using Wasm to construct a browser module and store it in IndexedDB. But was wondering whether Credo has a current Typerscript implementation. Thanks

TimoGlastra commented 4 months ago

Hey @alberto-instnt, we never finished the browser package, but with the modularity of the framework it should be quite straightforward to implement the needed agent dependencies yourself. We could support a browser package by default, but you'd still have to provide a wallet and storage implementation compatible in the browser (these have been extracted from core and must now be provided by another package).

If you'd wnat to use Askar we need to work on separating the crypto from the storage, but you may also be able to create a custom wallet implementation based on other available modules (depending on which crypto you need)

berendsliedrecht commented 4 months ago

A bit of an old one, but you could use this to setup some of it up. Mainly the webpack items were a bit annoying to configure.

https://github.com/berendsliedrecht/afj-browser

It is rather hacky and likely won't work with the current credo-ts, but it might be useful for some inspiration.

I also have this branch of anoncreds-rs (https://github.com/berendsliedrecht/anoncreds-rs/tree/wasm) to make it work with WebAssembly.

alberto-instnt commented 4 months ago

@TimoGlastra Thanks for your response. Why would the current implementation not be compatible with browser? My current understanding from @berendsliedrecht is that there is no CL signature in Credo. Is there more to it? I can always maybe use JSON-LD as a alternative format for credential definition?

Also im not expert in Credo source code, but in an overly simplified way, I am thinking something like this:

Also would I have an issue with Indy-vdr for browser?

Im trying to create a roadmap of the effort needed. Also evaluating WASM.

Thanks :)