Metadata issue

0 votes
Hi, I'm trying to add metadata to a transaction and however I receive no error the output containing the metadata looks weird:

{
            "value" : 0.00000000,
            "n" : 3,
            "scriptPubKey" : {
                "asm" : "OP_RETURN 0",
                "hex" : "6a00",
                "type" : "nulldata"
            },
            "assets" : [
            ],
            "permissions" : [
            ]
        }

I use Base58 encoding for strings to add as metadata.
asked Nov 13, 2015 by Miklos

2 Answers

+1 vote

Assuming you're calling appendrawmetadata, you need to pass the metadata in hexadecimal format. What you're seeing there is a transaction with metadata that has no content.

answered Nov 13, 2015 by MultiChain
Thanks, yeah I made a mistake to convert the data into Base58 text instead of hex string... now it works fine.
Btw, is there a size limit for metadata?
You set the size limit yourself in max-std-op-return-size in the blockchain parameters.
+1 vote

You may be interested that alpha 12 adds new sendwithmetadata and sendwithmetadatafrom APIs that make all this a lot easier.

answered Nov 26, 2015 by MultiChain
...