func DecodeRLPMessage(rawBytes []byte) []interface{} {
	res := []interface{}{}
	rlp.DecodeBytes(rawBytes, &res)
	return res
}
DecodeRLPMessage takes an RLP serialized bytearray and parses the RLP to
return the deserialized, structured data as bytearrays ([]interfaces that
should be later coerced into specific types). Only meant for debugging
purposes - to parse serialized RLP into a useful type, see DeseralizeTx.
package binary
import (
	"crypto/sha256"
	"encoding/base64"
	"errors"
	"fmt"
	rlp "github.com/aeternity/rlp-go"
	"github.com/btcsuite/btcutil/base58"
	"golang.org/x/crypto/blake2b"
)
func hashSha256(data []byte) []byte {
	d := sha256.New()
	d.Write(data)
	return d.Sum(nil)
}
func Encode(prefix HashPrefix, data []byte) string {
	checksum := hashSha256(hashSha256(data))
	in := append(data, checksum[0:4]...)
	switch objectEncoding[prefix] {
	case Base58c:
		return fmt.Sprint(prefix, base58.Encode(in))
	case Base64c:
		return fmt.Sprint(prefix, base64.StdEncoding.EncodeToString(in))
	default:
		panic("Encoding not supported")
	}
}
func Decode(in string) (out []byte, err error) {
	var p HashPrefix
	var h string
	var raw []byte
	if len(in) <= 8 || string(in[2]) != PrefixSeparator {
		err = errors.New("invalid object encoding")
		return
	}
	p = HashPrefix(in[0:3])
	h = in[3:]
	switch objectEncoding[p] {
	case Base58c:
		raw = base58.Decode(h)
	case Base64c:
		raw, _ = base64.StdEncoding.DecodeString(h)
	}
	if len(raw) < 5 {
		err = fmt.Errorf("invalid input, %s cannot be decoded", in)
		return nil, err
	}
	out = raw[:len(raw)-4]
	if chk := Encode(p, out); in != chk {
		err = fmt.Errorf("invalid checksum, expected %s got %s", chk, in)
		return nil, err
	}
	return out, nil
}
func Blake2bHash(in []byte) (out []byte, err error) {
	h, err := blake2b.New(32, nil)
	if err != nil {
		return
	}
	h.Write(in)
	out = h.Sum(nil)
	return
}