Git Product home page Git Product logo

wallet's Introduction

Credible header

Check out the Credible documentation here.

Credible

Credible is a native mobile wallet that supports W3C Verifiable Credentials and Decentralized Identifiers built on DIDKit and Flutter. We packaged the DIDKit library written in Rust into a Flutter application running on both Android and iOS, using C bindings and Dart’s FFI capabilities. This is the wallet counterpart to the rich, growing toolkit supplied by DIDKit, the two pillars of a reference architecture for creating trusted interactions at scale.

Security Audits

Credible has undergone the following security reviews:

We are setting up a process to accept contributions. Please feel free to open issues or PRs in the interim, but we cannot merge external changes until this process is in place.

Common Dependencies

To manually build Credible for either Android or iOS, you will need to install the following dependencies:

  • Rust
  • Java 17 or higher
  • Flutter
  • wasm-pack (WEB)
  • binaryen (WEB and targeting ASM.js)

Rust

It is recommended to use rustup to manage your Rust installation.

Java

On Ubuntu you could run:

# apt update
# apt install openjdk-17-jdk

Please ensure you have JAVA_HOME set to the java 17 install when building this project.

For more information, please refer to the documentation of your favorite flavour of Java and your operating system/package manager.

Flutter

Please follow the official instalation instructions available here to install Flutter, don't forget to also install the build dependencies for the platform you will be building (Android SDK/NDK, Xcode, etc).

We currently only support build this project using the dev channel of Flutter.

To change your installation to the dev channel, please execute the following command:

$ flutter channel dev
$ flutter upgrade

To confirm that everything is setup correctly, please run the following command and resolve any issues that arise before proceeding to the next steps.

$ flutter doctor

wasm-pack (Required for both WEB targets)

To build the WASM target you will need wasm-pack, it can be obtained running:

$ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

binaryen

To build Credible for WEB using ASM.js you will need binaryen, which allows the conversion of DIDKit WASM to ASM.js. This is necessary when you don't have WASM support and need to run your page in pure Javascript. More detailed instructions on how to build binaryen can be found here.

If you are in a UNIX-like distribution you just have to clone the repo and build, we recommend cloning into your ${HOME}, to avoid having to specify the ${BINARYEN_ROOT} variable:

$ git clone https://github.com/WebAssembly/binaryen ~/binaryen
$ cd ~/binaryen
$ cmake . && make

Target-Specific Dependencies

Android Dependencies

To build Credible for Android, you will require both the Android SDK and NDK.

These two dependencies can be easily obtained with Android Studio, which install further dependencies upon first being opened after installation. Installing the appropriate Android NDK (often not the newest) in Android Studio can be accomplished by going to Settings > Appearance & Behavior > System Settings > Android SDK and selecting to install the "NDK (Side by Side)".

If your Android SDK doesn't live at $HOME/Android/Sdk you will need to set ANDROID_SDK_ROOT like so:

$ export ANDROID_SDK_ROOT=/path/to/Android/Sdk

Make the above permanant by adding it to your shell initialization script, ~/.bashrc for bash or ~/.cshrc for mac

:::note Some users have experienced difficulties with cross-compilation artefacts missing from the newest NDK, which is downloaded by default in the installation process. If you experience errors of this kind, you may have to manually downgrade or install multiple NDK versions as [shown here])(img/ndk_downgrade.png) in the Android Studio installer (screengrabbed from an Ubuntu installation).

If your build-tools and/or NDK live in different locations than the default ones inside /SDK/, or if you want to specify a specific NDK or build-tools version, you can manually configure the following two environment variables:

$ export ANDROID_TOOLS=/path/to/SDK/build-tools/XX.X.X/
$ export ANDROID_NDK_HOME=/path/to/SDK/ndk/XX.X.XXXXX/

:::

iOS Dependencies

To build Credible for iOS you will need to install CocoaPods, which can be done with Homebrew on MacOS.

$ brew install cocoapods

DIDKit and SSI

This project also depends on two other Spruce projects, DIDKit and SSI.

The correct commits for these projects are submodules in the deps directory. Fetch them by issuing, in the project root directory:

git submodule update --init --recursive

SSI does not need to be explicitly built, it is required only to build DIDkit.

Build DIDkit as:

cd deps/didkit
cargo build   # Build the normal rust library
cd ../../

The above comand just builds DIDkit as a normal Rust library for the hardware you're currently running on. Now we must build it for mobile hardware.

cd deps/didkit/lib

# For Android development, we must cross compile the Rust library for
# several Android binary targets.  You will see simmilar messages appear
# multiple times while this runs.
#
# You only need to do this when building for Android.
make ../target/test/android.stamp

# For iOS development, we must cross compile the Rust library for iOS
# binary targets.
#
# You only need to do this when building for iOS.
make ../target/test/ios.stamp

