IdentityWallet SDK implements the 3ID protocol, which is exposed with the ThreeIdProvider
. It also provides additional functionality that can be used within the wallet. 3ID is used for user identity, encryption, and data authorization.
Auth
Signing Verifiable Claims
Encrypt/Decrypt
Sends a request to the provider that is handled by the IdentityWallet instance the provider was retrieved from.
Kind: instance method of ThreeIdProvider
Returns: Promise<Object>
- The response to send back to the rpc requester
Param | Type | Description |
rpcRequest |
| The 3ID JSON-RPC request |
origin |
| The URI origin of the request |
callback |
| (Optional) A callback function. Takes two params, (error, response) |
Creates an instance of IdentityWallet
Returns: this
- An IdentityWallet instance
Param | Type | Description |
config |
| The configuration to be used |
config.seed |
| The seed of the identity, 32 hex string |
config.authSecret |
| The authSecret to use, 32 hex string |
config.ethereumAddress |
| The ethereumAddress of the identity |
Get the 3IDProvider
Kind: instance method of IdentityWallet
Returns: ThreeIdProvider
- The 3IDProvider for this IdentityWallet instance
Link a blockchain address to the identity. Usually the address would be an ethereum address (EOA or EIP1271 compatible contract) and the provider is an JSON-RPC provider that can sign a message with this address using personal_sign
.
Param | Type | Description |
address |
| The address to link |
provider |
| The provider that can sign a message for the given address |
Kind: instance method of IdentityWallet
Returns: Object
- The link proof object
Authenticate to given spaces
Kind: instance method of IdentityWallet
Returns: Object
- The public keys for the requested spaces of this identity
Param | Type | Description |
spaces |
| The desired spaces |
opts |
| Optional parameters |
opts.authData |
| The authData for this identity |
Check if authenticated to given spaces
Kind: instance method of IdentityWallet
Returns: Boolean
- True if authenticated
Param | Type | Description |
spaces |
| The desired spaces |
Add a new authentication method for this identity.
Kind: instance method of IdentityWallet
Param | Type | Description |
authSecret |
| A 32 byte hex string used as authentication secret |
Sign a verifiable credential. The format of the credential is did-jwt.
Kind: instance method of IdentityWallet
Returns: String
- The signed claim encoded as a JWT
Param | Type | Description |
payload |
| The payload of the claim |
opts |
| Optional parameters |
opts.DID |
| The DID used as the issuer of this claim |
opts.space |
| The space used to sign the claim |
opts.expiresIn |
| Set an expiry date for the claim as unix timestamp |
Encrypt a message
Kind: instance method of IdentityWallet
Returns: Object
- The encrypted object (ciphertext and nonce)
Param | Type | Description |
message |
| The message to be encrypted |
space |
| The space used for encryption |
opts |
| Optional parameters |
opts.nonce |
| The nonce used to encrypt the message |
opts.blockSize |
| The blockSize used for padding (default 24) |
Decrypt a message
Kind: instance method of IdentityWallet
Returns: String
- The decrypted message
Param | Type | Description |
encryptedObject |
| The encrypted object (ciphertext and nonce) |
space |
| The space used for encryption |