Service Bus
Overview of the ConfidentialServiceBus Contract
The ConfidentialServiceBus is a critical part of the NotVault SDK. Its core functionality lies in providing a confidential service bus that makes use of a zkSNARK verifier to ensure the creator of the message knows the value of the hash being published.
Contract Structure
The ConfidentialServiceBus contract encompasses the following main components:
Events:
set_value: An event emitted when a new value is set, including the owner's address, the key, the value, and the block timestamp.
Functions:
getValue: A view function that retrieves a value fromvaluesMapusing an owner's address and a key.setValue: A function that verifies a zkSNARK proof and then sets a value in thevaluesMap. It emits theset_valueevent.
Functions Description
getValue Function
This function retrieves a value from the
valuesMapfor a given owner and a key. It is a view function and hence does not alter the state of the contract. The function signature is as follows:function getValue(address owner, uint256 key) public view returns (uint256);setValue Function
This function sets a value in the
valuesMapafter verifying a provided zkSNARK proof. It emits aset_valueevent that contains the owner's address, the key, the value, and the block timestamp. The function signature is:function setValue(bytes calldata proof, uint[2] memory input) public;
This contract provides a confidential service bus using the power of zkSNARKs and an EVM compatible blockchain. This approach ensures that the data's integrity is maintained while keeping the original value confidential, hence the name ConfidentialServiceBus.
Last updated