text:
Does using different addresses affect subsequent transaction size, given the same number of inputs?
I'm quite confused about the input count that affect the transaction size, example:
x1 = my receive btc address

x2 = my another receive btc address

x3 = my another receive btc address

Scenario A
P1 send 1 btc to address x1
P2 send 1 btc to address x1
P3 send 1 btc to address x1
Scenario B
P1 send 1 btc to address x1
P2 send 1 btc to address x2
P3 send 1 btc to address x3
So my wallet will have total balance 3 btc.
My question is when I try to send 3 btc to P4 (Another user), scenario A will count as 3 inputs or scenario B will count as 3 inputs or both is same 3 inputs?

Transaction inputs need to reference the Unspent Transaction Output (UTXO) they are spending with the outpoint of that UTXO. The outpoint is the transaction id of the transaction that created the transaction output concatenated with a colon and the output position in that transaction: txid:vout.
Let's say you were sent 1 BTC by P1 to address x1 in transaction uiaex and it was the second output (vout = 1 because we start counting at 0), the corresponding outpoint would be uiaex:1.
The UTXO reference therefore is independent of the address that the funds were sent to previously.
The transaction size is therefore the same whether you received all outputs to the same address or different addresses. There are no savings in transaction size by receiving funds to the same address multiple times.

There are three inputs to the transaction in both scenario A and scenario B.
Your scenarios, with a little more details:
Scenario A
P1 makes transaction t1, and sends 1 btc to address x1 in transaction output 0
P2 makes transaction t2, and sends 1 btc to address x1 in transaction output 0
P3 makes transaction t3, and sends 1 btc to address x1 in transaction output 0
Scenario B
P1 makes transaction t1, and sends 1 btc to address x1 in transaction output 0
P2 makes transaction t2, and sends 1 btc to address x2 in transaction output 0
P3 makes transaction t3, and sends 1 btc to address x3 in transaction output 0
Transactions
With scenario A, sending 3 btc to P4 translates to the following transaction: merge t1-output0, t2-output0, t3-output0 together, and send 3 btc to P4's address. There are no transaction fees.
With scenario B, it is the same transaction-wise: merge t1-output0, t2-output0, t3-output0 together, and send 3 btc to P4's address. There are no transaction fees.

Thanks for your reply bro, you mean both scenario also no network fee? This 3 inputs will not increase the next payment transaction size? I saw many article mentioned inputs+outputs+10 = best fee to pay..

"There are no transaction fees" is misleading.  It's true that you have described transactions that don't include any fees.  If you try to actually make such transactions, they will most likely not be confirmed.  If you want them to be confirmed, you will need to include fees, which means that you will not be able to send a full 3 BTC to P4, but rather slightly less.  However, the amount of fees needed will be the same in either case, since both transactions would be the same number of bytes.


text:
Recovering BCH sent to BTC Ledger Nano S Wallet
I've looked at existing  relevant threads, but still I didn't got the right solution for my situation, so raising this request. This case is perhaps somewhat different because it relates specifically to a Ledger hardware wallet.
I was trying to transfer BCH from Koinex wallet to my Ledger Nano S wallet, but I've given BTC address wrongly instead of BCH address! The transaction was succesfully sent from the Koinex site, however I've not received my coins into my Ledger Nano S wallet as I've given BTC address instead of BCH! When I see the transaction status in Block Chain, I was surprised, there were 63 confirmations till now! I wonder how it is possible as I've given wrong wallet id.
Anyway, I would like advice on how to retrieve my coins.

Dear Admin(s), the thread seems to be duplicate, but it is not. I've gone thru all the relevant threads but didn't find solution for my issue. thus, raised this thread. Kindly help me to get responses and solution. Thanks

I voted to reopen this, because the linked question is about transferring to an address in an exchange, whereas this is about transferring to a hardware wallet where the user holds the key.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Are there any signatures where the recid (v) is equal to 29,30 (or 33,34 compressed)?
Peter Wuille recently explained how ECDSA pubkey recovery is done, in response to my question.
So it's basically that for a given base64 signature, the value v in v,r,s provides the specific coordinates, hence the recid (recovery ID).
Example from BitcoinCore test vectors:
> sig =
> "H8PgOb/liZzt3QQHJn9kLBqH7E/i+SC6JTwYGtdNdOjnXzFqXnHMZqP7oZ1wb1QiQ3H/kF8xC9Yx7pK9ddlx8TA"
> addr = "1K5Z1nxN4mjUgCLpSXMRkeZxuAMpbn2CQB" wif =
> "KwfJTiKdcjNMjBu4ksgGd21EZXz6JomoZNbirP3nfd3K9ZMXMEUi"
>
> v,r,s = vrs = (31,
> 88597177789312009809148107221292570613390338668815747761545214128303675599079L,
> 43057030252916568867525408201971649068117337291455262356277580652864892694832L)

The value of v is 27 + recid for uncompressed keys and 31 + recid for compressed keys.
Ive run a Python loop using pybitcointools which signs a message using a random key, and I've yet to ever see v=29 or v=30. Why is this? Is it by design, or is it just a very low probability event?

For random signatures, it is an extremely low probability event. Around 1 in 2128, so it will likely never ever actually happen.
However, you can easily construct a valid signature that has one of those, and the recovery algorithm will give you an actual public key for it. It just won't be a public key anyone actually knows the secret key for.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Redeeming a raw transaction step by step example required
I am looking, specifically, for a step by step example transaction of sending Bitcoin which uses an actual transaction (How To Redeem A Basic Txn, from a few years back, does a great job of outlining most steps of sending a raw txn but does not use a real TxID).
I have played around with both the Python pybitcointools library, the SX library and JSON output from the Bitcoin Core client (Bitcoin-QT, Bitcoin-cli, Bitcoin daemon) but have yet to find an actual step by step guide using raw transaction output (single input / single output Bitcoin txn, ie not multisig).
Hopefully the bounty will bring a step by step example transaction (with private keys for the sending address) will bring an answer showing how it's done and, specifically:

how the ScriptPubKey element fits into the raw txn
how the ScriptSig element fits into the raw txn
how the txn is signed (with DER encoding).