cd ../../../

Building DIDKit for different targets

Android

To build DIDKit for the Android targets, you will go to the root of DIDKit and run:

$ make -C lib install-rustup-android
$ make -C lib ../target/test/java.stamp
$ make -C lib ../target/test/android.stamp
$ make -C lib ../target/test/flutter.stamp
$ cargo build

This may take some time as it compiles the entire project for multiple targets

Android APK

$ flutter build apk

Android App Bundle

$ flutter build appbundle

iOS

To build DIDKit for the iOS targets, you will go to the root of DIDKit and run :

$ make -C lib install-rustup-ios
$ make -C lib ../target/test/ios.stamp
$ cargo build

Web using WASM

$ make -C lib ../target/test/wasm.stamp

Web using ASM.js

If you have installed bynarien somewhere other than $HOME, you will have to set BYNARIEN_ROOT as shown below, otherwise, just run the make command.

$ export BINARYEN_ROOT=/path/to/binaryen
$ make -C lib ../target/test/asmjs.stamp

Building Credible

You are now ready to build or run Credible.

Run on emulator

If you want to run the project on your connected device, you can use:

$ flutter run

Run on browser

If you want to run the project on your browser, you can use:

$ flutter run -d chrome --csp --release

Otherwise, Flutter allows us to build many artifacts for Android, iOS and WEB, below you can find the most common and useful commands, all of which you should run from the root of Credible.

iOS .app for Simulator

$ flutter build ios --simulator

iOS .app for Devices

$ flutter build ios --no-codesign

iOS IPA

$ flutter build ipa

Web

$ flutter build web \
  --csp \
  --release

If you don't have support for WASM, you'll probably need to provide your own canvaskit dependency without WASM as well as DIDKit, to do that you need to specify the FLUTTER_WEB_CANVASKIT_URL in the build command like below.

$ flutter build web \
  --csp \
  --dart-define=FLUTTER_WEB_CANVASKIT_URL=vendor/ \
  --release

For more details about any of these commands you can run

$ flutter build $SUBCOMMAND --help

Note about canvaskit

Since by default canvaskit comes in a WASM build, in order to the ASM.js be fully supported canvaskit was manually built for this target.

A prebuilt canvaskit is already included in the Credible web folder. If you want to build it by yourself, however, follow these steps:

git clone https://skia.googlesource.com/skia.git --depth 1 --branch canvaskit/0.22.0
cd skia
python2 tools/git-sync-deps
  • Modify build script modules/canvaskit/compile.sh
diff --git a/modules/canvaskit/compile.sh b/modules/canvaskit/compile.sh
index 6ba58bfae9..51f0297eb6 100755
--- a/modules/canvaskit/compile.sh
+++ b/modules/canvaskit/compile.sh
@@ -397,6 +397,7 @@ EMCC_DEBUG=1 ${EMCXX} \
     -s MODULARIZE=1 \
     -s NO_EXIT_RUNTIME=1 \
     -s INITIAL_MEMORY=128MB \
-    -s WASM=1 \
+    -s WASM=0 \
+    -s NO_DYNAMIC_EXECUTION=1 \
     $STRICTNESS \
     -o $BUILD_DIR/canvaskit.js
  • Build canvaskit
$ cd modules/canvaskit
$ make debug
  • Replace this line on $SKIA/modules/canvaskit/canvaskit/bin/canvaskit.js
618c618
< var isNode = !(new Function('try {return this===window;}catch(e){ return false;}')());
---
> var isNode = false;
  • Copy $SKIA/modules/canvaskit/canvaskit/bin/canvaskit.js to $CREDIBLE/web/vendor/

  • Build Credible as described above.

Troubleshooting

If you encounter any errors in the build process described here, please first try clean builds of the projects listed.

For instance, on Flutter, you can delete build files to start over by running:

$ flutter clean

Also, reviewing the install_android_dependencies.sh script may be helpful.

Supported Protocols

All QRCode interactions start as listed below:

  • User scans a QRCode containing a URL;
  • User is presented the choice to trust the domain in the URL;
  • App makes a GET request to the URL;

Then, depending on the type of message, one of the following protocols will be executed.

CredentialOffer

After receiving a CredentialOffer from a trusted host, the app calls the API with subject_id in the form body, that value is the didKey obtained from the private key stored in the FlutterSecureStorage, which is backed by KeyStore on Android and Keychain on iOS.

The flow of events and actions is listed below:

  • User is presented a credential preview to review and make a decision;
  • App generates didKey from the stored private key using DIDKit.keyToDIDKey;
  • App makes a POST request to the initial URL with the subject set to the didKey;
  • App receives and stores the new credential;
  • User is redirect back to the wallet.

And below is another version of the step-by-step:

