1

I dont know what is wrong

var insight = new Insight('https://insight.bitpay.com','livenet');
insight.getUnspentUtxos('1MkZVyKqNB5jpJDpfhp4TkDikFwdQM44he', function(err, utxos) {

if (err) {
        console.log('Error in getUnspentUtxos: ' + err);
    } else {
        console.log('utxos' + ' :' + JSON.stringify(utxos, undefined, 2));

        var transaction = new bitcore.Transaction()
        .from(utxos)
        .addData('pime')// Add OP_RETURN data.
        .to('1J4u97VGMz4GV7YFfRjtKLDchZ5zjiKLu4',15000)
        .fee(1000)
        .change('1AG1c1t3FAAEFdxmzm3wTg7XAnRGSwX5QA')
        .sign(privateKey);

        console.log(transaction.serialize());

        //console.log(transaction);

    }
});

This is the result: http://pastebin.com/raw.php?i=YNaHBcmU

1
  • blockchain.info does not accept OP_RETURN outputs via API, You should use any other service for broadcasting. for example webbtc.com/relay_tx
    – amaclin
    Aug 11 '15 at 5:40
2

There is nothing wrong with this transaction, the website you tried to submit it through (blockchain.info) is defective. I have broadcast it for you, and it is visible as a confirmed transaction on most block explorers.

bitcoin-cli decoderawtransaction is a useful tool which will let you decode and view the transaction have created prior to submitting it to the network, and bitcoin-cli sendrawtransaction will allow you to broadcast the transaction without relying on possibly faulty third parties.

{
  "txid": "63913178feb485db6f25c9f7940e3d17175ae7a51bf1ae58acf8f11ee95a2966",
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "f713e91b7df1dc4e4e85c7e2d9a050ca95408d1f578925f54aa93dc7bc98daa7",
      "vout": 0,
      "scriptSig": {
        "asm": "3044022012051ad672731cf555964c23d31defb67b06a85ea7de4843777d7058d3a084490220567864bf79669a8cb48e8de29f31fb29caef56f741ab9145424b3430af7b317001 038042cf5da3747c559e1d77e574eb81842958ef0cbc0461c1b783eda091afa782",
        "hex": "473044022012051ad672731cf555964c23d31defb67b06a85ea7de4843777d7058d3a084490220567864bf79669a8cb48e8de29f31fb29caef56f741ab9145424b3430af7b31700121038042cf5da3747c559e1d77e574eb81842958ef0cbc0461c1b783eda091afa782"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_RETURN 1701669232",
        "hex": "6a0470696d65",
        "type": "nulldata"
      }
    },
...
}
2
  • so..I need to put sendrawtransaction..for example get the rawtransaction and then sendrawtransaction. can i use rpc json to use node and bitcoind??
    – Jesus Pime
    Aug 10 '15 at 19:23
  • Basically use any raw transaction submission method that is not Blockchain.info. The RPC interface of bitcoind will work fine, and there is surely tools existing to communicate with it.
    – Claris
    Aug 10 '15 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.