EDIT: I think the best resource is Ken Shirriff's Bitcoins the hard way: Using the raw Bitcoin protocol, but again, there's no single source online that answers my question without skimming past areas like scriptPubKey, signing etc.
When I activate the bounty, if you can answer this refer to this Tx as it can serve as the actual example (ie I'll provide ~$1 in BTC and private keys for 1From/1MBngSqZbMydscpzSoehjP8kznMaHAzh9y if interested)
EDIT 2: The RoyalFork Blog: Deconstructing Txns provides an unbelievably good reference for interactive Txn creation

You should read Bitcoin the hard way.

Are you looking for step by step with RPC calls, or step by step with byte manipulation by hand?

@NickODell - yes, have seen that, Nick, and you're right, it's a fantastic resource! The issue still remains though even after reading the Python code... I just don't get the whole ScriptPubKey / scriptSig part and every resource I read is very opaque at that part. I'll edit the question to provide more clarity once I can put up the bounty

@StephenM347 Aiming for a step by step example which is as close to how would I create a Bitcoin transaction with pencil and paper? (similar to:  http://bitcoin.stackexchange.com/q/808/9382 ). I am certainly avoiding RPC calls which "do the work" so to speak

Do you care that it uses the exact txid you mentioned? I just think it would be easier to do it with a tx that I own. I wouldn't reveal the private key, but I would make the signatures that it calculates known.

@stephenm347 it doesn't have to be that tx. If you'd like to reference your own txn that's fine too but I've setup this because the outputs are from 1From and the 1MB address is a brainwallet which happens to reference letters the same as 1MB (so private key is easy to link to the address)

@StephenM347 For the bounty I need the private keys so I can repeat the process myself. Even Nick's suggestion to check out "Bitcoin the hard way" references the stack exchange How To Redeem A Raw TX so there is no canonical answer to this online; https://github.com/shirriff/bitcoin-code/blob/master/txnUtils.py

Note that even if you repeat the process provided, the signature produced may not be identical to the one in the instructions.  That's because DSA/ECDSA signatures need to be produced with a secret value (often called k) and one method for producing a secret value is a one-time random number.  If you want perfectly reproducible steps, you should specify either that the value of k be provided in the instructions or that RFC6979 deterministic generation of k be used.

Step-by-step description:
We start creating a new transaction which we hash and sign.

Add four-byte version field: 01000000
One-byte varint specifying the number of inputs: 01
32-byte hash of the transaction from which we want to redeem an output (reverse order): be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d5396
Four-byte field denoting the output index we want to redeem from the transaction with the above hash (counting from zero): 00000000
Now comes the scriptSig. For the purpose of signing the transaction, this is temporarily filled with the scriptPubKey of the output we want to redeem. First we write a one-byte varint which denotes the length of the scriptSig (0x19 = 25 bytes): 19
Then we write the actual scriptSig (which is the scriptPubKey of the output we want to redeem): 76 a9 14 dd6cce9f255a8cc17bda8ba0373df8e861cb866e 88 ac (look to the bottom line line on https://blockchain.info/tx/96534da2f213367a6d589f18d7d6d1689748cd911f8c33a9aee754a80de166be?show_adv=true )
Then we write a four-byte field denoting the sequence. This is currently always set to 0xffffffff: ffffffff
Next comes a one-byte varint containing the number of outputs in our new transaction. We will set this to 1 in this example: 01
We then write an 8-byte field (64 bit integer, little-endian) containing the amount we want to redeem from the specified output. I will set this to the total amount available in the output minus a fee of 0.0001 BTC (128307 - 10000): 23ce010000000000
Then we start writing our transaction's output. We start with a one-byte varint denoting the length of the output script (0x19 or 25 bytes): 19
Then the actual output script: 76 a9 14 a2fd2e039a86dbcf0e1a664729e09e8007f89510 88 ac ( this is transferring funds back to address 1FromKBPAS8MWsk1Yv1Yiu8rJbjfVioBHc )
Then we write the four-byte "lock time" field: 00000000
And at last, we write a four-byte "hash code type" (1 in our case): 01000000

OK, the result is
01000000
01
be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d5396
00000000
19 76 a9 14 dd6cce9f255a8cc17bda8ba0373df8e861cb866e 88 ac
ffffffff
01
23ce010000000000
19 76 a9 14 a2fd2e039a86dbcf0e1a664729e09e8007f89510 88 ac
00000000
01000000

Now we double-SHA256 hash this entire structure, which yields the hash 1cde0239b55717cca8003104abc2ec2673d4f6fabea0b74351940e382e88486f
Now we should create ECDSA signature...
1MBngSqZbMydscpzSoehjP8kznMaHAzh9y is a brainwallet of "mrbubbymrbubbymrbubby!", which just happens to encode an address starting in 'MB' (making linking the 2 quite easy; see @WizardOfAussie comment below for phrase origins).
Private key in WIF: 5HvofFG7K1e2aeWESm5pbCzRHtCSiZNbfLYXBvxyA57DhKHV4U3

In hex, the private key is 0ecd20654c2e2be708495853e8da35c664247040c00bd10b9b13e5e86e6a808d. There is a sign (key, digest) method in every crypto lib. It will return an array of bytes. This array will be no more than 72 bytes, and start with hex code 30. Lets imagine that the signature is 3046022100cf4d7571dd47a4d47f5cb767d54d6702530a3555726b27b6ac56117f5e7808fe0221008cbb42233bb04d7f28a715cf7c938e238afde90207e9d103dd9018e12cb7180e
 To this signature we append the one-byte hash code type: 01. The public key for 1MBngSqZbMydscpzSoehjP8kznMaHAzh9y is: 042daa93315eebbe2cb9b5c3505df4c6fb6caca8b756786098567550d4820c09db988fe9997d049d687292f815ccd6e7fb5c1b1a91137999818d17c73d0f80aef9

We construct the final scriptSig by concatenating: <One-byte script OPCODE containing the length of the DER-encoded signature plus the one-byte hash code type>|< The actual DER-encoded signature plus the one-byte hash code type>|< One-byte script OPCODE containing the length of the public key>|<The actual public key>

scriptSig will be
49 3046022100cf4d7571dd47a4d47f5cb767d54d6702530a3555726b27b6ac56117f5e7808fe0221008cbb42233bb04d7f28a715cf7c938e238afde90207e9d103dd9018e12cb7180e 01
41 042daa93315eebbe2cb9b5c3505df4c6fb6caca8b756786098567550d4820c09db988fe9997d049d687292f815ccd6e7fb5c1b1a91137999818d17c73d0f80aef9

first line is 'push signature concatenated with 01', second line is 'push pubkey'. The length of scriptSig is 140 bytes (0x8c in hex)

We then replace the one-byte, varint length-field from step 5 with the length of the data from step 16. The length is 140 bytes, or 0x8C bytes: 8c
And we replace the actual scriptSig with the data structure constructed in step 16.
We finish off by removing the four-byte hash code type we added in step 13, and we end up with the following stream of bytes, which is the final transaction:
01000000
01
be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d5396
00000000
8c
49 3046022100cf4d7571dd47a4d47f5cb767d54d6702530a3555726b27b6ac56117f5e7808fe0221008cbb42233bb04d7f28a715cf7c938e238afde90207e9d103dd9018e12cb7180e 01
41 042daa93315eebbe2cb9b5c3505df4c6fb6caca8b756786098567550d4820c09db988fe9997d049d687292f815ccd6e7fb5c1b1a91137999818d17c73d0f80aef9
ffffffff
01
23ce010000000000
19 76 a9 14 a2fd2e039a86dbcf0e1a664729e09e8007f89510 88 ac
00000000

Isn't this the steps outlined in the link in the question? I don't this this qualifies for the bounty. @wizardofozzie one thing you have to understand about bitcoin is that testing transactions is unlike any other computer program in history: it is impossible to replicate the same situation twice as is normally the case with testing. ie you can never go back a re-run the exact same situation again.

I do not pretend for bounty. I've just answered a question. And yes, most of my answer is pure copy-paste. May be very small additions. English is not my native language and it is hard for me to write the whole answer myself :)

I understand now! @amaclin if you want the private keys to edit your answer I can provide it (or I can edit the answer and give the privkey). Fyi it was the DER encoding (the part starting with a 0x30 byte) which I couldn't for the life of me place. I knew there was the 130 char public key starting with 0x04 within the byte array but I couldn't place the first part. I do understand it's going to be signed differently each time (one would hope!) but this is exactly the clarification I needed. I'll likely have to wait until I'm not using the iOS app to award the bounty but amaclin thank you!

You should not publish your private keys. You even should not send me your keys (my email is in profile). I think that my answer is full enough, nobody needs that the result been correct transaction existing in blockchain.

I appreciate what you're getting at (and the fabulous answer!) but the addresses are not holding BTC. The whole point of this was to have a canonical answer which is not testnet or regtest or abstract. So I'm going to edit your answer as I've successfully signed the txn and transmitted it. https://blockchain.info/tx/211b8fb30990632751a83d1dc4f0323ff7d2fd3cad88084de13c9be2ae1c6426

I'll add an answer outlining the process using sx tools but for those interested the brainwallet for 1MB... is "mrbubbymrbubbymrbubby!" (no quotes) => 1MBngSqZbMydscpzSoehjP8kznMaHAzh9y ... in case you're wondering it's what the neighbor yells each night to call her cat. It just so happens to hash to 1MB :)

Waiting for your next question: how to redeem two outputs in one tx (how to create & sign transaction with more than one input)

@amaclin Found this AWESOME reference; this blog is unbelievably good for visual ppl like myself... http://www.royalforkblog.com/2014/11/20/txn-demo/?#the-ins-and-outs-of-transactions

This is great! However, how is the raw transaction constructed when there are more than one input / output?

Is there a bip that describes the above?

It's great post. Thanks. I wrote some code based on your great answer but my code doesn't run. Could you help take a look at https://bitcoin.stackexchange.com/questions/92005/verify-bitcoin-transaction ? Thanks a lot.

This is an excellent answer by amaclin and Wizard of Ozzie. I'd just like to add some more detail for the Wizard of Ozzie's transaction at blockchain.info.

The correct input to the signature process for this transaction is
 01000000
 01
 be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d5396
 00000000
 19 76 a9 14 dd6cce9f255a8cc17bda8ba0373df8e861cb866e 88 ac
 ffffffff
 01
 23ce010000000000
 19 76 a9 14 2bc89c2702e0e618db7d59eb5ce2f0f147b40754 88 ac
 00000000
 01000000

The double-SHA256 hash of this is computed by bx as
 d304448dff517bcf677cd36f3491e9ef2ccfdf40fb63af5782d9b768640af130

but this is written in "reverse" order for whatever peculiar historical reason (I've heard it was to be compatible with M*soft CRAPi). So when using this with the sign(key, digest) in most sensible crypto toolkits you may need to reverse the hash value to the "proper" order for SHA256(SHA256(m))
30f10a6468b7d98257af63fb40dfcf2cefe991346fd37c67cf7b51ff8d4404d3

The above input data will indeed validate against the signature given in the actual blockchain transaction
  3045022100da43201760bda697222002f56266bf65023fef2094519e13077f777baed553b102205ce35d05eabda58cd50a67977a65706347cc25ef43153e309ff210a134722e9e

using the given public key
042daa93315eebbe2cb9b5c3505df4c6fb6caca8b756786098567550d4820c09db988fe9997d049d687292f815ccd6e7fb5c1b1a91137999818d17c73d0f80aef9

To generate a reproducible signature over the same data, the following signature has been made by the deterministic method of RFC6979.
 30450220587ce0cf0252e2db3a7c3c91b355aa8f3385e128227cd8727c5f7777877ad772022100edc508b7c14891ed15ab38c687019d7ebaf5c12908cf21a83e8ae57e8c47e95c

using the matching private key provided by Wizard of Ozzie
0ecd20654c2e2be708495853e8da35c664247040c00bd10b9b13e5e86e6a808d

This signature also validates over the given data using the public key and should be reproducible.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
5 GH/s Bitcoin Miner from Butterfly Labs can mine Litecoin?
I was wondering buy this ASIC miner of 5GH/s to mine Litecoin.

I want know, can I mine Litecoin with this powerful tool? If not, there any ASIC miner's that can mine Litecoin?

Litecoin uses a different proof of work than Bitcoin, so that hardware won't be compatible(it won't be solving the right problems).
One of the motivations of Litecoin was to make CPU mining viable by making it difficult to create efficient GPU/FPGA/ASIC miners, so it's unlikely that you can find specialized hardware for this purpose. I think that some GPUs do give a speedup over CPU mining with Litecoin, but it isn't as dramatic as with Bitcoin.

No, you can't mine Litecoin with any of Butterfly Labs' products. There is an ASIC miner in development by Alpha Tech http://alpha-t.net/ that they claim will be able to.

Will these Alpha Tech miners which mine scrypt based coins like Litecoin, be able to mine scrypt-jane based coins like Yacoin?

Supposedly, UK-Based Alpha Technologies are about to release a Litecoin/Scrypt-capable ASIC ship miner, which should speed up mining Scrypt-based coins substantially.
http://alpha-t.net/product/scrypt-asic-miner

+1 He was proposing an alternative that may be able to do what OP wanted to do with the Butterfly Labs miner.

@AustinBurk, thanks for the support mate, yes was only  being helpful.

Just be careful about these sorts of things. Lots of scammers pop up claiming to build ASICs with inflated claims of their efficiency (or existence).


text:
Is it true the genesis block reward can't be spent forever?
Is the genesis block reward forever unspendable?

I believe this is not a duplicate.  The other question asks why it is unspendable.  This questions asks if that is changeable.

I might be biased, since I wrote the original question, but I think that this question is a subset of the question I wrote.

There is no technical constraint causing the genesis block's reward to be unspendable forever.
It is a bug that has now become the accepted standard.  In the future the genesis block reward could be spent but clients must be updated to fix this bug or they will reject blocks containing a valid input referring to this transaction (4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b).
Other clients outside of bitcoind, like btcd, also mimic this bug so they don't risk a fork if Satoshi ever decided to spend these coins.  Seeing that Satoshi isn't around much fixing this bug isn't exactly a priority and there is a good chance that this might never be "fixed".

It may or may not be considered a bug, but it is part of the consensus rules now, effectively. Software can be changed to alter this, but with a software change we could also make Bitcoin a frontend for Paypal - so it's not a very interesting argument. Effectively, every full validation node needs to be modified, at the same time simultaneously, or we'd be giving Satoshi a means to instantly fork the network. Changes like this are called "hard forks", and only done when there is very pervasive consensus that it is needed.


text:
"block decode failed" error while mining in pool
I just started solo mining last month, and I have no problems with cgminer.
I have already shares accepted and sometimes new block detected.
I want to know why when I want decode I've an error?
For example, "block decode failed (-22)"
In my Roaming\Bitcoin\blocks, I have some 300 files who called blk00000.dat and until i'm mining, until the list expand.
But I don't have receive my awards for my blocks.... and not to for the fees...
Can you explain me please?
Is the blocks files are my detected block by mining?
Why I've an error block decode failed? How to do too receive my awards?
Thanks for your  help...
Ps:i'm french and i say "il n'y a rien de plus frustrant de ne pas comprendre"
It's like "there is nothing biggest frustation than don't understand!!!"

Are you using any software besides Bitcoin and cgminer? Are you sure you're solo mining?

the blk0xxx.dat files are just the blocks that form the blockchain. They are not the blocks you found. Unless you have a LOT of mining power (more than 10,000 ASIC machines, for example), I really doubt you even found 1 block.

Hello Beliomir: Please, put any additional information into the question by editing instead of adding answers to your post.

Are you running "bitcoin-cli submitblock xyz" manually? You are not supposed to do this. Software does this. If you mine in a pool you don't even need to run bitcoind at all.
If you do want to run your own bitcoind node, don't mess with the blk*.dat files. You don't need to touch them. The bitcoind program is the only thing that needs to use them.
If you mine in a pool just set up your ASIC mining machines and make sure they are running, then use the pool website for the rest of your needs.

Good Day,
Are you solo mining or pool mining?
If you are solo mining.... You will need to have about 1000 Th/s of ASIC Cheddar to Mine Solo. So, that is striked.
If you have that kind of cheddar of a 1000 ASICS, it will take about a day for it to come in your account with a couple of confirmations....
To know if you are solo mining you will have a --btc-address= and this param should have your BTC Address... if you are solo mining.
If you are pool mining, your parameters will something like -u somename.worker1 -p password or -u BTC_ADDRESS -p x
It is also safe to assume that you haven't mined a solo block. with a CPU or GPU
If you are pool mining (duh!), go to that pool's website and login to your account.
Hopefully, you created a worker or else there is a chance that you have mined to donation.... and you didn't make a dime..... If you did, your Username should be your Worker ID e.g. username.worker1 and Pass to whatever you set...
Then wait for the round of cash complete (Seriously Wait..)..... for hours...
Then go and withdraw your BTC from the pool to your wallet address and enjoy this tiny (I guess...) wealth.
If you are using Eligius or a Non-Registratable P2P Pool then your Username Should be your BitCoin Address and Your Password Being x or 123.
Same applies here, if you don't put a Version 0 Address, (i.e. An Address starting with 1) or put some other rubbish other than YOUR address, it goes for donations....
Your worker password cannot be used for accessing your bits.
Also that blk(whatever...).dat is the records of other cash, that is the BlockChain!

Thank's for your answer... Surely i use two asics miners in usb connect, the last version of cgminer can use asics in usb... I'm not liying, i have all the time, some share accpeted and sometimes i have new block detected. I've found on the net, that the lastest version of bitcoin-qt doesn't mining??? really??? I use a pool, which i can solo mining by user=adress wallet and pass=wathyouwant When i write getblocktemplate i have a list of block transaction and shares and fees...

When i submit a block with submitblock =>block decode failed.
Thank's for your answer, but the mining pool that i use, can solo and there is develloped for low power mining....
I can't understand why?
I understood that blk00000.dat is the blockchain. First block that creator have been created in a first time.


text:
Unable to Compile Particle-Qt using qmake in Ubuntu 15.04
Good Day!
I am trying to compile the Particle-Qt Client on Ubuntu 15.04 Vivid Velvet using GCC 5.0 & libboost1.55
So my system is throwing errors, these are the following:
While executing qmake, I am getting this:
Project MESSAGE: Building with UPNP support
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Removed plural forms as the target language has less forms.
If this sounds wrong, possibly the target language is not set or recognized.
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Removed plural forms as the target language has less forms.
If this sounds wrong, possibly the target language is not set or recognized.
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element
Warning: ignoring <defaultcodec> element

And When Executing Make I am getting:
cd /media/red_gene/DeOxyRibose/Particle_REACQ/src/leveldb && CC=gcc CXX=g++ make OPT="-m64 -pipe -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2" libleveldb.a libmemenv.a
make[1]: Entering directory '/media/red_gene/DeOxyRibose/Particle_REACQ/src/leveldb'
make[1]: 'libleveldb.a' is up to date.
make[1]: 'libmemenv.a' is up to date.
make[1]: Leaving directory '/media/red_gene/DeOxyRibose/Particle_REACQ/src/leveldb'
cd /media/red_gene/DeOxyRibose/Particle_REACQ; /bin/sh share/genbuild.sh /media/red_gene/DeOxyRibose/Particle_REACQ/build/build.h
fatal: Not a git repository (or any parent up to mount point /media/red_gene/DeOxyRibose)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
g++ -c -m64 -pipe -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -D_REENTRANT -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -fPIE -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6=1 -DHAVE_BUILD_INFO -DLINUX -D_FILE_OFFSET_BITS=64 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -Isrc -Isrc/json -Isrc/qt -Isrc/leveldb/include -Isrc/leveldb/helpers -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -Ibuild -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o build/bitcoin.o src/qt/bitcoin.cpp
src/qt/bitcoin.cpp:5:24: fatal error: QApplication: No such file or directory
compilation terminated.
Makefile:1106: recipe for target 'build/bitcoin.o' failed
make: *** [build/bitcoin.o] Error 1

Problem is here:
QApplication: No such file or directory

You might not have QT development files installed.
If using debian / ubuntu try:
apt-get install libqt4-dev

Had to remove qt5-qmake and replace with qt4-qmake!

Had to remove qt5-qmake and replace with qt4-qmake! -> how to do this?


text:
What version byte will produce a Base58 encoding starting with X?
What is the Value of X in Base58?
The Problem is when I referred to this table: https://en.bitcoin.it/wiki/Base58Check_encoding
I in the end come up with D when I used 30, but I want X, so what will be the correct value for PUBKEY_ADDRESS and (if necessary) SCRIPT_ADDRESS
This is my existing code:
PUBKEY_ADDRESS = 30, // The letter X (Version 1 Addr.)
         SCRIPT_ADDRESS = 9,
PUBKEY_ADDRESS_TEST = 56, // The Letter P (Version 0 Addr.)
   SCRIPT_ADDRESS_TEST = 119,

Can somebody give the Value that will give me X

Are you asking what version byte quarkcoin uses, or what version byte will produce a prefix of X?

I am asking which version Byte will produce the Prefix of X

I wrote a node.js program to solve this in general.
var cs = require('coinstring')

var hash160L = "0000000000000000000000000000000000000000" //hash representing uncompressed
var hash160H = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" //hash representing uncompressed
function startsWith(version) {
        var hash160Buf = new Buffer(hash160L, 'hex')
        lowEnd = cs.encode(hash160Buf, version).charAt(0);
        hash160Buf = new Buffer(hash160H, 'hex')
        highEnd = cs.encode(hash160Buf, version).charAt(0);
        if(lowEnd == highEnd) {
                return lowEnd;
        } else {
                return [lowEnd, highEnd];
        }
}
var version = 0x00; //Bitcoin public address
for(var i = 0; i < 256; i++) {
        console.log(i + " will produce addresses starting with: " + startsWith(i));
}

Here's the output:
0 will produce addresses starting with: 1
1 will produce addresses starting with: Q,o
2 will produce addresses starting with: o,2
3 will produce addresses starting with: 2
4 will produce addresses starting with: 2,3
5 will produce addresses starting with: 3
6 will produce addresses starting with: 3
7 will produce addresses starting with: 3,4
8 will produce addresses starting with: 4
9 will produce addresses starting with: 4,5
10 will produce addresses starting with: 5
11 will produce addresses starting with: 5
12 will produce addresses starting with: 5,6
13 will produce addresses starting with: 6
14 will produce addresses starting with: 6,7
15 will produce addresses starting with: 7
16 will produce addresses starting with: 7
17 will produce addresses starting with: 7,8
18 will produce addresses starting with: 8
19 will produce addresses starting with: 8,9
20 will produce addresses starting with: 9
21 will produce addresses starting with: 9
22 will produce addresses starting with: 9,A
23 will produce addresses starting with: A
24 will produce addresses starting with: A,B
25 will produce addresses starting with: B
26 will produce addresses starting with: B
27 will produce addresses starting with: B,C
28 will produce addresses starting with: C
29 will produce addresses starting with: C,D
30 will produce addresses starting with: D
31 will produce addresses starting with: D
32 will produce addresses starting with: D,E
33 will produce addresses starting with: E
34 will produce addresses starting with: E,F
35 will produce addresses starting with: F
36 will produce addresses starting with: F
37 will produce addresses starting with: F,G
38 will produce addresses starting with: G
39 will produce addresses starting with: G,H
40 will produce addresses starting with: H
41 will produce addresses starting with: H
42 will produce addresses starting with: H,J
43 will produce addresses starting with: J
44 will produce addresses starting with: J,K
45 will produce addresses starting with: K
46 will produce addresses starting with: K
47 will produce addresses starting with: K,L
48 will produce addresses starting with: L
49 will produce addresses starting with: L,M
50 will produce addresses starting with: M
51 will produce addresses starting with: M
52 will produce addresses starting with: M,N
53 will produce addresses starting with: N
54 will produce addresses starting with: N,P
55 will produce addresses starting with: P
56 will produce addresses starting with: P
57 will produce addresses starting with: P,Q
58 will produce addresses starting with: Q
59 will produce addresses starting with: Q,R
60 will produce addresses starting with: R
61 will produce addresses starting with: R
62 will produce addresses starting with: R,S
63 will produce addresses starting with: S
64 will produce addresses starting with: S,T
65 will produce addresses starting with: T
66 will produce addresses starting with: T
67 will produce addresses starting with: T,U
68 will produce addresses starting with: U
69 will produce addresses starting with: U,V
70 will produce addresses starting with: V
71 will produce addresses starting with: V
72 will produce addresses starting with: V,W
73 will produce addresses starting with: W
74 will produce addresses starting with: W,X
75 will produce addresses starting with: X
76 will produce addresses starting with: X
77 will produce addresses starting with: X,Y
78 will produce addresses starting with: Y
79 will produce addresses starting with: Y,Z
80 will produce addresses starting with: Z
81 will produce addresses starting with: Z
82 will produce addresses starting with: Z,a
83 will produce addresses starting with: a
84 will produce addresses starting with: a,b
85 will produce addresses starting with: b
86 will produce addresses starting with: b,c
87 will produce addresses starting with: c
88 will produce addresses starting with: c
89 will produce addresses starting with: c,d
90 will produce addresses starting with: d
91 will produce addresses starting with: d,e
92 will produce addresses starting with: e
93 will produce addresses starting with: e
94 will produce addresses starting with: e,f
95 will produce addresses starting with: f
96 will produce addresses starting with: f,g
97 will produce addresses starting with: g
98 will produce addresses starting with: g
99 will produce addresses starting with: g,h
100 will produce addresses starting with: h
101 will produce addresses starting with: h,i
102 will produce addresses starting with: i
103 will produce addresses starting with: i
104 will produce addresses starting with: i,j
105 will produce addresses starting with: j
106 will produce addresses starting with: j,k
107 will produce addresses starting with: k
108 will produce addresses starting with: k
109 will produce addresses starting with: k,m
110 will produce addresses starting with: m
111 will produce addresses starting with: m,n
112 will produce addresses starting with: n
113 will produce addresses starting with: n
114 will produce addresses starting with: n,o
115 will produce addresses starting with: o
116 will produce addresses starting with: o,p
117 will produce addresses starting with: p
118 will produce addresses starting with: p
119 will produce addresses starting with: p,q
120 will produce addresses starting with: q
121 will produce addresses starting with: q,r
122 will produce addresses starting with: r
123 will produce addresses starting with: r
124 will produce addresses starting with: r,s
125 will produce addresses starting with: s
126 will produce addresses starting with: s,t
127 will produce addresses starting with: t
128 will produce addresses starting with: t
129 will produce addresses starting with: t,u
130 will produce addresses starting with: u
131 will produce addresses starting with: u,v
132 will produce addresses starting with: v
133 will produce addresses starting with: v
134 will produce addresses starting with: v,w
135 will produce addresses starting with: w
136 will produce addresses starting with: w,x
137 will produce addresses starting with: x
138 will produce addresses starting with: x
139 will produce addresses starting with: x,y
140 will produce addresses starting with: y
141 will produce addresses starting with: y,z
142 will produce addresses starting with: z
143 will produce addresses starting with: z
144 will produce addresses starting with: z,2
145 will produce addresses starting with: 2
146 will produce addresses starting with: 2
147 will produce addresses starting with: 2
148 will produce addresses starting with: 2
149 will produce addresses starting with: 2
150 will produce addresses starting with: 2
151 will produce addresses starting with: 2
152 will produce addresses starting with: 2
153 will produce addresses starting with: 2
154 will produce addresses starting with: 2
155 will produce addresses starting with: 2
156 will produce addresses starting with: 2
157 will produce addresses starting with: 2
158 will produce addresses starting with: 2
159 will produce addresses starting with: 2
160 will produce addresses starting with: 2
161 will produce addresses starting with: 2
162 will produce addresses starting with: 2
163 will produce addresses starting with: 2
164 will produce addresses starting with: 2
165 will produce addresses starting with: 2
166 will produce addresses starting with: 2
167 will produce addresses starting with: 2
168 will produce addresses starting with: 2
169 will produce addresses starting with: 2
170 will produce addresses starting with: 2
171 will produce addresses starting with: 2
172 will produce addresses starting with: 2
173 will produce addresses starting with: 2
174 will produce addresses starting with: 2
175 will produce addresses starting with: 2
176 will produce addresses starting with: 2
177 will produce addresses starting with: 2
178 will produce addresses starting with: 2
179 will produce addresses starting with: 2
180 will produce addresses starting with: 2
181 will produce addresses starting with: 2
182 will produce addresses starting with: 2
183 will produce addresses starting with: 2
184 will produce addresses starting with: 2
185 will produce addresses starting with: 2
186 will produce addresses starting with: 2
187 will produce addresses starting with: 2
188 will produce addresses starting with: 2
189 will produce addresses starting with: 2
190 will produce addresses starting with: 2
191 will produce addresses starting with: 2
192 will produce addresses starting with: 2
193 will produce addresses starting with: 2
194 will produce addresses starting with: 2
195 will produce addresses starting with: 2
196 will produce addresses starting with: 2
197 will produce addresses starting with: 2
198 will produce addresses starting with: 2
199 will produce addresses starting with: 2
200 will produce addresses starting with: 2
201 will produce addresses starting with: 2
202 will produce addresses starting with: 2
203 will produce addresses starting with: 2
204 will produce addresses starting with: 2
205 will produce addresses starting with: 2
206 will produce addresses starting with: 2
207 will produce addresses starting with: 2
208 will produce addresses starting with: 2
209 will produce addresses starting with: 2
210 will produce addresses starting with: 2
211 will produce addresses starting with: 2
212 will produce addresses starting with: 2
213 will produce addresses starting with: 2
214 will produce addresses starting with: 2
215 will produce addresses starting with: 2
216 will produce addresses starting with: 2
217 will produce addresses starting with: 2
218 will produce addresses starting with: 2
219 will produce addresses starting with: 2
220 will produce addresses starting with: 2
221 will produce addresses starting with: 2
222 will produce addresses starting with: 2
223 will produce addresses starting with: 2
224 will produce addresses starting with: 2
225 will produce addresses starting with: 2
226 will produce addresses starting with: 2
227 will produce addresses starting with: 2
228 will produce addresses starting with: 2
229 will produce addresses starting with: 2
230 will produce addresses starting with: 2
231 will produce addresses starting with: 2
232 will produce addresses starting with: 2
233 will produce addresses starting with: 2
234 will produce addresses starting with: 2
235 will produce addresses starting with: 2
236 will produce addresses starting with: 2
237 will produce addresses starting with: 2
238 will produce addresses starting with: 2
239 will produce addresses starting with: 2
240 will produce addresses starting with: 2
241 will produce addresses starting with: 2
242 will produce addresses starting with: 2
243 will produce addresses starting with: 2
244 will produce addresses starting with: 2
245 will produce addresses starting with: 2
246 will produce addresses starting with: 2
247 will produce addresses starting with: 2
248 will produce addresses starting with: 2
249 will produce addresses starting with: 2
250 will produce addresses starting with: 2
251 will produce addresses starting with: 2
252 will produce addresses starting with: 2
253 will produce addresses starting with: 2
254 will produce addresses starting with: 2
255 will produce addresses starting with: 2

You can use 75 or 76. 74 and 77 will work too, but only sometimes.

Tangentially, why for eg would 111 (0x6f) return 2 possible base58 representations? Ie m or n

@WizardOfOzzie Because you're essentially converting a base 256 number to a base 58 number. As for why 2 maps to both Q and o, I got nothing.

Ah OK. I'm actually really bad with base256 conversions from an abstract standpoint. Hex I've got no problem working with. Re Q/o perhaps bc Q=23, o=46 (position in base58), since 46/2=23. That's an off the cuff guess though tbh

@WizardOfOzzie I'm actually really bad with base256 conversions [..] That's what computers are for. :)


text:
How many OP_RETURN transactions in the Blockchain would be too many?
I realize this question may not have an answer and therefore might not be suitable for SE, but I'm very curious about OP_RETURN transactions.
OP_RETURN transactions appear to be the accepted mechanism for inserting metadata into the Blockchain. Considering the innumerable uses for metadata (contracts, colored coins, proof of ownership...), I foresee more and more non-monetary transactions filling up the Blockchain.
Will that be bad?

It is reasonable solution. The main problem is not in the size of blockcain itself. The problem is in growing the number of unspent outputs. OP_RETURN outputs do not increase size of Utxo database

Why is "growing the number of unspent outputs" a "problem"?

@tim peterson: Client software needs to keep track of unspent outputs to be able to verify future transactions, so unspent transactions require storage space.  It does not need to keep track of transactions that have already been spent; once it has used them to verify the following transactions, they could be discarded (though some clients like Bitcoin Core keep them around anyway).

I don't think so, because the use case of, "I need to pay (the equivalent of) five dollars to buy this comedian's work is more common than the use case of "I need to store this 128-bit string for an indefinite period of time."
Prediction: By the end of 2016, transactions intended to hold metadata instead of actually sending coins will make up less than 10% of the blockchain's size.

What will the % be in 2030? Right now in 2014 the % has to be way less than 1%, so anything even close to 10% would indicate a huge increase.

This is a subjective question of course, but you could view it simply as a technology finding its most compelling applications.
Eventually we will reach a time when transactions have to constantly complete for confirmation via the size of the miner fees that they attach.
When that happens, if people are willing to pay higher fees to embed metadata than to send bitcoins, then this will be the dominant use of the blockchain. If not, then not.
At Coin Secrets, we're currently seeing the OP_RETURN volume doubling every 10,000 blocks or so, i.e. every 70 days. We'll see if that continues.


text:
Most important spec to look for on a GPU for scrypt mining (e.g. Litecoin)
By taking a look at all the current AMD cards comparison:
http://en.wikipedia.org/w/index.php?title=Comparison_of_AMD_graphics_processing_units
I was wondering if GFLOPS would be the best way to compare the raw power those cards would have for Litecoin mining.
In that case is single or double precision more important for the current mining software?
Also I'm aware that power consumption is another key factor.
Edit:
No answers so far...
A friend of mine who has been mining for a while thinks the number of shaders is the most important one. Still in the comparison chart above there are more specs that could be important I guess:

Pixel pipelines
Vertex shaders
Texture mapping units
Render output units

Still I think that they should all be reflected into the Processing Power GFLOPs, either single or double precision.

I think the important factors for scrypt in OpenCL are as follows

GPU core clock rate
Memory clock rate / memory bandwidth
Memory bus width / channel
Computation Units
Processing Elements

You can check out in Programming Guide of AMD Accelerated Parallel Processing.
single or double precision of floating number does not matter. Either SHA-256 or scrypt is doing integer arithmetic operations.

That's correct, number of integer (as opposed to floating point) arithmetic operations per second is what matters most in mining. And ATI's chips tend to be better in that metric than NVidia's. Since they're cheaper as well, that's the reason you're generally not adviced to buy NVidia for mining: you'd get more hashes (i.e. money) with ATI for each kilowatt of power consumed.


text:
How to stabilize Bitcoin's exchange rate (reduce volatility)?
Is it possible to stabilize exchange rate(s) of Bitcoin to FIAT currencies (USD, EUR etc.) and make the rates less volatile only by raising the market capitalization (more people buy/invest in Bitcoin so it will be less vulnerable to big buys/sells) or are there other options?

There is another crypto currency called Freicoin, that tries to diminish in value in order to encourage spending: "Fees are taken for holding coins and distributed to miners. " https://en.bitcoin.it/wiki/Freicoin

The Bitcoin price is the result of a free market. There is no central authority that could by order "pump money into the system".
This currently happens anyway - but decentralized. When more people buy Bitcoins the market cap increases. With a higher market cap a single trade has a lesser effect on the price. Therefore, over time when Bitcoin attracts more users and investors, volatility will go down. There is no need for a centralized intervention.
Bitcoin can also be compared to small cap stocks or currencies of small countries. These types of assets are known for their high volatility. Large cap stocks on the contrary show a significantly smaller volatility due to the above stated reasons.
For a more in depth treatment of these arguments, read this article on Bitcoin volatility.

I did not say I want a "central authority" to pump money into Bitcoin... I just said if money is pumped into it (= more people buy Bitcoin) it could be less volatile. Edited question accordingly.

What if there was a built-in mechanism that would limit the number of transactions? like they do in the stock market when prices have high volatility.

Even commodities or stock with large trade volumes are still prone to price shocks. The Dow Jones Index for example, isn't a smooth line.
Often governments on the behalf of taxpayers in the wider economic environment will pump money into a crashing market to stabilise prices ("buyer of last resort"). Whether you believe this to be a good thing depends on your economic ideology1 and who exactly is benefiting and at what moral hazard.
The exchange rate is going to stay volatile until after all the Bitcoins hoarded by early adopters are flushed out into the wider economy.
1. Ha Ha. You think the mainstream schools of economics are scientifically rigorous? No pundit wants that, so 21st century economics is banished to academia. Our creaky hobby-horses limp along like superstitions.

"The exchange rate is going to stay volatile until after all the Bitcoins hoarded by early adopters are flushed out into the wider economy." Is this ever going to happen?

The way to reduce volatility is by giving a greater incentive to profit (and lose) from volatility. Options do this by rewarding trades that best follow discovery of the true market prices of the underlying product. Time to expiry allows leverage choices. The options are also market participants, so the effect is to stabilize prices while rewarding the best trades. The large bitcoin exchanges don't offer options trading.

Bitcoin has a deterministic supply and an uncertain demand, so its value will always be volatile, regardless of its market capitalization. You can read a more detailed explanation in this article.

I believe that more money will be there in bitcoin, more stabilized it will be to big buys/sells.

Downvoted, because this is not an 'expert answer', it is only an opinion without supporting arguments and as such not useful.


text:
Is Bitcoin database cross platform compatible?
I want to use my Windows 7 Bitcoin database (the block chain I downloaded + my wallets) on Linux (Debian). I run Debian as VirtualBox guest on Windows 7 host and share the Bitcoin data folder (C:/Users/Username/AppData/Roaming/Bitcoin/) as a folder to Debian.
However bitcoind on Debian with proper -datadir parameter says "Error opening block database. Do you want to rebuild the block database now?" message. This brings me to the question whether the databases are compatible between Windows and Linux at all.
Edit 1:
I am using one Bitcoin instance at a time. I realized I get the same error even when using en empty data directory that is mounted via VirtualBox on the host.
Here is the debug.log (same for empty or full data directory):
2013-12-22 20:49:07 Bitcoin version v0.8.6-dirty-beta (2013-12-05 13:11:26 +0100)
2013-12-22 20:49:07 Using OpenSSL version OpenSSL 1.0.1e 11 Feb 2013
2013-12-22 20:49:07 Default data directory /home/kozuch/.bitcoin
2013-12-22 20:49:07 Using data directory /home/kozuch/vboxshare2
2013-12-22 20:49:07 Using at most 125 connections (1024 file descriptors available)
2013-12-22 20:49:07 init message: Verifying wallet...
2013-12-22 20:49:07 dbenv.open LogDir=/home/kozuch/vboxshare2/database ErrorFile=/home/kozuch/vboxshare2/db.log
2013-12-22 20:49:07 Bound to [::]:8333
2013-12-22 20:49:07 Bound to 0.0.0.0:8333
2013-12-22 20:49:07 init message: Loading block index...
2013-12-22 20:49:07 Opening LevelDB in /home/kozuch/vboxshare2/blocks/index
2013-12-22 20:49:07 : Error opening block database.
Do you want to rebuild the block database now?
2013-12-22 20:49:07 Shutdown : In progress...
2013-12-22 20:49:07 Flush(false)
2013-12-22 20:49:07 DBFlush(false) ended               0ms
2013-12-22 20:49:07 StopNode()
2013-12-22 20:49:07 Flushed 0 addresses to peers.dat  4ms
2013-12-22 20:49:07 Flush(true)
2013-12-22 20:49:07 DBFlush(true) ended               1ms
2013-12-22 20:49:07 Shutdown : done

Seems like the problem might be with following:
ErrorFile=/home/kozuch/vboxshare2/db.log

Edit 2:
There also is a .lock file with 0 size in the datadir after I get the error.
Edit 3:
So "ErrorFile=/home/kozuch/vboxshare2/db.log" was not a problem. I get this error for a working instance locally (without shared data folder).

can you check if all the files in bitcoin folder are owned by the same user you are using? if not try to chown -R ~/.bitcoin as root

It should be compatible if your running one instance at a time, BUT I think that the datadir is being locked.
Try to find more details in the logs, it should tell you the reason of the error which could be anything.
if you are running any bitcoin software on windows stop it and try to restart bitcoind from your linux box.
EDIT: Did you install bitcoind and run it as root? if not, can you try to chown -R  ~/.bitcoin as root, not the db folder itself, it still can be a permission issue,

Just something to check quick. What are the file permissions on the folder and files you are trying to access. You may want to set them to 777 temporarily and try opening it just to rule out that it's not a permission issue.
Edit: A .lock file of size 0 does not tell us anything. My client is running perfectly and also has one just fyi.

The permissions should be fine. The user under which I run bitcoind can write/delete from that shared directory. Running "chmod -R 777 vboxshare2" does not help.

have you tried starting bitcoin with starting bitcoin with the datadir=\new directory\ flag. Also do you need to run bitcoin-qt instead of one of the lighter wallets?

Yes I use the -datadir=/home/kozuch/vboxshare2 parameter if that is what you are asking. And yes I want to run the full client.

Very odd issue. Last thing I can think of is running bitcoin with -checklevel=2.


text:
How do Bitcoin exchanges fill orders?
If the order book looks like the following…
A)  Ask: 2 bitcoin at $100

B)  Bid: 2 bitcoin at $100

