xmtpd icon indicating copy to clipboard operation
xmtpd copied to clipboard

Data retention: Pay for blockchain payloads

Open mkysel opened this issue 6 months ago • 4 comments

Right now the payer is only charged for payloads that are broadcast on the XMTPD network.

All commits / identityUpdates etc are paid in blockchain money (USDC) by the payer directly to the blockchain.

The operators still incur a cost for storing these and there needs to be a cost associated.

The XIP specifies a cap of 90 days, rather than infinite or similar.

The challenge here is that to calculate the baseFee we must assign a stable timestamp to the payload. This can be done by reading the block time. That is an expensive operation and we definitely do not want to check the block for every event processed by the indexer.

There has to be a better way.

@neekolas @deluca-mike @fbac

mkysel avatar Jun 14 '25 00:06 mkysel

Revisiting and bumping this.

Currently we store group messages and identity updates with an expiry of MaxInt64, essentially, forever.

When indexing a new event it comes with a BlockTimestamp field that could be used easily to store it with the 90 days expiration, or even ignore it if the event is older. Same as for calculating fees.

fbac avatar Aug 21 '25 14:08 fbac

Pulling into iteration for discussion

mkysel avatar Aug 21 '25 21:08 mkysel

@mkysel I believe after latest discussions this can be closed?

fbac avatar Sep 02 '25 16:09 fbac

I would prefer to keep it in the "not today" bucket, since it might come back to haunt us :)

mkysel avatar Sep 02 '25 17:09 mkysel