code: func ChannelCreationBlockToGenesisBlock(block *common.Block) (*common.Block, error) {
  	if block == nil {
  		return nil, errors.New("nil block")
  	}
  	env, err := utils.ExtractEnvelope(block, 0)
  	if err != nil {
  		return nil, err
  	}
  	payload, err := utils.ExtractPayload(env)
  	if err != nil {
  		return nil, err
  	}
  	block.Data.Data = [][]byte{payload.Data}
  	block.Header.DataHash = block.Data.Hash()
  	block.Header.Number = 0
  	block.Header.PreviousHash = nil
  	metadata := &common.BlockMetadata{
  		Metadata: make([][]byte, 4),
  	}
  	block.Metadata = metadata
  	metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = utils.MarshalOrPanic(&common.Metadata{
  		Value: utils.MarshalOrPanic(&common.LastConfig{Index: 0}),
  		// This is a genesis block, peer never verify this signature because we can't bootstrap
  		// trust from an earlier block, hence there are no signatures here.
  	})
  	return block, nil
  }
docs: // ChannelCreationBlockToGenesisBlock converts a channel creation block to a genesis block