A trade will be done from A to B.
But what happens in the following situation:
C)  Ask: 1 bitcoin $100

D)  Bid: 2 bitcoin $100

Do bitcoin exchanges partially fill orders?
Does one of the following occur:

Nothing the orders need to be the same quantity.
Does the trade occur for one bitcoin.
If the trade does occur, what happens if the bid is cancelled? Is the trade for 1 bitcoin still valid.

Also, what happens in this situation:
E)  Ask:2 bitcoin $90

F)  Bid: 2 bitcoin $100

Does the Bid pay $100 or $90?
Thank You for your help

Q1: Yes, orders will be partially filled. Some exchanges offer advanced orders that can only be completed wholly, but that's not the default.
Q2: The deciding price is the one that entered the book first. So if first a $90 ask is placed and then a $100 bid is placed, the trade will be executed at $90.


text:
Where did https://launchpad.net/~bitcoin/+archive/bitcoin just install to?
I just ran the following three commands:
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo su bitcoinuser
sudo apt-get install bitcoind

and I believe bitcoind has been installed on my Ubuntu 12.10 64Bit ec2 box, but the problem is I can't find it anywhere.
Where does bitcoin download to when installed via the ppa?

More an ubuntu question than a bitcoin one...

why do you do "su bitcoinuser"? I'm curious

