This section outlines various ideas for the future development of Routes, enables apps and blockchains to access permissionless, cross-chain stablecoin liquidity.
proveIntent
function duplicates the proveAccount
function call for each separate intent proof, and this call could be shared over multiple intents.
To drive the cost per intent down beyond the 50% threshold, optimizations to the storage layout of intents on the Inbox
contract is required. This is a consequence of how hashmaps are laid out in Contract Storage in the EVM. As a reminder, the storage slot for a hashmap is calculated using the key and the base storage slot, as shown below:
Inbox
contract using an array.
Arrays, unlike mappings, store their elements in contiguous storage slots. This means that once the base slot of the array is located, each element can be accessed by simply incrementing the index. Consequently, the Merkle Patricia Trie is much less sparse when arrays are used, as the elements are closely packed together.
This tighter packing of data allows for more efficient storage proofs since the paths to the array elements in the storage tree are more likely to overlap. By grouping intents into an array, the proof overhead is minimized as multiple intents can be proven with mostly shared calldata. By batching extremely large numbers of proofs together like this, the cost per proof can be driven down to near zero.