Skip to content
pubscout

ssi

4.3.0, released 2 months ago by affinidi.com

Affinidi Self-Sovereign Identity library for Dart and Flutter.

WASM-ready
$ flutter pub add ssi
Source repository

What it does

Provides tools and libraries for implementing Self-Sovereign Identity (SSI) solutions, supporting Decentralised Identifiers (DIDs), Verifiable Credentials (VCs), and Verifiable Presentations (VPs). It manages cryptographic keys and wallets across multiple DID methods.

AI-written summary of version 4.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to implement Decentralised Identifiers (DID) resolution and management.
  • You are building a digital wallet that handles Verifiable Credentials (VCs) and Verifiable Presentations (VPs).
  • You need cryptographic signing and verification using various key management solutions like BIP32 and persistent wallets.

Skip it when

  • You only require standard centralized authentication like OAuth or social logins without decentralized identifiers.
  • You are targeting a Dart SDK version older than 3.10.0.

Strengths

  • Supports multiple DID methods including did:key, did:peer, did:web, and did:webvh.
  • Provides comprehensive Verifiable Credential and Presentation data models (V1 and V2, JWT, and SD-JWT).
  • WebAssembly compatibility through dart2wasm.

Weaknesses

  • Niche domain-specific package with a steep learning curve related to SSI standards.
  • Experimental support for post-quantum algorithms (ML-DSA-44) tied to draft W3C specifications.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
16

Add the dependency to pubspec.yaml and import ssi.dart. Requires Dart SDK version ^3.10.0.

import 'dart:typed_data';
import 'package:base_codecs/base_codecs.dart';
import 'package:ssi/ssi.dart';

void main() async {
  final seed = hexDecode(
    'a1772b144344781f2a55fc4d5e49f3767bb0967205ad08454a09c76d96fd2ccd',
  );

  final keyId = "m/44'/60'/0'/0'/0'";
  final wallet = Bip32Wallet.fromSeed(seed);

  final data = Uint8List.fromList([1, 2, 3]);
  final signature = await wallet.sign(data, keyId: keyId);
  final isRootSignatureValid =
      await wallet.verify(data, signature: signature, keyId: keyId);
  print('check if root signature is valid: $isRootSignatureValid');
}

Works with

Packages commonly used together with ssi: ones it builds on, ones built on it, and its own family.