unwriter / BitcoinMediaUpload

A set of demos to demonstrate how to upload media to Bitcoin using Datapay or Bitpipe
16 stars 3 forks source link

notwork, trying to send base64 data but getting error #1

Closed breign closed 5 years ago

breign commented 5 years ago

Keep getting error: {"error":"64: scriptpubkey. Code:-26"}

code is:
      const tx = {
        data: ["", String(imgb64)],
        pay: { 
          key: privateKey
        }
      }
      datapay.send(tx, function(err, res) {
        if (err) {

... What am I doing wrong?

opReturn0 commented 5 years ago

i have exact the same issue, troubleshooting it as we speak

breign commented 5 years ago

if I build TX and send it via https://whatsonchain.com/broadcast it worx

opReturn0 commented 5 years ago

ok, good to know. It probably is an issue with datapay and the service/node it communicates with.

breign commented 5 years ago

also, I noted that it prepends base64 with some extra bytes, can I override that? tx example of an image

P.S. I'm node noob.

opReturn0 commented 5 years ago

what did you do to post the raw tx? the base64 is not accepted by whatsonchain

torusJKL commented 5 years ago

I think the raw tx needs to be in hex.

opReturn0 commented 5 years ago

OK i got it to send a tx - but as with @breign some data is prepended which breaks it

breign commented 5 years ago

what did you do to post the raw tx? the base64 is not accepted by whatsonchain

image inside tx was encoded base64, not tx. but something prepended that image base64 data.

opReturn0 commented 5 years ago

yes "Mg" is prepended, i tried some tricks but no luck so far

opReturn0 commented 5 years ago

The prepending issue might be related to WoC - I informed the operator. The op_return looks good in electrumsv

breign commented 5 years ago

any other compatible xplorers for datapay or just https://bchsvexplorer.com ?

breign commented 5 years ago

I closed this issue because I figured it out.