Pages:
Author

Topic: Is this transaction spendable? (Read 5161 times)

hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
November 15, 2014, 09:12:16 AM
#30
what is altstack?Huh
do you have some tutorials?

thanks

it is alternative/secondary stack
it is not used now for standard scripts
but the operations are valid

Where i can get more info a bout altstack?
Do you Have some docs or links?
Thanks!

See https://bitcoin.org/en/developer-guide#p2pkh-script-validation

   ~~MZ~~
member
Activity: 112
Merit: 10
November 15, 2014, 06:20:09 AM
#29
what is altstack?Huh
do you have some tutorials?

thanks

it is alternative/secondary stack
it is not used now for standard scripts
but the operations are valid

Where i can get more info a bout altstack?
Do you Have some docs or links?
Thanks!
legendary
Activity: 1260
Merit: 1019
November 13, 2014, 03:49:37 PM
#28
what is altstack?Huh
do you have some tutorials?

thanks

it is alternative/secondary stack
it is not used now for standard scripts
but the operations are valid
member
Activity: 112
Merit: 10
November 13, 2014, 03:35:47 PM
#27
what is altstack?Huh
do you have some tutorials?

thanks
sr. member
Activity: 250
Merit: 253
July 30, 2014, 11:31:04 AM
#26
I'm curious though.

Can anyone think of a script that uses the altstack and can do something no other script can?
I'm pretty sure that theoretically, there's nothing you can do with altstack that you can't without (given enough space). However, it can make some things simpler/shorter, and since there is a limit on the script size, that can make it quite useful.
legendary
Activity: 1260
Merit: 1019
July 30, 2014, 10:05:45 AM
#25
Quote
Can anyone think of a script that uses the altstack and can do something no other script can?

Some algorithms will be much more shorter using the altStack.
For example this script is only 10 bytes long
Code:
OP_TOALTSTACK 
OP_TOALTSTACK
OP_TOALTSTACK
OP_HASH160
OP_FROMALTSTACK
OP_HASH160
OP_FROMALTSTACK
OP_HASH160
OP_FROMALTSTACK
OP_HASH160
and (I can be wrong, please correct me) replaces 4 values on the top of the stack with their hashes, leaving the original order.
Try to do the same without altStack in less than 10 bytes.

Update1: OK, may be it is possible to do with OP_2DUP and OP_2SWAP opcodes. You can try to find out your own examples for using altStack

Update2: Note, that bitcoin script language is not Turing-complete. Not all things are even possible with current opcode set
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 30, 2014, 09:40:45 AM
#24
I'm curious though.

Can anyone think of a script that uses the altstack and can do something no other script can?

An m of n PubKeyHash (as opposed to PubKey) multisig.  I haven't exhaustively tested it so there may be some clever solution I just didn't see but anything not involving altstack ends up being much longer and more complex.


newbie
Activity: 13
Merit: 0
July 30, 2014, 09:32:22 AM
#23
I'm curious though.

Can anyone think of a script that uses the altstack and can do something no other script can?
newbie
Activity: 2
Merit: 0
July 29, 2014, 11:02:45 AM
#22
I created this transaction and it is in fact unspendable due to the fact the alt stack does not persist from the scriptSig to the scriptPubKey. I'm glad it sparked some discussion though.
full member
Activity: 157
Merit: 100
July 26, 2014, 04:58:22 AM
#21
maybe its about the fees?

amaclin has answered above
sr. member
Activity: 252
Merit: 250
July 25, 2014, 03:12:57 PM
#20
maybe its about the fees?
full member
Activity: 157
Merit: 100
July 25, 2014, 03:26:30 AM
#19
Good explanation, thanks!
PS  I think your English is good and better than what you probably think Smiley
legendary
Activity: 1260
Merit: 1019
July 24, 2014, 02:59:27 AM
#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.
full member
Activity: 157
Merit: 100
July 24, 2014, 02:30:51 AM
#17
Hmm do you mean OP_TOALTSTACK is broken and shouldn't be used?
legendary
Activity: 1260
Merit: 1019
July 23, 2014, 12: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 > 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.
sr. member
Activity: 250
Merit: 253
July 22, 2014, 05:53:34 PM
#15
The transaction has the following metadata:

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.
legendary
Activity: 1386
Merit: 1053
Please do not PM me loan requests!
July 22, 2014, 05:38:03 PM
#14
The transaction has the following metadata:

Interesting...
newbie
Activity: 13
Merit: 0
July 21, 2014, 05: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
legendary
Activity: 1260
Merit: 1019
July 21, 2014, 12: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:
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 21, 2014, 11:45:33 AM
#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.
Pages:
Jump to: