sendrawtransaction gives -26 error in Namecoin 0.13.99

Post Reply
PeerName
Posts: 8
Joined: Mon Apr 27, 2015 4:39 pm
os: linux
Contact:

sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by PeerName »

Hi,

I have problems with sending raw transaction in the new namecoin client.

1. I am creating the transaction via createrawtransaction;
2. I am singning the transaction (offline) via signrawtransaction;
3. Until now everything is working. But in the new namecoin client sendrawtransaction is giving me this error:
error code: -26
error message:
0:
This is my transaction (encoded):
007100000162579d856de011372384879cdbd04ba735ac2ffb6b52590e131ce0afa34f10ae000000008b483045022100b11ac41ca7acbe5a10a5e336b1bf151cae7c2efb197ecb49e7856bb39e9721d30220716764fe5d6ed19f6a24ccbf458b99c3938fc51d820670838e8c6c34f94d67f801410474afe9525132452e996533df211715568db30fc319b93126bad180fe887db1df3ebc0ab6147a3edc24ae091dd50d6639efdaf693b5c5409efe81b6d811ba8be7ffffffff0200afe33a000000001976a914b9634d3bd371c3247410fca16685dc014f0111e888ac40420f000000000042530b642f706565726e616d6573197b22616c696173223a22706565726e616d652e636f6d2e227d6d7576a91486817186170ac2c570a764f964fb3b203bc698b488ac00000000
This is the transaction (decoded via decoderawtransaction):
{
"txid": "762fa7ef83e07bd2bb6a6e2a83a97b42f66606d012e0e03f6f3a2333eb08627c",
"hash": "762fa7ef83e07bd2bb6a6e2a83a97b42f66606d012e0e03f6f3a2333eb08627c",
"size": 299,
"vsize": 299,
"version": 28928,
"locktime": 0,
"vin": [
{
"txid": "ae104fa3afe01c130e59526bfb2fac35a74bd0db9c8784233711e06d859d5762",
"vout": 0,
"scriptSig": {
"asm": "3045022100b11ac41ca7acbe5a10a5e336b1bf151cae7c2efb197ecb49e7856bb39e9721d30220716764fe5d6ed19f6a24ccbf458b99c3938fc51d820670838e8c6c34f94d67f8[ALL] 0474afe9525132452e996533df211715568db30fc319b93126bad180fe887db1df3ebc0ab6147a3edc24ae091dd50d6639efdaf693b5c5409efe81b6d811ba8be7",
"hex": "483045022100b11ac41ca7acbe5a10a5e336b1bf151cae7c2efb197ecb49e7856bb39e9721d30220716764fe5d6ed19f6a24ccbf458b99c3938fc51d820670838e8c6c34f94d67f801410474afe9525132452e996533df211715568db30fc319b93126bad180fe887db1df3ebc0ab6147a3edc24ae091dd50d6639efdaf693b5c5409efe81b6d811ba8be7"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 9.88000000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 b9634d3bd371c3247410fca16685dc014f0111e8 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914b9634d3bd371c3247410fca16685dc014f0111e888ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"NDUcAjo6MMgngabEqnjDTRSzoES2DGvVXz"
]
}
},
{
"value": 0.01000000,
"n": 1,
"scriptPubKey": {
"nameOp": {
"op": "name_update",
"name": "d/peernames",
"value": "{\"alias\":\"peername.com.\"}"
},
"asm": "OP_NAME_UPDATE 642f706565726e616d6573 7b22616c696173223a22706565726e616d652e636f6d2e227d OP_2DROP OP_DROP OP_DUP OP_HASH160 86817186170ac2c570a764f964fb3b203bc698b4 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "530b642f706565726e616d6573197b22616c696173223a22706565726e616d652e636f6d2e227d6d7576a91486817186170ac2c570a764f964fb3b203bc698b488ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"N8qZpExFVGhFhFkPeURo5QVetc1MP7wVHi"
]
}
}
]
}
Please, help me if you can see the problem with that transaction.

cassini
Posts: 336
Joined: Sun May 26, 2013 6:36 pm

