What are the pros and cons of P2P mining pools?

P2Pool allows individual miners to band together and find blocks with the reward being shared directly with the miners who participated in finding the block.  If you didn't contribute a pool share during a round, you wouldn't receive a payment for a block found by the round.  The pool has a lower difficulty than the network but greater than an individual miner.  That is, your miner can be submitting shares to the pool but you won't get a pool share unless one of your shares has a difficulty greater than the pool difficulty.  When somebody submits a share with a difficulty greater than the network difficulty, a block is found and everybody who contributed at least one pool share gets part of the reward.

So the trade-off is a high variance since you only get paid if you were participating at the time a block is found and you contributed a pool share.  And finding a block itself is highly variable since it depends on the total hash power of the pool (luck also plays a large role).

Depending on your hash power, you could run your own p2pool or join a p2pool set up by somebody else.  The advantage of joining a common p2pool is it increases your chance to contribute a pool share and thus share in the block reward.


How is a multisig transaction transferred between multiple signers?

I'm wondering how does one, using rpc or cli, perform a multi sig spend from physically separate machines?

It is the usually the same exact process, just doing the signing command(s) on multiple devices. The software should be able to handle when it can't fully sign and will produce as many signatures as it can for that transaction.

How does a signee know that there is a transaction that he/she needs to sign?

He has to be given the transaction to sign. If using PSBT, the transaction will usually contain an identifier for the signer that the signer can look for to know whether to sign.

Can a 2-of-3 transaction, that initially only contains 1 sig be broadcast then updated by 2nd or 3rd signatory?

No, the transaction is not fully signed so it cannot be broadcast to the network. It must be given to one of the other signers and they must sign the transaction before it can be broadcast.


Is it possible to get stuck with a block that nobody can mine?

Is there a property on the SHA-256 function that asserts that on these 320 bits of freedom, one combination will give us a hash that is matching the diff requirements?

No.

AFAIK there are in general hardly any research results about the possible SHA-256 output values and their probabilities.

Satoshi Nakamoto probably assumed that you will always be able to find a possible block by modifying the nonce and the Merkle root.

  If not, does that mean that the blockchain could get stuck on a block because nobody can mine on it?

Yes (Theoretically, but it is very unlikely which was already pointed out by Alpha)

Let us try to be more precise. If you only change the nonce and the Merkle root there are  bits you can change. So you have  possible inputs for the SHA-256 function ( If you find all  possible Merkle roots, which is also very difficult admittedly. but let's assume you accomplish this because you have many ways to change the Merkle root like changing bytes in the coinbase transaction and you can choose every combination of arbitrary valid transactions from the mempool).

Now take a look at the possible SHA-256 results, there are  possible SHA-256 outputs and  possible inputs. With these you should be able to find atleast one hash below the target. It would then be possible to create a new block.

Remember there are  times more inputs than the possible SHA-256 outputs.


Is there a maximum balance that a single address can hold?

Nope. Not 1 bit. A balance (in this context) is the sum of all UTXO's for a given address. There is no limit on the number of UTXO's or their total amount (from the perspective of how the blockchain works and the blockchains limitations).

Software interpreting the balance may have limitations on consuming, processing and/or displaying a number beyond a point. Int32 vs Int64 for example: https://stackoverflow.com/questions/9696660/what-is-the-difference-between-int-int16-int32-and-int64

Here's an address with a balance of 138,660 BTC at the time of this post:
https://longhorn.bullpay.com/?gateway=2&data=3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r

Note: This answer is specific to the question and specific to Bitcoin. For the sake of brevity situations where "creating" tokens or currency on another chain in amounts that could theoretically "break" anything is not covered.


Looks like you must have entered it in a phishing site that looks like trezor suite.
AFAIK you don't need to enter a seed phrase to transact from Trezor, because the hardware wallet does all the transaction signing for you.
SEED phrases should never be disclosed
Always use the official website https://wallet.trezor.io/


What is the algorithm to create a Bitcoin mining calculator?

I want to give an extended answer as I found the pre-existing here or elsewhere in need of a bit more clarification, specifically for newcomers.

Formula

In order to calculate the approximated total bitcoin earnings value per month from a mining operation (not taking into consideration mining costs [electricity, hardware maintenance etc...]) the following formula can be used:

H = Hashrate (hashes / second)
D = Difficulty (Reference for values below)
B = Reward per Block (Reference for value below)
N = Number of days per month (default = 30)
S = Number of seconds per day (S = 60 * 60 * 24 = 86400)

Example

H = 21,990,232,555,520 h/s (~= 20TH/s)
D = 47,427,554,950.648
B = 25
N = 30
S = 86400

The total number of bitcoins earned per month as per the defined variables above will be ~6.995. Dismiss N from the numerator and you'll get the daily value.

Python

A quick python statement as an example implementation (you can type this directly in the terminal)

$ python -c "print (30*21990232555520*25*86400)/(47427554950.648*2**32)"
$ 6.99542703277

Some References:

Difficulty (Current Value | Wiki)

Reward per Block (Current and Future values)


Why you need to rehash each block after a changed block when changing data in a blockchain?

The blockhash is a hash that includes the previousblockhash as input.

Suppose you are trying to change the data in block 9000. You modify it the way you like and then successfully mine the modified block (find a hash that meets the difficulty threshold at that height). You now have a block 9000 with a new hash, so block 9001 has the wrong value in previousblockhash.

Your theory is that you can simply update the previousblockhash in block 9001, but since that field is part of the input to the hash of block 9001 modifying it changes the blockhash. Now you need to successfully mine block 9001 with the modification and once you do, block 9002 will need to be modified to have a new previousblockhash referring to the new blockhash for block 9001 and then it will need to be mined as well, and so-on, and so-on.


Get scripthash for known scriptPubKey in PHP

I found the solution replicating https://github.com/janoside/btc-rpc-explorer/blob/master/app/api/electrumAddressApi.js

$scriptPubKey = '76a914e0ad60c897901128662623c500a4a6079e99cd3e88ac';

$addrScripthash = hash('sha256', hex2bin($scriptPubKey));
$re = '/.{2}/';
preg_match_all($re, $addrScripthash, $matches, PREG_PATTERN_ORDER, 0);
$addrScripthash = implode('', array_reverse($matches[0]));

print($addrScripthash);


How to recover private key if I have the 12-word and an address?

Add 12 words (the seed) on another wallet, electrum (https://electrum.org) for example.


How do I find a pubkey and the nbits value to generate a genesis block?

The public key doesn't matter, no coins are created in the genesis block.

nBits decides the blocks difficulty, affecting how long it will take to mine. You also have to modify your daemons code to allow this difficulty.


Bitcoin transaction fees and how to handle it

Yes, you can. This is the exact purpose of the RPC command prioritisetransaction.


Does Bitcoin have a physical equivalent like US dollars do?

Bitcoin is only stored on the blockchain. Unlike a fiat currency, where the banknote holds inherent value (i.e., the banknote holds its own value - it does not rely on another system to say it has that value, and a $1 banknote will always maintain its value of $1).

Bitcoin is always on the blockchain. A wallet, or paper wallet, only holds the private keys that can spend certain outputs on the bitcoin blockchain. As long as the outputs corresponding to those keys are unspent, a wallet will hold value.

However, once those outputs are spent, a wallet would have no value (unless more transactions created new outputs controlled by that wallet).

Paper wallets allow you to put a private key on a piece of paper. However, if the money controlled by it is spent, the value written on the paper will not be true.

Additionally, Tangem sells banknotes that contain some BTC that cannot be easily spent, making it function more like an actual banknote.


What's the easiest way to import a balance from a paper wallet private key (non-QR code) to coinbase?

Use wallet which supports key import. This could be at least Electrum (desktop & mobile).

There are also another wallets supporting so called "sweeping". I can remember precisely that Blockchain.com has this option but I strongly not recommend to use their wallet.

Just now, I've checked that Samourai Wallet can import private key via QR as soon as allows typing it manually.I don't see the same function in Green Wallet.

That's enough options I think.


You probably haven't gracefully shutdown your node during the first run.

Make sure you always stop your node(s) with ./bitcoin-cli -regtest stop


Unconfirmed Transaction disappeared when I pressed "repair wallet"

That transaction looks fine so try the Tools | Repair wallet again to see if it appears.

If that does not work then you can 'clone' your wallet in Lighthouse using your wallet words and see if it appears in that.

Lighthouse and MultiBit HD use the wallet words in the same way.
https://www.vinumeris.com/lighthouse


Digital signatures really aren't much alike someone's John Hancock. Digital signatures cryptographically commit to exactly one message and resolve as invalid for any other messages. Unlike someone's three crosses they cannot be lifted from one document to another or easily imitated.
ECDSA's signature algorithm uses two inputs, the private key and the message that the signature commits to. In the case of Bitcoin, the "message" is the Bitcoin transaction you mean to commit to.
The signature is mathematically derived from the message, the private key, and a random component generated during the signing. While producing the signature requires knowledge of the private key, the signature can be validated by anyone who knows the message, the signature, and the corresponding public key. The signature will only ever fit that specific transaction. Any other transaction would require a signature to commit to a different "message", and such a signature could not be produced without knowledge of the private key.
As a transactions spends at least one unspent transaction output (UTXO), and each UTXO is unique¹, the premise of "signing the same message" is in conflict with "same for all my transactions". As each transaction must be unique, signatures do not transfer, even if the transaction spends inputs associated with the same private key. Therefore, yes, every signature is unique.

Furthermore, if <sig> was always the same for all my transactions, would that mean that everyone who knows my <sig> can impersonate me?

No, that's not how signatures work. If your signature was always the same for all transactions, they would not be useful. Such a "signature" would not prove that you committed to something specific and therefore could not be a means of authorizing a payment.

¹ A UTXO are uniquely identifiable by their outpoint which consists of the txid that created it and the output's position in that transaction's output list. txid are the SHA256D digest of the transaction data. This is defacto unique since BIP34 requires Coinbase transactions to include the block height, which therefore by induction means that no transaction can ever consist of the same data.


How can one download the bitcoin client securely?

Jeff Garzik signs every release with his GPG key (also here). You can find release announcements (such as this one) on the SourceForge.net Bitcoin development list.

To verify the signature on a release, obtain the key from the link above. Obtain the release announcement from the link above. Obtain the download from any source. Then point GPG at the release annoucement (or the signature block from it, including the BEGIN and END lines). GPG will ask what file you want to verify, pick any of the ones listed in the signature certificate. It will then tell you if the release is identical to the release Jeff Garzik signed.


Physical access:

Minimise your risk by using a deterministic wallet with Armory, and enabling extreme encryption and key stretching. The program will let you configure your wallets settings, and you can make it sting to the point of being completely ridiculous, seconds to open is enough to stop any attack on the password.

Malware

There is no protection against malware on a computer with a wallet. These exist already as pre-made tools, so it's hardly a stretch to think you might be infected.

Use a hardware wallet like the Bitcoin Trezor or a split-wallet with an offline portion with Armory.

In a split-wallet a computer is kept air-gapped and stores the private keys, and a separate one is used to manage the wallet. Transactions are ferried by USB drive between the machines, so the offline wallet is never at risk of compromise. This is the best option for storing large amounts of funds safely.


How does a wallet decide which utxo to use?

Why does a wallet have to use multiple utxo (input>output 2>2 or 3>2) rather than just use one and split it in two (1>2)? (the aimed tx amount is smaller than each utxo)

There's no generic reason a wallet would have to do that.

Is the algorithm to select which utxo specific to each wallet or is there any general rule throughout bitcoin network?

Specific to each wallet


https://bitcointalk.org/index.php?topic=41718.0
Don't miss the threads it links to at the bottom of the post.

But I wouldn't recommend diving right in if you don't know the basics of how bitcoin functions. You are going to need an okay understanding of cryptography used and C++, networking and program design.


After a long connection to the wallet, it offers to reinstall blocks and synchronize all Bitcoin core blocks

The restart after moving data to a new machine might be because some program data is stored in the Windows registry (Computer\HKEY_CURRENT_USER\Software\Bitcoin\Bitcoin-Qt) which you might have left behind on a conventional HDD.

In particular the path to the data directory is stored in the registry. However simply the absence of any bitcoin key in the registry may be enough to convince Bitcoin core that it is running for the first time.

You can copy the blockchain data from an old install over the data directory created by a new install, so you can prevent the new install downloading the data you have already downloaded.

See How to transfer only the blockchain to a friend's computer?


I want to place the Antminer at work

Using your employer's electricity for personal gain is likely to get you into some trouble. If you have a legitimate reason to consider such a setup (for example, if your employer pays a lower, business electricity rate than you do), you can ask your employer for permission.

  I can see where to put the DNS information, but not where to put a proxy name

If you need to go through a restrictive firewall, you can try a project such as the OnionPi (Adafruit), which uses a Raspberry Pi (35$) to tunnel all incoming connections through Tor. You will need to change the Wi-Fi antenna in the original project with a USB to Ethernet adapter, as the Antminer needs to connect via Ethernet, and besides, running a Wi-Fi router inside your company's network will get you into trouble.

Tor itself can connect through a proxy with the HTTPProxy and HTTPProxyAuthenticator configuration directives. If entry nodes are on the firewall's blacklist, you can use the BridgeDB to get some circumvention servers that use encryption and obfuscation to evade blacklisting.


Segwit to legacy address transaction possible?

'Having a segwit address' dictates how you prove you received/own the money, not how you spend it. If you have a segwit UTXO, it's perfectly fine to create a transaction with witness inputs and then normal old P2PKH outputs, sending to 'legacy addresses'.


How we can use Blockchain to prevent Plagiarism in scientific papers?

"Blockchain" can't be made to prevent, or even detect plagiarism. The most useful thing related to your problem which the chain can help with, is it enables you to timestamp a document in order to prove that the document must have existed before a certain point in time. It can't tell you when the document was created or who the document was created by. It can only tell you who first pushed the document onto "Blockchain".

Assume author A publishes a document, by whatever medium, and person B receives the document. B checks "Blockchain" to see if the document has been published on it already, and if not, B publishes the document themselves, linked to an address which they have the private keys for.

Now B can go around pretending they created the document, and since A didn't pre-emptively publish the document onto "Blockchain", they are unable to use this tool to disprove B's copyright ownership. "Blockchain" actively prevents A from asserting their ownership this way because only B has the private keys.

So for such tool to ever have practical use, it would need to be absolutely ubiquitous in use, such that nobody would ever publish any document without first timestamping it onto "Blockchain" linked to their own private keys.

You also have the case of private key loss or theft, which would prevent an author being able to assert their ownership of the document using "Blockchain".


There are at least two I'm aware of: Python-bitcoinlib and bitcoin_tools


How to connect LND to bitcoind RPC with authentication cookie stored in a custom folder?

It is supported according to the LND installation guide

NOTE:
The auth parameters rpcuser and rpcpass parameters can typically be determined by lnd for a bitcoind instance running under the same user, including when using cookie auth. In this case, you can exclude them from the lnd options entirely.


How to check about 10 million bitcoin addresses?

You don't need to check the whole 62*62*62*62 addresses online through API. That would be an insanely long journey, and you'll get blacklisted at any free service before finding what you seek, no doubt.

In your place I would:

1) download the daily balance snapshot from blockchair.com

2) either in Windows through Cygwin or in Linux shell, or in MacOS terminal type:

zcat blockchair_bitcoin_addresses_latest.tsv.gz|grep "the part of the address you remember"

Example, I took a random address from the list and removed last 4 digits:

root@ubuntu:~# time zcat blockchair_bitcoin_addresses_latest.tsv.gz |grep 1EpfyhhNnwF2Sv53PUzoJGRawiTVy
1EpfyhhNnwF2Sv53PUzoJGRawiTVybuMTz      1

real    0m9.479s
user    0m9.209s
sys     0m0.746s

I've run the command with time in front just for testing purposes, in order to demonstrate that it took less than 10 seconds to parse the list and find the matching address, and this is not a powerful PC. I don't even have SSD here, I bet if you have one it will be even faster.

Please note the number 1 after the address: this BTC address has indeed 1 satoshi.

If you are in doubt about capital letters in your address just add the -i option after grep so it will not run a case-sensitive search and will return the result even with wrong capitals in the search pattern; here I searched all Bitcoin addresses with non-zero balance containing my name despite any capitals, and it still took 10s:

root@ubuntu:~# time zcat blockchair_bitcoin_addresses_latest.tsv.gz |grep -i marco
3NPjX9BFc3hZdXeqjFqMNMARco2gfna9cR      1512000000
1HTsd6dR5qdKUTghRh8VdfDq3marcoVBdZ      4267964
1LCidVxbHzL4maRcoeaYZrevVVz3KTHnqb      3900000
1AF9enGasTBY1zxsMARCotYP9izc2v3Fzs      2028360
17kaMiiyDa11VGYMArCoZM8wD9enpWXc5K      1009417
1EoDrgLovufWp4BjC4iEqyhSHR2MaRcob1      1003055
14UEd1qtHwvWk3tWjkDsZfRXKUDx7mArCo      483996
1At868R9nWceRRpymarCopNhrywPUooDvE      431629
1Marco12CWtLWwAK9eKxqTZmeQgitBwAhg      200000
1marcoUFS2NyCtW7hH2AGxGVbJ9fpZkrR       184000
17Nw3Ed1vnUQpmzKty2MarcoCskKDZQmAp      167192
18odA7ipASdRFkf1gGAspQ8DQmArCoLrsU      99300
1MArcoSBgoNhnypXD7YhE4T9B7eUFSTLA3      26280
1marco52Uta2SKaLPeNiEczbrwCHnV7Jb       17100
1MaRCoEoSZXpupVVtCcs5chdEVwF78FQ9U      10000
1Kf9aZ21UQmrRBpXfMarcoQoj7VgV2e9H2      3660
1FT4mpGZS4Df8WzjWHhDDCezJJKksmARCo      3607
1MarcoStvKXXkeQJhwfcUdUP1NLnHB2bfr      1
1MArCovVsyQ54sRufEvjCrNCmUfgr3ZsvY      1
1MARcoseSo15DysRD9t2GoRm2aaHPKxgeh      1
1DemArcoSrb2D8RCSvsU7gPBvFbT3sdDL1      1
1MarConm2xEoBveieCcGGZvAvKZi6EHvzn      1
1DemArCozufYcpvVqxsXy3ttLh2iN5keHr      1
1MARCoNioFuSbuX7mgAifgBx8hsF8FVFu8      1

real    0m9.921s
user    0m10.829s
sys     0m0.656s

Relevant note: if you have not a premium API account on blockchair.com the list download (today over 700MB) is rate limited to 128KB/s. The DL takes around two hours but it is updated daily, and I find it's still a tremendous booster for all bulk balance lookups issues, unless you need balances to be real time. In this last case, look to a paid API as only solution.


Negative number of confirmations for a testnet transaction on blockexplorer

If you look closely on blockexplorer.com, you will notice that the site does mention that the transaction was included in block #1484064. The blockexplorer seems to be confused about the height of the blockchaintip, or has some other general issues regarding the confirmation count. For example, it shows all of the transactions in the latest block to have -3562 confirmations:

The transaction in question has some 1300+ confirmations, so this seems to be squarely on blockexplorer.com.


Remaining bitcoins sent to a different address

Your bitcoin client must have used a full UTXO to paid for your transactions, since you didnt own the exact amount your bitcoin client created a new private key where it send the remaining ( 20-5 = 15 ) bitcoins, also you had to pay a fees to the miner who mined the block that got your transaction.

To learn more about this process you should go there https://en.bitcoin.it/wiki/Change

If you want to receive new coins, The most private and secure way would be to use a new address given by your wallet, I suggest you to learn about HD wallet who can give you automatically a new address each time you want to receive new bitcoins.


I suspect that it is hard to find real life stories because the miners would like to remain anonymous. If you had a few million dollars in largely untraceable BTC, would you want to publicize your story and make it easy for the government to tax you?

But there's some very strong evidence to indicate that "getting rich" was very possible. One story that comes to mind is "allinvain" who posted a reasonable amount of evidence that 25,000 BTC that he had mined was stolen from him. So, even though allinvain didn't "get rich" in this story, it certainly showed that a solo miner in 2011 could be making tens of thousands of BTC, easily worth millions of USD in 2013.

