input: 
  from typing import List
  
  def chain_to_json(blockchain: Blockchain) -> str:
      """ 
      Convert a given blockchain into a JSON string representation.
      Each block in the blockchain should be represented as a dictionary containing its attributes.
      
      >>> blockchain = Blockchain()
      >>> blockchain.add_block({'timestamp': '2023-10-01 12:00:00', 'data': 'First block'})
      >>> blockchain.add_block({'timestamp': '2023-10-01 12:05:00', 'data': 'Second block'})
      >>> chain_to_json(blockchain)
      '[
        {
          "index": 0,
          "timestamp": "2023-10-01 12:00:00",
          "data": "First block",
          "previous_hash": null,
          "hash": "..."
        },
        {
          "index": 1,
          "timestamp": "2023-10-01 12:05:00",
          "data": "Second block",
          "previous_hash": "...",
          "hash": "..."
        }
      ]'
      """
  
output:     
      blocks = []
      for block in blockchain.chain:
          block_dict = {
              "index": block.index,
              "timestamp": block.timestamp,
              "data": block.data,
              "previous_hash": block.previous_hash,
              "hash": block.hash
          }
          blocks.append(block_dict)
      return json.dumps(blocks, indent=2)
  