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

feat: add signer / 'delegate' field to support account abstraction #166

Open
mfw78 opened this issue Jul 15, 2023 · 1 comment
Open

feat: add signer / 'delegate' field to support account abstraction #166

mfw78 opened this issue Jul 15, 2023 · 1 comment
Labels

Comments

@mfw78
Copy link

mfw78 commented Jul 15, 2023

Problem

Refer to the postage batch struct:

struct Batch {
// Owner of this batch (0 if not valid).
address owner;
// Current depth of this batch.
uint8 depth;
//
uint8 bucketDepth;
// Whether this batch is immutable.
bool immutableFlag;
// Normalised balance per chunk.
uint256 normalisedBalance;
//
uint256 lastUpdatedBlockNumber;
}

This provides pretty average UX / DX in that the owner MUST always be the same as the signer for stamps applied to chunks. This is a large handbrake on some particularly important features that would greatly smooth UX / DX.

Solution

Considering that stamps that have been processed by Swarm clients are in effect immutable, I propose:

  1. The owner field is changed to a signer field. This represents the public address of the signer that must sign the chunks, as inspected by Swarm clients when exchanging data over Swarm. The signer would still effectively have root control over the batch.
  2. An owner field is created, which can be instantiated on createBatch to a custom address. This owner has the additional benefits of being able to call dilute the batch and set a delegate as described below.
  3. A delegate field (or better terminology TBD), which is configurable on createBatch, and configurable by owner. This field can also call the topUp and dilute functions for the respective batch.

Use cases

This allows for atomic dilution of a batch to increase it's capacity. Mandating that dilute can only be called by the owner requires the owner to posses gas, which prohibits smart contracts / smart contract wallets from possessing batches, which is prohibitively exclusive given the moves towards account abstraction.

@bee-runner bee-runner bot added the issue label Jul 15, 2023
@mfw78 mfw78 changed the title feat: add signer / 'delegate' field feat: add signer / 'delegate' field to support account abstraction Jul 15, 2023
@mfw78
Copy link
Author

mfw78 commented Jul 15, 2023

Actually, a much tighter solution to this would be to enable an EIP-712 signatures on dilute so that owner could sign a dilute. This would represent significant UX/DX experience, allowing for many dilutes to be batched effectively, and atomically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant