This is an Ink! smartcontract implementing credentials storage logic.
With this contract you can create/update/delete your encrypted credentials in a blockchain database. It works with client-side DApp.
- Contract set-up with owner, set by constructor's argument, or set caller by default.
- After initialization of the contract users can save credentials. All payload need to be encrypted before saving in storage, you can make it from the dapp.
- CRUD operations with credentials.
- Contract own management and transfer ownership.
Please follow installation instructions provided here.
git clone https://github.com/bsn-si/rubeus-smartcontract
cd rubeus-smartcontract
cargo test
Also you can run an example from the /example
folder, that is written with polkadot.js and works with client-side encryption.
To run example please follow these steps:
cd example/
npm install
npm run start
cargo contract build
You need wasm
target and dylint
set.
To install specified toolchain & targets please run:
rustup target add wasm32-unknown-unknown
cargo install cargo-dylint
In case you get a compilation error during the wasm optimization step, make sure you have binaryen installed.
First setup and start substrate-contracts-node, go to Polkadot Portal UI for setting up a test contract.
After creating an instance of the contract on the blockchain you can use a core owner
from test accounts list like Alice
.
Next you need to send funds to the contract and then you can call contract's methods from Polkadot Portal UI.
- Instantiate new contract with
Alice
owner. - From Polkadot Portal UI call
addCredential
method, enter any payload with a unique ID - you can generate it or choose any for test from the list - Call method with
Execute
action on Polkadot Portal UI. - You can load all your credentials with method
getCredentials
A short video explaining how to comile the smart-contract:
Rubeus Keeper browser extension
Apache License 2.0 © Bela Supernova (bsn.si)