First of all, the chaincode (or smart contracts) and the assets are two different things.
- Chaincode: the code that you will execute/invoke. This code is the same in all the nodes, i.e. each node of the network has installed the same chaincode.
- Assets: you digitize the assets using transactions that are governed by smart contracts.
On the other hand, how it works:
- Ledger: the Ledger stores all the transactions. The ledger is comprised of a blockchain (‘chain’) to store the immutable, sequenced record in blocks. Each peer maintains a copy of the ledger.
- State Database: maintains the current state. It represents the latest values for all keys ever included in the chain transaction log. Chaincode invocations execute transactions against the current state data.