7. The Smart Transaction Infrastructure
Alice wants to swap tokens, ensure minimal slippage and fast turnaround. Alice initiated her transaction by sending her request to the Laminator
. The Laminator
stored it onchain, acting as a virtual mempool. Its job was to provide spatial awareness. It understood the current state of the blockchain, including the status of all pending transactions. The transaction is now ready to be picked up by the Solver.
With respect to the Laminator's virtual mempool, Alice's transaction gets broken down by the wallet (or the equivalent frontend application used) into smaller individual transitions that make up the entire transaction. These are known as CallObjects
, or internal transactions. Each CallObject
represents a specific part/transition of the transaction, such as checking the token price, verifying account balances, or executing the swap itself.
The CallBreaker
interacted with the CallObjects
, verifying the truth conditions
for each one. For instance, before executing the token swap, the CallBreaker
would verify that « the token price was within the acceptable range specified by Alice » (being one of the truth conditions
). If any condition was not met, the CallBreaker
would halt the process, preventing any unintended or malicious actions.
7.1. Avoiding The Paradoxes of Time Travel
Any infrastructure that leverages time travel must have the capacity to handle paradoxes around changing events/transitions that further invalidate other such events/transitions which could then lead to invalidating the call from which the time travel was initiated. This is another form of the classic Grandfather Paradox. In order to avoid this, we use Deutsch’s solution around “causal consistency check” [“Closed Timelike Curves Make Quantum and Classical Computing Equivalent”, source]. This is the logic: upon return from the after/before transition, enforcing a causal consistency check as a default for any commitment on the call execution to be considered final, failing which, causes a rollback followed by trying again with a different timeline such that eventually no such causal consistency checks fail.
Transactions with Temporal Awareness:
- : Conditions.
- : Logical times.
Oracle Function:
Example: Time Traveling Token Swap Transaction with Causal Consistency Check
-
Initial Transaction Definition:
ser initiates the ransaction.
Alice defines the transaction to swap 100 X tokens with a maximum acceptable price of 50 USDC per token at a future date.
USDC
-
Storage and Spatial Awareness: aminator (virtual mempool) stores the transaction onchain, providing spatial (à la blockspace) awareness:
Stored transaction with conditions: -
olver and Sequential Execution: Solver pulls the transaction sequentially for execution (could be at a later block based on temporal conditions: ).
-
xecution and erification: Transaction is executed and verified to check if conditions are met.
-
Interaction with Time:
- Check Past Conditions:
Oracle provides historical data: USDC
Condition met as 45 ≤ 50. - Check Future Conditions:
Oracle provides future data: USDC
Condition met as 48 ≤ 50.
Past and future conditions are erified using MEV-Time Oracles.
- Check Past Conditions:
Oracle provides historical data: USDC
-
Causal Consistency Check: Ensure the transaction does not create paradoxes: by ensuring that the future condition does not invalidate the past condition.
This involves finding a fixed point where the state remains consistent over time.
-
Transaction Completion: If all conditions are met and causal consistency constraint is maintained, the transaction is considered completed (i.e., ready to be submitted for inclusion in the block, or an equivalent mechanism depending on the specifics of the confirmation logic of the chain). Otherwise, rollback and try again.
7.2. The Smart Transaction Lifecycle
As the LaminatedProxy
held the transaction onchain, and the CallBreaker
verified the conditions, the CallObjects
interacted with each other across time. This dynamic interaction was orchestrated through the concept of MEV-time, allowing transactions to adapt and respond in hypertime (i.e., to both real-time data and future states as well).
The CallObjects
would query oracles for the latest price data, check gas fees, and ensure that all parts of the transaction aligned perfectly. They communicated seamlessly, adjusting their execution paths based on the information they received.
Once all conditions were verified and optimal conditions were met, the CallBreaker
would give the green light: the Laminator
releases the transactions from the virtual mempool, and the CallObjects
execute their tasks. If the Solvers actually optimize the transaction’s capital performance, Alice's token swap would be completed seamlessly, with minimal slippage and guaranteed timing.
7.2.1. Example Workflow for a Token Swap with Conditional Execution
Alice wants to swap tokens under specific conditions. She pushes her transaction calls to the LaminatedProxy
, which includes an assertion that the solver must call a function checkBalance()
to verify the trade conditions. The solver, Bob, then executes these calls, ensuring that Alice's conditions are met before completing the trade.
- Transaction Queuing: Users push a series of
CallObjects
(aka internal transactions) to theLaminatedProxy
with specified conditions. For example, a user might queue a transaction to swap tokens only if certain price conditions are met. - Transactions Stored Onchain: The proxy stores the internal transactions associated with trade execution along with other internal transactions associated with conditions/assertions.
- Verification and Execution: The
LaminatedProxy
holds these transactions until their specified conditions are satisfiable by the smart transactions solvers. TheCallBreaker
executes the calls and ensures their integrity by reverting and invalidating the bundle if 1) a call fails or if 2) a call doesn’t return the expected return value. If the bundle is executed fully, then all included internal transactions’ revert-conditions must have been satisfied.
Diagram Description:
- Alice: Initiates a transaction.
Laminator
: Manages transactions and usespush()
to forward the transaction to theLaminatedProxy
.LaminatedProxy
: Acts as an intermediary, handling calls from users and directing them appropriately.- Bob: Checks conditions and states within the system.
CallBreaker
: Verifies conditions and safeguards the integrity of the transaction flow. Interacts with Bob’s verification step as a final check and authorization step before the transaction is executed.
Flow:
- Alice’s call to the
LaminatedProxy
includes a transfer of 10 Token A. - The transaction asserts that Bob will make a future call to
checkBalance()
. - Bob pulls calls from the
LaminatedProxy
withverify()
to ensure the conditions are met. - The
CallBreaker
interacts with Bob’s verification as a final check before the transaction is executed.
7.3. The Time Turner
Mechanism
A mechanism that allows for checking and acting upon conditions in both the past and the future. Enables interaction with future states for temporal flexibility by embedding entire calls from the future. Basically, the setup ensures that smart transactions consider both historical and future states before execution, providing a robust mechanism for temporally aware condition-based transaction management.
This is the Time Turner
high-level flow:
- EVM Execution Direction:
- Check if in the past: A step to verify past conditions.
- The
Time Turner
checks if the condition is met in the past.
- The
- First make a call to the past, then make call to the future: A sequential step where past conditions are validated before future conditions.
- If the condition in the past is met, it proceeds to execute actions related to the past.
- The sequential call step first makes a call to the past and then to the future.
- Check if in the future: A step to verify future conditions.
- Finally, the future condition is checked before executing future-related actions.
- Check if in the past: A step to verify past conditions.
- Smart Transaction Execution Direction:
- This subgraph represents the ordered execution of transactions within the smart contract system.
- Each step (marked with numbers 1 to 5) represents a direction in the transaction execution sequence/flow.
7.3.1. Detailed Breakdown of The Time Turner
Lifecycle
- Initial State (Push to Past)
- Sequential Calls
- Future State (Push to Future)
- Initial State (Push to Past)
- User Action: The user initiates a transaction sequence and pushes it to the
LaminatedProxy
. - Condition Check: This sequence includes a condition to be checked in the past facilitated by the
Time Turner
. - Steps:
- Push the first transaction to check if the condition in the past is met.
- If the condition is met, proceed to « do stuff in the past ».
- User Action: The user initiates a transaction sequence and pushes it to the
-
Sequential Calls
- Validation: After validating the past condition, the next step involves making a call to the past first, followed by a call to the future.
- Steps:
- First make a call to the past using the
Time Turner
to validate conditions. - Then make a call to the future to ensure future conditions are set up correctly.
- First make a call to the past using the
-
Future State (Push to Future)
- Final Check: The final sequence involves checking a condition in the future and executing actions based on this future state.
- Steps:
- Push the second transaction to check if the condition in the future is met.
- If the condition is met, proceed to « do stuff in the future ».