Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require transactions to refer to recent blocks #933

Open
bobbinth opened this issue Oct 24, 2024 · 3 comments
Open

Require transactions to refer to recent blocks #933

bobbinth opened this issue Oct 24, 2024 · 3 comments
Labels
kernels Related to transaction, batch, or block kernels

Comments

@bobbinth
Copy link
Contributor

Currently, we have no restriction on how old a block referenced by a transaction needs to be (it could be a genesis block, for example). It may be beneficial to make this a bit more restrictive (and this is done in some other chains - e.g., Solana). For example, we could require that a transaction references a block which is within 256 blocks of the chain tip. This would be a global setting applicable to all transactions. Individual transactions would still be able to reduce this window via individual expiration settings as they can now.

@igamigo
Copy link
Collaborator

igamigo commented Oct 24, 2024

Is there any specific reason why we would not want to initialize the expiration delta to 256 instead of u32::MAX on the kernel prologue? I guess it could be be more "dynamic" by enforcing it on the node.

@bobbinth
Copy link
Contributor Author

Good point! Though, we'd set the block expiration time to block_ref + 256 rather than the delta directly. I'll transfer this issue to miden-base.

@bobbinth bobbinth transferred this issue from 0xPolygonMiden/miden-node Oct 24, 2024
@bobbinth bobbinth added the kernels Related to transaction, batch, or block kernels label Oct 24, 2024
@bobbinth
Copy link
Contributor Author

One drawback to imposing this condition is that it would require a wallet to always sync with the chain before it can issue transactions. Most of the time, this could be fine, but there could be some use cases where this may be undesirable.

For example, I can imagine a kind of a "spend only" account. Such an account can be funded once. The state of this account could be loaded into an air-gapped device (e.g., something not connected to the internet). Then, this account can generate transactions which move assets out of the account (up until the balance is exhausted) without the need to ever be connected to the network. These transactions could be transmitted to the recipient, who is presumably connected to the internet and will be able to submit them to the network.

Requiring transactions to reference a recent block will make such "spend only" accounts impossible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernels Related to transaction, batch, or block kernels
Projects
None yet
Development

No branches or pull requests

2 participants