code: func witnessToHex(witness wire.TxWitness) []string {
  	// Ensure nil is returned when there are no entries versus an empty
  	// slice so it can properly be omitted as necessary.
  	if len(witness) == 0 {
  		return nil
  	}
  
  	result := make([]string, 0, len(witness))
  	for _, wit := range witness {
  		result = append(result, hex.EncodeToString(wit))
  	}
  
  	return result
  }
docs: // witnessToHex formats the passed witness stack as a slice of hex-encoded
  // strings to be used in a JSON response.