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 fromvaluesMap
using 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_value
event.
Functions Description
getValue Function
This function retrieves a value from the
valuesMap
for 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:setValue Function
This function sets a value in the
valuesMap
after verifying a provided zkSNARK proof. It emits aset_value
event that contains the owner's address, the key, the value, and the block timestamp. The function signature is:
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