1 unstable release
0.1.0 | Jun 16, 2023 |
---|
#713 in Memory management
150KB
3K
SLoC
CKB Open Transaction Pool
About CKB Open Transaction
CKB Open Transaction (OTX) is an extensible transaction format and workflow engine that supports the combination of multiple partial signed OTXs or multi-signed OTXs off-chain to construct a CKB transaction.
Compared to the CKB Transaction format described in the RFC 0022-transaction-structure, OTX can carry more auxiliary information to describe how it can be aggregated into a complete CKB transaction.
This project is an extensible OTX solution based on memory pools. We have developed several user cases in different application scenarios to make the solution reusable and versatile, which facilitates the secondary development of dApps.
Design Philosophy
We believe that the optimal architecture involves processing OTXs as a data stream. This architecture utilizes a Broker to collect OTXs and dispatch them to Agents.
An Agent serves as both a Consumer and a Producer. It receives OTXs from the Broker, executes its logic, and notifies the Broker of its processing result.
This project is an implementation of this design concept. It uses the memory pool as the Broker and plugins as Agents to expand its application business logic.
Open Transaction Lock Script
Open transactions require support from a corresponding lock script, which should follow the RFC: Composable Open Transaction Lock Script. The locking script that adheres to this RFC can support the partial signing of transactions, providing great convenience for subsequent aggregation and reducing the cost of interaction.
The lock script used in this project is provided by the Omni lock script. We have also utilized the CKB SDK, which has started to support this lock script.
Documentation
- Quick Start
- RPC Documentation
- Projects Layout
- Pool and Plugin
- Scenario Application Pattern
Integration Test
The integration-tests sub-project provides various scenarios for applying OTX, which helps in understanding the project.
The integration-tests README outlines how to build a local development environment.
Existing scenario application cases include:
- Payment: Dust Collector
- Swap: Atomic Swap
- ... more will be added later
Thank you for your contribution to the open-source community!
Dependencies
~30–47MB
~660K SLoC