rif-id-daf
RIF Identity - DAF
npm i @rsksmart/rif-id-daf
Extensions for uPort DAF agent.
Features
Support for RIF Identity key model
uPort DAF provides an Identity provider module that is responsible for the creation of keys and derivation of the respective identity. Each time an identity is created, a new private key is generated. RIF model proposes to use deterministic derivation for private keys, making all the identities associated with a single mnemonic phrase.
The model uses a wallet account like derivation for identity keys:
- Create a mnemonic phrase to derive identities from
- Use BIP32 to derive private keys using
TBD
derivation path
For a better developer experience the extension also provides BIP-44 support. Use mnemonic phrase instead of hex keys.
To use this interface we provide:
- New ORM Entity:
IdentityMnemonic
. Now used to store one single mnemonic. SeedStore
class - interface to store a seedRIFIdKeyManagementSystem
class - wrapper for adaf
AbstractKeyManagementSystem
- responsible for creating private keys derived from the mnemonic's seed.RIFIdentityProvider
class - Extension fordaf
IdentityProvider
enabling to import a mnemonic
All this modules can be plugged to uPort agent as explained in usage to provide uPort agent of this capabilities.
The identity recovery model is to be defined
Usage
To setup a DAF agent using RIF identity provider implementation:
// key store // key management system // rif identity provider await rifIdentityProvider.importMnemonicmnemonic
Extend
- Enable multiple mnemonics
Test
From base repo directory run npm test
or any of the described test script variants.
References
- uPort DAF: https://github.com/uport-project/daf