If you look at the blockchain it is easy to find addresses used by miners in 2010 that have thousands of bitcoins in them. Just find a block reward and trace where it went to. Here is one: 1AvLeBnWbiBeCNHwLGtWEK9GSVug3RWWxt It appears to be an address where the miner collected his block rewards over six weeks or so. (I'll substitute a blockchain.info link when it is back up.) Perhaps this private key was lost, so we can't say for sure. But it's reasonably to think that this one account (worth about $400,000) represents only a few weeks of work for this miner. If he kept all of the BTC he mined in 2010, he is likely a millionaire. At least on paper.

In short, since mining was much less difficult several years ago, and the exchange rate has gone up so much in that same time period, it seems very reasonable to assume at least some of the serious miners from those early days have made a considerable amount of profit.


Is the compact block protocol faster than normal blocks when it has to do getblocktxn/blocktxn round trip?

Yes, compact blocks are still usually faster even when there is a getblocktxn round trip.

The reason for this is because all that needs to be sent in that case is the requests for the missing transactions and the missing transactions themselves.

Although the time is increased by another round trip in this case it is only a single round trip and there is little delay from sending the data itself (serialization delay) since there is very little data to send.

When a full block is sent many round trips can be required due to TCP flow control and packet retransmissions and simply from the time it takes to send the additional data.

In the case where almost all transactions are unknown (which doesn't happen in practice) compact blocks would take about the same amount of time as non-CB transmission.

FWIW, on my node here 86.75% of the last 288 blocks (203) required no round-trip and 99.9749% of transactions were known in advance (378715 out of 378810).


GUIMiner won't start mining on Slush's pool

The problem is that in GUIMiner, the URL for Slush's pool is:

  api2.bitcoin.cz:8332

That address has been deprecated, and it falls back to the GetWork protocol. From Slush's Pool news:

  10.03.2013
  Default mining URL for Stratum is stratum.bitcoin.cz:3333. If you're still using api.bitcoin.cz, please fix your URL to prevent fallback to deprecated Getwork protocol.

In the GUIMiner interface, instead of choosing "Slush's Pool" from the dropdown menu, choose "other" and then enter

http://api.bitcoin.cz:8332

or

stratum.bitcoin.cz:3333


Having trouble transfering private keys from Bitcoin Core to Electrum, for want of not having to wait for sync

Redo the import. Start via file > new/restore, enter a unique filename and click next to begin the process. This time prepend one of the following to the private key:

p2wpkh: if the address in question begins with bc1
p2wpkh-p2sh: if the address in question begins with 3

For example:

p2wpkh-p2sh:Ky9mddDtaqcLC1vv6egmgQpiZh8Lgh111LnJSyJENxJs3oW93bjD

You can also click on the info button on the private key entry step to see further examples.


What are the pros and cons of premined altcoins?

pro's:

dev gets paid
some bounties and coin distribution can occur

con's:

depending on the size of the premine, developer could get an unreasonably large amount of coins for what is essentially a copy and paste job.
negative preconceived opinions about the coin because it is premined.
dev could be a scammer and dump all the coins, rapidly deflating the price(ie, a pump and dump)
those who claim the bounties may run with the money and pull the services at a moments notice once the bounty is paid.
coin may be subject to 51% attacks, difficulty stranding attacks, and other undocumented forking attacks from anti-premine "activists", who may be the vocal minority but often have the majority of hash on any given coin.
the coin will be under constant attack from trolls


You are mining, but most pools today have a minimum share difficulty requirement, otherwise very fast miners bombard them with shares that they have to process and discard. For many pools this is at a minimum of 128 or higher, meaning it would take several days for a CPU miner to find a share on average. No pool has a payout of any less than 0.00001 BTC, so there is absolutely no chance of you ever being paid for your work if you are mining using a CPU or GPU at this point in time.


Blockchain Receive Callback API in callback url not working

It's not about your code; it's from Blockchain.info.

I've made a transaction right now and never received the callback.

Blockchain.info always has these types of issues from time to time.

Please aware an issue with gap limit also. They may say that you've created 20 unused addresses and you're not.


In order to reduce fees, can I 'consolidate' my wallet by sending the entire balance to a new address in the same wallet?

It depends which of two cases you are in:

If you have lots of decently-sized transactions to 'gather', it will likely have the reverse of the effect you want. Right now, you probably have lots of old transaction outputs that your future transactions can claim. That means you can form many transactions that use only old outputs, and thus get a higher base priority. If you consolidate your coins, you will have only one transaction output to claim. So in the future, you will only be able to create one high-priority transaction. Once you do that, you will have no more old coins.

But if you have lots of absurdly-small transactions to 'gather', it will likely help you. By not having to gather lots of small transaction outputs together in the future, your future transactions won't be as large and therefore won't require as high a fee (or as large a wait).


Where can i download latest stable bitcoin-core src files?

git clone git@github.com:bitcoin/bitcoin.git
git checkout tag_name

the latest version must be v0.15.0.1 now. so the command is :
git checkout v0.15.0.1


Did Satoshi object to embedding data in the block chain? Why?

He supported IsStandard, but he was not against small amounts of arbitrary data. Satoshi said:

    why not make it easier on everyone and just allow say, 64 or 128 bytes of random data in a transaction?

  That's already possible.  <pubkey> OP_CHECKSIG.  <pubkey> can be 33 to 120 bytes.

  I also support a third transaction type for timestamp hash sized arbitrary data.  There's no point not having one since you can already do it anyway.  It would tell nodes they don't need to bother to index it.

He always promoted putting hashes in the chain instead of the arbitrary data itself, though I don't know whether he was strongly opposed to the latter.


Moving Bitcoin from Bitcoin Core to another Bitcoin Core or Bitcoin Diamond

he moved it out of said wallet I don't control

Yes, your helper stole all your money.

  is there anything I can do?

No, report the theft to the police.

Your money is gone forever though.


In my opinion trusting a third party with your Bitcoin savings is kind of against the grain of Bitcoin.

It makes perfect sense to keep day to day amounts on hot wallets either on your phone or online by using services such as Coinbase, Blockchain.info, Circle and their likes.
These companies offer various cold storage options (e.g. coinbase vault) and there are other vendors that specialize in cold storage solutions, e.g. xapo

All these are viable options and have a place on the ever denser continuum of options to store bitcoins, and in all these cases you surrender some control over your bitcoins for the benefit of simplicity and ease of use.
However, part of the appeal of Bitcoin is the fact that by design you can maintain 100% control over your bitcoins. If you choose to do so, let me recommend CoinCooler (disclosure: I'm the founder).

CoinCooler helps you generate and encrypt digital files containing cold storage addresses and keys in a way that is guaranteed to be 100% offline. It also includes splitting the encryption password into shares (as was recommended above by Christopher).
Basically, its a tool that helps you perform cold storage of bitcoins in a way that is easy and secure so that, hopefully, you will consider doing it yourself and not rely on a third party.

Good luck!


Is it possible to trigger a contract with a not prunable public trigger message?

Ardor has two levels of pruning. Pruning of messages (like the contract trigger message), data cloud items and shuffling artifacts are already implemented on each child chain. Child chain transaction pruning is scheduled for release later this year.

Only prunable trigger message are supported at the moment to reduce blockchain bloat.

Send your trigger message in plain text and setup an archival node to save it locally even after it is pruned. This will provide you unreputable proof that this message existed at the time when the contract was triggered and other nodes will be load this message automatically from your archival node at a later time.


Why would apps use Lightning over an on-chain TX?

I think these are two questions.

1.) Why charge with lightning in real time instead of once? I guess the main reason would be the convenience for the consumer. It is much nicer if I don't continue to watch the video that I don't have to pay the full price.

2.) Why using lightning instead of an on chain transaction? I guess the main reason is that on chain transactions are slow and with the higher adoption of bitcoin also more expensive. This means that it will just be cheeper and faster to accept payments via the lightning network which goes in the direction of the guess you made. There is another advantage which is that your lightning channel can be reused over and over again.


It's not possible to use the GUI. (If you really want to, you can use TeamViewer, which is about controlling your computer remotely and not not that efficient.) You can use the RPC API to use the most of Bitcoin Core's functionality. If you're using it as a blockchain data API, the REST API might be a better choice.


Why can't a 51% attack change past blocks on the blockchain?

Lets say the block height is currently 700000 and you computed a different version of block 699990 and broadcast it.
The old block 699991 cannot be considered a successor to the new 699990 because it references the hash of the old 699990, so the new 699990 is the top of a new fork of the blockchain.
Each node would consider the two forks, one has a block height of 699990 and the other has a block height of 700000 with ten more blocks worth of work in it, the nodes would choose the fork with 700000 blocks. Note that it isn't the length that matters but the amount of accumulated work.
So you can't just change one block, in this case you'd also have to compute successor blocks with a combined amount of work greater than the existing chain up to 700000. You'd have to do this faster then other miners are adding blocks on top of block 700000. So you'd probably have less than 10 minutes to do something that normally takes the best mining pools around 100 minutes.


Do all block have to be verified every time a new block is broadcasted?

TL;DR: Each block only needs to be verified once. Upon receiving a new block, only the reference to the parent and the validity of the new block need to be checked.

When one gets started with Bitcoin, the client or mining software will download and verify the blockchain. During this synchronization, each block starting from the genesis block will be verified by the client. This is only necessary once for each block, because new blocks always reference the hash of the preceeding block.

I.e. when you are trying to verify Block 5, it will contain the hash of it's parent, Block 4. As your client has already verified that Block 4 is valid, and if the hash featured in the new Block 5 matches the known hash of Block 4, it can go straight ahead and only check whether the new Block 5 is valid.


How many signatures are there in one non-multisig transaction

1.: For typical P2PKH/P2PK you will always need to provide one signature. If all inputs spend outpoints of this form, then each one of them must provide one signature.

2.: They must sign a "special" transaction structure, see here: Redeeming a raw transaction step by step example required


"block decode failed" error while mining in pool

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.


How to search for a transaction using a specifc OPCODE?

I don't think this is possible. Most, if not all, block explorers and blockchain indexers do not completely disassemble scripts and index them so that they are searchable. No software or service I know of allows you to search by opcode use in a transaction. It would be pretty useless for a service to provide this as probably no one would actually use it and having such an index would be a huge resource cost.

I think the best you will be able to do is to do write a program to look through every single transaction's scriptSig and looking for the opcodes that you want. However, be careful that you don't interpret random bytes as being opcodes. You will need to have something that can disassemble scripts and check the disassembled scripts for the opcodes that you want. Furthermore, such disassemblers won't be able to disassemble a redeemScript which is the actual script where opcodes will actually be for P2SH inputs.

Instead of searching for an example of an opcode which probably hasn't been used, just try using it yourself. I recommend that you read https://en.bitcoin.it/wiki/Script to get an idea of how the opcode works. Then you can use a tool like https://github.com/kallewoof/btcdeb to execute and debug your script. This way you can learn how the opcode works through experimentation and see exactly how a script interpreter will execute the script.


Bitcoin-Qt is a full p2p network client, so to work, it needs to sync with the network. Basically, it will download every transaction that was done with the currency (~15 GB in total at the moment). Might take one or two days, then you'll be good to go.


Is there any way to cancel such transaction and make sure no miner will ever pick it up?

No

  If not then what are my options when dealing with stuck transactions?

Use replace by fee (RBF)?


Dead On Arrival. The term is referring to about valid shares your miner discovers that were found too late to be included in the P2Pool internal block chain and therefor aren't paid to the miner. Counter intuitively a DOA share can still be a valid Bitcoin block.


How might I create a new Electrum wallet programmatically?

There is nothing special about an electrum wallet. The electrum API will allow you to query address balances, and build transactions, for any address, regardless of how they were created.

Electrum itself does use a special key derivation scheme, but that does not affect the usability from an API point of view. If you are using electrum servers as a backend, you should be able to generate wallets using any BIP39 library in your language of choice, and simply querying with the resulting addresses.


As of 2017-09, Has there been talks or test implementations of making Litecoin anonymous / untracable like Monero or Zcash?

Increasing fungibilty is a goal, there have been several proposals of differing seriousness and support. But this is generally seen as a goal for the project.

That being said, BTC/LTC simply cannot ever achieve this goal as throughly as Monero has without a complete redesign, which will not happen.


When joining the bitcoin network, why aren't we connected to the most geographically closest nodes?

There isn't any reason that I'm aware of to think that this would be desirable. I'm not aware of any way that it would improve things and it would make the network highly prone to partitioning. E.g. why would the nodes in north america ever have any connectivity to the nodes in europe?

Making some number of additional connections to nodes on your LAN would probably be useful, but it isn't that often that there are multiple nodes on a LAN.


My seed from Electrum has 12 + 2 extension words. Iconomi ask for 12

Unfortunately Coinomi uses BIP32/BIP44, those are not compatible with Electrum seed. What you need to do in order to retrieve your BTG:

Move your BTC to a new wallet, so they stay secure and safe.
Make a new wallet with Coinomi.
Use the sweep function to sweep private keys from your old BTC wallet.
Shouldn't be that many private keys needed to sweep, usually 1 - 3 that hold BTG.
Or you can check on block explorer before sweeping.


How can I look up how much ASIC Miner has mined in the last week?

http://www.asicminercharts.com/live/ keeps track of the total amount stored in the mining wallet, as well as hashing power over time (Take the /live off to see historical charts).


Is Bitcoin a viable way to transfer money from one currency to another

Most exchanges charge around 0.5% per transaction. Assuming you go both ways, that can be around 1% of your total conversion. You will also lose money to another fee when transferring coins back to fiat. A second consideration worth noting is the volatility of the coins. You may gain or lose money during the time that you are converting from one currency to another.

The risks are still up in the air. Cryptocurrency is like the wild west, and its exciting! Maybe you'll be the one to create the new cheapest currency conversion service ;)


Implement HTLC manually by writing scripts

Yes...

... But it is going to be a lot of work.

First you should look at BIP 199 which defines htlc scripts. However that alone will only tell you how to create a htlc output.

But with the transaction itself it is not done. You need to use the right channel state and keys so you could read BOLT 02, 03 and 05 to learn about the peer protocol and messages you need to exchange with your channel partner (for such you will actually also need  BOLT 08 and 01 covering setting up a transport session and the message format), the key derivation and the exact onchain specs for htlc output and witeness  scripts. You will find all the BOLTs at https://github.com/lightningnetwork/lightning-rfc?files=1

All of this can be done in regtest. If you want to use a regular lightning implementation you can also run them in regtest mode by changing the corresponding entry in the config file.


May be:

You sent to incorrect address
Electrum have not synchronized yet


Am I screwed? Transferred USDT from Polinex to USD dollars in Coinbase and now it's gone

You do not have access to your Private keys on coinbase, as it is considered a custodial wallet, which means only they have access to it. I highly doubt they would give you these private keys as its not standard practice. You only option is to email support. I doubt they would care. Another option is to ask someone inside coinbase to help you, but you'll need connections to do that I imagine.


The value of Quarkcoin knowing that big amount was preminted

It really depends on what happens to that original 85%-90%. If the developers really own that large an amount, they will always be able to corner the market if they work together.

That idea troubles me, but I still buy Quarks because I see the value in the multiple hashing algorithms.

I think perhaps 85%-90% is quite clever as it puts Quarks on the map a lot quicker. Right? I think this has helped them gain press attention to their increased security meassures, by becoming the 5th largest crypto-currency available. I'm thinking that's an effect of generating so much currency so quickly.

I would expect value to continue to come into Quark, especially after Bill Still and Max Keiser talk about it on the 19th, then again as the new financial year starts around the world and everyone has another panic attack about the state of the world economy.

My point is, after the value has increased for a while and flattened out (if it does), I would expect Quarks to be used as currency earlier than Bitcoin. If quarks go to a dollar in 2014, then that's a lot of currency already out there, and it's not so expensive for people to invest, and not such a big deal when you spend a Quark.

The original holders of that 80%-90% would be more insentivized to spend that currency into the market than if they held Bitcoin (assuming it does not rise too fast).

One thing I really want to know, is how people arrive at the idea that the "the developers" own that much, and how they 80%-90% figure is arrived at. Are they meaning 3 developers, or do they mean 100 developers, 1000? It makes a big difference.

I guess we will have to wait and see if those original developers will put their Quarks where they mouths are and spend enough Quarks into the market on real goods and services, that they begin to circulate and become useful to everyone as a currency.

The way I see it, and I may be crazy, but those original developers would do themselves a huge favor if they got together and re-distributed a good portion of their monopoly as a PR exercise.

It would say a lot. And it would do a lot for Quarks as a currency to have a smooth distribution across the market.


How to broadcast a Bitcoin Gold transaction

Bitcoin Gold is a fork of Bitcoin. You can just start up a Bitcoin Gold node and broadcast transactions using sendrawtransaction. Another option is to use an insight-api.

https://btgexplorer.com/ is a fork of the famous insight block explorer. You can use their API to broadcast your raw transaction using these docs:
https://github.com/bitpay/insight-api#transaction-broadcasting

Send a POST request to https://btgexplorer.com/api/tx/send with rawtx as a parameter.


bitcoin address to Hash 160 public key : not consistantly reversible?

Both of those are correct decoding, the difference is the base58check version byte.

1MCNpVGDY7BGjJyWZL5FJZiaVkQEiuxy8H has a version byte of 0x01 for P2PKH
3MtPk2kf61VepUfwgRjqjC5WeGgxE4rRPS has a version byte of 0x05 for P2SH

Due to it being a hash, only one of these is typically going to have a valid destination, either a pubkey (P2PKH) or a script (P2SH). If money has been sent to both version bytes of the same hash it is very likely that one amount has been lost.


Are There Examples of Asset Backed Virtual Currencies?

This is basically how every asset in Ripple works, other than XRP.

Ripple permits anyone to create an asset and back it in any way that they choose. Others can declare their willingness to accept specific assets in payment. And Ripple implements distributed order books, payment pathfinding, and atomic multi-asset transactions to implement transfers of value.


Bitcoin Cash testnet version of insight API

With a trial & error procedure I've found this one :-)

Prefix for APIs is https://test-bch-insight.bitpay.com/api

For example:
https://test-bch-insight.bitpay.com/api/addrs/2MzrMhMEPN9KYsZHgijMqekPa8kmvwsuEVm,2N1w811DgtWzjHdwtP1zzbXqJdh9vNK3sk9,2N3rs2KJBYxZQifg5TY6Bjb8CGcvmYTppsG/utxo


Popularity based mining (variable block reward)

How would you define popularity? Any measure you make must be decentralised, and whatever you decide on can be arbitrarily faked. It's completely impossible in the terms of a trustless currency like Bitcoin.


Pools combine power, but all focus on a block? How do they all earn?

Generally (in centralized mining pools), the block everyone is working on mining in the pool, is a block which pays the pool owner. When a valid block is found, the pool owner receives the reward and distributes it to the members in the pool. So every block found, each user receives a little bit of the total reward, generating a more steady income stream for the members who own their own would have very little chance of ever finding a block and getting paid the entire reward.

There is no way for a member of the pool to change who the block pays, without being excluded from the share of the rest of the pool, if they tried to change it to make it pay themselves they would just be solo-mining


Segwit transaction - Non-canonical DER signature

The "01" byte at the end is the sighash type byte (specifically, 01 means SIGHASH_ALL, indicating that all inputs and outputs are signed). Such a byte is required for all signatures in Bitcoin scripts (both in legacy and segwit signatures). However, that byte is part of the DER-encoded signature; it's appended to it.
Presumably your hardware wallet produces the DER signature without the sighash type, and whatever software you use to construct the actual transaction is responsible for adding it.


Is there anyway to access those coins again?

If you wrote down your ripple secret (string of about 28 letters & numbers, starting with “s”), then you're OK unless a thief somehow got hold of your ripple secret. If your wallet software gave you a seed phrase and you wrote it down, then you're OK. (You can use your seed phrase to recover your ripple secret, either by using the same wallet software or by using tools such as Ian Coleman's mnemonic converter, linked below.)

If you had no such back ups, then your only hope is to undelete your wallet-file, using either a professional data recovery service or some sort of undelete tool (in which case try not to use the disk before). A skilful user of undelete tools might be able to find a ripple secret in a damaged relic of your wallet-file, but only if it's not encrypted.

Assuming you recover your ripple secret, what next? First of all, don't post it on the internet: it's secret for a reason! The same goes for seed phrases. You can use a ripple secret to access your coins via several freely available in-browser tools (examples linked below, but some of them are rumoured to misbehave in the Mac web browser Safari.). Whatever tool you use, I strongly recommend that you study it on a computer that's disconnected from the internet. If you're using it properly, it will tell you your address (string of about 34 letters & numbers, beginning with “r”.  It's safe to look up your address (beginning with “r”) on the internet, e.g. here, to see if your coins are still there.

Ian Coleman's mnemonic seed converter. If you use this, download the page and open it on a computer that's disconnected from the internet. Don't expose your seed phrase to the internet!
Bithomp wallet. Read the opening message very carefully before you start (“Introduction”, “Features”, “Offline mode”, “Online mode”).
Ripplerm's wallet. This one opens up with a demo account, so you have to set it to your account by clicking the blue Change button & then the use secretkey button. It's denominated in drops (1 XRP = 1 million drops), so don't let that confuse you. It has cold-signing functionality, so there's a lot you can do while safely disconnected from the internet. Don't try anything with the four pale blue buttons at the foot of the page.
Jatchili's minimalistic ripple client. Avoid the rekey account button.


Is there such a thing as an "ERC20 compatible Ethereum address"?

This is correct.

Any Ethereum address is compatible with ERC20 tokens (even a contract address).

There is also the ERC223 standard, which isn't finalized, and if approved would allow contracts to accept or reject specific tokens. In such a case, contract address validity would be a valid concern.

However, for ERC20 tokens, there is no such issue, and every address works (although some tokens include safeguards against sending to 0x0000000000000000000000000000000000000000)


A node is a "point" that relays new transactions and blocks.
For example, if a make a transaction from the GreenWallet app, the GreenWallet app will send the transaction to GreenWallet's API. The node(s) GreenWallet runs will broadcast that transaction. The rest of the nodes will relay those new transactions to each other.
Only some of those nodes are also miners. They listen for

new transactions, so that they could include those transactions in their next blocks.
new blocks, since every block must reference the hash of the previous block.

An Antminer, which is an ASIC machine, is not a node. It specializes in doing the work given to it. A mining node, today, refers to a pool operator's node.
Additionally, pool operator nodes utilize low-latency block distribution routes such as the Falcon Network. This is to ensure that all miners have access to the latest block's hash. If two blocks reference the same previous block, one of them will be orphaned, which means the longest chain will be following the other block.
Software such as the BRD app or Bitcoin Core can act as nodes and they can directly push their transactions. The difference is that Bitcoin Core has the ability to store the whole blockchain, which most of Bitcoin Core instances do. This kind of node is said to be a full node. Bitcoin.org defines a full node as a "fully validating client". The opposite is a pruned node, which discards irrelevant data.
"User" is not defined for Bitcoin. There are miners, which make new blocks, nodes, which act as transparent connectors between nodes and miners, and wallet clients, which just keep track of relevant balances and transactions. Note that bitcoins aren't located in addresses. Transaction outputs are called unspent outputs, which may be spent with the corresponding private key and the public key of the address.


How will the Lightning Network handle most money being pushed towards specific nodes?

Payment routing could handle this. Any business has operational costs and will have to make outgoing payments.

If your concern is that channels will mostly consist of payments in a single direction (i.e. from customers to larger businesses), and that this will lead to a high frequency of channel closings or on-chain settlements, then we can consider the theory of Six Degrees of Separation.

The theory of Six Degrees of Separation postulates "that all living things and everything else in the world are six or fewer steps away from each other". In regards to the Lightning Network, we can postulate the theory that any user will be able to pay any other user through approximately six other users.

So if you have a source of incoming payments on the Lightning network (i.e. your wage), and the larger business has outgoing payments (i.e. their employee's wages), then through the six degrees of separation you may be able to pay the larger business through already existing payment channels you have open with your contacts.

Successful payment routing should ensure that payment channels operate bidirectionally and that payment channel closing or on-chain settlement should be of a low relative frequency.

Edit: Put Alternatively

Customers may never directly make payment channels with large businesses, but instead create routed payments through payment channels they have open with exchanges or other Lightning Network intermediaries.

Users may create payment channels with an exchange. A large business may create a payment channel with the same exchange. Users make payments to the large business routed through the payment channels they have open with the exchange. The large business decides to sell some bitcoin through the exchange. It makes a payment using the payment channel it already has open with the exchange. This process continues indefinitely such that there is a bidirectional flow of bitcoin along the open payment channels.


How do you configure the Antminer S1 to mine Dash?

The Antminer S1 produces SHA-256d hashes, but Dash uses the X11 hashing algorithm for its proof of work. The Antminer S1 cannot be used to mine Dash.


Are there any post BTC halving hashrate prediction markets?

No obvious place that has this bet right now, but you can create a bet at bitbet. Note that you bet at your own risk, there's no actual guarantee that you'd get your bitcoins if you win.


ScriptHash from bitcoin address with BitcoinJS

Got the answer via github

let script = bitcoin.address.toOutputScript(address)
let hash = bitcoin.crypto.sha256(script)
let reversedHash = new Buffer(hash.reverse())

console.log(address, ' maps to ', reversedHash.toString('hex'))

Note that -for some reason- Electrum uses the reverse scripthash


Resources

Anonymous CoinJoin Transactions with Arbitrary Values
 discusses the optimized and non-optimized version of it. In this reply I will discuss the non-optimized version of it.
CoinJoin Sudoku may also be something to look up.

Tooling

I wrote a small command line tool in .NET Core that anyone can play around with. You can either provide an input and output list to it or a real txid. In case of txid, it will fetch the transaction from SmartBit and analyze that.

Provide inputs or transaction ID! Example: 21,12,36,28.1 or 0f9f3b68f369b3b95779284d4d0607cb8f5051055c2e1b1813848370496e95aa
21,12,36,28.1
Provide outputs! Example: 25,8,50,14.1
25,8,50,14.1

Given 21,12,36,28.1 input list, and 25,8,50,14.1 output list the tool will output 2 sub mappings:

Sub mappings:
21,12,36,28.1 -> 25,8,50,14.1
21,12 -> 25,8 | 36,28.1 -> 50,14.1

The first sub mapping (21,12,36,28.1 -> 25,8,50,14.1) is the transaction as it appears in the blockchain, it is called the non-derived mapping. This is the case if the transaction wasn't a coinjoin to begin with.

The second is a derived mapping (21,12 -> 25,8 | 36,28.1 -> 50,14.1). In this case it was a coinjoin with 2 participants, as 2 sub transaction has been identified.

However there is another important analysis that can be done on this coinjoin. We can tell what is the probability of two inputs or outputs are in the same transaction:

Input match probabilities:
21 - inputs: 12(1) 36(0.5) 28.1(0.5) | outputs: 25(1) 8(1) 50(0.5) 14.1(0.5)
12 - inputs: 21(1) 36(0.5) 28.1(0.5) | outputs: 25(1) 8(1) 50(0.5) 14.1(0.5)
36 - inputs: 21(0.5) 12(0.5) 28.1(1) | outputs: 25(0.5) 8(0.5) 50(1) 14.1(1)
28.1 - inputs: 21(0.5) 12(0.5) 36(1) | outputs: 25(0.5) 8(0.5) 50(1) 14.1(1)

Output match probabilities:
25 - inputs: 8(1) 50(0.5) 14.1(0.5) | outputs: 21(1) 12(1) 36(0.5) 28.1(0.5)
8 - inputs: 25(1) 50(0.5) 14.1(0.5) | outputs: 21(1) 12(1) 36(0.5) 28.1(0.5)
50 - inputs: 25(0.5) 8(0.5) 14.1(1) | outputs: 21(0.5) 12(0.5) 36(1) 28.1(1)
14.1 - inputs: 25(0.5) 8(0.5) 50(1) | outputs: 21(0.5) 12(0.5) 36(1) 28.1(1)

For example input with value 21 and input with value 12, there's 100% chance they are in the same sub-transaction, however input 21 with output 50, there's only 50% chance that they are in the same sub-transaction.

Example 2: Output for 2,3,4->4,5

For completeness here's the output for the numbers that were present in the question.

Sub mappings:
2,3,4 -> 4,5
2,3 -> 5 | 4 -> 4

Input match probabilities:
2 - inputs: 3(1) 4(0.5) | outputs: 4(0.5) 5(1)
3 - inputs: 2(1) 4(0.5) | outputs: 4(0.5) 5(1)
4 - inputs: 2(0.5) 3(0.5) | outputs: 4(1) 5(0.5)

Output match probabilities:
4 - inputs: 5(0.5) | outputs: 2(0.5) 3(0.5) 4(1)
5 - inputs: 4(0.5) | outputs: 2(1) 3(1) 4(0.5)

Background

Our basic building block is partitioning, so in order to understand the algorithm you must understand partitioning first.
While understanding what the Bell Number is, not essential to understand the algorithm, it is essential to understand the limitations of this algorithm.

Definition of Bell Number

The Bell Number is the number of partitions of a set.

Examples

Empty Set

Set:

Partitions:

Bell Number: 1

Set with 1 element

Set:

a

Partitions:

a

Bell Number: 1

Set with 2 elements

Set:

ab

Partitions:

ab
a b

Bell Number: 2

Set with 3 elements

Set:

abc

Partitions:

abc
ab c
ac b
bc a
a b c

Bell Number: 5

All Bell Numbers

1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, 678570, 4213597, 27644437, 190899322, 1382958545, 10480142147, 82864869804, 682076806159, 5832742205057, ...

Application to CoinJoin

Given a transaction with 100 inputs, assuming brute forcing, one would need to iterate through Bell Number of 100 elements number of partitions in order to find valid partitions. The Bell Number of 100 elements is 47585391276764833658790768841387207826363669686825611466616334637559114497892442622672724044217756306953557882560751.

Non-Optimized Algorithm

First we need to iterate through all the input and output partitions.

foreach (var inputPartition in inputPartitions)
{
    foreach (var outputPartition in outputPartitions)
    {

Then we need to iterate through all parts of the input partition and find out if we have corresponding output partition part:

foreach (var inputPartitionPart in inputPartition)
{
    var foundValidOutputPartitionPart = remainingOutputPartition.FirstOrDefault(x => x.Sum() == inputPartitionPart.Sum());

If we find such valid output partition part, and we also only find valid parts when comparing the remaining parts, then we found a valid mapping.

The Code

For reference the relevant codeblock looks like this. You may notice I made some optimizations to make it less painfully stupid.

var outputPartitions = Partitioning.GetAllPartitions(outputs.ToArray());
var inputPartitions = Partitioning.GetAllPartitions(inputs.ToArray());

foreach (var inputPartition in inputPartitions)
{
    foreach (var outputPartition in outputPartitions.Where(x => x.Length == inputPartition.Length))
    {
        var remainingOutputPartition = outputPartition;
        var validPartition = true;
        var subSetsBuilder = new List<(IEnumerable<decimal> inputs, IEnumerable<decimal> outputs)>();
        foreach (var inputPartitionPart in inputPartition)
        {
            var foundValidOutputPartitionPart = remainingOutputPartition.FirstOrDefault(x => x.Sum().Almost(inputPartitionPart.Sum(), Precision));
            // https://www.comsys.rwth-aachen.de/fileadmin/papers/2017/2017-maurer-trustcom-coinjoin.pdf
            // input partitions that include a set
            // with a sum that is not a sub sum of the outputs cannot
            // be part of a mapping
            if (foundValidOutputPartitionPart is null)
            {
                validPartition = false;
                break;
            }
            else
            {
                subSetsBuilder.Add((inputPartitionPart, foundValidOutputPartitionPart));
            }
        }

        if (validPartition)
        {
            var mapping = new Mapping(subSetsBuilder, Precision);
            mappings.Add(mapping);
            yield return mapping;
        }
    }
}

Discussion

Notice this approach has a benefit compared to the optimized version, that it does not use recursion.


The only way is to edit the json code in the wallet file and add the gap limit into it. You can do that using the command line tool jq:

jq ". + {gap_limit:100}" wallet_file


What does a double spend (CVE-2018-17144) look like if I gettransaction it?


Why Bitcoin core creates time locked transactions by default?

TL;DR: The aim is to discourage reorganizations and increase privacy.

In wallet.cpp, just above where nLockTime gets set, it says:

// Discourage fee sniping.
//
// For a large miner the value of the transactions in the best block and
// the mempool can exceed the cost of deliberately attempting to mine two
// blocks to orphan the current best block. By setting nLockTime such that
// only the next block can include the transaction, we discourage this
// practice as the height restricted and limited blocksize gives miners
// considering fee sniping fewer options for pulling off this attack.
//
// A simple way to think about this is from the wallet's point of view we
// always want the blockchain to move forward. By setting nLockTime this
// way we're basically making the statement that we only want this
// transaction to appear in the next block; we don't want to potentially
// encourage reorgs by allowing transactions to appear at lower heights
// than the next block in forks of the best chain.
//
// Of course, the subsidy is high enough, and transaction volume low
// enough, that fee sniping isn't a problem yet, but by implementing a fix
// now we ensure code won't be written that makes assumptions about
// nLockTime that preclude a fix later.

txNew.nLockTime = chainActive.Height();

// Secondly occasionally randomly pick a nLockTime even further back, so
// that transactions that are delayed after signing for whatever reason,
// e.g. high-latency mix networks and some CoinJoin implementations, have
// better privacy.

if (GetRandInt(10) == 0)
  txNew.nLockTime = std::max(0, (int)txNew.nLockTime - GetRandInt(100));

As Martin Habovštiak noticed, the sequence number is set to MAX-1 for every input. It's in the code just below the previously mentioned code section.


How do I detect a double-spend in real-time, like Bitpay?

If you want to detect a double spend, you need to listen to all transactions broadcasted to the network, and write some code to detect if the address that sent you Bitcoins also sends a transaction to another address (until 1+ confirmations).

To answer your other question, Bitpay cannot guarantee the transactions not to be double spent. In an effort to promote usage of Bitcoin as a payment solution, they take on the risk of a potential double spend, and if one happens, they eat the balance (no risk to the merchant). This is a vanishingly small occurrence in practice, so any fees (or venture capital) paid to them more than cover that possibility.


You can do this with the seedrecover.py script in btcrecover

You will need to have the master public key (xpub), a receiving address generated from the seed, or an addresses database.  seedrecover.py will then check all the seed variations to see if they derive the specified key or address.


I. This is almost correct. The only difference is that you still need the χ suffix mentioned in the paper, which includes the most recent |χ| = k blocks of the blockchain. This is because the “last block” is not stable and may be withdrawn (in case another block of the same height happened to be mined at a similar time). You can only deduce the “current” balances as of k blocks ago.

II.
 a) This is correct.
     b) The predicate “Q” is application-specific. In your case, it could be, for example, a statement that the balance of a specific account holds a certain amount of money at a certain point in time. i.e. Q would be that “Alice holds 5 Ether at block #4,000,091”.

III. This is correct. Generally, unless there is a serious attack against the whole blockchain, this property will not fail to hold (for appropriate δ).

IV.
a) Yes.
b) c) You are correct. The C↓↑µ−1 should in fact be C’↓↑µ−1 instead. I have corrected the error and we will update the paper in the newest version. Many thanks for pointing this out!

Answer credits: Dionysis Zindros


Why did this empty transaction block get awarded 25 bitcoins?

The block reward is the block subsidy plus the fees from transactions. The block subsidy is 25 BTC, and will be for 3 years.

While mining a block without transactions isn't in the spirit of Bitcoin, and doesn't have much point, it is allowed.


How can I get the input addresses of a transaction in Java?

You should get the list of inputs, this is a snippet code using BitcoinJ to get input and outputs addresses:

List<TransactionInput> inputs = tx.getInputs();
List<TransactionOutput> outputs = tx.getOutputs();

for (TransactionOutput out : outputs) {
   System.out.println("addresses in output " + out.getAddressFromP2PKHScript(params));
}
for (TransactionInput in : inputs) {
    System.out.println("addresses in input " + in.getFromAddress());
}


if a coinbase reward isn't fully spent, can the coins ever be recovered?

No, the remainder of the reward is lost.

The bitcoin protocol includes a check which rejects a block that claims a bigger reward than 'current block reward + transaction fees'. Thus, inevitably follows that any rewards unclaimed in the coinbase transaction cannot be claimed at a later time.


All blocks have a field for their 'difficulty'. This is a parameter that determines how many hashes have to be calculated (on average) before you find a block. Higher difficulty means the block will be harder to solve.

  How can a block be considered more difficult to solve/hash than another one?

Think of it like flipping coins, where the difficulty number is the number of Heads you have to flip in a row. So, With difficulty 8, you have to get 8 heads in a row, etc. Difficulty 9 is harder than a difficulty 8.

This difficulty number is used to increase/decrease the number of blocks solved on the network, according to very specific rules, in order to keep blocks solved at an average of 10 minutes. If the network is solving too many blocks, say a block every 9 minutes on average, then the network will increase the difficulty. Similarly, if the network is only solving blocks every 11 minutes at the current difficulty, then the difficulty is lowered. This re-adjustment process happens every two weeks in Bitcoin.

The tricky part is what can happen if a fork takes place at the same time as the difficulty adjustment. Let's say our blockchain looks like this:

                X_8
              /
-> X_8 -> X_8
              \
                X_8

(Where 8 is the difficulty of each block). Since the top fork and the bottom fork have different time fields in their block header, they result in a different difficulty re-adjustment calculation (difficulty re-adjustment is based on number of blocks in a given time, trying to keep it at a block per 10 minutes). Now the next blocks on either side of the chain, which have the newly calculated difficulties, at not given the same weight.

                X_8 -> X_9
              /
-> X_8 -> X_8
              \
                X_8 -> X_7

Since the difficulty re-adjustment in the top fork ended up with a higher difficulty, any block solved on that half of the chain (X_9) will override a block solved on the bottom side of the fork (X_7). However, if X_7 had been solved significantly before the X_9 block, then that would be the chain with the most work (8 + 7 on the bottom chain is better than just 8 on the top chain).

The network essentially looks for the chain of blocks with the highest sum of difficulties, i.e. the chain that took the most work to produce, and would be the hardest for an attacker to try to override. Nodes on the network choose this highest-difficulty-sum chain as their correct chain, and the great thing about this is that when everyone follows the simple rules, they arrive at consensus about the history of transactions.

  Does it have to do with the number of transactions it contains?

No.


The reason you pre-generate some forward keys is to avoid the situation you describe, if you only looked ahead one you risk missing a transaction in the current block (the order of the transactions in the block are unrelated to the order of your keys).

The term "gap limit" refers to a parameter of non bloomfilter SPV clients which do look ups by querying an address based index on a remote peer. The gap limit is the end stop of the current wallet state, when the scanning wallet sees 10 empty address results in a row they decide that's probably the last used address in the wallet and give up generating further. If there wasn't a gap limit in place they would search unused addresses until the end of time (or 2**128, which ever came first).


Why would running a light node riskier and subject to more frauds than a full node? We don't NEED a full ledger, do we?

First, we can verify or validate the transaction on the website. I don't understand why do we need a full blockchain if we are not mining.

What website? There's no website that defines the blockchain. All blockchain explorers just show the information. If you are relying on a website to check that your transaction is valid, then that is a central point of failure. What if whatever website you are using mistakenly says an invalid transaction is valid? Do you just blindly trust the website? This has happened many times in the past, especially with blockchain.info.
The whole point of the blockchain is to remove central points of failure and to remove trust in third parties. Relying on a website to tell you what is correct defeats that purpose.

Second, doesn't miner verify the transactions before including into the block? In addition to that, the process of validating the block served like a double validation?

Miners are supposed to verify transactions before including them in a block. Just because they are supposed to verify does not mean that they actually do. Just accepting a transaction that has been included in a block does not guarantee that the transaction is valid. What if a miner included an invalid transaction?
Again, the point of a blockchain is to remove trust in third parties. By trusting miners to have validated transactions, you are trusting a third party. Verifying a block after you receive it from someone else removes that trust in a third party because you yourself has checked that the block is valid.

Third, when the block is added to the network, isn't it a third validation?
Forth, when the block has several more confirmations, isn't that a forth validation?

Kind of (to both). But again, you yourself are not verifying the blocks if you are not running a node. You are trusting that someone else has verified the blocks. That is trust in a third party, which is what the blockchain is designed to avoid.

A light node, although doesn't have the full ledger since the genesis block, keeps a section of the most recent blocks, isn't that sufficient?
Why would a light node be riskier?

No. If I had sufficient hash rate, I could produce a block that has an invalid transaction and send it directly to your light node. This block with the invalid transaction that spends a nonexistent input and could be something that defrauds you. If you have not verified the entire blockchain and constructed the UTXO set, then you do not know that the transaction is invalid because it spends an nonexistent input. You cannot verify this for yourself. You are trusting a miner that the transactions is valid. This is riskier because you could inadvertently accept an invalid transaction and thus lose money.

Realistically, what are the chances of receiving incomplete or invalid blocks?

Pretty low. But the whole point of the blockchain is to remove centralization and trust in third parties. By using a light node, you are now trusting third parties and this increases your risk for being defrauded.


When you make a Bitcoin transaction, can the receiving person (and the world?) really see how much coins you have in the entire wallet?

No, you will not disclose the entire amount of your wallet when you make a payment, but effectively you can disclose some info on your bitcoin.
Your wallet has several addresses and each one can have received one or more payment, once you receive a payment this amount will become an UTXO (unspent transaction output) which you can use to make a payment later;  so you will have some UTXOs in your wallet and when you pay you must spend a full UTXO (the amount you received in a earlier payment) not the whole wallet.
For example, if you have received four payment to four different addresses (0.3, 0.04, 0.61, 0.05 - wallet total balance 1 btc)  and you must pay 0.2 btc, you will use an UTXO that is greater than requested amount, in our example 0.3 btc UTXO (but you can pick also 0.61). So you will make a transaction with one input (0.3 btc) and two output: 0.2 btc for the payment and 0.1 as change that you receive on a new address.
In this case you will disclose to your counterpart (the only one who know that this address is your) that you have at least other 0.1 btc but not the wallet balance.
Any other that see this transaction on blockchain can't know that this address is your and maybe can't even distinguish payment from the change, depending on how the transaction is made.
This is the most simple situation and the one in which you reveal less info, there are other factor that can reveal part of your holdings (i.e. if you use the same address to receive multiple payments, when you spend from that address, you will disclose the whole amount on it,  not only the UTXO you pick) but Bitcoin privacy is not so simple that can fully explained here.
You can read more here:
https://bitcoin.org/en/protect-your-privacy
https://en.bitcoin.it/Privacy


How do SPV (simple payment verification) wallets learn about incoming transactions?

You are right that SPV as described in the Bitcoin paper does not explain how to discover payments to yourself, without downloading full blocks. My guess is that Satoshi either planned to develop this later, or that he assumed you'd just be told about payments to yourself (pay-to-IP, as existed next to pay-to-pubkeyhash as is used now).

Practical implementations of SPV nodes today however use a protocol extension called bloom filters, described in BIP 37. They use getheaders to fetch block information prior to their wallet's birth timestamp, and request filtered blocks afterwards. To do so, they submit a bloom filter that describes the addresses and transactions they are interested in to the peer. The peer then only includes the relevant transactions in blocks it submits, together with their Merkle paths to prove that these transactions were indeed part of said block.


Possibility to retrieve BIP39 mnemonic (24 words English dict) from BIP39 (hex) seed?

This is not possible.
The seed words are converted to the hex seed through a process involving a one way hashing operation - it is not possible to go the other way.
That said, as long as your hex seed is the tree root, keeping that safely would allow you to access all your coins, although it would make importing it into a wallet somewhat difficult.


blockchain.info's recovery phrase is a BIP 39 phrase. They use BIP 32 derivation and BIP 44 derivation paths IIRC. This means that you can use the recovery phrase to import your blockchain.info wallet into any other wallet that also support BIPs 32, 39, and 44. Since it uses BIP 32, you will have access to all of the private keys that you used on blockchain.info.


The original USB cable supplied was faulty?? After I plugged it into another USB port just above it started to kick in but went ZOMBIE after a few seconds with USB Communication error??

I took another USB cable from my old 10xErupter Mega hub. Plugged it direct into the motherboard USB slot and U3 (also shorter cable).  cgminer started to do all kinds of weird settings until it settled down on AU3.

Using the official git, I compiled cgminer (This also works for Raspberry Pi)

CFLAGS="-O2 -Wall -march=native" ./configure --enable-icarus

NOTE: Since version 4.9.0 you should not need to use any au3 switches

After that I set cgminer to --au3-freq 238 --au3-volt 780 Allot of people say that when you go higher than 780 with the stock 6A power supply it melts in about 10 hours.

So when I get round to using my computer PSU I will clock these at 250/800 as recomended for best speed stability.


Bitcoin Address Workflow on Spend Leftovers

It appears that the wallet moved my funds to a new address in my wallet.

That is normal and desirable behavior.  See How does change work in a bitcoin transaction?

  Should a wallet always move the left over from m/49'/0'/0'/0/x to m/49'/0'/0'/x/0?

This wallet is using BIP 49, which extends the hierarchical wallet organization described in BIP 44.  General standards for hierarchical deterministic wallets are described in BIP 32.  You'll want to read these carefully if you are implementing your own wallet.

Under BIP 44, the fourth level of the derivation path is to be 0 for "external" keypairs (those presented to the user as a receive address which she may send to a payer), and 1 for "internal" keypairs (to be used as change addresses).

  Constant 0 is used for external chain and constant 1 for internal chain (also known as change addresses). External chain is used for addresses that are meant to be visible outside of the wallet (e.g. for receiving payments). Internal chain is used for addresses which are not meant to be visible outside of the wallet and is used for return transaction change.

BIP 32 specifies something similar:

  Each account is composed of two keypair chains: an internal and an external one. The external keychain is used to generate new public addresses, while the internal keychain is used for all other operations (change addresses, generation addresses, ..., anything that doesn't need to be communicated). Clients that do not support separate keychains for these should use the external one for everything.

So it is in keeping with this standard that an external keychain address .../0/x was used to receive your coins initially, while the internal keychain address .../1/y was used for the change from your outgoing transaction.  (It's just a coincidence that x and y were both 0 in this case; it would normally just be the next unused value on each chain, but since you hadn't done anything else with the wallet, you got the first keypair on each chain.)


LocalBitcoins is a service that allows you to trade BTC with real money. The difference between it and other exchanges is that LocalBitcoins staff themselves don't buy or sell, but its users set their trading fee, price, and the currency, and to buy or sell bitcoins the site allows you to find a merchant-user.

A local Bitcoin does not exist. The BTC blockchain is a whole and only meaningful if it's together.


Is there a paper wallet for all crypto-currencies?

Essentially yes. Paper wallets are just storing the private key in written format, and you can encode just about any data into a QR code. The limitations to this would be centralized alternative coins where users are unable to hold their own keys.


Exhaustive technical explanation of signing & verification

This should get you started on public key verification: **Digical signature

In essence, the bitcoin address is the public key.  A hash is created of the transaction and this value is then encrypted using the private key that is known only to the owner of the bitcoin address.  Anybody can then use the public key (the bitcoin address) to decrypt this hash value and determine that the transaction has not been modified by creating a hash of the transaction and then comparing it to the decrypted value.  This serves a two-fold purpose: it protects against transaction modification and it proves that the transaction creator has access to the private key for the bitcoin address.


Expect more delays until you start paying reasonable transaction fees. This site can help you:

https://bitcoinfees.21.co/


Bech32 encoding, apart from the checksum, is a simple matter of converting base-256 (8-bits) to base-32 (5-bits). Base-256 is the byte array (octet string) that you get from a hash function. Only focusing on first 3 bytes of the hash:

as hex    = 0x18     0x63     0x14
as bytes  = 24       99       20
as binary = 00011000 01100011 00010100

In order to convert the above base-256 (8-bits) input to base-32 (5-bits) we start from the most significant bit and select 5 bits at a time until we run out.

12345123 45123451 23451234 ...
00011000 01100011 00010100
(00011) (00001) (10001) (10001) (0100 ...

For a bech-32 address there is an extra step here after the base conversion is done. That step is to append of the "witness version" to the beginning of this group as an already converted value in base-32 (since witness version is defined from 0 to 16 inclusive it is already in range).

[00000] (00011) (00001) (10001) (10001) (0100 ...

This final result can be converted to an array of numbers that are between 0 and 31

0, 3, 1, 17, 17

To convert this "number" array to human readable format we print the corresponding character from the bech32 charset (qpzry9x8gf2tvdw0s3jn54khce6mua7l)

0->q, 3->r, 1->p, 17->3, 17->3 ...

P.S. There is a checksum calculation that I skipped to keep it simple but it is just another appended set of 5-bit values at the end of what we have in last step.


No, a mobile device cannot mine bitcoin.

These days, mining bitcoin requires specialized computer hardware called ASICs. They are loud and hot, and incredibly efficient at computing the SHA256 mining algorithm. A mobile device is not like this at all, it is not optimized to compute SHA256, it is meant to be a general-purpose device. Trying to mine bitcoin using a mobile device would be a literal waste of money (electricity), and you would receive no bitcoin in return, because your device would not contribute a meaningful amount of hashpower to the network.

The app is likely malicious, I would remove it from your device.


This question is a complicated one, but I'll see what I can do to answer it. Also, I won't try tackling the issue of endianness, as in the case of Bitcoin it gives me a headache...

First, lets see what we have in a block header given to us by getwork. Lets take the Genesis Block for an example.

01000000 - version
0000000000000000000000000000000000000000000000000000000000000000 - prev block
3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A - merkle root
29AB5F49 - timestamp
FFFF001D - bits
00000000 - nonce (it will be set to 1DAC2B7C later)
00 - number of transactions (always 0, this is the block header)
0000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000 - padding

In order to calculate the midstate, we split the header into two parts that are accepted by SHA algorithm (64 bytes each):

0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA
4B1E5E4A29AB5F49FFFF001D00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000

We load the first part into the SHA algorithm. We take save this state for later use (midstate) (sorry for lack of examples, but I don't have my hashing algorithms on hand). Then we load the second part into the SHA algorithm. We read the output, this is the first hash. We take that output, plug it back to a new input, and get its result. That is the second hash. Assuming we got the correct nonce (in our case - 1DAC2B7C), our result should look something like this:

000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

and compare it to our target:

00000000ffff0000000000000000000000000000000000000000000000000000

Taken as a number, which is bigger? The target. This means that we have the correct nonce, and we can submit our full header as the result. Profit!

From what I understand, you tried to break up the resulting numbers too much, instead of operating on really big numbers like Bitcoin appears to be doing. Then again, endianness is also a big problem with the protocol and what not...

I hope this answers your problem.


You cannot request this information, because it does not exist.

There is no central registry of nodes, nor do they have identities to begin with. Full nodes do maintain a database of IP addresses of peers they now about, but that is not, and is not intended to be, a comprehensive list of all nodes on the network.

The closest that exists are network crawlers who ask around for IP addresses and try connecting to them (some DNS seed report results based on crawler information), but even that is only an approximation, and can only discover nodes that are reachable. The vast majority of full nodes only make outgoing connections.


Making a transaction

When you make a new transaction sending Bitcoins, you broadcast the transaction to the peers you're connected to, then they send it on to their peers, etc.  There's no way for anyone to know for sure whether you created a transaction they get from you, or whether you're just relaying a transaction you received from someone else.

If I was able to connect to all the peers in the network then it's likely that the first one to send me a transaction is the one who created the transaction, but that's not certain, and it's also not possible to connect to all the peers.

Receiving a transaction

When someone sends Bitcoins to your address, your client isn't involved at all.  You don't even need to have your computer turned on to receive Bitcoins at your address.  So there's no way anyone can find your IP address when you receive Bitcoins.


How to transfer bitcoins from one Currency to Another from Brazil

You both need to have bitcoin wallet and know each other BTC address.

If you both have both bank accounts in each country it makes easy.

Buy BTC in your country with BRL.
Send BTC to the person living anywhere in the world.
He can convert his bitcoin against EUR via lobalbitcoins, exchanges or ATM in some cities.
Converting bitcoin to EUR might not be easy. Exchanges will require verification documents. If he can contact persons or go to an bitcoin ATM machine, that will probably not require verification process.


Re-insalling Bitcoin Core without re-downloading blockchain

Since you downloaded the blockchain onto an external drive, you do not need to redownload the entire blockchain. When you start Bitcoin Core for the first time, it will ask you to choose the data directory. Just choose the folder on your external drive which contains the blockchain data. That folder should have a folder named "blocks", a folder named "chainstate", a file named "wallet.dat", a file named "debug.log" and a few other files.


Does a Bitcoin node need to scan through the whole blockchain in order to be 100% sure that a transaction sent to it is genuine?

Yes. It doesn't have to do all the work when it receives the transaction, of course. If it's in sync with the network, it's already scanned the whole blockchain.


Is it normal not to see my sending/receiving addresses while the bitcoin client is syncing?

1)

No.

Receiving addresses are not shown because they are intended to be used only for a single payment. The practice of reusing addresses weakens your privacy, but also that of others in the system who you interact with.

It is possible to see the receive addresses that were created in the past, but you need to explicitly check the address reuse box in the receive payment tab.

2)

You can move the wallet.dat file when Bitcoin Core is not running. You can also copy to make a backup, but realize that the backup will need to be recreated every 100 incoming payments (this will change in 0.13, where a backup will be permanently valid). Do not actually use copies of a wallet from multiple locations at once.


How much computing power is required to bruteforce a Litecoin private key in reasonable time?

How much computing power is required for that?

The computing power required to brute force private keys is incredibly immense, so much so that the human mind cannot consider its largeness.

Let's assume that you have a processor (say an Intel Xeon) that can perform 1 Trillion key guesses per second. The number of keys possible (and thus the number of keys that you would have to guess in order to guess a private key) is 2^256. With 1 trillion guesses per second, that single processor will take 3.671743 * 10^57 years, which is  2.7 * 10^47 times the age of the universe.

Now if you wanted to have enough processors to get a "reasonable" time frame of 1000 years, you would need 3.671743 * 10^54 processors. With Intels biggest Xeon Platinum chips at 7.6 cm X 5.6 cm, this many chips would take up 1.564162518 * 10^55 Square Meters just to lay them all out (not even on motherboards or the rest of a computer required to even have these processors be useful). With this much area, you could cover the Sun 2.564 * 10^36 times.

Even with more efficient ASICs and processors that can do more key guesses per second, the immense-ness of these numbers makes it so that the numbers barely change; they are still incompreshensibly large.

  Does any hardware exist which can find a matching private key in, say, a year?

No, if there were, then Litecoin's signing algorithm would be considered broken.

  Is it possible that it ever becomes cheap enough to bruteforce Litecoin addresses, i.e. it costs less money than one can steal from the address once the key is found?

It is possible, but not through brute force. Making it cheap enough requires a cryptographic break. Currently, the only known solution to finding someone else's private key besides brute forcing is to use a quantum computer with several thousand qubits. Such computers do not yet exist.


How to take advantage of the free transaction relay policy?

By simply adding addnode=68.168.105.168 to your bitcoin.conf file then any transaction you send will automatically be broadcast and eventually make it into a block. No one but you has to add this node and nothing special needs to be done beyond this one configuration.

Now it may be true that the bitcoin-qt client will not actually allow you to send a transaction that is against its own rules, I'm not sure as I've never tried, but if this is the case you will need a non-standard client which is another question entirely.

Note: May 2015, 68.168.105.168 is the only Eligius relay IP I can find that's active


Yes, it is possibly, but not probable, or in other terms, extremely rare. There'll be maximum 2^160 addresses, which is much more than the number of addresses that are used. See this.


Why do we need two different formats of WIF (wallet import format)?

Wallet software needs to know whether to search the blockchain for an address generated from a compressed public key or not. The encoding of the private key signals which type should be searched for.


There are two stages that affect double spending transactions.

Initially, when the transactions are unconfirmed, a node can't know which transaction was "the first" or the "double spend". Through a local policy it can pick either, usually the first it sees. But it might pick the other one depending on for example the amount of fee (Miners might prefer the highest fee).

As soon as one of the transactions is confirmed (6 confirmations to be sure), the other will be invalid. A Bitcoin node maintains an Unspent Transaction Ouput (UTXO) set. Whenever a transaction spends an output (of an earlier transaciton), that ouput is removed from the UTXO set and any outputs of the new transaction are added to the set.

A double spend transaction would be trying to spend an output that is not in the UTXO set and is therefore invalid.

The UTXO set is currently about 1 GB and is kept in memory, to make all the lookups very fast. There are optimizations in the works that would reduce this size. Although with larger Bitcoin adoption the UTXO set will also grow again.


Armory client shows transaction unconfirmed

You should launch it with the -rescan option, to rescan the blockchain for missed transactions and confirmations.


Many commands block the daemon from responding to requests, and during startup you'll not get responses while the node is initializing.


Generate new .onion address for bitcoind over tor

bitcoind will cache the private key used. It is located at in the onion_private_key file in your bitcoind data directory (default will be ~/.bitcoin/onion_private_key). Delete that file and you should get a new onion private key and thus a new onion URL.


What is the difference between deleting a private key and deleting an address?

An address can be generated from a private key. But you need to have the private key from the address to be able to spend it's funds.

So, when deleting the address, it will just be completely removed from your wallet. (Note that there is no such notion of "whether or not an address exists". All addresses exist, but if nobody owns a private key for the address, the balance will be unspeakable.)

When deleting the private key only, the address will still be in your wallet, but it will be watch-only. This means that you will see the address's balance in your account, but you won't be able to spend the funds unless you enter the private key again. The main reason to do this is for security. If you write the private key down on a piece of paper, f.e., you could delete the private key from your wallet so that a person that hacks into your wallet will not be able to spend the funds.


How to prevent a miner from stealing another miner's block?

A is protected by adding coinbase transaction with himself's bitcoin address.

from https://en.bitcoin.it/wiki/Block_hashing_algorithm

The body of the block contains the transactions. These are hashed only indirectly through the Merkle root. Because transactions aren't hashed directly, hashing a block with 1 transaction takes exactly the same amount of effort as hashing a block with 10,000 transactions.

The compact format of target is a special kind of floating-point encoding using 3 bytes mantissa, the leading byte as exponent (where only the 5 lowest bits are used) and its base is 256. Most of these fields will be the same for all users. There might be some minor variation in the timestamps. The nonce will usually be different, but it increases in a strictly linear way. "Nonce" starts at 0 and is incremented for each hash. Whenever Nonce overflows (which it does frequently), the extraNonce portion of the generation transaction is incremented, which changes the Merkle root.

Moreover, it is extremely unlikely for two people to have the same Merkle root because the first transaction in your block is a generation "sent" to one of your unique Bitcoin addresses. Since your block is different from everyone else's blocks, you are (nearly) guaranteed to produce different hashes. Every hash you calculate has the same chance of winning as every other hash calculated by the network.

Another expalatation from http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html

The diagram below shows the structure of a specific block, and how it is hashed. The yellow part is the block header, and it is followed by the transactions that go into the block. The first transaction is the special coinbase transaction that grants the mining reward to the miner. The remaining transactions are standard Bitcoin transactions moving bitcoins around. If the hash of the header starts with enough zeros[3], the block is successfully mined. For the block below, the hash is successful: 0000000000000000e067a478024addfecdc93628978aa52d91fabd4292982a50 and the block became block #286819 in the blockchain.

Structure of a Bitcoin block


I m using bitcore for stand alone rpc because it has many new indexes and new methods.

See this link https://bitcore.io/guides/bitcoin


You should use a new address for each transaction, likely generated from an BIP32 extended public key (your #2).

  I don't think this could be technically possible, as it is neccessary to derivate child key from master private key.

Extended public keys can be derived from a parent public key if the Chain Code (256 bits) for that parent extended public key is known. Merchants should give you an extended public key and chain code, and then you can generate a new address for them each time. Note that your system wouldn't have any risk of exposing private keys, as you would only be using BIP32 extended public keys.

For technical information on BIP32, visit https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki.