feat: add signer / 'delegate' field to support account abstraction
Problem
Refer to the postage batch struct: https://github.com/ethersphere/storage-incentives/blob/e97ec1033843dbd373857597332e43dfc209806c/src/PostageStamp.sol#L61-L74
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:
- The
ownerfield is changed to asignerfield. This represents the public address of the signer that must sign the chunks, as inspected by Swarm clients when exchanging data over Swarm. Thesignerwould still effectively have root control over the batch. - An
ownerfield is created, which can be instantiated oncreateBatchto a custom address. Thisownerhas the additional benefits of being able to call dilute the batch and set adelegateas described below. - A
delegatefield (or better terminology TBD), which is configurable oncreateBatch, and configurable byowner. This field can also call thetopUpanddilutefunctions 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.
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.