Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

add Aries Askar as wallet/storage implementation besides Indy SDK #15

Open
2 tasks
Tracked by #14 ...
TimoGlastra opened this issue Sep 30, 2021 · 2 comments
Open
2 tasks
Tracked by #14 ...
Labels
afj Task related to AFJ epic native code Item that involves writing native code

Comments

@TimoGlastra
Copy link
Member

Create abstraction in AFJ that allows us to use both the current, Indy SDK, wallet/storage and a new Aries Askar wallet/storage implementation

@TimoGlastra TimoGlastra added afj Task related to AFJ epic labels Sep 30, 2021
@TimoGlastra TimoGlastra added this to Backlog in Aries Mobile SDK Development via automation Sep 30, 2021
@TimoGlastra TimoGlastra added the native code Item that involves writing native code label Sep 30, 2021
@TimoGlastra
Copy link
Member Author

TimoGlastra commented Oct 24, 2021

Untitled-2021-10-05-1552 (1)

This approach is the same for Indy Credx (#14), Indy VDR (#12) and Aries Askar (#15). For description of Indy Format see #22

@TimoGlastra
Copy link
Member Author

Wallet design

Remove createDid from the wallet. Wallet only focusses on creating and managing keys. Extend to support multiple key types

interface WalletManagement {
  initialize(walletConfig: WalletConfig): Promise<void>;
  create(walletConfig: WalletConfig): Promise<void>;
  open(walletConfig: WalletConfig): Promise<void>;
  close(): Promise<void>;
  delete(): Promise<void>;
}

interface SignOptions {
  data: Buffer | Buffer[];
  publicKey: Buffer;
  keyType: KeyType;
}

interface VerifyOptions {
  data: Buffer | Buffer[];
  signature: Buffer;
  publicKey: Buffer;
  // May be inferred
  keyType: KeyType;
}

interface PackOptions {
  payload: Buffer | string;
  recipientKeys: string[];
  senderKey: string;
}

interface UnpackOptions {
  payload: Buffer;
}

interface UnpackResult {
  payload: string;
  recipientKey: string;
  senderKey?: string;
}

interface Wallet {
  sign(options: SignOptions): Promise<Buffer>;
  verify(options: VerifyOptions): Promise<boolean>;

  pack(options: PackOptions): Promise<Buffer>;
  unpack(options: UnpackOptions): Promise<UnpackResult>;

  generateNonce(): Promise<string>;
}

interface DidRegistrar {
  create();
  update();
  deactivate();
}

// DidRegistrar calls the wallet to create the needed keys
// DidRegistrar creates a did record storing details about a specific did
//  - could only be a did with some metadata (in case of did:key or simple did:peer)
//  - or could be a complete DIDDoc (in case of complex did:peer)

// need to remove seed from startup parameters, you should just call did registrar if you want to call it.
// If the did already exists on the ledger you should somehow be able to add the key to the wallet based on a seed, resolve the did from the ledger, and be able to mark it as owned by me
// no reason at all to only have a single public did
// when issuing with indy credentials, the credential definition determines the did to use for issuance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
afj Task related to AFJ epic native code Item that involves writing native code
Development

No branches or pull requests

1 participant