Evidence Management System based on Hyperledger Sawtooth using IPFS with PBFT or PoET Consensus mechanism.
Note: This repository consist only the code for the Evidence Management System's React web client.
Check out the Transaction Processor code and Full Documentation here
Module: src/services/signing.js
Sawtooth use Secp256k1 for signing.
Useful APIs:
Signatures form the basis for verifiable identity and correctness on most, if not all, blockchains. First, a private key is generated; it's basically just a random set of bytes. This key is kept secret. Next, a cryptographic algorithm uses these bytes to derive a public key which can be widely shared. Finally, a signature is generated by combining the private key with some message. This signature, the message, and the public key are then all distributed together.
private key message private key
| \ /
v v v
public key signature
While others won't ever be able to deduce the original private key, they will be able to confirm that the public key and signature came from the same private key and that the message was not altered. Not even a single byte. This powerful cryptographic tool is fundamental to how blockchains work.
public key -
\
signature - - - > ???
/
message -
A simple signing API is built using Secp256k1, a common cryptographic algorithm used by Bitcoin, Ethereum, and Hyperledger Sawtooth. It will be relying on the library secp256k1-node.
Note that this library uses Node Buffers
(basically raw bytes) as the format of choice for keys and signatures. One of
the things to do is to convert these bytes to and from hex strings.
Make sure you are familiar with Buffer's from
and toString
methods.
To be added soon
In .env
file
REACT_APP_REST_API_URL = "http://localhost:4000" # Sawtooth's Rest Api Proxy
REACT_APP_FAMILY_NAME = "evidence_management_system" # Transaction Processor Family Name
REACT_APP_FAMILY_VERSION = "0.0" # Transaction Processor Family Version
REACT_APP_EMS_KEYS = "emsKeys" # Local Stroge Key Name
REACT_APP_IPFS_GATEWAY = "https://ipfs.infura.io:5001/"
REACT_APP_IPFS_BASE_URL = "https://ipfs.io/ipfs/"
EvidenceManagement-frontend/
├── README.md
├── node_modules/
├── public/
├── img/
└── src/
├── components/
├── pages/
├── services/
├── App.js
└── index.js
Requirements and dependencies:
- Node >= v10.*
- Npm >= v6.*
- React >= v16.*
- sawtooth-sdk >= v1.0.*
- ipfs-http-client
- axios
- tachyons
- react-table
Installation:
- Clone the repository
git clone https://github.com/amanag7/EvidenceManagement-frontend.git
- Change Directory
cd EvidenceManagement-frontend
- npm install
npm i
-
Edit
.env
file according to your environment -
Run the application
npm start
- Building the application
npm run build:prod
MIT