README
React Native Evernym SDK
Introduction
Self Sovereign Identity is a lifetime portable identity for any person, organization, or thing that does not depend on any centralized authority and can never be taken away. Self-sovereign identity is a two-party relationship model, with no third party coming between you and the organization, now considered your “peer”.
SSI is possible today with DIDs and Verifiable Credentials.
Decentralized Identifier - DID
DID is a new type of globally unique identifier (URI) that does not require a centralized registration authority because control of the identifier can be proved using cryptography. You can think of it like one of the identifiers we’re more familiar with—a domain name or a phone number—without a central registrar like ICANN or NANP.
Verifiable Credentials
Verifiable Credential (VC) is the new format for interoperable digital credential being defined by the W3C Verifiable Claims Working Group. Verifiable credentials conform to the W3C’s Verifiable Credentials Data Model, and they facilitate interactions using a pattern called the triangle of trust:
Issuers create credentials, usually by having JSON docs digitally signed in a special way. Holders store them, and verifiers ask for proof based upon them. Verifiable presentations that Holders provide to Verifiers are packages of evidence—either credentials, or data derived from one or more credentials—built by holders to satisfy a verifier’s requirements. Verifiers learn with certainty which issuers have attested something by checking digital signatures against a verifiable data registry (typically, a blockchain).
React MSDK
React MSDK is built as an Aries compatible React Native package which allows the quick building of customized applications representing a Holder side in the Verifiable Credentials model. The application will be able to establish secure connections with institutions, accept and store Verifiable Credentials from Issuers, and provide Zero Knowledge Proofs to Verifiers.
Creating a new application with React MSDK
To create a new project, you would need to go through the following steps.
Create base app
Create new react native project. We will call it awesomeMsdkProject
for this guide.
npx react-native init awesomeMsdkProject --version 0.61.4
NOTE: you need to use the same version of react-native
as specified in peerDependencies
section of package.json
file for the evernym react-native-sdk.
The currently recommended React-Native version is 0.61.4
.
By using a different version you are taking a risk of having issues with sdk.
Base app configuration
To include SDK in your new application, you need to set up it's dependencies.
Replace dependencies section leaving only@dev/react-native-evernym-sdk
dependency to yourpackage.json
."dependencies": { "@dev/react-native-evernym-sdk": "https://gitlab.com/evernym/mobile/react-native-evernym-sdk.git", },
Native dependencies should be put in app dependencies (see issue). They are listed as peer dependencies in SDK.
Add all peer dependencies fromreact-native-evernym-sdk
intodependencies
section of your apppackage.json
."dependencies": { "@react-native-community/async-storage": "x", ... "react-native-zip-archive": "x", "react-native": "0.61.4", "rn-fetch-blob": "x", ... },
Add dev dependencies to
devDependencies
section of your apppackage.json
:"devDependencies": { ... "copyfiles": "x" },
Add the following command to your
scripts
section of your apppackage.json
:"scripts": { ... "evernym-sdk:configure": "yarn --cwd node_modules/@dev/react-native-evernym-sdk run configure" },
This command will add necessary modules for future application customization via
evernym-sdk
.Now you can install all dependencies and do the automatic configuration, run following commands in your project directory:
yarn yarn evernym-sdk:configure
This will install all dependencies and add required modules to the
awesomeMsdkProject/app/evernym-sdk
directory.
- Remove default
App.js
and put the following inindex.js
:import * as EvernymSdk from '@dev/react-native-evernym-sdk'; import {name as appName} from './app.json'; EvernymSdk.createApp(appName);
- Congrats! Now we have ready JS part of the application. As the next steps, we need to configure the build for the target platforms.
Android
Note: At this point, you should already have completed Base app configuration section.
In order to configure the building of your application for an Android platform see the document.
iOS
Note: At this point, you should already have completed Base app configuration section.
In order to configure the building of your application for an Android platform see the document.
Customization
See documentation to get an overview of available configuration options.