Comment on page
BEAMS refers to Blockchain Enquiring, Auditing,and Messaging System.
Blockchain is almost entirely isolated from the real world as it cannot send messages to off-chain proactively. If a smart contract encounters a problem in its logic or isattacked, the real world will not sense it passively. Hence, it requires continuous monitoring of the operation of the contract and strict audit of the data and assets in the contract. It also requires immediate alert when a problem is found to best ensure the security of the application.
For users, the experience of interacting with blockchain is naturally unfriendly. Asynchronous feedback caused by delays, frequent and large amounts of on-chain data reading and business model reconstruction, and the fragmentation between on-chain and off-chain messages have all led to slow and even chaotic interaction.
The issues mentioned above urge us to build a system that connects the on-chain and off-chainworlds, which can constantly monitor the operation of the contract, audit the data and assets, and accelerate the response speed of a product, making the response speed more stable, and the inevitablyasynchronous feedback more smooth and fluent. All reminders and messages triggered by conditions can not only meet users’ financial needs but also give them better product experience when using COFi applications.
BEAMS is an off-chain system that works closely with contracts. Its core concept containsthe following three characteristics:
Fig 2 BEAMS Technical Structure Diagram
BEAMS is composed of three modules: enquirer, auditor, and messanger.
BEAMS adopts a rotating mechanism that is based on on-chain events, to monitor contract state and data change. Basic data will be stored in the database and given to the front-end through the interface. Changes in contract data will be audited and abnormalities will be reported to the system administrators in real-time.Meanwhile, the changes of collateralvalueand the liquidation statewill be continuously calculated, and various forms of notifications and warnings will be pushed to users when necessary.
All major transactions that involve asset changeswill trigger customized on-chain events. The enquiring system constantly monitors for the emergence of new events and inquiries the corresponding data contracts of the event content. Data contracts provide the read-only interface that exposes data for the external, and the enquiring system reads the relevant data from the contract according to the data model’s requirements.
All the data read will be sorted and aggregated into the BEAMS data warehouse, and changes in the data will be recorded. As the core of the whole system, the data warehouse will provide quasi-real-time data cache to the front-end through the back-end API interface, and provide the data required for calculation and triggering to the message module. The audit module will use this data to review and audit the state transformationand data changes.
Audit Risk Control
The audit risk control module will constantly monitor the state and data change in every contract. It will use an independent and parallel logic to conduct a secondary review of the asset changes, and notify the system administrators to take action in real-time once an abnormality occurs.
The audit risk control module will use different review methods such as total assets, dynamic logic, and status verification to conduct real-time audit of contract data from all directions to improve the accuracy of the audit. The audit module can rateand alert on abnormalities, and the risk control module will have the permissionto interfere and manage the operation of the on-chain contract when it is evaluated as highly risky.
The audit risk control module is also in charge of statistical analysis. It will count and analyze system operation data including user order records, historical returns, asset change curves, real-time return indicators of the platform, and historical return curves. The audit risk control will also predict and control risks, and provide data reference for product operation direction.
In order to improve the user experience of asynchronous feedback caused by blockchain’s characteristics, the message push module will play an important role in all aspects of the use process. A blockchain that lacks infrastructure needs a message push system to coordinate, especially when it comes to informationthat may affectusers’ interests.
On one side of the page, the message push module will preferentially use the Websocket long connection mode, and establish a two-way real-time link with users through the front-end page. It will monitor the execution of the transaction on-chain in each link and push transaction results and on-chain stateto users when atransaction is finished.
In terms of messagesregarding asset liquidation, returns distribution, and withdrawal reminder, the message push module will conduct constant monitoring and analysis on the contract date and push reminders and warnings to users in various forms including emailing and text messaging in real-time when the action is triggered.