Re: sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by cassini »

Do the sendrawtransaction again and watch the latest lines in your debug.log file. There must be something like this:

Code: Select all

ERROR: CheckNameTransaction: update without previous name input
I guess you told your tx where to find the NMCs for paying the fees, but you didn't let it know what name you want to update. The 0.01 input from the previous name_update is missing.

PeerName
Posts: 8
Joined: Mon Apr 27, 2015 4:39 pm
os: linux
Contact:

Re: sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by PeerName »

Thank you. I am comparing it with previous transactions. One input is really missing. I will research why createrawtransaction is not creating it in the new wallet. In the old wallet the same operation is creating it.

cassini
Posts: 336
Joined: Sun May 26, 2013 6:36 pm

Re: sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by cassini »

Could it be this is the result of that possible bug I recently observed? See https://github.com/namecoin/namecoin-core/issues/150
Maybe a previous transaction of your wallet got stuck with that error code -4, and now createrawtransaction is malfunctioning because of this?

johnc
Posts: 89
Joined: Sun Dec 28, 2014 10:03 am

Re: sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by johnc »

this is what i found about error 26 on google:
https://github.com/bitcoin/bitcoin/issues/7241
just that the tx doesn't fit some condition to be included on the memory pool.

That maybe insuficient fees, missing inputs, anything. You should first check if you have any stuck tx and then abandontx.

What namecoin wallet versions are you using? are they the same?

maybe the wallet you used didn't mark the tx as replacebyfee-able or not. Not sure how is this being handled for name_operations.

PeerName
Posts: 8
Joined: Mon Apr 27, 2015 4:39 pm
os: linux
Contact:

Re: sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by PeerName »

This is what I found. The same command (for example):
createrawtransaction '[{"txid":"6942d3a43ff17419404e44307760012ba480699fa96518aaf3e4cd1bf7739856","vout":1}]' '{"NDUcAjo6MMgngabEqnjDTRSzoES2DGvVXz":4}' '{"op":"name_update", "name":"d/anory", "value":"XXX", "address" : "N4sP1WsH6ydURtT3sRTBdwzcy6LGLRzZg9"}'
Produces different outputs in both Namecoin clients.

Namecoin 0.3.80

0071000002569873f71bcde4f3aa1865a99f6980a42b01607730444e401974f13fa4d342690100000000ffffffff04b05ecf09f916ccc1bc5691822c4a19c38b1fcb88f9ff4efa9d41970d6d63410100000000ffffffff0260f59000000000001976a914b9634d3bd371c3247410fca16685dc014f0111e888ac40420f0000000000465307642f616e6f7279217b226d6170223a7b22223a7b22616c696173223a22616e6f72792e636f6d2e227d6d7576a9145af8c08e1b96981c2fb69e081a9275da32d0555188ac00000000

Decoded:
{
"txid": "02ab975c2c60fda066b4402c1c18f57af90c46638c1849e6222e6eab13d48f03",
"hash": "02ab975c2c60fda066b4402c1c18f57af90c46638c1849e6222e6eab13d48f03",
"size": 205,
"vsize": 205,
"version": 28928,
"locktime": 0,
"vin": [
{
"txid": "6942d3a43ff17419404e44307760012ba480699fa96518aaf3e4cd1bf7739856",
"vout": 1,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
},
{
"txid": "41636d0d97419dfa4efff988cb1f8bc3194a2c829156bcc1cc16f909cf5eb004",

"vout": 1,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.09500000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 b9634d3bd371c3247410fca16685dc014f0111e8 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914b9634d3bd371c3247410fca16685dc014f0111e888ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"NDUcAjo6MMgngabEqnjDTRSzoES2DGvVXz"
]
}
},
{
"value": 0.01000000,
"n": 1,
"scriptPubKey": {
"nameOp": {
"op": "name_update",
"name": "d/anory",
"value": "{\"map\":{\"\":{\"alias\":\"anory.com.\"}"
},
"asm": "OP_NAME_UPDATE 642f616e6f7279 7b226d6170223a7b22223a7b22616c696173223a22616e6f72792e636f6d2e227d OP_2DROP OP_DROP OP_DUP OP_HASH160 5af8c08e1b96981c2fb69e081a9275da32d05551 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "5307642f616e6f7279217b226d6170223a7b22223a7b22616c696173223a22616e6f72792e636f6d2e227d6d7576a9145af8c08e1b96981c2fb69e081a9275da32d0555188ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"N4sP1WsH6ydURtT3sRTBdwzcy6LGLRzZg9"
]
}
}
]
}
Namecoin 0.13.99-name-tab-beta1

