Execute Signed Intent (Intent/Permit) from Wallet
#2001
Replies: 4 comments 5 replies
-
|
This is super interesting but I'm not fully understanding the conditions under which these would work. Could you describe one of the use cases in more detail? For example: "I want to send 100 USDC from Miden to Ethereum":
|
Beta Was this translation helpful? Give feedback.
-
|
I love this idea. We could match it with the idea of having "prioritized batches". One slot in each block could be auctioned by the Miden Node. And solvers could compete in the auction to get their batch in. That way, the solvers can arbitrage and the Node can distribute the fees to a Miden Staking contract, in which every use can stake The intent could result just a simple SWAPp note. And solvers can either swap directly or bridge and swap to chains with more favorable prices. This seems to do what also MegaEth and Arbitrum are doing. This will give us |
Beta Was this translation helpful? Give feedback.
-
Lets take the first example: "I want to transfer 100 USDC from Miden to Ethereum"
pub struct TransactionSummary {
account_delta: [], // no storage change
input_notes: vec![], // no input notes
output_notes: vec![B2AGG, P2ID], // two output notes
salt: Word,
}The user signs a
This would be application specific, just like with EVM applications. User goes to a dapp website. They click "bridge assets" or "swap" and instead of sending a tx that costs gas, they just sign a message. The intent is crafted under the hood by the app. The app requests the user's signature from the browser extension wallet.
Filling the intent means crafting a transaction against the signer's account which results in the intent getting executed. The Take the following example: A user wants to exchange 3500 USDC for 1 ETH. They would sign an intent that would look like this: pub struct TransactionSummaryExt {
account_delta: [], // no storage change
input_notes: vec![ONE_ETH_P2ID], // one input note 1 ETH
output_notes: vec![3500_USDC_P2ID], // one output note 3500 USDC
expiration_block: 10, // say current block is 5
salt: Word,
}The exchange app would create this In a trading scenario, its important that these intents have expiration times, so that at some point in the future the signed intent "expires" and so that someone can't execute this intent against a user account long after the intended use of the intent. Not fully aware how this would be enforced at the kernel level since users can pick arbitrary reference blocks when executing transactions. Maybe we should enforce this at the node level, that reference blocks for locally proven transactions should be within at least 5-10 minutes of the chain tip? |
Beta Was this translation helpful? Give feedback.
-
|
I think this is a pretty cool idea, thanks for sharing and proposing this! Intent Expiration Relates to #2000. Because expiration blocks are set by the transaction executor, I now understand why this mechanism by itself is insufficient for intent expirations. The intent fulfiller is the transaction executor, and so they would have to set the expiration block, but they cannot be trusted. This also made me realize that
I think the challenge with an intent-based auth component is primarily the same as with the multisig: If we want support for in-flight transactions, then a storage map-based replay protection instead of a nonce-based one, might be necessary (though I could be missing other approaches). And with these two known replay protection mechanisms you have different expiration mechanisms:
Additionally, you can also make There may be even more ways to do intent expiration, but replay protection and expiration are closely linked. In any case, I think adding a protocol-level expiration mechanism doesn't solve this problem in a simpler way than what we can already do with the protocol, and instead would probably increase the complexity involved in creating correct auth components as there would be more things to think about. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Execute Signed Intent from Wallet — Gasless + CoW-style
Summary
Add a new wallet entrypoint that accepts a signature over an Intent and executes it atomically. Any executor can submit the signed intent; the wallet verifies the signature and terms, then settles: if incoming note(s) satisfy the minimum requirements, the wallet releases the exact outgoing assets specified. This enables gasless transactions, intent-based trading, and CoW-style settlement.
Motivation
Proposed Solution
1. New Intent Variant in
SigningInputsAdd a new variant to the existing
SigningInputsenum:2. Intent Structure
Define a new Intent structure that is separate from
TransactionSummary:3. Wallet Integration
Create
execute_intentprocedure that:Key Differences from TransactionSummary
Use Cases
Bridge Integration
AggLayer Settlement
CoW Trading
Benefits
TODOs
Intentvariant toSigningInputsenum with proper serializationSequentialCommitforIntentwith domain separationThis feature would significantly enhance Miden's capabilities for intent-based applications, cross-chain bridges, AggLayer integration, and CoW-style trading while maintaining security and composability.
Beta Was this translation helpful? Give feedback.
All reactions