Open TimoGlastra opened 2 years ago
This approach is the same for Indy Credx (#14), Indy VDR (#12) and Aries Askar (#15). For description of Indy Format
see #22
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
Create abstraction in AFJ that allows us to use both the current, Indy SDK, wallet/storage and a new Aries Askar wallet/storage implementation
AskarWallet
andAskarStorageService
implementations that leverages aries-askar