0071000001569873f71bcde4f3aa1865a99f6980a42b01607730444e401974f13fa4d342690100000000ffffffff0260f59000000000001976a914b9634d3bd371c3247410fca16685dc014f0111e888ac40420f00000000003b5307642f616e6f7279167b22616c696173223a22616e6f72792e636f6d2e227d6d7576a9145af8c08e1b96981c2fb69e081a9275da32d0555188ac00000000

Decoded:
{
"txid": "0e357ed367ee573f8ba2151e90d384f6638c0da38d47153954039a8081e52a98",
"hash": "0e357ed367ee573f8ba2151e90d384f6638c0da38d47153954039a8081e52a98",
"size": 153,
"vsize": 153,
"version": 28928,
"locktime": 0,
"vin": [
{
"txid": "6942d3a43ff17419404e44307760012ba480699fa96518aaf3e4cd1bf7739856",
"vout": 1,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.09500000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 b9634d3bd371c3247410fca16685dc014f0111e8 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914b9634d3bd371c3247410fca16685dc014f0111e888ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"NDUcAjo6MMgngabEqnjDTRSzoES2DGvVXz"
]
}
},
{
"value": 0.01000000,
"n": 1,
"scriptPubKey": {
"nameOp": {
"op": "name_update",
"name": "d/anory",
"value": "{\"alias\":\"anory.com.\"}"
},
"asm": "OP_NAME_UPDATE 642f616e6f7279 7b22616c696173223a22616e6f72792e636f6d2e227d OP_2DROP OP_DROP OP_DUP OP_HASH160 5af8c08e1b96981c2fb69e081a9275da32d05551 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "5307642f616e6f7279167b22616c696173223a22616e6f72792e636f6d2e227d6d7576a9145af8c08e1b96981c2fb69e081a9275da32d0555188ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"N4sP1WsH6ydURtT3sRTBdwzcy6LGLRzZg9"
]
}
}
]
}
The red part is missing.

Any ideas why this input is missing? Is this a bug in the new version or I have to add something to the command?

biolizard89
Posts: 2001
Joined: Tue Jun 05, 2012 6:25 am
os: linux

Re: sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by biolizard89 »

I don't use the raw tx API much, but my understanding is that it's often used to create transactions that are not intended to be broadcast immediately (and, for that matter, transactions that aren't currently valid but will be in the future). Given that, I think it's reasonable to expect the user to supply the input TXID for the name input, since the user might be attempting to create a transaction that doesn't spend the name output that's currently in the UTXO set but instead spends a name output that will be broadcast later. Therefore I think the Namecoin Core behavior is correct. Daniel might be able to comment further on this.
Jeremy Rand, Lead Namecoin Application Engineer
NameID: id/jeremy
DyName: Dynamic DNS update client for .bit domains.

Donations: BTC 1EcUWRa9H6ZuWPkF3BDj6k4k1vCgv41ab8 ; NMC NFqbaS7ReiQ9MBmsowwcDSmp4iDznjmEh5

domob
Posts: 1129
Joined: Mon Jun 24, 2013 11:27 am
Contact:

Re: sendrawtransaction gives -26 error in Namecoin 0.13.99

Post by domob »

Yes, that's roughly speaking the intent I had when I implemented it like this: The raw tx API should really be a very low level layer, and by not prefilling the name input, you gain additional flexibility. Adding the name input is not hard, just use name_show to look up the txid and vin.
BTC: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS
Use your Namecoin identity as OpenID: https://nameid.org/

Post Reply