- Hugo Bustamante
- Gabriel Bustamante
Submission link Chainlink Hackathon
This project is intended to create an authorization scheme for users and their multiple files (or data) that they would want to keep stored on an off-chain server, while encrypting it, and made sure that key information associated with that data is stored in the Ethereum blockchain. Thus, this project portrays a form of granting or revoking access to certain files that a user (Owner) may have in their power. The Owner of certain files would have the following properties for their files:
- Privacy and security.
- Access control.
- Data sharing.
- Data integrity and Availability.
The following languages have been used for this project:
- Solidity.
- JavaScript (for Node.js).
- Json.
The environments used for guidance and testing the smart contract deployment:
- Truffle.
- Ganache.
A user will pass through the following steps in order to ensure a correct use of the application:
- Users must be registered in the application to generate and store keys (both public and private). The user will need to determine which role they will have (be it an Owner, a writer or a reader of files).
- The user identifies which file (or files) will be managed soon for sharing.
- The user uploads the data to the off-chain storage.
- The application encrypts the data sent to the off-chain storage.
- The data is stored in the off-chain; successively, an address (location) is generated, as well as a key (record ID).
- The application generates a hash value of the registered data.
- The application stores the hash of the data and its location.
- The data may be downloaded for use by an allowed user (may them be a writer or reader). For this, the data must be decrypted using the Owner's public key.
- Clone Github repository.
git clone https://github.com/hugueitor/chainlink-hackaton-2023
-
Start Ganache application.
-
Change to record-sharing directory.
cd chainlink-hackaton-2023/record-sharing
- Update variables 1-env.sh file with Ganache parameters.
- Edit file 1-env.sh and change the following environment variables.
AURIUM_PUBLIC_KEY= <Public Key (1st Account)>
AURIUM_PRIVATE_KEY= <Private Key (1st Account)>
AURIUM_NODE_URL= <Node-RPC URL>
- Then, apply changes.
. ./1-env.sh
- Install main Smart Contract in blockchain network.
./2-run-install-smart-contract.sh
- From migration output get "Contract address" for "AccessControlService.sol" contract and update 1-env.sh with that value.
AURIUM_CONTRACT_ADDRESS= <Contract address result of migration>
- Then, apply changes.
. ./1-env.sh
- Run API for contract interaction.
./3-run-nodejs-api.sh
-
Start Postman for testing transactions.
-
Import collection file in Postman.
- FILE: record-sharing/postman/Chainlink-Hackaton-2023.postman_collection.json
- Enjoy our API.