cloudwallet
v0.5.9
Published
Cloudwallet Implementation
Downloads
8
Maintainers
Readme
cloudwallet
Cloudwallet Implementation
[](https://circleci.com/gh/energychain/cloudwallet/tree/main
API Usage
You need to register for the Cloudwallet-API on RapidAPI. Replace rapidApiKey
with yours.
const Cloudwallet = require("cloudwallet");
const instance1 = new Cloudwallet('<rapidApiKey>'); // Create a new KeyPair
await instance1.set('Hello','World'); // Store a Keyvalue like a presentation
// ReUse wallet remembering privateKey
const keys = instance1.getKeys();
console.log(keys);
const instance2 = new Cloudwallet('<rapidAPIkey>',keys.privateKey);
console.log(await instance2.get('Hello'));
In other words: You might create an instance as a new object. If you do not specify a privateKey as the second argument - a new keyset is generated. Values are values of the instance object and could be accessed via get()
or set()
methods. It is a good practice to retrieve at least the privateKey and store it externally as there is no possibility to recover wallet data in case this key is lost.
Background
The node module CloudWallet
uses an Ethereum-PrivateKey to generate an Decentralized Identifier as a signed JSON-WebToken (JWT) . The token itself gets transferred to the CloudWallet-API using an HTTPS-POST. Upon receiving the JWT by the CloudWallet-API the JWT and its containing DID get decoded and the signature is verified before the fields get stored. As a result, the HTTPS-POST will return a JSON containing all values stored in the Wallet.
Maintainer / Imprint
Project Website: https://co2offset.io/