The introduction of Wallet in BigBang Core (Part 1)The core wallet program is used for backbone network nodes and common users. It has certain requirements for the running
environment and hardware, and can completely use all the functional modules of the blockchain system.
LWS is an acronym for "light wallet service", which connects the BigBang Core blockchain backbone network with terminal of data
acquisition sensor. Through it, blocks and transactions of BigBang Core wallet are updated and cached in time to LWS high-speed
memory database and local database. Based on these data, it calculates the latest UTXO of the public key address corresponding to the private key saved on different terminal devices and publishes this information to the Amazon cloud through the MQTT connection with AWS's IoT Core. The message broker forwards it to the terminal devices subscribed. Correspondingly, the terminal devices will package the monitoring and collecting data into a transaction according to the UTXO list, and publish it to the Amazon IoT Core through MQTT.
The transactions are forwarded to the LWS that has subscribed topics of these devices via the Amazon IoT Core's message broker. LWS will verify these transactions. If successful, the transactions will be forwarded to the BigBang Core wallet through the Socket
API. After the BigBang Core wallet receives these transactions, it broadcasts them to the BigBang Core network through the P2P
network interface. The producing node collects these transactions and packages them into blocks. LWS uses the persistent-connected, two-way pub/sub message broker provided by AWS to decouple the huge number of connections with devices, which solves the high concurrency and high scalability of the devices. LWS uses AWS's Amazon DynamoDB service to store the key-value pairs, such as blocks, transactions, and UTXO data.
Due to the massive transaction data, packaged block data and UTXO data generated by the high-concurrency TPS on the multifork of the BigBang Core, Amazon DynamoDB that uses AWS's mslevel response-delay storage service can create a block database and a UTXO database for each application fork, thereby speed up the retrieval of data.
While LWS synchronizes the blockchain data of the BigBang Core, caches huge block files to Amazon S3's highly scalable, highly persistent, and highly available distributed data storage using highthroughput and resilient Amazon Kinesis services. After collecting and processing block real-time data, it can be used by other LWS in the neighborhood of local physical addresses, and even provide retrieval services to LWS worldwide. On the other hand, when the LWS occur synchronization error with the core wallet or data, it can be quickly recovered from S3. In addition, LWS uses AWS's rules engine to convert information, and then use Kinesis services or Lambda services to divert data to different AWS services. There can also use AWS's CloudFront service to provide CDN-like functionality in an unstable network environment.
Use structured PB-level Amazon Redshift relational databases to store structured blockchain data. It can be used for BigBang Core blockchain web browsers, smart device wallet apps, and the data views that BigBang Core developers and testers debug on running
program.
LWS is developed by the high-concurrency language golang. The program uses goroutine and channel to ensure that a large number of concurrent device-side sending transactions can be processed in a timely and efficient manner, thus achieving the packaging of
massive transactions.