This service manages references to documents in the OwnYourData Notary Service by creating Decentralized Identifiers (DIDs) in the Sovrin Blockchain.
Get the Docker image: https://cloud.docker.com/u/oydeu/repository/docker/oydeu/srv-sovrin
The following inputs must be available:
- DID registered as TRUST ANCHOR in the Sovrin blockchain
- wallet that incudes this DID
- link to genesis record of the blockchain
- Sovrin Live Net: https://github.com/sovrin-foundation/sovrin/blob/stable/sovrin/pool_transactions_live_genesis
- Sovrin Test Net: https://github.com/sovrin-foundation/sovrin/blob/stable/sovrin/pool_transactions_sandbox_genesis
you can register a DID as Trust Anchor in the Sovrin Test Net here: https://s3.us-east-2.amazonaws.com/evernym-cs/sovrin-STNnetwork/www/trust-anchor.html
indy-cli
to manage DID and wallet - available here: https://github.com/hyperledger/indy-sdk/tree/master/cli
Compile the inputs from above into a JSON:
- in
indy-cli
export the wallet with the DID to a file and note wallet-key and export-keyindy> wallet open my-wallet key=wallet-key indy> wallet export export_path=/path/to/wallet export=export-key
- base64 encode the exported wallet
$ base64 -w0 /path/to/wallet
- generate JSON with the following elements:
{ "master_did":"DID string", "genesis_file":"link to genesis record of the blockchain", "wallet_key":"wallet-key from wallet export", "export_key":"export-key from wallet export", "wallet":"base64 encoded wallet" }
$ docker run -d -i -p 3000:3000 oydeu/srv-sovrin /bin/init.sh "$(< /path/to/JSON_from_above)"
The API exposed by the Docker container is described here: https://api-docs.ownyourdata.eu/notary-sovrin/
Examples:
- request a new DID:
curl http://localhost:3000/api/did/new
response:{"did":"3V7SK7DrUdKYp1A4QAMNHy","seed":"e0015c5ba2894c7091ae8d1a0d14ca5c","verkey":"~FC9tYLSoDCnGwXSALCZKJc"}
- write DID to blockchain:
curl -d did=3V7SK7DrUdKYp1A4QAMNHy -d verkey=~FC9tYLSoDCnGwXSALCZKJc -d seed=e0015c5ba2894c7091ae8d1a0d14ca5c -d hash=476911022fc90f12f23052ddc863fd2a3ad3e9f3123b986dd1fded867cd3ae27 -X POST http://localhost:3000/api/did/create
response:{"wallet-key":"9bec3b1cf9a0","export-key":"14f34009253d","wallet":"VA...ha"}
To use the new DID in the provided wallet perform the following steps:
- create wallet file
$ echo -n "base64 encoded wallet" | base64 -d > new_wallet
- import wallet in
indy-cli
indy> pool connect sovrin indy> wallet import new_wallet_name key=wallet-key export_path=/path/to/new_wallet export_key=export-key indy> wallet open new_wallet key=wallet-key indy> did use new-did indy> did rotate-key # make sure to update keys after getting a DID from a public service
Please report bugs and suggestions for new features using the GitHub Issue-Tracker and follow the Contributor Guidelines.
If you want to contribute, please follow these steps:
- Fork it!
- Create a feature branch:
git checkout -b my-new-feature
- Commit changes:
git commit -am 'Add some feature'
- Push into branch:
git push origin my-new-feature
- Send a Pull Request