1

I'm trying Hyperledger Composer and I'm just wondering what happen when we remove an asset. Is it possible to remove / delete anything from the blockchain?

Or we simply mark an asset as removed, but actually all the transaction records of that asset still exist in the blockchain?

When I removed an asset I still see the block number increasing. So I have a feeling that maybe the asset is not removed (as in deleted from existence) but just marked that the current state is removed.

I have tried to create an asset with the same ID and it works though. I can delete and recreate as many times I want yet block number always increases.

Following the above, is restarting the entire Hyperledger Network (e.g. reloading Docker image from all computers in the network) the only true way of deleting the blockchain from existence?

Thank you in advance.

Christian Lim
  • 369
  • 4
  • 14

1 Answers1

3

It sounds like you've got it right. No, data on a blockchain won't ever be deleted. A deletion is just another transaction saying certain data is deleted, so that the world state database (the DB with the non-deleted info) can remove that data.

Since a blockchain is a Merkle Tree in the background (or maybe a Hashgraph...), it plays by those rules and is immutable. Data will always be there unless the ledger and transactions are removed from the machines, such as restarting the network and removing all the information from the peers. That's basically a wipe of every machine that was used for the network structure holding the ledger. For Bitcoin that's everyone, for permissioned blockchains that may only be a few machines and could reasonably happen.

However, that's in theory, and it gets a little complicated with different implementations of a blockchain. It sounds like you're using Hyperledger Fabric, so let's take that as an example. If you're upgrading the Business Network Definition for your network dynamically and your asset definitions changed and won't support existing assets in the registry, are they actually deleted? I'm not sure, but I know they won't show up in a query, which might be effectively the same. Similarly, if you set an ACL rule or use encryption, then a marked asset might as well be deleted, since there will be many barriers (see the docs on Security and Access control) for a random participant to view that data. So depending on how sensitive your data is, it may not really matter.