If For example Entity A wants to build a smart contract that manage a group of devices. But since each device uses pseudonym and he may change it later, is there any way to build the contract such that each device should have a certain address for a certain amount of Time ( month for example) and Is it available now in Etherum so that that Entity A can issue addresses for devices joining the smart contract ? Just thinking of a private application on the etherum controlled by a single entity and also also he would like to detect bad users
1 Answer
It would be better for the devices to have semi-permanent identifiers, their address, and then Entity A will have exclusive management control of a whitelist or similar access control system. The contract would reject interactions from unauthorized devices.
This is just a very quick sketch with some important concerns glossed over to illustrate the idea.
pragma solidity 0.4.25;
contract SimpleWhitelist {
address public owner;
mapping(address => bool) public isAuthorizedDevice;
modifier onlyOwner {
require(msg.sender==owner);
_;
}
modifier onlyAuthorizedDevice {
require(isAuthorizedDevice[msg.sender]);
_;
}
constructor() public {
owner = msg.sender;
}
function addOrRemoveDevice(address device, bool authorized) public onlyOwner {
isAuthorizedDevice[device]=authorized;
}
function somethingDevicesDo() public onlyAuthorizedDevice {
// contract rejects transaction unless the sender is whitelisted.
}
}
Hope it helps.
-
But this solution require a previous knowledge from Entity A about the white list. This may endanger their privacy /anonymity since Entity A can link future transactions with one of them– MohamedOct 17, 2018 at 15:14
-
I think we need to know more about the secrecy requirements and frequency of transactions, scale, etc., to know if your plan is feasible. Oct 17, 2018 at 15:31
-
The idea is at some time slot,Entity A will receive requests from some other devices and based on this information , each device will be assigned some value . So the following security/ privacy are required: 1. Keeping privacy of users identities from Entity A 2. Also Entity A would like to detect if one of the devices misbehaved by trying to change his request in future to gain more privileges.– MohamedOct 17, 2018 at 15:48