Wallet 1 Server
Scan QRCode 2
Trust Host ○ / ×
HTTP GET https://domain.tld/endpoint
CredentialOffer
Preview Credential
Choose DID ○ / ×
HTTP POST 3 https://domain.tld/endpoint
VerifiableCredential
Verify Credential
Store Credential

1 Whether this action requires user confirmation, exiting the flow early when the user denies. 2 The QRCode should contain the HTTP endpoint where the requests will be made. 3 The body of the request contains a field subject_id set to the chosen DID.

VerifiablePresentationRequest

After receiving a VerifiablePresentationRequest from a trusted host, the app calls the API with presentation the form body, that value is a JSON encoded string with the presentation obtained from the selected credential and signed with the credential's private key using DIDKit.issuePresentation.

Here are some of the parameters used to generate a presentation:

  • presentation
    • id is set to a random UUID.v4 string;
    • holder is set to the selected credential's didKey;
    • verifiableCredential is set to the credential value;
  • options
    • verificationMethod is set to the DID's verificationMethod id;
    • proofPurpose is set to 'authentication';
    • challenge is set to the request's `challenge';
    • domain is set to the request's `domain';
  • key is the credential's stored private key;

The flow of events and actions is listed below:

  • User is presented a presentation request to review and make a decision;
  • App generates didKey from the stored private key using DIDKit.keyToDIDKey;
  • App issues a presentation using DIDKit.issuePresentation;
  • App makes a POST request to the initial URL with the presentation;
  • User is redirect back to the wallet.

And below is another version of the step-by-step:

Wallet 1 Server
Scan QRCode 2
Trust Host ○ / ×
HTTP GET https://domain.tld/endpoint
VerifiablePresentationRequest
Preview Presentation
Choose Verifiable Credential ○ / ×
HTTP POST 3 https://domain.tld/endpoint
Result

1 Whether this action requires user confirmation, exiting the flow early when the user denies. 2 The QRCode should contain the HTTP endpoint where the requests will be made. 3 The body of the request contains a field presentation set to the verifiable presentation.

wallet's People

Contributors

bumblefudge avatar charlesshuller avatar clehner avatar grdsdev avatar krhoda avatar obstropolos avatar sbihel avatar skgbafa avatar theosirian avatar w4ll3 avatar wyc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wallet's Issues

can not create a new install

I tried to do a fresh android install but I'm struck at make -C lib ../target/test/aar.stamp which is failing with the following message :

