The ApeX Pro community would know firsthand the lengths ApeX Pro has gone to in order to deliver a high-performance decentralized derivatives trading platform — in speed, efficiency, liquidity and most importantly, security. Guaranteeing the safety of a trader's funds is critical consideration of ApeX Pro's architecture and design, and working with StarkWare's scalability engine, StarkEx, was the first major step forward when we commenced ApeX Pro in November, 2022.
For those who might not be as familiar, StarkEx is powered by STARK-proofs, a form of zero-knowledge proofs that helps secure the validation of transactions in batches at some of the fastest speeds and lowest gas fees in decentralized finance (DeFi). The integration of this engine allows us to provide ApeX Pro traders with efficient, self-custodial and highly secure trading experience, fortified by fast withdrawals and gas-free transactions.
By leveraging StarkEx infrastructure, ApeX Pro users enjoy full control over and ownership of their assets, which are retrievable at any point in time! However, to ensure and fully enable self-custody of user funds, ApeX Pro needs to maintain uninterrupted availability of user data.
This is where Data Availability Committees (DAC), like infrastructure service provider Chainstack, come into play. They offer a reliable solution to ensure the accessibility of your users' data at all times and allow for the direct withdrawal of user funds without the facilitation of an operator such as ApeX Pro — certainly an essential feature on decentralized products under current overarching market conditions.
Let's delve deeper into this.
Validium and Data Availability on StarkEx
Validium is a scaling solution that upholds transaction integrity through validity proofs like ZK-rollups, without storing data on the Ethereum Mainnet. By harnessing the capabilities of Validium tech, ApeX Pro traders experience substantial enhancements in both privacy and transaction processing speed, achieving an impressive 10 trades and 1,000 order placements/cancellations per second.
However, in order to maintain impartial and trustworthy data storage, as well as facilitate self-custody, the involvement of DACs is essential. Data availability in the blockchain context is defined as the ability of network node operators to access data stored on a blockchain, i.e. a layer-1 (L1) network such as Ethereum. In StarkEx's case, this data belongs to that of batched transactions and the generated STARK-proofs, and state commitment to the blockchain — network nodes need to be able to access this data to participate in the consensus process, which helps to keep the network safe.
Data availability guarantees the following:
Synchronized State: The state stored in the ApeX users' validium vaults stays perfectly aligned with the state maintained by StarkEx.
Constant Balance Tree: The complete balance tree remains accessible at all times. This assures ApeX users that if StarkEx ever encounters any issues, they can validate their fund custody.
Data Availability Committee for Safe, Direct Withdrawals
ApeX Pro currently works with three distinct DACs, including Chainstack, that oversee the storage of data off-chain. What this means is that ApeX Pro traders would not have to rely on ApeX Pro to verify their account balance and gain access to their funds. In the unlikely event of downtimes or any circumstances where ApeXers are unable to connect to ApeX Pro for withdrawal requests, the DAC has the authority to place off-chain data back onto the public domain. The Application Smart Contract (ASC) involved will stop receiving new state updates.
Once it's in the public domain:
Users will only have to verify their account balance in a given state with a Merkle path from their account in the Merkle tree to its root;
Users can then access the Merkle path to their accounts, and use that path to retrieve their funds directly from the ASC, bypassing operators that are unable to service users’ withdrawal requests due to emergency.
Partnership with Chainstack
In its role as our trusted DAC member, Chainstak ensures the dependable and secure functioning of the ApeX Pro platform during both regular and emergency situations:
In regular hours, the scope of operations involves overseeing state transitions, safeguarding off-chain data, and verifying STARK proofs.
During emergency situations, it makes off-chain data accessible to the public and enables users to directly retrieve their funds from the ASC using the Merkle path associated with their accounts.
Effecitvely, Chainstack, along with other DACs, establishes a fail-safe mechanism and an extra layer of trust and security for ApeX Pro traders. This adds contingency plans and a way to reclaim user funds in case the platform faces challenges. As a result, user funds remain secure and accessible, even during critical situations.
Next Steps
To enhance traders' understanding of forced withdrawals, the ApeX team is devising a simulation that will replicate a 24-hour shutdown of ApeX Pro, affording users the opportunity to exercise the emergency asset recovery feature. This will enable users to practice withdrawing their assets during unforeseen circumstances, and also present a chance to earn rewards by participating in the test.
Moreover, we've partnered with L2BEAT, an analytics and research platform for Ethereum L2 scaling technologies, to integrate forced withdrawals into a user-friendly platform currently under development. This platform will provide a streamlined and accessible approach to executing forced transactions, ensuring straightforward asset ownership via a familiar and intuitive interface.
Closing Thoughts
The DAC is important as it grants users the ability to sidestep StarkEx Operators in times of emergency when handling withdrawal requests. During such critical scenarios, when the Application Smart Contract (ASC) fails to produce the new state updates, DAC services allow traders to execute direct user withdrawals utilizing a valid Merkle proof for the most recent state, ensuring that ApeX Pro traders exercise full custody and control over their funds.
Incorporating StarkEx into the framework of ApeX Pro infrastructure and leveraging multiple DACs like Chainstack, represent critical strides towards a future characterized by seamless, self-custodial, and safe decentralized trading.
Through such strategic integrations, our objective is to firmly establish our position as frontrunners within the DeFi and DEX trading scene. Bolstered by the robust infrastructure of StarkEx that is fortified by the support of DACs such as Chainstack, we collectively look forward to advancing our shared journey in shaping the future landscape of secure decentralized trading.
About Chainstack
Chainstack is the leading suite of services connecting developers with Web3 infrastructure. Chainstack offers fast, reliable, and easy-to-use infrastructure solutions distributed globally, and enables thousands of companies to cut down the time to market, costs, and risks associated with creating and scaling decentralized applications. Chainstack provides unified access to multi-chain node and data APIs, distributed compute and storage, identity management and security testing, and the ever-expanding list of services and tools to build amazing applications across all prominent Web3 protocols. Chainstack’s enterprise-grade platform has intuitive developer experience, battle-tested reliability, predictable pricing, and outstanding customer support.