Friday, February 2, 2018

Implement access control in a simple iot system using ethereum smart contracts.

This post presents the code used for our paper "Smart Contract-Based Access Control for the Internet of Thins" (arxiv.org),including the ACC, RCJC, JavaScript at the subject and JavaScript at the object.

Steps to run the code.
1. Deploy the ACC, RC and JC on the Ethereum blockchain network. In my case, I just built a local private Ethereum blockchain network using three devices, i.e., a desktop PC and two Raspberry Pi's. Each device has the geth client installed.

2. Add the address of the ACC into the lookuptable of the RC and store the address of the JC to the jc variable of the ACC. This is to enable the interactions among the contracts.

3. Add the required information for access control to the smart contracts, e.g., access control policies.

4. Run the monitor.js javascript on the object side and the requester.js on the subject side to test the access control.