make: *** Aucune règle pour fabriquer la cible « ../target/test/aar.stamp ». Arrêt.`

which mean something like : No rules to build the target « ../target/test/aar.stamp ». Stopping.
If I try to revert to old DidKit version I have compilation errors like :

error[E0061]: this function takes 3 arguments but 2 arguments were supplied
    --> lib/src/jni.rs:124:40
     |
124  |     let proof = rt.block_on(credential.generate_proof(&key, &options))?;
     |                                        ^^^^^^^^^^^^^^ ----  -------- supplied 2 arguments
     |                                        |
     |                                        expected 3 arguments

At the end of the installation process credible is "working" but there is no libdidkit.so library available.
Same issue with stable or dev channel.

Stuck at Splash screen

The app hands at the splash screen (blurry view of the app). In the log, below, there is a "Unhandled Exception: PlatformException".

  • Flutter (Channel main, 3.1.0-0.0.pre.1066, on Debian GNU/Linux bookworm/sid 5.15.0-3-amd64, locale C.UTF-8)
  • Android SDK version 30.0.3
  • Android version 11 (Linux 3.4.113-lineageos-ge89434a69fe), armv7l
$ flutter run
"fr": 5 untranslated message(s).
To see a detailed report, use the untranslated-messages-file
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
<other option>: <other selection>


This will generate a JSON format file containing all messages that
need to be translated.
Launching lib/main.dart on SM G900T in debug mode...
Warning: The plugin qr_code_scanner requires Android SDK version 32.
For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to /home/cel/src/credible/android/app/build.gradle:
android {
  compileSdkVersion 32
  ...
}

Running Gradle task 'assembleDebug'...                           2,691ms
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
W/FlutterActivityAndFragmentDelegate( 4875): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Syncing files to device SM G900T...                                137ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on SM G900T is available at: http://127.0.0.1:41695/06rfaqJ1gng=/
I/flutter ( 4875): AppModule started!
I/flutter ( 4875): 0.4.0
The Flutter DevTools debugger and profiler on SM G900T is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:41695/06rfaqJ1gng=/
E/flutter ( 4875): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(NotAvailable, Required security features not enabled, null, null)
E/flutter ( 4875): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:647:7)
E/flutter ( 4875): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:18)
E/flutter ( 4875): <asynchronous suspension>
E/flutter ( 4875): #2      LocalAuthentication.authenticate (package:local_auth/local_auth.dart:124:13)
E/flutter ( 4875): <asynchronous suspension>
E/flutter ( 4875): #3      _AppWidgetState._authenticate (package:credible/app/app_widget.dart:48:12)
E/flutter ( 4875): <asynchronous suspension>
E/flutter ( 4875): #4      _AppWidgetState._unlockOnLoad (package:credible/app/app_widget.dart:57:9)
E/flutter ( 4875): <asynchronous suspension>
E/flutter ( 4875):
I/flutter ( 4875): -- OnBoardingModule INITIALIZED
W/Adreno-EGL( 4875): <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL( 4875): <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE

Error: Expected a value of type 'FutureOr<JSObject<CryptoKey>>?', but got one of type 'CryptoKey'

I'm getting the following exception on the Private Key Generation screen while running in Chrome:

Uncaught (in promise) Error: Expected a value of type 'FutureOr<JSObject<CryptoKey>>?', but got one of type 'CryptoKey'
    at Object.throw_ [as throw] (errors.dart:251)
    at Object.castError (errors.dart:84)
    at Object.cast [as as] (operations.dart:442)
    at dart.NullableType.new.as (types.dart:417)
    at js_util.dart:183

Output of flutter doctor:
[✓] Flutter (Channel dev, 2.3.0-0.1.pre, on macOS 11.3 20E232 darwin-x64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.2)
[✓] Connected device (1 available)

I'm pretty sure this is a duplicate of dart-lang/sdk#44499 but wondering if you have a workaround.

DID Alias Map

I'm leaning towards a local array of arbitrary, user-defined strings with DIDs as keys as an object in local memory
1.) portability/sync between different credible form factors may be required later so we may need to pick a type of object/array that works across contexts.
2.) eventually we might need to align this with:
https://identity.foundation/faq/#what-exactly-is-a-connection-is-it-a-transport-is-it-ephemeral
and/or
https://w3c-ccg.github.io/universal-wallet-interop-spec/#connection
passive interop might be fine-- if our data model connection doesn't align perfectly with the Aries one, it's fine, as long as it's relatively feasible to translate between the two on im/export.

can't find libdidkit.so on fresh android install

Fresh install for ios is working fine.

When building for android, I don't have any error message.
The credible app is launching but when DynamicLibrary.open('libdidkit.so') occurs I have an error message : libdidkit.so.
here's the list of libdidkit.so files I have in my spruceid folder :
./didkit/target/debug/libdidkit.so
./didkit/target/debug/deps/libdidkit.so
./didkit/target/release/libdidkit.so
./didkit/target/release/deps/libdidkit.so
./didkit/target/armv7-linux-androideabi/release/libdidkit.so
./didkit/target/armv7-linux-androideabi/release/deps/libdidkit.so
./didkit/target/aarch64-linux-android/release/libdidkit.so
./didkit/target/aarch64-linux-android/release/deps/libdidkit.so
./didkit/target/x86_64-linux-android/release/libdidkit.so
./didkit/target/x86_64-linux-android/release/deps/libdidkit.so
./didkit/target/i686-linux-android/release/libdidkit.so
./didkit/target/i686-linux-android/release/deps/libdidkit.so
./didkit/lib/android/didkit/src/main/jniLibs/x86/libdidkit.so
./didkit/lib/android/didkit/src/main/jniLibs/arm64-v8a/libdidkit.so
./didkit/lib/android/didkit/src/main/jniLibs/x86_64/libdidkit.so
./didkit/lib/android/didkit/src/main/jniLibs/armeabi-v7a/libdidkit.so
./didkit/lib/flutter/android/src/main/jniLibs/arm64-v8a/libdidkit.so
./didkit/lib/flutter/android/src/main/jniLibs/x86_64/libdidkit.so
./didkit/lib/flutter/android/src/main/jniLibs/armeabi-v7a/libdidkit.so
./didkit/lib/flutter/libdidkit.so
./didkit/lib/python/didkit/libdidkit.so

So I don't have any libdidkit.so files in credible/build/ folders

Build failure with mergeDebugJniLibFolders

  • #101
  • Flutter (Channel main, 3.1.0-0.0.pre.1066, on Debian GNU/Linux bookworm/sid 5.15.0-3-amd64, locale C.UTF-8)
  • Android toolchain - develop for Android devices (Android SDK version 30.0.3)
$ flutter run
"fr": 5 untranslated message(s).
To see a detailed report, use the untranslated-messages-file
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
<other option>: <other selection>


This will generate a JSON format file containing all messages that
need to be translated.
Launching lib/main.dart on [...] in debug mode...
Warning: The plugin qr_code_scanner requires Android SDK version 32.
For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to /home/cel/src/credible/android/app/build.gradle:
android {
  compileSdkVersion 32
  ...
}


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':didkit:mergeDebugJniLibFolders'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Running Gradle task 'assembleDebug'...                           2,110ms
Exception: Gradle task assembleDebug failed with exit code 1

didkit targets are built:

$ ls -lL lib/android/didkit/src/main/jniLibs/*/libdidkit.so
-rwxr-xr-x 1 cel cel 13237776 Jun  2 13:49 lib/android/didkit/src/main/jniLibs/arm64-v8a/libdidkit.so
-rwxr-xr-x 1 cel cel  9391496 Jun  2 13:46 lib/android/didkit/src/main/jniLibs/armeabi-v7a/libdidkit.so
-rwxr-xr-x 1 cel cel 16317080 Jun  2 13:44 lib/android/didkit/src/main/jniLibs/x86/libdidkit.so
-rwxr-xr-x 1 cel cel 15621520 Jun  2 13:51 lib/android/didkit/src/main/jniLibs/x86_64/libdidkit.so
$ ls -lL lib/flutter/android/src/main/jniLibs/*/libdidkit.so
-rwxr-xr-x 1 cel cel 13237776 Jun  2 13:49 lib/flutter/android/src/main/jniLibs/arm64-v8a/libdidkit.so
-rwxr-xr-x 1 cel cel  9391496 Jun  2 13:46 lib/flutter/android/src/main/jniLibs/armeabi-v7a/libdidkit.so
-rwxr-xr-x 1 cel cel 15621520 Jun  2 13:51 lib/flutter/android/src/main/jniLibs/x86_64/libdidkit.so

Error when loading did on RELEASE builds

When running on release builds the app fails to load the did.

The error thrown is:

Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, didkit_key_to_did): symbol not found)

It seems to be an issue when linking the didkit lib on release builds.

error: unable to find library -lunwind

  1. Cloned didkit and ssi in the same level in a folder
  2. Ran cargo build in the didkit root folder
  3. Ran cd ./lib
  4. Ran make ../target/test/android.stamp

Got this error:

error: linking with `i686-linux-android19-clang` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="... "-o" "~/Desktop/didkit/target/i686-linux-android/release/deps/libdidkit.so" "-Wl,--gc-sections" "-shared" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs"
  = note: ld: error: unable to find library -lunwind
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `didkit` (lib) due to previous error
make: *** [../target/i686-linux-android/release/libdidkit.so] Error 101"

I ran brew install lunwind:

➜  lib git:(main) ✗ brew install lunwind 
Warning: No available formula with the name "lunwind". Did you mean luabind or libunwind?
==> Searching for similarly named formulae and casks...
==> Formulae
luabind

To install luabind, run:
  brew install luabind

I ran brew install luabind:

➜  lib git:(main) ✗ brew install luabind
Error: luabind has been disabled because it is not maintained upstream!

I ran brew install libunwind:

➜  lib git:(main) ✗ brew install libunwind
libunwind: Linux is required for this software.
Error: libunwind: An unsatisfied requirement failed this build.

Dependency mismatch with DIDKit

With spruceid/didkit#60 and current Credible, there is a dependency conflict:

credible$ flutter pub get
Because path_provider >=1.6.17 <2.0.0-nullsafety depends on path_provider_windows ^0.0.4 which depends on ffi ^0.1.3, path_provider >=1.6.17 <2.0.0-nullsafety requires ffi ^0.1.3.
And because every version of didkit from path depends on ffi ^0.3.0-nullsafety.1, path_provider >=1.6.17 <2.0.0-nullsafety is incompatible with didkit from path.
So, because credible depends on both didkit from path and path_provider ^1.6.24, version solving failed.
Running "flutter pub get" in credible...                                
pub get failed (1; So, because credible depends on both didkit from path and path_provider ^1.6.24, version solving failed.)

Should Credible have dependency updates corresponding to the updates in DIDKit?

IOS Release mode issue

Hi Team.

I am facing 1 issue while integrating the did kit library in flutter.

When I am running on device locally by connecting cable with my mac in debug mode, I am able to get the did key generated. However, when I am archiving it and uploading on the Testflight, did key is not getting generated.

Can you please let me know where could be the issue? Is there any issue already reported.

Thank you
Rohit

Support credentials without expiration date

Adding a credential that doesn't have an expirationDate property results in an unhandled error. It looks like because the date is parsed without checking, here:
https://github.com/spruceid/credible/blob/main/lib/app/pages/credentials/models/credential.dart#L20

Stack trace:

[ +389 ms] E/flutter (30994): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)]
Unhandled Exception: Unhandled error Invalid argument(s) (input): Must not be
null occurred in Instance of 'ScanBloc'.
[        ] E/flutter (30994): #0      _RegExp.firstMatch
(dart:core-patch/regexp_patch.dart:221:24)
[        ] E/flutter (30994): #1      DateTime.parse
(dart:core/date_time.dart:266:23)
[        ] E/flutter (30994): #2      new CredentialModel.fromMap
(package:credible/app/pages/credentials/models/credential.dart:20:26)
[        ] E/flutter (30994): #3      CredentialsRepository.findAll.<anonymous
closure>
(package:credible/app/pages/credentials/repositories/credential.dart:22:44)
[        ] E/flutter (30994): #4      MappedListIterable.elementAt
(dart:_internal/iterable.dart:411:31)
[        ] E/flutter (30994): #5      ListIterator.moveNext
(dart:_internal/iterable.dart:340:26)
[        ] E/flutter (30994): #6      new
_GrowableList._ofEfficientLengthIterable
(dart:core-patch/growable_array.dart:188:27)
[        ] E/flutter (30994): #7      new _GrowableList.of
(dart:core-patch/growable_array.dart:150:28)
[        ] E/flutter (30994): #8      new List.of
(dart:core-patch/array_patch.dart:50:28)
[        ] E/flutter (30994): #9      ListIterable.toList
(dart:_internal/iterable.dart:211:44)
[        ] E/flutter (30994): #10     CredentialsRepository.findAll
(package:credible/app/pages/credentials/repositories/credential.dart:22:62)
[        ] E/flutter (30994): <asynchronous suspension>
[        ] E/flutter (30994): #11     WalletBloc.findAll.<anonymous closure>
(package:credible/app/pages/credentials/blocs/wallet.dart)
[        ] E/flutter (30994): <asynchronous suspension>

Cannot build DIDKit for Android

I'm following the instructions to run the app. I've installed DIDKit, SSI. Cloned the Credible repository and put didkit, ssi and spruce into the same directory. I've been able to run the command make -C lib install-rustup-android and make -C lib ../target/test/java.stamp successfully but when I run make -C lib ../target/test/android.stamp, I get errors. Below is the full output of the command. What could be the issue here? As it says in the output, an error occurrs while building the dependency ring. I've checked out lots of issues and questions but I couldn't find an answer. I'm using Pop!_OS 21.10 which is based on Ubuntu 21.10.

make: Entering directory '/home/sametsahin/work/spruceid/didkit/lib'
jar -cf ../target/didkit.jar -C ../target/jvm com/spruceid/DIDKit.class -C ../target/jvm com/spruceid/DIDKitException.class
PATH=/home/sametsahin/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin:"/home/sametsahin/.nvm/versions/node/v16.15.1/bin:/home/sametsahin/.cargo/bin:/home/sametsahin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin:/home/sametsahin/work/android-studio/bin:/home/sametsahin/Android/Sdk/emulator:/home/sametsahin/Android/Sdk/platform-tools:/opt/idea-IC-203.7148.57/bin:/home/sametsahin/work/flutter/bin:/home/sametsahin/work/flutter/bin/cache/dart-sdk/bin:/home/sametsahin/.pub-cache/bin:/usr/share/code:/home/sametsahin/work/google-cloud-sdk/bin" \
cargo build --lib --release --target i686-linux-android
warning: /home/sametsahin/work/spruceid/didkit/http/Cargo.toml: only one of `license` or `license-file` is necessary
`license` should be used if the package license can be expressed with a standard SPDX expression.
`license-file` should be used if the package uses a non-standard license.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields for more information.
warning: /home/sametsahin/work/spruceid/didkit/lib/Cargo.toml: only one of `license` or `license-file` is necessary
`license` should be used if the package license can be expressed with a standard SPDX expression.
`license-file` should be used if the package uses a non-standard license.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields for more information.
warning: /home/sametsahin/work/spruceid/didkit/cli/Cargo.toml: only one of `license` or `license-file` is necessary
`license` should be used if the package license can be expressed with a standard SPDX expression.
`license-file` should be used if the package uses a non-standard license.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields for more information.
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.13.0
   Compiling subtle v2.4.1
   Compiling byteorder v1.4.3
   Compiling pin-project-lite v0.2.9
   Compiling opaque-debug v0.3.0
   Compiling cpufeatures v0.2.2
   Compiling futures-io v0.3.21
   Compiling bytes v1.2.1
   Compiling block-padding v0.2.1
   Compiling itoa v1.0.2
   Compiling constant_time_eq v0.1.5
   Compiling arrayref v0.3.6
   Compiling keccak v0.1.2
   Compiling futures-sink v0.3.21
   Compiling arrayvec v0.7.2
   Compiling data-encoding v2.3.2
   Compiling pin-utils v0.1.0
   Compiling base-x v0.2.11
   Compiling ppv-lite86 v0.2.16
   Compiling smallvec v1.9.0
   Compiling unsigned-varint v0.7.1
   Compiling ryu v1.0.10
   Compiling cache-padded v1.2.0
   Compiling adler v1.0.2
   Compiling const-oid v0.5.2
   Compiling fnv v1.0.7
   Compiling const-oid v0.6.2
   Compiling tap v1.0.1
   Compiling wyz v0.2.0
   Compiling funty v1.1.0
   Compiling foreign-types-shared v0.1.1
   Compiling tinyvec_macros v0.1.0
   Compiling matches v0.1.9
   Compiling parking v2.0.0
   Compiling waker-fn v1.1.0
   Compiling fastrand v1.8.0
   Compiling spin v0.5.2
   Compiling bitflags v1.3.2
   Compiling event-listener v2.5.3
   Compiling base64 v0.13.0
   Compiling hashbrown v0.12.3
   Compiling static_assertions v1.1.0
   Compiling byte-tools v0.3.1
   Compiling openssl-probe v0.1.5
   Compiling async-task v4.3.0
   Compiling try-lock v0.2.3
   Compiling unicode-bidi v0.3.8
   Compiling percent-encoding v2.1.0
   Compiling atomic-waker v1.0.0
   Compiling hex v0.4.3
   Compiling scopeguard v1.1.0
   Compiling tower-service v0.3.2
   Compiling httpdate v1.0.2
   Compiling subtle v1.0.0
   Compiling either v1.7.0
   Compiling fake-simd v0.1.2
   Compiling hashbrown v0.11.2
   Compiling opaque-debug v0.2.3
   Compiling pct-str v1.1.0
   Compiling langtag v0.2.0
   Compiling base64 v0.12.3
   Compiling ryu-js v0.2.2
   Compiling json v0.12.4
   Compiling arrayvec v0.5.2
   Compiling untrusted v0.7.1
   Compiling mown v0.2.1
   Compiling ucd-trie v0.1.4
   Compiling mime v0.3.16
   Compiling ipnet v2.5.0
   Compiling bech32 v0.8.1
   Compiling combination v0.1.5
   Compiling ssi-contexts v0.1.3 (/home/sametsahin/work/spruceid/ssi/contexts)
   Compiling regex-syntax v0.6.27
   Compiling gimli v0.26.2
   Compiling rustc-demangle v0.1.21
   Compiling dyn-clone v1.0.8
   Compiling lalrpop-util v0.19.8
   Compiling memsec v0.6.2
   Compiling xxhash-rust v0.8.5
   Compiling cesu8 v1.1.0
   Compiling jni-sys v0.3.0
   Compiling typenum v1.15.0
   Compiling libc v0.2.126
   Compiling memchr v2.5.0
   Compiling serde v1.0.141
   Compiling log v0.4.17
   Compiling futures-core v0.3.21
   Compiling anyhow v1.0.59
   Compiling getrandom v0.1.16
   Compiling crunchy v0.2.2
   Compiling parking_lot_core v0.9.3
   Compiling futures-channel v0.3.21
   Compiling futures-task v0.3.21
   Compiling futures-util v0.3.21
   Compiling radium v0.6.2
   Compiling tiny-keccak v2.0.2
   Compiling tracing-core v0.1.29
   Compiling serde_json v1.0.82
   Compiling blake2b_simd v1.0.0
   Compiling blake2s_simd v1.0.0
   Compiling concurrent-queue v1.2.4
   Compiling miniz_oxide v0.5.3
   Compiling http v0.2.8
   Compiling der v0.4.5
   Compiling foreign-types v0.3.2
   Compiling tinyvec v1.6.0
   Compiling crc32fast v1.3.2
   Compiling httparse v1.7.1
   Compiling lazy_static v1.4.0
   Compiling async-lock v2.5.0
   Compiling fixed-hash v0.7.0
   Compiling block-padding v0.1.5
   Compiling form_urlencoded v1.0.1
   Compiling crossbeam-utils v0.8.11
   Compiling encoding_rs v0.8.31
   Compiling iref v2.1.3
   Compiling blake2b_simd v0.5.11
   Compiling cached v0.30.0
   Compiling libm v0.2.3
   Compiling generic-array v0.14.5
   Compiling value-bag v1.0.0-alpha.9
   Compiling num-traits v0.2.15
   Compiling indexmap v1.9.1
   Compiling num-integer v0.1.45
   Compiling slab v0.4.7
   Compiling lock_api v0.4.7
   Compiling num-bigint v0.2.6
   Compiling blake3 v1.3.1
   Compiling tokio v1.20.1
   Compiling num-bigint v0.4.3
   Compiling clear_on_drop v0.2.5
   Compiling ring v0.16.20
   Compiling num-iter v0.1.43
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/home/sametsahin/work/spruceid/didkit/target/release/build/ring-203a974efa355649/build-script-build` (exit status: 101)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("i686-linux-android")
  HOST = Some("x86_64-unknown-linux-gnu")
  CC_i686-linux-android = None
  CC_i686_linux_android = None
  TARGET_CC = None
  CC = None
  CFLAGS_i686-linux-android = None
  CFLAGS_i686_linux_android = None
  TARGET_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")

  --- stderr
  running "i686-linux-android-clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-c" "-o/home/sametsahin/work/spruceid/didkit/target/i686-linux-android/release/build/ring-bb955e14aaf4337f/out/aesni-x86-elf.o" "/home/sametsahin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesni-x86-elf.S"
  thread 'main' panicked at 'failed to execute ["i686-linux-android-clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-c" "-o/home/sametsahin/work/spruceid/didkit/target/i686-linux-android/release/build/ring-bb955e14aaf4337f/out/aesni-x86-elf.o" "/home/sametsahin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesni-x86-elf.S"]: No such file or directory (os error 2)', /home/sametsahin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:653:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:99: ../target/i686-linux-android/release/libdidkit.so] Error 101