Just as all applications you install using Aptitude (apt-get), it is installed somewhere in a /usr subdirectory. However, where exactly doesn't matter because you can run those programs just by typing them in the command line.
Thus, you can launch them by typing in your Terminal either bitcoind for the server daemon or bitcoin-qt for the GUI Wallet. Also, most desktop manager automatically place a shortcut for all apps in their app menu; for Ubuntu Unity, you can just type "bitcoin" in your Dash to find Bitcoin-Qt GUI wallet app.
Just as most apps, it makes a folder in your home directory to save the data it uses. Both bitcoind and bitcoin-qt save all the block chain data in a ~/.bitcoin/ folder. You wallet is thus saved in ~/.bitcoin/wallet.dat.


text:
How does one attain 1,000+ connections like blockchain.info?
At this moment, blockchain.info has over 1,900 nodes connected to their bitcoin client.
I have been running an m1.small ubuntu 12.04 server and bitcoind for ~4 days straight now with no reboots. My bitcoind client still only shows ~60 connections maximum when performing a "./bitcoind getinfo" command.
How can I achieve 1,000+ connections to my bitcoind client? And is it "worth it" in your opinion?
EDIT: I have re-started my bitcoind client with the -maxconnections=1000 and -timeout=15000 parameters but after ~12 hours of running bitcoind, the number of connections is only up to ~40. And I don't seem to be maxing out my CPU, RAM, or bandwidth just yet.
EDIT 2: I have not seen a "connected time" over 8 hours in the list provided by blockchain.info so that tells me they must restart their server every 8 hours or so. Either that, or connections drop and refresh after 8 hours? I am beginning to think that blockchain.info keeps track of IP addresses running bitcoin in a database of sorts... and forefully connects to them every time their bitcoind reboots. Am I right?

