Pruning old blockchain transactions?

+1 vote
This is a purely hypothetical question. Let’s say I want to use a blockchain for storing app login sessions. The blockchain would be stored on a private network and client apps and websites would use it for single sign on.

If a user logs in, their session is created in the blockchain. It is used by any apps or websites they visit.

If that user logs out hours later, lots of additional sessions may have been created for other users in subsequent transactions. Would it be possible to delete the transaction for this user without invalidating or destroying the subsequent transactions?
asked Jan 2, 2018 by Mike

1 Answer

0 votes
In general blockchains are not designed to forget things. So you should think less in terms of deleting the session transaction, and more in terms of creating a new transaction that represents the session ending. For example you could use streams for this, with the key of stream items representing a session ID. One item in the stream with that key starts the session, and another item with the same key ends the session. Any node subscribed to the stream can easily retrieve its full history and/or most recent state.
answered Jan 2, 2018 by MultiChain
I am also interested in forgetting about old blocks that contain "spent transaction outputs". I am a complete newby to Multichain, so forgive me if I say something stupid. As I understand in multichain terms this would mean to forget about blocks that have all assets redeemed or something like that.
I am after issuing contracts with an expiration date, I am not anymore interested in keeping them if they have been fully executed. In case of disputes this is another transaction and another block. I dont need blocks made of only those expired contracts and they can be archived. Only the 80bytes blockheader needs to be kept in every node. Does this make sense?
Yes, it makes sense in theory, but MultiChain does not currently support pruning of old blocks. Note also that for blockchain use cases where the data in the transactions itself is important (such as MultiChain streams), pruning would lose this data.
...