Why is OP_CHECKLOCKTIMEVERIFY disabled by maximum sequence number?

In the code for OP_CHECKLOCKTIMEVERIFY i noticed that if the txin sequence number is maxxed out then the script will fail to validate. I’m wondering what the point of this is? Why would anybody ever submit a transaction that will fail to verify to the network?

Here is the relevant section of code:

// Finally the nLockTime feature can be disabled and thus
// CHECKLOCKTIMEVERIFY bypassed if every txin has been
// finalized by setting nSequence to maxint. The
// transaction would be allowed into the blockchain, making
// the opcode ineffective.
// Testing if this vin is not final is sufficient to
// prevent this condition. Alternatively we could test all
// inputs, but testing just this input minimizes the data
// required to prove correct CHECKLOCKTIMEVERIFY execution.
if (txTo->vin[nIn].IsFinal())
    return false;

I’m also confused about the comments in the code for this. They say that every sequence number has to be maxxed out to get the script to fail to validate, but it looks to me like this is not true – it looks like only one sequence number needs to be maxxed out and then the whole transaction (all txins) will fail. And I assume this would mean that the transaction will therefore not be included in the blockchain? But that runs counter to the code comments. It would make sense if there were a ! on the if condition.

CHECKMULTISIG a worked out example

I was wondering if somebody could point me to or give me a worked out example of how OP_CHECKMULTISIG works behind the curtains?

I expect that CHECKMULTISIG will call the CHECKSIG function and manipulate the stack to run CHECKSIG in a loop until it terminates and either has its M-out-of-N valid sigs or not?

But how exactly does it work? E.g. for 2-of-3 multisig. If we have OP_0 (sig1) (sig2) in the scriptSig, then the stack will look like:

  • (sig2)
  • (sig1)
  • 0

Now from the general way of writing CHECKMULTISIG in the scriptPubKey: 2 (pubKey1) (pubKey2) (pubKey3) 3 OP_CHECKMULTISIG, when pushing all the data onto the stack, the stack for the scriptPubKey will look like:

  • 3
  • (pubKey3)
  • (pubKey2)
  • (pubKey1)
  • 2

What exactly will the first step be of CHECKMULTISIG?

Will it pop the “3” from the stack and then maybe check if there are three pubKeys on the stack?

Or will it just pop the “3” and then immediately run CHECKSIG on (sig2) and (pubKey3), which will not be valid, hence CHECKSIG will push a “0” on the stack?

Will then CHECKMULTISIG remove the “0” that CHECKSIG introduced on the stack and try again with (sig2) and (pubKey2)? Since this is valid CHECKSIG will push a “1” on the stack, but where does CHECKMULTISIG store this “1”?

And will CHECKMULTISIG at the end count how many “1”‘s CHECKSIG made and this number must correspond to the last value on the stack, in this case “2”, but in general “M”?

I would really like to find a low-level description of CHECKMULTISIG, similarly to the one I could find for CHECKSIG:

Any help would be very appreciated!

How to restore Multibit HD keys using cloud .zip.aes files

weird thing happened to me. I kept backup in cloud under Dropbox/bitcoinz. I can see many mbhd-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.zip.aes files, I also have wallet words but when I try to restore old wallet after fresh install on new pc, I enter the words and select coud backup filder, it says that no backup files were found.

But they are there, present.

So I clicked on ok, window disappeared and new wallet opened. I entered my password (the one I used with old backuped wallet), it got accepted and bitcoin started to sync.

But when it finished, it showed 0 BTC. And moreover, I found nowhere again the option, to restore from cloud backup .zip.aes files.

What happened here? How to restore bitcoins using wallet words and online backup?


Bitcoins disappeared?

I have the Bitcoin Core client installed on my desktop, and I have encrypted it and backed up the wallet. I rarely, if ever, go into it. I just thought I would bring it up today and it now shows a 0 balance (instead of what was in there).

The last transaction was a series of small debits, that I didn’t initiate, that appears to have wiped my account out. What happened? What can i do? Anything?

I have a transaction ID, but no mention in the program of where they went.

How to determine if a public key point y is negative or positive, odd or even?

Take a bitcoin public key (x, y) and its additive inverse (x, -y). How do you identify which is the positive point and which is the negative point?


Private key 1 -> (x, y)

x = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798L

y = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8L

-y = 0xb7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777L

Private key 2 -> (x, y)

x = 0xc6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5L

y = 0x1ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52aL

-y = 0xe51e970159c23cc65c3a7be6b99315110809cd9acd992f1edc9bce55af301705L

Private key 3 -> (x, y)

x = 0xf9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9L

y = 0x388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672L

-y = 0xc77084f09cd217ebf01cc819d5c80ca99aff5666cb3ddce4934602897b4715bdL

Also, how can you identify which pub key is odd and which is even?

ex: private key 1 x,y is odd , private key 2 x,y is even

Blockchain.info receive payments API, bitcoins lost?

I use the Blockchain.info receive payments API. It’s all working nice and good, but now I have a payment that doesn’t reach my adress. It is unconfirmed for almost 24 hours.

Also, the payment doesn’t show in Bitcoin-QT (also not as unconfirmed)

You can see here: https://blockchain.info/address/1J2SpT8wBUsVhP6MBtc5sqJkUMgdfHPSZ4

Normally Blockchain.info pays the miner fee, so I should receive them very quickly.

Are my bitcoins lost in the abyss?

Run bitcoin-qt at startup of Windows server

I am running bitcoin-qt on my server. I use .Net library to query it through windows services.
It all works when I start bitcoin-qt manually.
But if the server is restarted, I see that it is running in task manager (bitcoin-qt.exe), but it is not available for services.
I also tried to run it as administrator using the scheduler, but this did not help.