Any idea on what might be holding me back from achieving 1,024 connections on my bitcoind? I don't seem to be maxing out my CPU, RAM, or bandwidth just yet.

Bitcoin Unlimited has an option -maxoutconnections that allows you to increase outgoing connections to peers. It defaults to 8 but you can set it to something higher without having to recompile the node from modified source.

When I set -maxconnections to something high I get the following error:

Warning: Reducing -maxconnections from 4096 to 865, because of system limitations.

so it seems like one can not even go super high with incoming connections as well?

@AMB I believe BU offers two versions of the client, one works with the legacy chain and the other works with Bitcoin Cash.

The links to the node list are broken could someone fix them? In addition, looks like blockchain.info is now blockchain.com?

The bitcoind client has a maxconnections configuration option.  The client launched With -maxconnections=N will allow up to N incoming connections to be established simultaneously.
Perhaps you may need to increase the connection timeout for that many connection attempts from a single (possibly underpowered) node.  Perhaps set it to like 15 seconds (15000 ms).

-timeout=           Specify connection timeout in milliseconds (default: 5000)

[Edit: Pieter Wuille's answer gets you further there.  -addnode will let you force new outgoing conections to nodes when you have their IP addresses.]

I will re-start my bitcoind client now with the timeout increased to 15 seconds as suggested as well as the -maxconnections=1000 and get back to you.

So after 7 hours of running bitcoind with a 15 second timeout and 1,000 max connections.. I was at 32 connections at one point but have now dropped to 28, so I doubt adding the maxconnections or the timeout variable did much at all unfortunately. In fact I think it may have hindered the number of connections I would normally have after 7 hours.

does maxonnections in the .conf override what's in code as the max?

Bitcoin by default will not make more than 8 outgoing connections, and -maxconnections only controls how many incoming connections you allow. Feel free to set this higher, but it will take time before others connect to you in large numbers.
Please don't change this, as there is no need. Connectable peers on the network are a scarce resource, and essential to the decentralization. If people go try connect to all of them like some sites do, we'll very quickly run out.
In case you're a merchant or miner, you perhaps want to set up a few fixed connections to trusted others (see the -addnode command line/config option), but having more connections does not mean stronger verification (the reference client always verifies everything) or even faster relaying (as you'll slow down by distributing new blocks and transactions to all your peers). It is mostly a matter of providing a service to the network.