make: Leaving directory '/home/sametsahin/work/spruceid/didkit/lib'

The plugin `didkit` requires your app to be migrated to the Android embedding v2

I have followed the instructions to get credible up and running but when I run flutter run I get the following error:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

  /Users/joe/GitHub/credible/android/app/src/main/AndroidManifest.xml uses
  `android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin `didkit` requires your app to be migrated to the Android embedding v2. Follow the steps on
https://flutter.dev/go/android-project-migration and re-run this command.

Do I need to follow the migration guide as it suggests or is there another way to fix this?

Thanks for any help 🙂

After running on flutter web : Cannot read properties of undefined (reading 'getVersion')

I've properly done setup of both WASM and ASM.js, after running in chrome, this is the error :

The following JSNoSuchMethodError was thrown building Builder:
TypeError: Cannot read properties of undefined (reading 'getVersion')

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 3.19.0-0.4.pre, on macOS 12.6.7 21G651 darwin-x64, locale
en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.86.0)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

installed wasm-pack and binaryen successfully with no issues.

$ make -C lib ../target/test/wasm.stamp - command executed fully successfully

$ make -C lib ../target/test/asmjs.stamp. - command not success :
make: *** No rule to make target `../target/test/asmjs.stamp'. Stop.

can't finish presentation with defaultDIDMethod = 'key'

