code: func serializeUtxoEntry(entry *UtxoEntry) ([]byte, error) {
  	// Spent outputs have no serialization.
  	if entry.IsSpent() {
  		return nil, nil
  	}
  
  	// Encode the header code.
  	headerCode, err := utxoEntryHeaderCode(entry)
  	if err != nil {
  		return nil, err
  	}
  
  	// Calculate the size needed to serialize the entry.
  	size := serializeSizeVLQ(headerCode) +
  		compressedTxOutSize(uint64(entry.Amount()), entry.PkScript())
  
  	// Serialize the header code followed by the compressed unspent
  	// transaction output.
  	serialized := make([]byte, size)
  	offset := putVLQ(serialized, headerCode)
  	offset += putCompressedTxOut(serialized[offset:], uint64(entry.Amount()),
  		entry.PkScript())
  
  	return serialized, nil
  }
docs: // serializeUtxoEntry returns the entry serialized to a format that is suitable
  // for long-term storage.  The format is described in detail above.