After 4 days of running my box with -maxconnections=1000, I was still only at ~50 connections. I have not seen a "connected time" over 8 hours in the list provided by blockchain.info so that tells me they must restart their server every 8 hours or so. Either that, or connections drop and refresh after 8 hours?

I'm sure they have a custom infrastructure that creates thousands of outgoing connections. Bitcoind never creates more than 8. As I said, there is no need for more.

It could be also counted from aggregate nodes across the country and not just from one client.

As nobody seems to have mentioned it I'll chip in for future reference. If your bitcoind node is behind a router/NAT then you can only connect to others, they cannot connect to you. Let's assume most people are in that situation, which makes most nodes unconnectable (directly at least). If you open up your node port on your router then every bitcoind node out there will be able to connect to you if they wish rather than your node only being able to connect to others who have opened their port. The same applies to Bittorrent and other p2p systems.

Why do you need 1,000+ connections?
By default bitcoind cannot have more than 125 connections. You need to start bitcoind with the parameter -maxconnections=<n> or set maxconnections=<n> in  bitcoin.conf to be able to connect to more peers.

Why?! Why not should be the real question! If you must know, I want to have the most verified blockchain in the world.

"The most verified"?  That makes no sense.  Every node at the same block height and block hash is equal.  And yours may have a blockchain fork that eventually becomes orphaned.

Sorry for the typo, I'm not up to speed on the entire bitcoin lexicon just yet. If not the most verified, then I want to be the fastest at recognizing new transactions. That is what I meant.

To check whether you allow incoming, use this: https://bitnodes.21.co
There is a button to check your ip and if it results in green, you are fine to have incoming connection. Once you have that, I was told you can have more outgoing connection.  Good luck.

That's not an answer to the question.


text:
How to close debug window (qt client on linux)
I have the same problem with the Litecoin and Dogecoin client. Once I open the window in the menu Help > Debug window there is no way of closing it (no X in the corner of the window).
I'm using Debian and Gnome 3.
The following image contains the Dogecoin client (downloaded from Github and compiled), Litecoin client looks just the same.

I checked in Bitcoin-Qt on Ubuntu and it had an exit button in the corner. It might be a bug.

Can confirm as well on Ubuntu. Could you post a screenshot of the client with debug window open?

@Tony I added a screenshot.

If you right-click on the top bar, does that help?

@Tony YES, thanks a lot. Right-clicking on the title (or pressing ALT+SPACE) bar brings up the window's menu where Close is one of the options. Also the menu actually shows the well-known hotkey (ALT+F4) to close the window. These things should have been familiar from the windows world... - Please also post your suggestion as an answer. :)

Just right-click on the top bar, and it will bring up a menu that allows you to close it.


text:
Shabal256 code explanation
Can anyone please explain the code below with comments?
What are pbegin & pend ?
What is ( I believe it is data, where it comes from ?): (pbegin == pend ? pblank : static_cast<const void*>(&pbegin[0]))
What is (I believe it is the size of data 80?) : (pend - pbegin) * sizeof(pbegin[0])
What is : pblank[1]
template<typename T1>
inline uint256 HashShabal(const T1 pbegin, const T1 pend)
{
    sph_shabal256_context ctx_shabal;
    static unsigned char pblank[1];
    uint256 hash[1];
    sph_shabal256_init(&ctx_shabal);
    // ZSHABAL;
    sph_shabal256 (&ctx_shabal, (pbegin == pend ? pblank : static_cast<const void*>(&pbegin[0])), (pend - pbegin) * sizeof(pbegin[0]));
    sph_shabal256_close(&ctx_shabal, static_cast<void*>(&hash[0]));

    return hash[0];
}

Out of curiosity, where'd you find this?

@NickODell this can be found in most alt-coins that uses sphlib

What are pbegin & pend ?

Pointers to the beginning of the data and one byte past the end of the data, respectively. The function it's wrapping takes a pointer to the beginning plus the the size, so it needs to do some math with the pointers.

What is (I believe it is data, where it comes from ?)

Presumably, if you found this code in a Bitcoin derivative, the data is a block header. This function might also be used to build a merkle tree. (Shabal256 appears to be fast enough for that.)

What is : pblank[1]

A zero-length string. Presumably, sometimes this function gets called as HashShabal(NULL, NULL), so this is for avoiding a null pointer exception.

Can anyone please explain the code below with comments?

The purpose of this function appears to be to wrap the Shabal256 functions from Projet RNRT SAPHIR to make them easier to use.


text:
Can Bitcoin Core be used to create a raw transaction for CLAM altcoin?
Clam is an altcoin that issued that altcoin to the owner of the private key of each and every Bitcoin address that had funds (0.0001 or more) on May 12, 2014.
I don't want to install the Clam client.  If I know the CLAM address that corresponds to my Bitcoin address, and know the Clam txid for the Clam UTXO I can then manually construct the raw transaction. The transaction needs to be signed with the private key but that key in the CLAM client would be the same as the one in my Bitcoin Core wallet for that corresponding Bitcoin address.
So if Bitcoin Core has the private key, can I use it to create the Clam raw transaction?  I know I'ld then need to broadcast the signed raw transaction onto the Clam network but I can do that from another host.
Is this possible?   Or do I need to sign using the Clam client?

Why did this question get a -1?

No.
CLAM network has another transaction format with additional timestamp field. So, you can not create and sign your transaction with Bitcoin Core client.
Of course, it is possible to create and sign transaction for CLAM network without using untrusted CLAM client software. But you have to have tools to do it besides Bitcoin Core client.
Signing transaction with untrusted software can leak your private key.

yes, I know this is way too late, but for anybody stumbling across this with a Google search: you don't need the Clam client. you just need the private keys for the addresses that contained non-dust amounts at the time of the fork. use a wallet like Coinomi to sweep the private keys, and you're done.


text:
How do i get info from Bitcoin QT 0.7 to Bitcoin QT 0.11?
I'm having trouble with Bitcoin QT 0.11 not automatically extracting address info from my Bitcoin QT 0.7. When I try to open my Bitcoin QT wallet it comes up with an error code saying it is to unsafe to continue. How can I get hold of my info from my Bitcoin QT wallet.

What's the exact error message?

Runaway exception

A fatal error occurred. Bitcoin can no longer continue safely and will quit.  EXCEPTION:ST13runtime_error    CDB() : can't open database file blkindex.dat, error22   C:\Program files (86)\Bitcoin\bitcoin -qt.exe in runaway exception  -@Nick ODell

@kym That looks like an error from 0.7, as blkindex is no longer used since 0.8. What happens if you just start the new version?

A blkindex.dat error means that the block index has been corrupted or can't be opened. However, the block index is not part of the wallet, and can be deleted without removing the funds in your wallet.
With that in mind, try this:

Open %APPDATA% in file explorer. Do this by pressing Windows + R, then typing %APPDATA%.
Open Roaming\Bitcoin.
Make a new folder in there called 'old block files,' or something similar.
Move every file in that folder except wallet.dat into the old block files folder.
Optionally, delete the 'old block files' folder.
Start Bitcoin 0.11, and your computer will redownload the block chain. This will take a few hours.

There are two ways of upgrading from such an old version: either perform the intermediate upgrade steps (0.7 -> 0.8 -> 0.9 -> 0.10 -> 0.11) or export you wallet, clear the bitcoin directory and import the wallet again.
The first option should be pretty straight forward. The second option requires you to use the GUI to export the wallet or the individual private keys, upgrading Bitcoin QT and then importing them.
The JSON-RPC calls dumpprivkey and importprivkey can be performed for each address and will get your addresses into the new version. Be careful to keep a backup copy of the wallet.dat file before clearing the bitcoin directory.

can't even get into my bitcoin-qt 7 wallet to import!

No need for incremental updates. Bitcoin Core's wallet files are backward compatible down to very early versions (0.3.x at least if not older), ignoring potential BDB version compatibilities (which can be bypassed using external bdb conversion tools).


text:
-walletnotify on 6 confirmations instead of 1?
Pretty straight forward. Right now im using -walletnotify to run some node.js code when i get an incoming transaction and when theres 1 confirmation. However, after reading around, i found out that 1 confirmation is not secure, which now makes me want to execute this confirmation code when theres at least 6 confirmations.
TL;DR, Is there a parameter or an equivalent for -walletnotify to run on N confirmations?

Maybe you can use -txconfirmtarget ?

Not out of the box with core.

I had opened issue - https://github.com/bitcoin/bitcoin/issues/10021 on bitcoin github

This is not possible with the current version of Bitcoin-Core (0.13.1).
Consider opening a issue (feature request) https://github.com/bitcoin/bitcoin or start implementing it yourself.


text:
How can I recover a blockchain.info wallet without the wallet identifier or the mnemonic?
My son made both of us each our own bitcoin wallet, and showed me how to use the faucets. With me being disabled and sometimes not being able to get out of bed because of pain; He thought it would give me something to do while he was at school all day.
So, I played with 3 or 4 of the faucets last week and at least 2 of them said they paid out Sat/Sun as long as you have at least 5500 Satoshi in their account, which I did.
So, I  wanted to see how much was in my wallet (and if the faucets actually paid out like they say they do) after the weekend. I went to Blockchain.info (where my son said he went to make/get the wallets) and tried to login. It has a place that asks for "Identifier" and in the box it says Identifier or Alias. Now I have he long Alphanumerical "number" which I am not sure whether that is an address or Identifier or what, but I tried putting that in the box and it says "Unknown Wallet identifier. Please check you entered it correctly" I know I entered it correctly bc I copied and pasted it the last time to make sure.
I know that on the other wallet (the one I an NOT using) my son remembered to write some sort of mnemonic device that is supposed to be for recovering the wallet if you lose the long string of letters and numbers? (I think) but not for this one. I do know the email address and password used to create the wallet, but it doesn't ask for either of those.
Also, I read through a few not so similar Questions and answers where they spoke of downloading the wallet, which I know for sure we DID NOT do. Is this something you have to do?
I can type the long alphanumerical number into the main page and see there has been 2 deposits totaling 0.00033813 BTC, so I know it's there. But, I don't know what I am doing wrong.
Please, someone tell me how to access my wallet and what I am doing wrong.
THANK YOU.

Quick primer:

The identifier is a dash separated lowercase bit of text, like a32d0de4-818b-4aa3-...
It's specific to blockchain.info - other wallets use different systems. It was probably emailed to you.
The mnemonic is a 17 word bit of text, like skill course bleed oversize attempting lazer endure...
A bitcoin address looks like 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W. A bitcoin address is not specific to blockchain.info. It's how you tell the faucet where to send the money. This is not what you use to log in.
All of this is different from your email address or password.

