code: func (msg *MsgTx) Serialize(w io.Writer) error {
  	// At the current time, there is no difference between the wire encoding
  	// at protocol version 0 and the stable long-term storage format.  As
  	// a result, make use of BtcEncode.
  	//
  	// Passing a encoding type of WitnessEncoding to BtcEncode for MsgTx
  	// indicates that the transaction's witnesses (if any) should be
  	// serialized according to the new serialization structure defined in
  	// BIP0144.
  	return msg.BtcEncode(w, 0, WitnessEncoding)
  }
docs: // Serialize encodes the transaction to w using a format that suitable for
  // long-term storage such as a database while respecting the Version field in
  // the transaction.  This function differs from BtcEncode in that BtcEncode
  // encodes the transaction to the bitcoin wire protocol in order to be sent
  // across the network.  The wire encoding can technically differ depending on
  // the protocol version and doesn't even really need to match the format of a
  // stored transaction at all.  As of the time this comment was written, the
  // encoded transaction is the same in both instances, but there is a distinct
  // difference and separating the two allows the API to be flexible enough to
  // deal with changes.