When trying a DIDAuth presentation (https://talao.co/wallet/test/presentationRequest), with key as default method, I have an error.
The error is happening in didkit.dart:

final vm = key_to_verification_method(
        methodPattern.toNativeUtf8(), key.toNativeUtf8());

vm equal Pointer: address=0x0
methodePattern = "key"
key = {"kty":"OKP","crv":"Ed25519","d":"skMDj_TuYaq1ZB-4ZzntpN-7CQjOqKl69Zs5-8gPO4w=","x":"AMKCOePOz8RFfSLFOqi5Rtf4TvG6EOxPX3T6TWhSgNLi"}

Unable to take screenshot

On Android, the app disallows taking screenshots. As a user, I want to be able to take screenshots.

Support Screen

Must add our support informations like links to GitHub issues to Profile -> Support.

didkit build error

while I was building credible, following the steps in README, I had some problem running

 make -C lib ../target/test/android.stamp

error:

// snip..
"-Wl,-Bdynamic" "-ldl" "-llog" "-lunwind" "-ldl" "-lm" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/uni01/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/i686-linux-android/lib" "-o" "/home/uni01/spruceid/didkit/target/i686-linux-android/release/deps/libdidkit.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
  = note: ld: error: unable to find library -lunwind

however I have libunwind installed on my system

libunwind.so
libunwind.so.8
libunwind.so.8.0.1
libunwind-x86_64.a
libunwind-x86_64.so
libunwind-x86_64.so.8
libunwind-x86_64.so.8.0.1

and about LD_LIBRARY_PATH:

/usr/lib/x86_64-linux-gnu

so what is going on and what i have missed?

flutter android : Failed to load dynamic library 'libdidkit.so': dlopen failed: library "libdidkit.so" not found

iOS is working perfectly fine.

after running the project on android, it shows Failed to load dynamic library 'libdidkit.so': dlopen failed: library "libdidkit.so" not found.

every make command is success

this is my file structure after making every .stamp files successfully
iam guessing libdidkit.so file should be found in ../../target/release/libdidkit.so, but its not there,iam seeing Its available in different in folders x86_64,x86_64-linux-android,i686-linux-android etc as seen in the release folder.
Ive tried copying that file , but no luck

Notices Screen

Must add our OSS notices and licenses to Profile -> Notices.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.