Troubleshooting steps:
You need to get either the mnemonic or the identifier. The identifier was probably emailed to you by blockchain.info, so check there. If you get the mnemonic, you can recover the identifier on the login screen with the 'Recover Wallet' button. I think it's also possible to get the identifier by contacting blockchain.info support, but you need additional information.
Once you have the identifier and the password, you can log in.

Also, I read through a few not so similar Questions and answers where they spoke of downloading the wallet, which I know for sure we DID NOT do. Is this something you have to do?

It's something you need to do for some wallets. Not blockchain.info, though.

Three quick thoughts:

The identifier (the dash-separated string of lowercase text mentioned above) is typically sent to you in an email with the subject line: Welcome to My Wallet.
If you don't have the "Welcome to My Wallet" email, Blockchain.info will mail your identifier to the email address associated with your account if you follow these steps:

Point your web browser to: https://blockchain.info/wallet/#/login
Click on “View Options” in the lower right-hand corner of the login form
Click the option that says “I’ve lost my Wallet ID: Email me a reminder with my Wallet ID to my email address”
Select “Remind Me”
Enter the email address you used to create the wallet, fill out the “captcha” and submit the form

If you correctly identified the email address that you used to create your wallet, then Blockchain.info should email you the Wallet ID within a few minutes.

Finally, if you can get your Wallet ID, but you don't remember your password, you can find a systematic process to try to find your password in this article.


text:
How will Mt.Gox select matching orders if asking for a price that is higher than available prices
E.g. if we have this order stock:

SELL 0.5 BTC @ PRICE $72 $/BTC (1)
SELL 3 BTC @ PRICE $75 $/BTC (2)
SELL 0.5 BTC @ PRICE $76 $/BTC (3)

And trying to buy 3.5 bitcoins for a price at $76.5 (higher than available prices). How will Mt.Gox select matching orders? Will it select the cheapest possible lines (1)&(2)? Is this equal to a market order?

Of course it would select the cheaper ones. It's a limit order.

Ok. Trying to by 3.2 BTC for $76.5, it would process 3 BTC and leave 0.2 BTC, since there are no corresponding order?

It would buy 0.5 at 72, and 2.7 at 75

The sales order of 3 BTC will probably leave a new sales order of 0.3 BTC at same price? (has partly processed the total sales order)

Exactly, that's how it works.


text:
Any need for coinbase field in coinbase transaction?
My understanding is that every block in the bitcoin blockchain has a coinbase transaction which contains a coinbase field. It is essentially an orphan field (placeholder) for use in claiming existing outputs. Since the coinbase transaction does not need to claim any existing outputs, it can be filled with any random data the miner chooses.
Would there be any adverse effects on Bitcoin (security or otherwise) if restrictions were placed on what the coinbase field can contain?
[Note: such a restriction may be desirable in order to prevent Bitcoin from being used as a parent coin in merged mining.]

The coinbase field is crucial for pooled mining. All workers in a pool will be working to produce a block with the same list of transactions and the same block reward recipient address (that belongs to the pool owner/admin). The "nonce" field in the block header is only 32 bits long. The only way each worker can independently avoid wasting cycles on duplicate work is for the each worker to be assigned a different piece of coinbase data.

The input for the coinbase transaction must now contain the block height as the first script data element.  The remainder of the input script can be used however you want, although I believe the total script is limited to 100 bytes.

The coinbase field can be used to distinguish coinbase transactions from one another on the level of hashes.  If two coinbase transactions pay to the same address and use the same data in their coinbase fields, these transactions will have the same hash.  This would introduce ambiguity into the blockchain, since the same transaction hash and offset would refer to two distinct transaction outputs.


text:
Why are my Signature Scripts Different from my professors?
bob_addr = "1NWzVg38ggPoVGAG2VWt6ktdWMaV6S1pJk"#"1FMb8Jnn1jSh7yjDFfonC8xCCH3ittoEzB"
bob_hashed_pubkey = base58check.b58decode(bob_addr)[1:]
bob2_hashed_pubkey = b'\xec\x06\xb2\xbf\x18\xc8\x97\x06\x85_v\x1d!_!\xf31[9\x94'.hex()
bob3_hashed_pubkey =codecs.encode(bob_hashed_pubkey, 'hex')
print("bob_hashed_pubkey: ", bob2_hashed_pubkey )

bob_private_key = "CF933A6C602069F1CBC85990DF087714D7E86DF0D0E48398B7D8953E1F03534A"

prv_txid = "84d813beb51c3a12cb5d0bb18c6c15062453d476de24cb2f943ca6e20115d85c"

charlie_addr = "17X4s8JdSdLxFyraNUDBzgmnSNeZpjm42g"
charlie_hashed_pubkey = base58check.b58decode(charlie_addr)[1:]
charlie2_hashed_pubkey = b'G\x80u\x92*\xf4\x1f\xb4A\xaa\n\xb6~\x91\xae\xf2~\xf1\xe6\x86'.hex()

class raw_tx:
    version        = struct.pack("<L", 1)
    tx_in_count    = struct.pack("<B", 1)
    tx_in          = {}
    tx_out_count   = struct.pack("<B", 2)
    tx_out1         = {}
    tx_out2         = {}
    lock_time      = struct.pack("<L", 0)
    hashcode       = struct.pack("<L", 1)
    nonce          = struct.pack("Q", 0)

class raw_tx2:
    version        = struct.pack("<L", 1)
    lock_time      = struct.pack("<L", 0)
    hashcode       = struct.pack("<L", 1)

def flip_byte_order(string):
    flipped = "".join(reversed([string[i:i+2] for i in range(0, len(string), 2)]))
    return flipped

rtx    = raw_tx()

rtx.tx_in["txouthash"]   = codecs.decode(flip_byte_order(prv_txid), 'hex')
rtx.tx_in["tx_out_index"] = struct.pack("<L", 0)
rtx.tx_in["script"]      = codecs.decode(("76a914%s88ac" % bob2_hashed_pubkey), 'hex')
rtx.tx_in["script_bytes"]= struct.pack("<B", len(rtx.tx_in["script"]))
rtx.tx_in["sequence"]     = codecs.decode("ffffffff", 'hex')
rtx.tx_out1["value"]           = struct.pack("<Q", 100000)
rtx.tx_out1["pk_script"]       = codecs.decode(("76a914%s88ac" % charlie2_hashed_pubkey), 'hex')
rtx.tx_out1["pk_script_bytes"] = struct.pack("<B", len(rtx.tx_out1["pk_script"]))
rtx.tx_out2["value"]           = struct.pack("<Q", 50000)
rtx.tx_out2["pk_script"]       = codecs.decode(("76a914%s88ac" % bob2_hashed_pubkey), 'hex')
rtx.tx_out2["pk_script_bytes"] = struct.pack("<B", len(rtx.tx_out2["pk_script"]))

raw_tx_string = (

    rtx.version +
    rtx.tx_in_count +
    rtx.tx_in["txouthash"] +
    rtx.tx_in["tx_out_index"]+
    rtx.tx_in["script_bytes"]+
    rtx.tx_in["script"] +
    rtx.tx_in["sequence"]+
    rtx.tx_out_count +
    rtx.tx_out1["value"]+
    rtx.tx_out1["pk_script_bytes"]+
    rtx.tx_out1["pk_script"]+
    rtx.tx_out2["value"]+
    rtx.tx_out2["pk_script_bytes"]+
    rtx.tx_out2["pk_script"]+
    rtx.lock_time +
    struct.pack("<L", 1)

)

hashed_tx_to_sign = hashlib.sha256(hashlib.sha256(raw_tx_string).digest()).digest()
sk = ecdsa.SigningKey.from_string(codecs.decode(bob_private_key, 'hex'), curve = ecdsa.SECP256k1)
vk = sk.verifying_key
public_key = (b'\04'.hex() + vk.to_string().hex())
signature = sk.sign_digest(hashed_tx_to_sign, sigencode=ecdsa.util.sigencode_der)
sigscript = (
     signature
     + b'\01'
     + struct.pack("<B", len(codecs.decode(public_key, 'hex')))
     + codecs.decode(public_key, 'hex')

    )
print("public_key: ", public_key)
ha  = rtx.version.hex()
ha1 = rtx.tx_in_count.hex()
ha2 = flip_byte_order(prv_txid)
ha3 = struct.pack("<L", 0).hex()
ha4 = struct.pack("<B", len(sigscript) + 1).hex()
ha40 = struct.pack("<B", len(signature) + 1).hex()
ha5 = sigscript.hex()
ha6 = 'ffffffff'
ha7 = rtx.tx_out_count.hex()
ha8 = struct.pack("<Q", 100000).hex()
ha9 = struct.pack("<B", len(rtx.tx_out1["pk_script"])).hex()
ha10 = ('76a914%s88ac' % charlie2_hashed_pubkey)
ha11 = struct.pack("<Q", 50000).hex()
ha12 = struct.pack("<B", len(rtx.tx_out2["pk_script"])).hex()
ha13 = ('76a914%s88ac' % bob2_hashed_pubkey)
ha14 = rtx.lock_time.hex()

my output is :
01000000
01
5cd81501e2a63c942fcb24de76d4532406156c8cb10b5dcb123a1cb5be13d884
00000000
8b
48
304502207088158730ae6a7f0d6bc51e3e6ea30fb36599a5017760f222f20dee8a4d6701022100ff1636de2d06332e78532bcb8cfcb15db4bd956bd53bbe98ace82d1c2f6b9c2b014
10437078f8c4a54b67cd1724a3535cb1918bca186c7a143459c9aac35113d4a958b0d4eea6b320fa82c17147b72e0fe11c08b0054897ffb7bdb194f259b0db9e129
ffffffff
02
a086010000000000
1976a914478075922af41fb441aa0ab67e91aef27ef1e68688ac
50c3000000000000
1976a914ec06b2bf18c89706855f761d215f21f3315b399488ac
00000000

her output is:
01000000
01
5cd81501e2a63c942fcb24de76d4532406156c8cb10b5dcb123a1cb5be13d884
00000000
8b
48
304502205139475c3a1b5d6c009d1856fcc906a50e594eac92e317e989fec0fd2a1f73b8022100d36ba3cc952ef0e71df0b6f0215cdc7136e90ce6134cd21245645bbc7b63bc6a01410437078f8c4a54b67cd1724a3535cb1918bca186c7a143459c9aac35113d4a958b0d4eea6b320fa82c17147b72e0fe11c08b0054897ffb7bdb194f259b0db9e129
ffffffff
02
a086010000000000
19
76a914478075922af41fb441aa0ab67e91aef27ef1e68688ac
50c3000000000000
19
76a914ec06b2bf18c89706855f761d215f21f3315b399488ac
00000000

