input: from typing import List, Dict
  
  def compose_blockchain(data: List[Dict[str, str]]) -> str:
      """Given a list of blocks data, compose a basic blockchain system and return the entire blockchain in JSON format.
      Each block data contains 'timestamp' and 'data'.
      >>> compose_blockchain([{'timestamp': '2023-01-01 12:00:00', 'data': 'Genesis Block'}])
      '[{"index": 0, "timestamp": "2023-01-01 12:00:00", "data": "Genesis Block", "previous_hash": null, "hash": "7e0eaca137c2383b4b91b7f899127eb8f91fd05db54500f42aa33cc8bc3463fd"}]'
      >>> compose_blockchain([{'timestamp': '2023-01-01 12:00:00', 'data': 'Genesis Block'}, {'timestamp': '2023-01-02 12:00:00', 'data': 'Second Block'}])
      '[{"index": 0, "timestamp": "2023-01-01 12:00:00", "data": "Genesis Block", "previous_hash": null, "hash": "7e0eaca137c2383b4b91b7f899127eb8f91fd05db54500f42aa33cc8bc3463fd"}, {"index": 1, "timestamp": "2023-01-02 12:00:00", "data": "Second Block", "previous_hash": "7e0eaca137c2383b4b91b7f899127eb8f91fd05db54500f42aa33cc8bc3463fd", "hash": "5e49218caceca80a081499ebdf3a0930662bcdb1265df5127da93ec4f49beafa"}]'
      """
output:     import hashlib
      import json
  
      def calculate_hash(index, timestamp, data, previous_hash):
          block_string = json.dumps({"index": index, "timestamp": timestamp, "data": data, "previous_hash": previous_hash}, sort_keys=True).encode()
          return hashlib.sha256(block_string).hexdigest()
  
      blockchain = []
      previous_hash = None
  
      for index, block in enumerate(data):
          block_hash = calculate_hash(index, block['timestamp'], block['data'], previous_hash)
          blockchain.append({
              "index": index,
              "timestamp": block['timestamp'],
              "data": block['data'],
              "previous_hash": previous_hash,
              "hash": block_hash
          })
          previous_hash = block_hash
  
      return json.dumps(blockchain)