Can one let me know why my signature script is a not identical?

Related: https://bitcoin.stackexchange.com/q/12833/38618

ECDSA signing is not deterministic. A random number k "nonce" is used for signing, and a different nonce must be used for every signature made with the same private key. (Otherwise, the private key could be extracted by a 3rd person.) This could be a random number, as it's in your case. However, never systems generate nonce deterministically, usually using RFC 6979.
Returning back to your question, both signatures are valid. Just make sure you don't publish both transactions. If you do, the network will just ignore one of the transactions as a double-spend, and it won't have any important consequences.

Signing the same piece of data with the same key typically produces different signatures unless you are using a deterministic signature scheme. Check if that is the case with the library you are using for signing.
EDIT: Seems like python-ecdsa supports deterministic signatures

Than if I use or try to publish my own transaction than it must be put into blockchain? In minute what length before it enters blockchain....

@A.McWilliams it should be put into the next block (~10 minutes) if you specify a miner fee that is high enough. However your transaction is invalid because the sum of outputs is higher than the sum of inputs.

:: 'Wow Great Response' :: My professor said that one input are for coinbase transactions and in our instance there can be a old transaction that can administer a new transaction that is there to provide one original transaction and return that other transaction to itself without miner fees. Thanks for that input on coinbase transaction could my code get support from stackexchange to administer a coinbase transaction that advise can be a great pledge because our professor is teaching that next month

more support is a great way

Tired again and blockchain told me it was have an server problem but it said that for 4 days' 'why?

@A.McWilliams what do you mean blockchain told you they have server problems? Do you mean blockchain.info ? What exactly are you trying to do?

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
how do miners verify transaction without identifying sender and receiver?
I mean in satoshi paper we read sender and receiver have limited anonymity.

By keeping public keys anonymous. The public can see that someone is sending an amount to someone else, but without information linking the transaction to anyone.

By keeping public keys anonymous how miners can verify that sender has enough money ?

by keeping public keys anonymous.

The whitepaper is referring to how, by default, it is not know which human or organisation controls a public key. ---The public key itself can be recovered from the signature on a Bitcoin transaction--- The public key is included as part of the scriptSig on a transaction input, and then hashed and validated against the public key used to create the address.
Since a signature can only be produced by the corresponding private key, you can validate that it is the correct key for the given address.
Thus, although you can see the amounts being moved around, you don't know who is spending them, or where they are going (without doing off chain analysis).

By keeping public keys anonymous how miners can verify that sender has enough money

Now that we've established that the key itself is available, miners validate that the amounts are correct by referencing the chain of inputs. Each input in a transaction refers to a specific output created in the past. When validating, the node will look up all of the previous transactions referenced, add up all of their output values, and then check the current transaction's outputs. If the outputs created by the transaction are less than or equal to the input sum, it is valid.
In practice, outputs are less than the input currently, since 0 fee transactions are no longer allowed (they can still be mined, but you will find it quite difficult to broadcast them). The difference between the inputs and the outputs is claimed by the miner as the transaction fee.
The complete signature and address verification process involves:

Validating the signature over the transaction data
Hashing the public key from the scriptSig using HASH_160, and comparing it to the hash embedded in the address

This verifies that:

The transaction itself is signed
The public key matches the public key inside the address (by checking that the hashes are equal)

@saraafshar Key recovery is described on Crypto.SE: https://crypto.stackexchange.com/a/18106/2301

thank's for your answering, but i can't understand when miners don't have public key how can they verify the signature?  you mean miner can find  sender's public key from signature?

Correct, I edited my answer a little more to elaborate on how the recovered pub key verifies the address as well

if i understand it correctly  because finally miners find public key so they know who is sender and we don't have any anonymity ?

They know the key, but they do not know who owns that key. Unless you have somehow publicly linked an address to your real world identity (by posting it on a forum, social media, blog, whatever), it is not possible to guess or prove who an address belongs to.

@RaghavSood the public key is explicitly included in the scriptsig not recovered from the signature. it could be recovered from the signature but isn't in practice because it's a CPU intensive process.

@Abdussamad Oh dear, you are correct. I was thinking of ethereum txs. I will update the answer, thank you!

If you were asked to verify a cash transaction, all you have to do is check that the bills being exchanged is authentic.  You don't need to know who the two parties are or what their motives are.
In a similar way, miners just verifies that the sending party has the private keys of an address that has the bitcoin and that they have not already sent the bitcoin somewhere else.

actually i'm searching a way for complete anonymity i know about mixing services or using multiple wallets but they have low anonymity


text:
How are nonces decided in mining?
I know that when I create a new block in a Bitcoin network, I change the nonce value to generate a block.
The question is, do you randomly assign the values you assign to nonces? Or do you start with the number one?
Some people say that they are random,
Some people say they start with the number 1 using the hash cache algorithm.
Who is right?
If both of you are right,
In the case of solo mining, randomly assign a value to nonces,
In pooled mining, do you distribute the numbers among the participants and increase them one by one?

Most mining implementations, solo or pooled, will start from 0 and increment the nonce value. In 2018 (and in recent years) ASIC miners are so fast that all possible nonce values are tried in practically no time. To get around this nonce-space exhaustion, the extraNonce value in the coinbase tx is updated once the nonce space has run out.
A pool can be thought of as multiple solo miners working in parallel.
Since ASICs are so fast, it doesn't make sense to have every worked mining on the same block template with only different nonce ranges (worker one on nonce 0-99, worker 2 on 100-199 etc.), since they will all quickly exhaust their own nonce space and start overlapping.
Instead, mining pools will send different block templates to each (or the majority, at least) of workers. The only difference is usually some transactions, which then change the merkle root. Thus, all workers are effectively mining a unique block, but all at the same height. If any worker solves a block, the pool will win that block.
Lastly, in addition to the nonce, the timestamp value is also updated every second, which allows you to retry the nonce space once again, since the header has changed.


text:
When does a node start mining the next block?
Will a particular node on the Bitcoin network begin mining the next block after it has successfully been mined?

Mine right away.

When the node with the best computation power among the nodes participating in the bit coin network is mined, the next block is also considered to have a higher probability of mining than the other nodes. Do you have a penalty for this?

Do not mined immediately.

If you are waiting for the next block without doing so, can you verify that the blocks are propagating to all nodes participating in the bitcoin network?

To start with, nodes no longer mine in Bitcoin. Bitcoin's difficulty is too high, and mining is now done via a series of mining pools, which distribute the work to tens of thousands (if not hundreds of thousands) of ASIC miners.

Mine right away.

Miners do start mining a new block as soon as the previous one is discovered, regardless of if it was discovered by them or another miner.
There is no penalty for mining multiple blocks in a row, since mining is not a operator-linked operation - That is to say, as far as the blockchain is concerned, there is no such thing as defined mining entities, and there is no database or registration against which the blockchain can check to see if a two blocks have been mined by the same entity.
Of course, the output in the coinbase transaction could be checked, but it is trivial to just send that to a new address each time.
Moreover, mining pools would usually assign a different block template to each participant, since ASICs can cover the nonce and timestamp space in a trivial amount of time. They then move on to updating the extraNonce, and by distributing different templates to each miner, pools can ensure work is not done twice.


text:
Does PPS reward depend on specific block difficulty?
How is reward per share calculated on PPS payments system? Does it depend on specific block difficulty or average difficulty per day/week/month used? If I have mined two successive blocks with difficulty 10,000,000 and 11,000,000 and there was the same number of shares for each block, will I obtain 10% higher reward on first block than second block? Or rewards will be the same?
If it depends on particular pool, I need answers on questions:

What is the most common practice?
How common are the pools that use difficulty of a specific block, rather than average?


text:
LN channel lnd + android wallet problem
I am running LN node powered by lnd. Also I have installed on my phone a LN  app - Bitcoin Lightning Wallet. I opened a channel from mobile app to lnd node sucessfully (many confirmations), but I cannot request money from the mobile app with only two 'errors':

Receiving not yet enabled by peer (View channel details screen)
Can't ask for Lightning payments because your peer has not allowed receiving yet, this typically happens once a funding Bitcoin transaction gets
confirmations (Receive funds screen)

In lnd (lncli listchannels) i see the channel as inactive ("active": false) , but the other channels opened from lnd are active.
Could you please advise what can I do before I close the channel ? Or explain what I didn't understand? How to bring the channel to active state? My opinion is that mobile wallet is not working well, because I can't generate invoice (payment request). I don't know.

It's a well known problem described here: https://github.com/lightningnetwork/lnd/issues/1347
LND team works on a fix here: https://github.com/lightningnetwork/lnd/pull/1595
Meanwhile i'd recommend to connect to Eclair based nodes to have receiving ability, such as the recommended ACINQ node.


text:
How do bonds in Secure Multi‐Party Lotteries work as described in Bitcoin and Cryptocurrency Technologies book
I have understood the details of it but I have a question related to claiming the bond.
We have two parties Alice and Bob and suppose the bond that Alice signs is
now if Alice reveals her value X then she will be able to get her bond money back. Suppose if Bob won the lottery then how will he get the money from Alice since she has already reclaimed her bond amount?

The transactions for revealing commitments are separate from the transactions for the lottery. Timed hash commitments only force parties to reveal preimage x of H(x). The lottery logic is carried in a separate transaction


text:
Send raw transaction (have tx_hex) on litecoin testnet using api or module
I have raw data (tx_hex) for raw transaction, but I cant send it to litecoin tesnet using post request to testnet.litecore.api. If I insert tx_hex manually in the browser, the transaction is correctly sent. My code:
request({
    url: 'https://testnet.litecore.io/tx/send',
    method: 'POST',
    data: test_tx
}, ((error, response, body) => {
    if(error) {
        console.log(error);
    } else {
        console.log(body);
    }
}));

I also tried to use another service, but it's failing too.
Code :
postdata = { tx_hex : test_tx };
request.post('https://chain.so/api/v2/send_tx/LTCTEST', postdata, function
             optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log('Upload successful!  Server responded with:', body);
});

Does it give you an error message on failing?

It return html-page with "Cannot POST to /tx/send".

From what I recall, the POST is supposed to be sent to the api /tx/send endpoint, which depends on your insight API prefix (it's usually /api or /insight-api)

Postdata must be String, not Object. ('tx_hex=...')


text:
bitcoin-cli createwallet electrumpersonal server true
I'm a noob following instructions to setup Electrum Personal Server on Linux.
I came to this instruction and I'm stuck.
Got an warning. What is this?
{
  "name": "electrumpersonalserver",
  "warning": ""
}

Thanks

There's no warning there.
The createwallet command will always return a JSON object containing the name of the wallet created, and a warning string. If there was a warning during wallet creation, that warning string would contain text. But it is just an empty string so there is no warning.