What are ASIC miners actually doing? I'm trying to understand Bitcoin mining (software-wise), and I wonder how ASIC miners are different? I'm going through this minimal Bitcoin miner Github repository.

Which part of Program.cs are ASICs optimizing (I guess Program.cs line 90)? Where can I read more about in-depth working of miners? Is there any documentation?

From trying to design my own ASIC---I got as far as having a simulated but not completely debugged Verilog implementation---I can tell you how mine would have worked. Whilst I have not checked, the design choices seem so obvious to me that I doubt anyone would do it differently.

The inner loop of the mining process is a double SHA-256 hash of data where only one 32-bit word, essentially a counter or "nonce", changes. It looks for a specific result where there are enough zeros in the right place after the second SHA-256 and only needs to output that counter value for which this is the case (if it is for any).

This inner loop is perfect for implementation in hardware: The SHA-256 is of reasonably low complexity, is itself a loop that can easily be unrolled and pipelined (there are 64 identical steps in each of the two applications after an optimization I'll describe later), and if the counter-loop is included in the hardware, then the required IO is very low, both in terms of actual data transmitted and in the sense that it can be very slow with negligible impact on overall performance.

In the source code you reference, the loop I am talking about constitutes the entire function FindShare (lines 85 through 107). However, let me explain that of the actual work, implemented in FindShare as Sha256(Sha256(Current)) in line 90, due to an easy and very common optimization, only half of the initial function call is executed. The first half can easily be moved outside the loop.

If you really want to know the details, then I should add that part of the first of the two SHA-256 runs that should be done for each counter value is identical for all counter values. Naturally that should be optimized, and removing it reduces the hardware complexity significantly. It is even removed from many software mining implementations (one protocol used for mining pools actually lets the pool solve that bit, passing only the intermediary SHA-256 data to the miners). So what remains for the ASIC is some I/O logic to get that intermediate SHA-256 data and then finish 2 applications of the SHA-256 hash algorithms on the resulting data, check the output (and output a signal if it corresponds to finding a block or solving a share in a mining pool), and iterate 2^32 times with the next counter value.

Because an ASIC is a really custom-made chip, and because SHA-256 is such a hardware-implementation-friendly algorithm, it is reasonable to generate one new double-SHA-256-hash every clock cycle from a much smaller area of silicon than it takes to make a general purpose CPU, which takes many hundred clock cycles for the same computation. Whilst in principle the same is true for FPGAs, the fact that their structure isn't quite what one would wish for to do fully unrolled, pipelined SHA-256 (the area-intensive more efficient method of choice for Bitcoin mining, but not typical for other applications and pre-mining ASIC cores for SHA-256) means that in many cost-effective FPGAs one struggles to fit a single fully unrolled double SHA-256, whilst an ASIC can easily accomodate many.


How Do I create a Mining Pool for an Altcoin? I made an altcoin using coincreator.net , but I can only mine it on an underpowered windows computer. I was wanting to make a pool so that my friends and I could mine it together from a Windows or a Mac computer. If no one knows how to do this, then could anyone tell me how to solo mine on a computer that does not have the altcoin wallet? Thanks in advance!

Check out MPOS, here is a guide to setting up an MPOS pool:

https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide

And, to answer your last question, it is impossible to solo mine standard coins on a single computer that does not have the alt coin wallet in question installed.


Unbreakablecoin - Block Height Stopped Moving I am running a full Unbreakablecoin (a Bitcoin clone) node.

Blocks were being generated every few minutes or so, until about a week ago. Now, the block height has been stuck at 82666 for multiple days. Also and all peers seem to have one thing in common: They have some reference to a single IP address of 71.71.215.6

Is this some sort of hack/attack? If yes, how is it being accomplished?

~ unbreakablecoin-cli getpeerinfo

[
    {
        "id" : 111,
        "addr" : "198.27.81.114:54022",
        "addrlocal" : "71.71.215.6:9336",
        "services" : "0000000000000001",
        "lastsend" : 1515125911,
        "lastrecv" : 1515125911,
        "bytessent" : 51777,
        "bytesrecv" : 52217,
        "conntime" : 1515032269,
        "pingtime" : 0.11530600,
        "version" : 70002,
        "subver" : "/Satoshi:0.10.3/",
        "inbound" : true,
        "startingheight" : 82666,
        "banscore" : 0,
        "synced_headers" : 82666,
        "synced_blocks" : 82666,
        "inflight" : [
        ],
        "whitelisted" : false
    },
    {
        "id" : 116,
        "addr" : "173.208.145.82:55264",
        "addrlocal" : "71.71.215.6:9336",
        "services" : "0000000000000001",
        "lastsend" : 1515125940,
        "lastrecv" : 1515125940,
        "bytessent" : 50453,
        "bytesrecv" : 51159,
        "conntime" : 1515033251,
        "pingtime" : 0.14900100,
        "version" : 70002,
        "subver" : "/Satoshi:0.10.3/",
        "inbound" : true,
        "startingheight" : 82666,
        "banscore" : 0,
        "synced_headers" : -1,
        "synced_blocks" : -1,
        "inflight" : [
        ],
        "whitelisted" : false
    },
    ...
    ALL PEERS HAVE "addrlocal" : "71.71.215.6:9336"
    ...
]

~ unbreakablecoin-cli getblockchaininfo

{
    "chain" : "main",
    "blocks" : 82666,
    "headers" : 82666,
    "bestblockhash" : "00000000000000010aacfc4d82170ae9e57854852f30f62d63393a64cab8d4b8",
    "difficulty" : 2079545789.81736517,
    "verificationprogress" : 0.89795278,
    "chainwork" : "0000000000000000000000000000000000000000000003a36f3a84fc39816ff7"
}

Also and all peers seem to have one thing in common: They have some reference to a single IP address of 71.71.215.6

That's unrelated. That should be your IP address.

Either you have become disconnected from the network or all miners have left the network.


Bitcoin Core Questions I am new to Bitcoin core and I put in my private key. Then I saw "synchronizing" that was a day ago. Can not find where the bitcoins are. What should I do? My knowledge is limited with software.

You can either wait until the synchronization is finished (at which point there will be quite a decent amount of storage space used by Bitcoin Core) or you uninstall Bitcoin Core if you don't want to synchronize the entire blockchain and use an SPV client instead.

Have a look at this table. It shows you how long it will take to get a certain wallet up and running and how much storage space it will need.


Why do we need bitcoins in the bitcoin network? I am new to the bitcoin world and I am just wondering why don't we simply use the US currency (or any fiat currency) to transfer money using the bitcoin network? Why do we need crypto currencies as a must to deal with that network?

Edit: why do we need (in the bitcoin network) to change our US dollers to bitcoins so as to be able to transfer our dollers to someone else? Or can we use the technology of the bitcoin network to transfer dollers without the need to convert the dollers to bitcoins, like what banks do?

You cannot transact physical goods digitally. If I have a physical dollar bill, I cannot magically turn that into something digital that I can send to you. I have to go to someone who will accept my physical dollar bill and give me digital dollar bills in return. Likewise, with my bank account, I need to convert my bank dollar bills into digital dollar bills that work on this other network.

Well now we really have three things that represent the same value: physical dollar bills, bank dollar bills, and digital dollar bills. At this point, the only thing holding them together is the fact that they all have the same value. But they can only have the same value if some central authority is dictating that all of these have the same value.

Suppose the digital dollar bills were created by some independent entity which is not influenced by the same entity that enforces that a physical dollar bill and a bank dollar bill are equal in value. Well now we have digital dollar bills which have a different value; it is now its own currency. It has its own digital tokens which have their own value. And thus we have Bitcoin, a digital token which has its own value independent of any other currency.


Is BitCoin controlled by China? Recently, the CEO of Ripple stated that more than 50% of the BitCoin miners are in China, therefore, were the Chinese
government to interfere, they could control BitCoin (I assume via a 51% attack, I didn't check details).

"“I’ll tell you another story that is underreported, but worth paying attention to. Bitcoin is really controlled by China. There are four miners in China that control over 50% of Bitcoin,”"

Is it true that 4 Chinese miners can control all of BitCoin?

Here is Blockchain.info's chart showing the current estimated distribution of the bitcoin network's hashrate.

Keep in mind: some pools are composed of many individual miners, so in the event of an attack, those individuals may simply redirect their hashpower to a different pool that is not involved in the attack.

In general, controlling the hashrate is not equivalent with 'controlling bitcoin'. If a single entity got control of 51% or more of the hashpower, then they could launch a 51% attack, meaning they could censor transactions. This is an existential threat to the network, but many developers have proposed countermeasures such as a POW change in the event such a thing ever happens.


What exactly is the definition of a Bitcoin node? This page claims there are about 11k nodes in the Bitcoin network. I wonder what exactly constitutes a "node" in the network. For example, if I connect to the network and do nothing, am I still considered in this 11k figure? Or do I have to have an "effect" on the network in some ways, e.g., broadcasting empty blocks or trying to mine honestly.
Another question is do mining pools, as a whole, count only as a single node in the network?

In general, what's the precise definition of a node in the context of Bitcoin network ?

A node is a computer that has a copy of the blockchain (or at least a part of it), and broadcasts and receives transactions and blocks from other nodes according to the bitcoin protocol.

The blockchain is more than 100GB, so most people use a lightweight client that connects to a service that connects to a node on the network. Clients are not considered nodes on the network.

A couple of specific examples of each type:

Bitcoin Core or Armory run full nodes on the network.
Mycelium or the Trezor Wallet are clients that connect to a server, not directly to the bitcoin network, and aren't included in the count.

The computers in a mining pool do not need to connect to the network so do not count as nodes (they are only solving a cryptographic problem and don't care about the transaction data). The mining pool will have at least one node that connects to the network to download and broadcast the transaction data, so the number of nodes in a pool depends on how many the maintainers of a specific pool decide to activate.


Can someone saturate the network? Suppose I have 2 wallets and 1 bitcoin and I write a program to make transfers of 1 satoshi from one wallet into the other.

Now suppose I have 100 bitcoins. Wouldn't that saturate the network?

Your transactions would be given the lowest priority as they are not paying fees, also if anyone is actually marginally successful in spamming the system it is entirely possible that the larger pools will simply not take their transactions, in fact some pools do filter out some transactions. This thread shows some of the restrictions that some mining pools already have.


I am looking for a reliable and low cost way to make loan repayments from Asia to the US. Are there any banks in the US that will acept Bitcoins? I'm looking for a reliable, low cost, transparent and efficient way to make monthly loan repayments from Asia to the US each month. Are there any banks in the US that will accept bitcoins?

So, I'm wondering: A) whether it is possible to translate Bitcoin to US dollars and B) whether any of the banks in the US accept and use them (yet)?

Are there any other apparent options to solve my problem?

"Translating" a Bitcoin to a US dollar is selling it. There are plenty of services that will sell your Bitcoins, including Coinbase, Kraken, and Bitstamp. You just need to find one that will do what you want with the US dollars after they've sold them.


BTC/USDT trading on binance I have an account on binance and i would like to trade on the platform in the BTC/USDT market. However something does not add up to me.

Lets say at 1100 HRS 1 BTC = 6154 USDT and at 1200 HRD 1 BTC = 6180 USDT

I should therefore be having more bitcoins if i sell when 1 BTC = 6180 USDT but this does not seem to be the case. I have attached the graphic to demonstrate what i mean.

What is exactly happening here?

What your screenshot is showing: You have set the amount of USDT to 30 in each case, so at the higher price, you will need to sell less BTC in order to get 30 USDT. This is different than setting the amount to a constant amount of BTC in both cases, and seeing the difference in USDT.

The math in your example:

(1 BTC/6180 USDT)(30 USDT) = (0.004854.. BTC)

(1 BTC/6154 USDT)(30 USDT) = (0.004875.. BTC)

The math, assuming you're buying/selling 0.005 BTC at the prices listed:

(6180 USDT/1 BTC)(0.005 BTC) = (30.90 USDT)

(6154 USDT/1 BTC)(0.005 BTC) = (30.77 USDT)


How do you generate a QR code for a not so popular coin? I'm running a the datacoin-qt client and was wondering how do you generate a QR code? This is relatively a new coin and I can generate an address, but I'm not sure where I can goto to generate a QR code for this.

Do you want to just generate the QR code for one time use, or include the code generation into a program? If the latter you can use this for javascript: http://larsjung.de/qrcode/


Reading transactions from blk*.dat files I'm reading through each blk*.dat file in order.

As I'm reading through each transaction, is it possible that I will read a transaction that is referencing an output (as an input) that I haven't encountered yet?

For example:

|--------|
| header |
|--------|
| tx1    |
| tx2    | <- This transaction is referencing inputs I haven't encountered...
| tx3    |
| tx4    | <- ...because the outputs are created in this transaction.
| tx5    |
|--------|

Furthermore, if this is true, it possible that the required inputs will be found in a transaction in a future block (and not just in a transaction further down the current block)?

Yes, it is possible.

According to Order of transactions within a block, transactions within a block must be listed in the "correct" order: a transaction may only spend outputs of transactions listed earlier in the same block, or in previous blocks.

However, blocks do not necessarily appear in the blk*.dat files in their proper order, but rather in the order in which they were downloaded.  If A,B are two blocks, and the prevBlockHash of B is the hash of A, it's still possible that B appears before A in the file.  In that case, a valid transaction may reference outputs from a transaction that appears later in the file, though earlier in the block chain.

It's also worth noting that blk*.dat can contain orphaned blocks.  So you may find two different transactions in the blk*.dat files that spend the same input.  You'll then have to determine which of them is in a block that is part of the longest chain (measured by total work), and which is on an orphan side chain.


How to buy using Kucoin? I want to buy a crypto-currency from Kucoin but there isn't any option like buy using card only options are exchange from coin  A to coin B. How to buy now ?

many exchanges are only cryptocurrency-to-cryptocurrency-exchanges. that means: you must buy bitcoin at any other place and then you can deposit it on kucoin, exchange it to another cryptocurrency and withdraw it. you can not pay with fiat-currencies (and you can not deposit/withdraw fiatcurrencies) on this exchange.


Preventing transaction fee collusion between large miners What would prevent the largest Bitcoin mining pools (top 3-4 have with 61-73% hash rate today according to link below) from colluding to demand much higher transaction fees to confirm transactions?

https://blockchain.info/pools

My question is somewhat theoretical and I am aware that many smaller pools would naturally oppose this. However even if transactions get confirmed by smaller pools eventually, when the majority of the hashing power is colluding to only accept high fee transactions, then the delay for confirmations of low fee transactions will be very significant.

Some countries have laws that may prevent this type of collusion, so please assume for the purposes of this question that the colluding parties are either in jurisdictions that do not regulate this or the pools operators cannot be identified.

In theory, preventing this problem is why miners exist in the first place. The sort of collusion you're describing can more generally be described as censorship: miners jointly deciding to delay certain transaction unreasonably long (up to indefinitely).

Ideally - and I'm well aware that reality is quite different now - the mining ecosystem is reasonably easy to enter for anyone, including people who feel they are being censored.

This is the difference - and the only difference - between using Proof-of-Work as a consensus mechanism and using a traditional (centralized) distributed consensus mechanism: anyone can enter, without asking anyone for permission (even anonymously). If we were fine with the set of existing mining pools to never change, we could replace it with a permissioned system.


Unconfirmed Transactions Please help It has been more than 48 hours and my transaction is still unconfirmed. I'm using Blockchain wallet for awhile now and this has been the first time happening. I was wondering what is happening?
https://blockchain.info/tx/f7bc86411b86473f5b33a15d61804e57652a7efceed6ddd5f1d64df076467cfe

Fee is not very high (considering the period) but it's a bit strange. After 72 h many miners drop transactions from their mempools. You may try to contact Blockchain, here's the ticket page link:

https://support.blockchain.com/hc/en-us/requests/new

The fee is chosen automatically by Blockchain, so you can underline it's not your fault.

But for the future, remember you can choose the fee you want selecting Advanced:

Here you can find hints on the best value:

https://bitcoinfees.21.co/

And I suggest you to google these terms, so that you can make suggestions to the Blockchain's staff and look cool, and, most important, you'll learn a lot (as I just did in the past hour)

Opt-in Replace-by-fee
Full replace by fee
Child Pays for Parent

These are all methods to unblock a transaction by rising the fee, but only Blockchain can do something.

Last but not least, your transaction may be confirmed by a nice miner.

Hope this helped!


How to Create Seed Node for Cryptonote Fork I have fork Cryptonote and made .rawiumd, and recompiled it successfully on Google Cloud computing.
I have created another 2 instances in google cloud computing.
I have modified CryptoNoteConfig.h file and mentioned both instances IP address at port 17236.
I have installed all dependencies too.
When I run ./rawiumd it says, continouing without seed node, cannot connect.
Any Help?

Make the build again after adding below changes in src/CryptoNoteConfig.h

Add IP addresses of your seed nodes.

Example:

const std::initializer_list<const char*> SEED_NODES = {
  "192.168.0.11:17236",
  "192.168.0.12:17236",
};

OR

create one file coin.conf in cryptonote/build/release/ and add below lines

seed-node=192.168.0.11:8080
seed-node=192.168.0.12:8080

and start the node with below command

$ ./yourcoind --config-file coin.conf

source :

https://cryptonotestarter.org/inner.html

http://forknote.net/guides/setup-private-blockchain/


two people with same PUBLIC address, how will people/network know how to deliver bitcoin I understand that a bitcoin address is a combination or more than one kind of encryption and entropy, and I also understand how improbable it is that the same address will get generated at the same time.

Although the private keys will be different, this doesn't alleviate my concerns.

If person A sends a payer their public address, how will the network know not to send it to the person A and person B's address

Maybe I am just having a lapse in judgement here, and that the public key must be derived from the private key and hash160 and therefore a public address cannot be generated without the same private key

The network can't tell the difference.  In the astronomically unlikely event that two different people have private keys whose public keys hash to the same public address, then both of them are able to spend any coins sent to that address, first-come-first-served.

To illustrate how unlikely this is: suppose every satoshi of every bitcoin ever to be generated was sent to its own unique private keys.  The probability that among those keys there could be two that would correspond to the same address is roughly one in 100 quintillion.

Of course the probability is only "astronomically unlikely" if the private keys are truly randomly generated.  If they are not, then there can be better chance of someone else being able to guess the private key.  Anyone who does so can spend coins sent to that address.  That was what happened with this vulnerability.

A fun activity, analogous to "leave a dollar bill on the street and see who picks it up", is to make yourself a private key that is a very small integer.  Then send some trivial sum of money to the corresponding address.  There seem to be a number of people watching such addresses so you can see who manages to grab it first (by spending it to a more secure address they control).


PPLNS implementation Quote from Meni Rosenfeld's post explaining PPLNS:

  Choose a parameter X, which represents multiples of D to include in the window when difficulty is static. X=2 is a good choice. When a
  share is submitted, assign to it a score of 1/D, where D is the
  difficulty at the time the share is submitted.
  When a block is found, pay (sB)/X for the last share (the one before the winning share), where s is the share's score and B is the
  block reward. Continue backwards, paying each share based on its
  score, until you reach a share which brings the total score of the
  shares counted above X. Pay that share the amount (sB)/(tX) * min
  (r,t), where r is the score required to bring the total to exactly X
  and t is the score of the winning share. Don't pay any older shares.
  If the pool has just started, and a block is found before there are shares totaling a score of X, there will be leftover rewards and
  it should be decided what to do with them. It doesn't matter much, but
  I recommend that the operator keeps them (in a macroscopic view, if
  the pool ever changes, this is compensation for the funds needed to
  cash participants out). Other options include donating to charity, or
  distributing among the miners.

So far so good. One thing I'm struggling to understand is where the difficulty of a share itself fits into the picture. How do I scale the reward by share difficulty without screwing up the algorithm?

Update:

What I also would like to know is how to handle cases where the network difficulty recorded with a share is different from the current network difficulty.

Well, that post is quite old. Variable-difficulty shares weren't a thing then.

That said, I'm pretty sure the fix is as follows: When a share is submitted, the post says you should assign to it a score of 1/D. Instead, assign to it a score of d/D, where d is the share's difficulty. That's it.

Also, you should have a look at https://bitcoil.co.il/pool_analysis.pdf, specifically the "unit-PPLNS" part of section 3.3. It's slightly more complicated, but IIRC it has the advantage that it is still hopping-proof when the block reward can change (which is much more relevant now than it was back then).

As for changes in the network difficulty - the score is based on the historical difficulty, and the current difficulty is not used at all in the calculation.

If this seems odd, consider that if the current network difficulty is higher, than each new share has less chance to become a block and reward historical shares, but on the other hand, have a lower score and thus more shares are needed until the historical share is out of the window. So it evens out.


NBitcoin get signature, use spending P2SH transaction with non-standard script After creating a new NBitcoin transaction (with a single pay-to-script hash input and multiple outputs), is there any way to calculate the transaction signature and manually put it in the inputs[0].ScriptSig, along with other parameters used by the script?

A related issue is whether (and how) non-standard scripts can be used in P2SH transactions.

It seems the first question can be accomplished with something like:

//after creating newtx and specifying input and outputs
newtx.Inputs[0].ScriptSig = privatekey.ScriptPubKey;
newtx.Sign(privatekey, false);  //puts signature and pubkey in ScriptSig
//use those plus additional parameters in script
newtx.Inputs[0].ScriptSig = new Script(
   newtx.Inputs[0].ScriptSig + " " +
   //leave signature and pubkey as first parameters pushed onto stack
   //then add additional parameter (type PubKey)
   Op.GetPushOp(additionalParameter.ToBytes()) + " " +
   //then add script whose hash was in original P2SH trans
   Op.GetPushOp(scriptIn.ToBytes()));

The scriptIn is the same as the usual P2KH script preceded by a check for the hash of another parameter

scriptIn = new Script(
        "OP_HASH160 "
        + Op.GetPushOp(additionalParameter.Hash.ToBytes())
        + " OP_EQUALVERIFY"
        + " OP_DUP"
        + " OP_HASH160 "
        + Op.GetPushOp(pubkeyhash.ToBytes())
        + " OP_EQUALVERIFY"
        + " OP_CHECKSIG"
        );

But when the transaction is sent it gets the following error:
    16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)

Not sure why it's failing.


How to get transaction with Bitcoin Core? I've have a fully tx index node in v.11 and I can do the following below just fine,

bitcoin-cli getrawtransaction c6556ca7e143d108f5ef594057ff83a78bceb4b5fdc565ae160b4783cddad00f

but with a fully tx index node in v.12, I cannot and I get an error

error code: -5
error message:
No information available about transaction

So what has change in v.12 that broke this and what can do to get this functionality back. I already have txindex=1 in my conf file and I already tried bitcoind -daemon -reindex

Can you right now put txindex=1 in your bitcoin.conf on both, and restart your node? That will cause a failure if the database was not created with txindex. If it continues, and there are still transactions that can't be found by getrawtransaction, file a bug report on https://github.com/bitcoin/bitcoin/issues.


What is the hash-rate of the Bitcoin network that results in the maximum difficulty? According to https://en.bitcoin.it/wiki/Target the target is a 256-bit number.
As the total hash-rate of the Bitcoin network rises, this number decreases to increase the difficulty. How much hash-rate (in terms of GHash/s) would cause the target to reach the minimum value? will the target ever get to 0? Does that mean it will be impossible to find a new block? (the minimum of a SHA256 hash is 0 which is not less than 0)

The hardest possible target is all zeros plus a one (0000000...1). If such a block were ever mined (which is extremely unlikely: on average you'd need 2^255 hashes per 10 minutes, which is 9.6e73 hashes per second), it would definitely crash the network : there can only be one hash at that difficulty, which means that there can only be one block mined at that difficulty.

Of course, if the target is zero, no block can be mined at all.


How and why we need to validate a transaction? I've starting doing some researches about the Bitcoin protocol and the blockchain. I'm trying to understand all the sections in the Bitcoin white-paper.
So far, i couldn't understand what is the utility of adding the transactions merkle tree root on the block header. Yes, i know that it's done to save space as the paper said. But when do someone need it?

For example, when miners receives a new block, does they receive only the block header, or the block header with the transaction? Means, is the blockchain a chain of blocks of headers?

If the 8- Simplified Payment Verification section Satoshi said:

  It is possible to verify payments without running a full network node.
  A user only needs to keep a copy of the block headers of the longest
  proof-of-work chain, which he can get by querying network nodes until
  he's convinced he has the longest chain, and obtain the Merkle branch
  linking the transaction to the block it's timestamped in. He can't
  check the transaction for himself, but by linking it to a place in the
  chain, he can see that a network node has accepted it, and blocks
  added after it further confirm the network has accepted it.

How can the user obtain the obtain the Merkle branch linking the transaction to the block it's timestamped in ?

So far, i couldn't understand what is the utility of adding the transactions merkle tree root on the block header.

To ensure that the transactions in the block are committed to by the block hash.

The block hash is not actually the hash of the entire block, it is the hash of the block header. If there were no merkle root, the block header would not contain anything that ensures that the transactions that are part of the block are actually part of the block. By hashing all of the transactions together into the merkle root and putting that in the block header, blocks received must contain all of their transactions so that the block header is valid.


Wallet.dat can contain only 100 private keys even if I back up? Considering the Bitcoin client for Windows 0.8.1:

So the best way (if I have already used up 100 keys) is to send bitcoins to different wallet and then to newly generated one?

When I want new keys, can I just delete old wallet from default location and WILL BE THE NEW ONE GENERATED AUTOMATICALY when turning on the client?

Run the client with the parameter -keypool=10000 to generate 10000 keys in your keypool.

Pros: Less backing up

Cons: Your wallet will be bigger (file size) and take maybe a few seconds extra to load


Bitcoin client from command line without blockchain Any bitcoin client used on linux plateform to send bitcoin from address to another one without using blockchain or full node like bitcoind ?

Thank you

Bitcoin transactions do not move funds from one address to another.

Bitcoin's core concept is coins. Coins are created by transactions, and can have have arbitrary value. Coins are consumed by another transaction by explicitly referring to the transaction that created them. So, in a way, transactions melt some input coins together (destroying them), and forge new ones from it (with a total value that can't exceed the value of the melted ones).

When creating a coin, you can assign it to an address (in fact a script, but let's simplify). This is just an authentication mechanism on top: in order to consume a coin assigned to address A, you have to sign the transaction with the private key corresponding to A.

So to answer your question: this is not possible. To create a transaction, you need to know the exact transactions that assigned coins to addresses of yours, and their value.


Possible to speed up reindex? I just reindexed a node that was already synced (in order to enable txindex); it took around 9 hours. It's on a pretty good system: 16G RAM, i7 with 4 physical cores. Storage is a weak point, with LUKS on software RAID0 on spinning disks. dbcache is at the default 100M, though I'm running 0.11 so I gather this ends up smaller than the previous default due to more accurate accounting. By extrapolation from testing a subset, a sequential read of the full ~38G of blk files should take ~4 minutes.

I understand reindex includes rebuilding the chainstate db, so I'm guessing that's the bottleneck. Questions: 1) reindex doesn't also re-validate blocks, does it? 2) Any experience with speeding this up -- perhaps putting chainstate on a tmpfs and copying to permanent storage once complete?

Followup: by increasing dbcache as suggested, and adding a recent custom checkpoint to the code, I got another reindex done in about 3 hours.

reindex doesn't also re-validate blocks, does it?

It does, but signature verification (the slowest bit) is skipped on most of the early blockchain. The command attempts to sync with the network by reusing as many blocks as possible that are already written to the disk, which may very well include damaged or partially written ones.

  Any experience with speeding this up

Increasing the dbcache will speed up reindexing, putting it at 2G (dbcache=2048) would not be an unreasonable choice given you have the memory. This is about all you can do, until it gets to the point where you are validating signatures a reindex is heavily single threaded.


How to exchange small amount of bitcoin? Hi I have a little question could you tell which is the best method to exchange 2.27mBTC (18€) in euros or USD?

I registered on coinmama but the minimum for them is 50€ is there any other exchange services that could sell USD or EUR for my small amount of mbtc?

The best and optimal method would be to avoid exchange since they will take their fees plus the fees taken by the miners that you gonna have to pay to send the coins to them on the blockchain, and also you gonna have to give them your personal information (KYC Know Your Costumer)

Exchanges are still the most simple, I suggest Coinbase who only require 2 euro of minimum deposit.

If you want a cheaper, savy way, more optimal and more bitcoin way of trading your bitcoin you could try local bitcoin which allow you to met other person willing to trade bitcoin in real life, or Bisq which is a decentralized exchange software.


Is there a wallet for different cryptocurrencies For a person who has different amount of different cryptocurrencies it is actually annoying to use many clients. Right now just Bitcoin data is more than 15 GB, litecoin 1.5 GB and so on.

Is there any wallet which incorporates many wallets? Is it possible?

You can use UFASoft Coin. Which is a multi currency client and miner. Also it's open source.

The supported currencies are.

Bitcoin - BTC
Bitcoin-testnet
Namecoin - NMC
Litecoin - LTC
PPCoin - PPC
NovaCoin - NVC
TerraCoin - TRC

This will essentially keep all your wallets in one application, so no more have 6 different wallets and clients. Then forgetting to start certain ones.

Just a side note regarding the performance of mining directly from the program: I have found it to be slower, around 10-30% slower than other miners.


Question about extracting BCC from a paper wallet I have some pre-split BTC in a paper wallet. Now, I found an article that describes how I can extract BCC from it using Electrum and Electron Cash. Basically the steps are:

Install Electrum wallet, import your paper wallet into it
From Electrum wallet, send your BTC elsewhere (possibly a new paper wallet)
Install Electron Cash, import the same private key and you should see your BCC balance there and be able to use it

Question: do we really need step #1 - can I just import BTC from my paper wallet into an exchange for example, without first using Electrum wallet?

Not every exchange or wallet supports import from private key, for example, coinbase explicitly says they don't support it. But if you find an exchange that supports it, then yes you can directly import to it instead of going to Electrum first.


Who decides whether a submitted share leads to a valid block or not? If a share does not lead to a valid block they would not require to be sent to the server?
Or is the only purpose of the share sent to the server to show that the client did some work?

Yes, shares are there to provide to the pool operator that you are working with the pool. Because you are actually hashing data and providing valid hashes of the data the pool sent, it proves you are working with them, meaning you deserve some of the sweet BTC reward when someone finds the actual answer.


Why one miner can dig out many blocks continually in one moment? I am new to bitcoin and blockchain, I browed the website just now. There is  a question confusing me,  I find that one miner dig out blocks many times even in one hour. For example, this miner dig out four block in 6:00 - 7:00 AM. Is it possible that this miner control 51% CPU? And may this would break the whole bitcoin blockchain?

I hope someone can answer me, thanks！

I suppose it just a succession of lucky event, even if this miner wanted to do a 51% attack, there is not a lot he could have done with it, except as you said break or reduce the trust in the bitcoin network, and someone who have invest that much money into mining equipment must own and will own lots of bitcoin and so have less incentive to try to break it.


Pros and Cons of each address types Can someone explain benefits of using p2pkh, p2sh, bech32, p2sh-p2wpkh, p2wkph, p2wsh.. and so on

from what I know, bech32 is most recent, but what would you say is the best?

The most commons, and which you need to understand best are those 3:

Legacy (P2PKH),  Pay-to-Pubkey Hash. begin with the number 1. Old addresses, fees are higher. Compatible with every software. Able to sign messages and get verified in every wallet.

Compatible (P2SH) begin with number 3. Segwit address, fees are intermediate. Widely supported and compatible with old software. "transitional" addresses until native segwit is fully adopted. Not able to get its messages verified in every soft.

Native Segwit (Bech32) begin with bc1. Lower fees. Not fully compatible with old software, like blockchain.com. Can't get messages verified in every software.

read more here: https://en.bitcoin.it/wiki/Address


Is bitcoin the most powerful computer network in the world? I read an article from twenty THIRTEEN saying, as of then, bitcoin had more power than the top 500 supercomputers. At that time, the difficulty was 21.3 million. Now, it is almost 11 trillion and projected to pass that number within September 2019. So, using that info, the computer says that the network uses 350,000 times as much (SHA256 brute forcing) computational power as those computers did. Is that still true and if so, what is the number of times more powerful now?

bitcoin had more power than the top 500 supercomputers

This is a nonsensical comparison.

Sure, nothing compares to the aggregate of all Bitcoin miners in quickly computing the last 32 bits of the double-SHA256 hash of particularly structured 80-byte inputs.

But at the same time, Bitcoin mining hardware can also literally not do anything else. It can't even multiply two numbers.

You simply cannot compare specialized Bitcoin hashing hardware with general-purpose supercomputers. Each is designed for a certain goal, and very good at that goal.

  Is bitcoin the most powerful computer network in the world?

If you're going to define network so abstractly, I'm sure that the Internet has a lot more computational power connected to it.


Is "Proof-of-work" a subset of "Byzantine fault tolerance (BFT)"? Can we say that Proof-of-work is a type of Byzantine fault tolerance (BFT) ? In other words, is PoW a subset of BFT ? Or they are two different categories?

Please note that there is a similar question here (BFT VS Bitcoin PoW VS PBFT) but without any answer.

Can we say that Proof-of-work is a type of Byzantine fault tolerance
  (BFT) ? In other words, is PoW a subset of BFT?

Yeah I think you can say that.

Proof-of-work is a proposed (and pretty well tested at this point) solution to the Byzantine Generals Problem, and therefore achieves Byzantine Fault Tolerance. The Byzantine faults that it solves includes the classic double spend.

The Byzantine Generals Problem is an illustration of the difficulty in arriving at consensus in a distributed network.


How is over-spending one block apart prevented? So, let's say you have a wallet with 20BTC, and you have a flow like so:

You send 15BTC to A in block 1
You send 15BTC to B in block 2

What happens if at block 1 there are two chains across miners. In chain X the transaction is there, in chain Y, the transaction is not there.

When they go to spend the other 15BTC in block 2 and their wallet(imagine a different computer using the same wallet) is on chain Y, then their wallet will let them do it. What happens when:

Chain X becomes the dominant chain
** Transaction 1 would have confirmed, so would transaction 2 have been rejected and never confirm?
Chain Y becomes the dominant chain
** Transaction 2 would have confirmed, so would transaction 1 be rejected and never confirm?

How is this represented in the bitcoin software even? I know there are some transactions that can be broadcast but then never confirmed, but how does the wallet know the money is not spend if it's been broadcast?

When a node learns of a transaction, some validity tests are performed and if the transaction is not yet in the blockchain it knows of with the longest height and the transaction also is valid (i.e., not a double spend) then that transaction is added to that node's memory pool.

If a later transaction arrives at a node but is an attempt to double spending of a transaction that is either already in the blockchain with the longest height or is already in the memory pool, then that later transaction is ignored.

A transaction propagates to nearly all miners within seconds, so most miners would immediately reject your later double-spend attempt since they would already know of the earlier transaction.

Blockchain forks happen all the time (i.e., multiple times each day).  So it is entirely possible to have conflicts where a transaction is included in a block on one side of the fork but is not yet in the block (or blocks) on the other side of the fork.  Eventually one of the several competing blockchain forks will emerge as the longest chain and the transactions in that chain are the ones reflected in the Bitcoin ledger from then on.  That's why exchanges wait until three or six confirmations -- as it is technically possible for there to be variations between sides should a fork occur.

Attackers might use this temporary inconsistency in an attempt to defraud by employing a race attack or other approach.  This is requisite reading on the topic: http://en.bitcoin.it/wiki/Double-spending


How does copying main stack prevent malformed unlocking scripts vulnerabilities? https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch06.asciidoc

  In the original bitcoin client, the unlocking and locking scripts were
  concatenated and executed in sequence. For security reasons, this was
  changed in 2010, because of a vulnerability that allowed a malformed
  unlocking script to push data onto the stack and corrupt the locking
  script. In the current implementation, the scripts are executed
  separately with the stack transferred between the two executions, as
  described next.

  First, the unlocking script is executed, using the stack execution
  engine. If the unlocking script is executed without errors (e.g., it
  has no "dangling" operators left over), the main stack is copied and
  the locking script is executed. If the result of executing the locking
  script with the stack data copied from the unlocking script is "TRUE,"
  the unlocking script has succeeded in resolving the conditions imposed
  by the locking script and, therefore, the input is a valid
  authorization to spend the UTXO.

In this chapter, Andreas states that due to a bug with malformed unlocking scripts, the scripts are now executed separately.

Here is my understanding:

The unlocking script is first executed on the main stack.
If the unlocking script is valid, the entire stack is copied and the locking script is then executed.

Is there a reason why the stack is not copied to an alternate stack and then the unlocking script is executed on the alt stack? This way, if the unlocking script is malformed, it would not corrupt the rest of the main stack.

you can find explanation here:
https://bitcointalk.org/index.php?topic=5095376.msg49150302#msg49150302

  the issue was actually with OP_RETURN. What OP_RETURN used to do is it would skip to the end of the script so whatever was on the stack was interpreted for the final script result. So what you could do was create a scriptSig that was just

OP_TRUE OP_RETURN

  which would push true to the stack and skip the rest of the script (which included the scriptPubKey at this time). The interpreter would see that at the end of script execution a true was left on the stack so it would say that the script passed. Obviously this is bad because the nothing in the scriptPubKey was evaluated so none of the spending conditions were actually met.

  In fixing this bug, Satoshi disabled many other opcodes, changed OP_RETURN to always cause script execution to fail, and separated the execution of the scriptSig and the scriptPubKey so that the scriptPubKey is always executed.


Warning: Reducing -maxconnections from 1000 to 865, because of system limitations I want to be the fastest/first one at recognizing/receiving new transactions, so i set i set these in bitcoin.conf and running a bitcoin full node on dedicated centos server.

maxconnections=1000
timeout=15000

ref : How does one attain 1,000+ connections like blockchain.info?

but when i restarted the bitcoind i get

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

why is that ? and how can i connect to maximum nodes to make sure i am the first one to get new transactions details.

bitcoin version

Bitcoin Core RPC client version v0.14.99.0-6adc3a3

Connecting to more nodes will not make you learn about transactions faster, after some point.

Your node will just be busy processing messages - including many uninteresting ones - to maintain connections with all peers, making it slower at processing new things.

Connect to a few fast peers with -addnode, or even run multiple nodes yourself, and interconnect them to each other. That will be faster than connecting directly to everyone.

The reason for the reduction of max connections is due to the limited number of file descriptors the operating system granted your bitcoind process. You can use the ulimit shell command to increase the maximum file descriptor.


Electrum: 2 Wallets showing same Transactions I hope someone can explain, if it's dangerous that i have 2 wallets and both showing the same transactions, the first one has a password for the seed and i can't remember it, the second one not. I also can't remember what i have done and why i have 2 wallets.

If someone can explain me what to do or/and how i can setup a new fresh password-protectet wallet in electrum with all my transactions, would be great.
This would help me to achieve a better technical-understanding for bitcoin and electrum-wallet.
thank you

The only important thing is the seed (the seed words). With it, you can create copies of the Electrum-wallet with or without password. So you could have the same wallet on a PC desktop without password and on an Android phone with a password. (Note that the Android-client also forces you to enter a PIN code.)

I assume you created a new Electrum-wallet, password-protected it and then imported the same Electrum-wallet again (using the seed), without password. You can safely delete the one with password as long as you are very sure they are indeed the same. Perhaps double-check the different Addresses (both Receiving and Change) before you do this. (But this might be hard since you forgot the password?) As long as you are sure you only have one seed that you used for both wallets, you can safely delete one of them. They are surely the same wallet.


Where off-chain transactions are registered afterwards? Reading the questions and answers on this StackExchange, i've learned that into Exchanges there's no transactions over public blockchains being performed, the funds are exchanged among accounts into the Exchange and a database seems to register and tracking the credited and debited funds of any internal transactions occurred. But, when one wants to withdraw his funds, move them to another exchange or move to a properly wallet, whether it being BTC or any other Altcoin, how does all that information are registered on Blockchain as a lot of other ones were done only internally on an Exchange?

It doesn't.

From the point of view of the blockchain there are just 2 transactions: one going into an exchange address the other is going out of an exchange address.

For example:

You sent 0.1 btc to an exchange [recorded on blockchain]
Some other people send other amounts to that exchange (exchange controls all these addresses) [recorded on blockchain]
You make 0.05 btc on a trade (that means somebody else lost that 0.05 btc) [NOT recorded on blockchain]
You withdraw 0.15 btc minus any trading fees
Exchange sends yours 0.1 btc + somebody else's 0.05 btc to you (they might use a couple of addresses that they sent from, or they might use a cold storage address) [recorded on blockchain]

The only transactions that are recorded on the blockchain are 0.1 btc from you, other deposits from other people, and you withdrawal of 0.15 btc as per example above. Any trades that are happening on the exchange are happening in their own database.

Also exchanges might consolidate balances into hot or cold address. So you might notice that after you sent 0.1 btc to an address that an exchange provided to you, that 0.1 immediately left that address to an address that has a large balance, but your funds are still displaying on your exchanges's account. That is because it is now handled by their internal database.


BFGminer running on GPU on Windows 7 I can't get the BFGminer to work on my Windows 7 machine. I've followed the instructions on https://www.btcguild.com/index.php?page=support. But when ever I run bfgminer.exe I get the following message at the top:

Waiting for devices; press 'M+' to add, or 'Q' to quit

I want to use my GPU, as I don't have any FPGA or ASIC devices yet. Can anyone help out?

You can try to "auto-manually" add your GPUs to bfgminer by pressing M then + and then typing auto, or you can use the -S opencl:auto option when launching bfgminer.

NOTE: Not all graphics cards are compatible; various software is required (e.g., AMD APP sdk); it is not recommended to use GPUs for bitcoin mining with bfgminer.

According to README.GPU, the official documentation for bfgminer on github:

  By default, BFGMiner will NOT mine on any GPUs unless in scrypt mode. If you
  wish to use your GPU to mine SHA256d (generally not a good idea), you can
  explicitly enable it with the -S opencl:auto option.

To start scrypt mining with bfgminer and GPUs, use the --scrypt and -S opencl:auto options, but keep in mind that there are several other parameters to consider. See README.scrypt for additional details about scrypt mining configuration and optimization with GPUs.


How to create a deterministic wallet using bitcoinjs-lib I'm new to bitcoin technology, however, I'm trying to develop a web wallet using bitcoinjs-lib that works like that of blockchain.info. I've gone through the code samples on the github repo but couldn't make out the one I could us to create a deterministic wallet.
I intend to make the wallet users enter a long and strong password from which the private key can be generated from.

Any code sample or link would be highly appreciated.

See Blockchain.info wallet source code
https://github.com/blockchain/My-Wallet-V3

Also check the bitcoinjs-lib's list of projects


Where can I find statistics on average feerates at different times of day and days of the week? I know there are websites that show the price needed to get a tx into a block if made now, but is there any website that show the average price per byte for a tx at different times of the week and day? I am pretty sure there will be daily and weekly patterns, so it would be cool to see this if someone has collected this data.
If not, I guess I'll have to create this myself! Thanks for any URLs or tips.

As someone keenly interested in that sort of stuff, I'm not aware of a website that shows the weekly and daily patterns in feerates.
The closest thing I could find was this chart that compares the feerate ranges of blocks on Bitcoin Optech Dashboard.
I was unable to find a graph that matches your description more closely across dashboard.bitcoinops.org, statoshi.info, transactionfee.info, bitinfocharts.com, blockchair.com, and txstats.com. You could perhaps build something like that on Coinmetrics.io, but the feerate is not one of the metrics they share publicly. Some of these projects may welcome your suggestion.
If you do build it, please add an answer here to point it out when you have! I would definitely want to see it!


I have sent a person some bitcoin. He never sent me the goods. How can I get my funds back? I have been scammed by a person and I want to dispute a bitcoin transaction.

Bitcoin transactions cannot be reversed unless some kind of escrow is implemented. Take this as a hard learned lesson. Sorry for your loss.


Is it possible to spend partial amounts from a paper wallet? Okay, so I create a paper wallet from blockchain.info and have it printed out with the public/private keys. Now I loaded it with some bitcoins. In my blockchain.info account it shows it as watch only.

Now my question is can I spend them partially or do I have to spend them in full by scanning the private key portion of the paper wallet?

The key to understanding what's going on here is to realize that there are not two, but three components of a bitcoin transaction that determine where coins end up. These are the inputs, the outputs, and the oft forgotten remainder. The inputs to a transaction are the addresses that have coins that are to be spent, and the outputs are the addresses where the coins are to be sent to. The reminder is the amount of coins left over when the inputs are greater than the outputs. In a bitcoin transaction, the remainder goes to the miner that confirms the block containing the transaction. That's why there needs to be a "change" address. If you have more coins in your input addresses than you want to send to the outputs, you need to send some back to yourself otherwise you'll loose them.

The standard bitcoin client handles this transparently by generating new change addresses when you complete a transaction. This is the "safe" thing to do because technically re-using an address can open you up to a kind of attack that would allow whatever coins remain to be stolen. This attack relies on being able to calculate a private key from a public key, however, so until quantum computers become a thing you don't really need to worry about it.

Though it is "less" safe, it is valid to use an input address also as an output address. I believe this is what blockchain does with a watch only address. Instead of creating a change address for the remainder in a transaction, it sends the change back to the original address. This means that you can use a watch only address multiple times without creating a new paper wallet. This means that you have to use blockchain when you are spending coins though. If you import your keys into bitcoin-qt and spend the coins, your paper wallet will no longer contain any coins. They will have been moved to a new change address.

EDIT:

I wanted to check and see if this is how blockchain actually works, and my guess is correct. If you spend coins from a cold storage address, blockchain will send the change back to the original address. You can see an example of this sort of transaction here.


What is the meaning of difficulty in Bitcoin mining? I'm a beginner in Bitcoin and Blockchain technology, so I have a question after reading about the difficulty in Bitcoin mining:
What the difficulty actually means?
I read that

A high difficulty means that it will take more computing power to mine
the same number of blocks, making the network more secure against
attacks

However, I don't clearly understand.
Ex: When the difficulty is 6, then what I can know from that number?
Thank you so much!

Suppose I give you some very complicated function f(), and I assign you the task of finding an input n with the property that f(n) is small.  That can be difficult.  I can make it more difficult by changing the definition of "small".  If I ask you to find an n such that f(n)< 100, that's difficult.  If I ask you to find an n such that f(n)< 90, that's more difficult.
Once you've compiled a block, you're confronted with a function f().  The function itself depends both on the block you've just compiled and the solution someone found for the problem associated with the preceding block.  Successfully mining the block means finding an n such that f(n) is small.  The only way that anybody knows to solve this problem is by trial and error.
The definition of "small" is periodically adjusted.  That definition of "small" is what people mean by "difficulty".


When no Bitcoins are left to be mined, how will the Blockchain continue to be validated? Sorry, this may be noobily phrased.
My understanding was that each individual "miner" crosschecks and validates the overall blockchain, ensuring decentralized verification of the bitcoin transactions. The reward for devoting your processing power to this verification system is newly "min(t)ed" Bitcoins.

So, I'm wondering, when there are no Bitcoins left, as in it reaches 21 million (out of the ~15 million in circulation now), how will the blockchain transaction system be validated any more? As in, the reward incentive of getting a piece of newly hashed Bitcoins will be gone, so nobody would mine any more?

I figure there's something I'm missing, but from my limited understanding it sounds like the verification backbone of Bitcoin will be in trouble. I assume there's existing threads on this topic, I just am having trouble phrasing my question, so it's hard to search

Mining rewards are not the only source of income for miners. There are also transaction fees. When there are no more bitcoins to be mined (happens around 2140) then miners would be mining for transaction fees only.


Is there empirical data about a relationship between bitcoin price and difficulty? There have been claims that Bitcoin price and difficulty correspond. Is there empirical data to support or refute this?

If you look at the network hash rate, you'll notice that it fell off after the Bitcoin exchange rate dropped.

This leads to the conclusion that price drives difficulty. A drop in price caused a drop in difficulty. I have noticed this same correlation on another occasion; about two months ago.

Also, the reverse is probably true. When the price soared to $30+; the network hash rate accelerated greatly. The higher prices clearly attracted miners.


How to compile coins from github? (linux mint/ubuntu) I tried to install a couple of coins from GitHub code, but none succeeded. For example, this (or other): https://github.com/muddafudda/PayCon

Please step-by step guide

You have to install the required dependancies first

sudo apt-get update

sudo apt-get install -y git make g++ build-essential libminiupnpc-dev

sudo apt-get install -y libdb++-dev libssl-dev libboost1.48-all libboost-chrono1.48-dev

then

git clone https://github.com/cryptotech/PayCon.git

cd PayCon/src/leveldb

sh build_detect_platform build_config.mk ./

cd

cd PayCon/src

make -f makefile.unix


What would be the process for identifying a person that performed a transaction from a wallet on a personal device? I presume the legal process would be something along the lines of

Get IP address from blockchain.
Get ISP to tell you whose that is or was at the time.

So I expect that this would normally require some legal warrant in most countries for ip address to user mapping, which of course can be made difficult.

Are mobiles client easier to trace?

What about an illegal but still pragmatic process?

The block chain doesn't report the IP address and the IP address isn't passes by nodes.  Any entities knowledge of Bitcoin network is limited to the connections it has.  If you get a transaction from a specific IP address you can't know that IP address originated the transaction you simply know it came from that IP address.  It was either originated or relayed by that node.

The more connections you have to the network the more information you would have about where an transaction originated.   However no matter how many connections you have you can never know you have a connection to every single node, thus all you can know when you see a specific transaction is that node at IP address X is where the transaction was first seen.

You can never be 100% sure of the originating node as you can never be 100% sure you have connections to ever node in the network.

Someone concerned about privacy could restrict the nodes they send transactions to only nodes they trust.  This would ensure that at most (unless they trusted you) you could only find the node that relayed the transaction not the originator.

Someone concerned about privacy could also route their transactions via VPN which would add another layer.  The connection couldn't be traced further back than the VPN gateway without the assistance of the VPN providers which likely would require a court order.  If the VPN provider was located in another country that would make enforcement even more difficult.

Using both trusted nodes (using web of trust like fature), and VPN which doesn't keep logs in a foreign country would make tracing the source of the transaction very difficult.

I find it unlikely that many courts would issue a warrant based on only the IP address of the "node transaction was first seen" as it really is proof of nothing.  The actually originator could be that node, a node which relayed it to that node, or a node which is x hops further down the chain.

Lastly a transaction is simply a sequence of bits. There are websites which act as dropboxes where a user can post a transaction in text form and the website will relay it to the rest of the network.  While this isn't particularly secure one could create a similar service on Tor and possibly require transactions to be encrypted with a public key of trusted operator reducing the likelihood of tracing the transaction back.

Of course the drop box method could be combined with trusted nodes, VPN access, and using a public internet wifi location to further obfuscate the source.  It really depends on how paranoid the sender is.


If most G20 nations ban bitcoins, would that effectively kill bitcoin? If the G20 nations (or most of them) ban bitcoins doesn't this effectively kill bitcoin? My thinking is that a normal person would no longer have any means of converting bitcoins to the local currency. The only other way this would work, were if most places took bitcoin (coffee shops, grocery stores), but if it's banned then most of the places would stop taking it.

My thinking is that (i) G20 nations are democracies, and (ii) Bitcoin is a useful service. If it's useful to people, and people want it, they'll vote for it and it won't get banned.

If your country bans something useful to the masses, it's not a democracy. It will be banned only because it lost its utility, and if that happens, there will probably be something better replacing it.


How to get a wallet feerate (sat/byte) of an unconfirmed transaction? On block explorers such as blockchain.com, each unconfirmed transaction has a desired feerate set by the wallet such as 58.000 sat/B. This is not to be confused with the actual final fee calculation.
My question is how do they obtain/calculate the feerate desired by the users wallet that submitted the transaction?
Is this possible via the bitcoin JSON RPC api?
From what I understand, getrawtransaction() does not provide any details of the feerate set by the sender. Moreover, you can also get the feerate set by a user by getting their wallet details. If so, how is the wallet feerate set calculated if there are two inputs to the transaction?

The fee rate is not related to the confirmation status of the transaction.
As far as the bitcoin protocol is concerned, fee rate is simply transaction fee (in sats)/transaction size (in bytes). So for a 100 byte transaction, paying 10000 satoshis as a fee, the fee rate is 10000/1000, or 10 sats/byte.
Currently, you have two possible fee rates: Segwit and non-segwit.
The Fee Rate/weight unit, instead of fee rate/byte, measure is intended to provide a consistent view of fee rates, regardless of whether a transaction has segwit inputs or not.
The calculation remains the same - weight units/total fee gives you the fee rate per weight unit, with a non-segwit byte counting as 4 weight units, and a segwit byte counting as 1 (this is a simplification, full details are outside the scope of fee rates).
To calculate this using Bitcoin Core, simply get the transaction details via RPC. A decoded response contains a weight field, which you then divide by the total fees paid to determine the fee rate per weight unit.
If a transaction has multiple inputs from distinct wallets, the fee is still paid at a transaction level - to determine how much of a fee was "paid" by a particular input, you'd need to determine who received the outputs, and where the change went. Once you know the output break up, you can attempt to distribute the total fee among the participants.


An authoritative resource for the history of Bitcoin I've been developing an introductory course on Bitcoin and would like to have a lecture about its history. Other than Wikipedia, does there exist a community-accepted resource elaborating on the history of Bitcoin?

The official Bitcoin Wiki has a page about the History of Bitcoin. Also, the original Bitcoin homepage has a page with a brief history of Bitcoin.

This wiki is primarily maintained by the original creators and developers of Bitcoin.

I especially like

  May 21 2010 - laszlo first to buy pizza with Bitcoins agreeing upon
  paying 10,000 BTC for ~$25 worth of pizza courtesy of jercos

If you want authority, you can either visit the Bitcointalk forums and contact some of the oldest forum members. Or take a look at the official Bitcoin GitHub project were the lead developers are listed. (They are also listed on the Bitcoin homepage.)


Buying bitcoin is easy, but how do you get it back? I just signed up on coinbase to see how it works. I bought 2$ (CAD) worth of bitcoin. I even managed to change it back into Canadian $. But I don't see any option to withdraw the money. Without the option to withdraw the money at any time, it's really hard to rationalize buying bitcoin. The thing is, I really want to. Badly. What can I do?

After searching for a pretty long time, I found this post confirming my fears.

  Our banking partner in Canada shutdown last year. With them shutting down, we no longer have access to deposit funds to Canadian Bank accounts. Fortunately, we were able to provide credit card/debit card access to our Canadian customers so they can continue buying digital currency. We hope to restore bank account access to provide Sells again, but we don't have a timeframe for this.

Sell bitcoins in an third party exchange. (First you need to send the bitcoins to address specified in exchange)
For example checkout a trade ad on localbitcoins.com


Satoshi's IP address(es)? Does anyone know Satoshi Nakamoto's IP address(es)? The forums he posted on should be able to figure that out. He posted on p2pfoundation.org, bitcointalk.org, and the cryptography mail archive.

Quote from: theymos [BitcoinTalk.org admin] on April 17, 2013, 11:20:31 PM:

  I'll probably release Satoshi's PMs and logged IPs addresses in ~8 years. This'd probably be of great historical interest. (Though he always used Tor, as far as I can tell.)


Is it possible to specify a default change address? Is it possible to enable default change address on my bitcoin-qt (aka bitcoin-core) client?

I'm using a webservice that monitors my balance (based on public keys) and whenever I send a transaction my balance goes to 0.0000 because my whole funds end up in a random change address.

I know there is a coincontrol option to specify a change address, but sometimes I forget to enter an address. Is there any way to configure the client to use a default change address? Where all changes end up?

Yes you can. Although it is discouraged.

Place the following in your bitcoin.conf file

changeaddress=yournewchangeaddress

Unless you have a real need to keep the address count in your wallet low than you shouldnt use this as it opens up security risks and destroys anonymity.

You should be using a new address for every transaction you make.


Why does GBTC frequently not track Bitcoin's price? As far as I know, the Grayscale Bitcoin Investment Trust (symbol GBTC) is currently the closest thing on the market to a Bitcoin ETF.

According to their web page, the investment objective of the trust is that:

  Shares track the bitcoin market price, less fees and expenses

I have looked at the GBTC share price and compared it to Bitcoin's price on several occasions over the past couple months.  Frequently I'll see GBTC make a huge move (sometimes over 20% in one day) while Bitcoin makes a small move (say less than 5%), or vice versa.

Why is there frequently a discrepancy in the price movement between Bitcoin and GBTC, if GBTC is supposed to track Bitcoin?  There should be no discrepancy at all (and for just about every ETF I've ever seen, there isn't).  But on most days with GBTC, there is a discrepancy (sometimes huge).

Grayscale never responded to my query about this.

An Investor's Business Daily article discusses why GBTC's value does not match the value of the Bitcoins held in the fund.

It says that GBTC is not an ETF - it is a grantor trust.

  It is not registered with the SEC [...] and it doesn't trade on an exchange.  It trades on the over-the-counter market, which has less stringent participation rules than exchanges. And unlike most ETFs, GBTC charges a high annual fee of 2% of assets."

It uses a recent day as an example of how GBTC trades at a substantial premium relative to the value of the Bitcoins held by the fund:

  At the Jan. 29 closing price, Bitcoin was $11,233.95. That would make the NAV for a share of GBTC (11,233.95 x 0.00100733) $11.31. However, shares of GBTC closed at $19.14, a 69% premium to the NAV. So investors would have to pay 69% more per share than the underlying asset is worth.

It explains the premium by noting there has been a high demand for GBTC and a small supply of shares:

  Instead of an ETF, people should think of GBTC as a closed-end fund. These typically trade at a premium or discount to its NAV. The reason for GBTC's premium is the high demand for the small supply of shares. It has only 176 million shares outstanding. [...] "If GBTC was more liquid and larger, and Bitcoin had wider acceptance, then there would be closer correlation between the price of GBTC and the price of the underlying asset," said David Foster, a securities fraud litigator in Farmington Hills, Mich.

Michael Sonnenshein, managing director of Grayscale Investments, basically said the same thing in the article:

  "Since the shares began quotation on the OTCQX market in early 2015, they have traded at a premium valuation to the NAV," said Sonnenshein. "While we cannot pinpoint a singular reason for the premium, we can surmise several factors. Firstly, there are fewer shares available on the market than there is demand.  Secondly, it is the only U.S.-based investment vehicle that provides direct exposure to Bitcoin through the purchase of a security."

The article then mentions how the recent GBTC stock split has increased the supply and lowered the premium:

  Grayscale recently declared a 91-for-1 stock split for the trust for shareholders of record on Jan. 22. They received 90 additional shares on Jan. 26. This lowered GBTC's share price and increased the supply adding more  shares to meet demand, thus increasing liquidity. The premium of share price over NAV has fallen but is still a whopping 47%.

Another thing the article mentioned is that the amount of Bitcoins held in the fund will fluctuate significantly as people buy and sell GBTC, so that would probably explain the frequent daily discrepancies that I've seen:

  GBTC held 177,037 Bitcoins as of Jan. 29. The number of coins held by the trust fluctuates substantially as investors move money in and out of GBTC.


electrum wallet: is recognizing the seed a problem? I understand if you find someones seed, you get hold of the contents of the wallet correct?

If so, the fact that the seed is a list of 13 words, is not a risk regarding being recognized by anyone that get holds of that list?

I mean, if you keep some text file with a bunch of passwords, but without too much info on what places the passwords are for, the passwords might not be too useful to the person getting them. But if there is a list of 13 words, a list that can be see it matches a subset of the electrum seed list, is that not a risk? someone could realize quickly that is a electrum wallet seed...

I guess there are ways to improve this, like storing just the position of the words etc, but still.

I guess there are ways to improve this, like storing just the position of the words etc, but still

Well, don't store it in a place where someone else can find it. No matter what. Not even inside a bigger list of text to obfuscate it. It is trivial to verify which combinations of words might be a valid seed.


Iquidus JSON settings for Blockchain Explorer I did a fork from litecoin into my own altcoin and I am trying to get it on a blockchain explorer to run realtime on a website. I chose an open source blockchain explorer called Iquidus which was recommended by one of the members in this community:

https://github.com/iquidus/explorer

I have followed the guide up to the point where I must adjust the settings.json file to customize it to by particular altcoin.

https://gist.github.com/zeronug/5c66207c426a1d4d5c73cc872255c572

The problem is that I am not too sure which information that needs to be adjusted in the file as it is not explicit in the instructions on what needs to be adjusted; for example, how do you know the blockhash, txhash, address, supply, which passwords and users that must be used, the instance, etc. Some values are subject to change so I am unsure where to set these values.

I am new to cryptocurrencies and I am trying to learn. My question is if there is a guide to help with modifying the settings.json file for my altcoin? Is there any recommended literature that can help me with this endeavor? If any, is there an easier option for a blockexplorer that you'd recommend?

Thank you for your time.

Mandatory settings.json changes

if not set correctly explorer will not work

have to dig in the code of your forked litecoind (daemon) to get them

genesis_tx
genesis_block

same settings as your litecoind daemon taken from litecoin.conf file

wallet
  host
  port
  user
  pass

mongo database, change if different than your settings

dbsettings
  user
  password
  database
  address
  port

make sure you set difficulty which for litecoin is POW

index
  difficulty

Secondary changes

meaning that the explorer can start working without them but should be changed to reflect your coin

title
address
coin
symbol
port

for the api page look here for details https://github.com/iquidus/explorer/issues/130

api
  blockindex
  address
  txhash
  blockhash

if you want to get coin value from markets set correct values for

markets

For reference settings.json.template


How does Market cap and daily movement affect a Crypto stock , do these numbers mean much? Really want to understand how the daily volume and overall cap works. I read that don't buy when a market cap is over 75 million and the best time to buy is between 25 and 75 million.
I understand that certain coins have mineable limits. Do some coins have unlimited caps ? How would they be valuable and not subject to inflation ?

To clarify the definitions for you:

Market cap => The total money invested into a coin (or stock). This is the sum of peoples perceived value of the coin and the amount of coins i.e. MK = Coin Value * No. of coins in supply. To answer your question, coins do not have limits on market caps (in other words the perceived value of the coin is unlimited).

Mineable limits => This is probably referring to A. The automatic mining difficulty adjustment of a coin and B. the hard limit on supply of the coins. Both of these are to prevent inflation of the coin. Inflation occurs on coins while they are mineable but usually small and steady and usually decreasing inflation (like Bitcoins block halving).

With regards to trading/investing, it may be wiser to analyse the market cap of the coin rather than the coin value. If you believe it is a worthy idea to invest in then for you to make a good return you would require a balance of 1. Small enough market cap that has potential to multiply 2. Coin supply is regulated by mining to prevent runaway inflation (premined can be risky) 3. The hard limit on the coin is reasonable. Just remember that the coins with the biggest market caps may be considered more trusted/reliable.


How can I get the public key? I am wondering if the public keys are broadcast to the network. I know that we are using addresses derived from the public key, but could we get the public key itself? Does this depend on which wallet the user uses?

The public key becomes known once you try to spend the output as part of the transaction spending that output. Before then only the address is known. This is one reason you should not reuse the same address twice, although a more important reason to not do that is your and others' privacy


How do transaction volume and block reward relate? As an example, assume a block has 10 transactions with a total value of 1BTC.
Does a miner get 25 BTC for validating and committing that 1BTC? What's the economics of this model?

Yes, the miner gets 25BTC regardless of the value of the bitcoins in the block. And yes, if blocks were all that small the economics would not make sense at all, but they are not that small, they are almost always much larger. Still, 25BTC per block works out at around $10 per transaction processed at the moment. Which is still an interesting number and is presently funded by the continuing investment flowing into the Bitcoin economy.


Where is the source code that allows new coins to be generated? As per Bitcoin documentation, new coins are generated and brought into circulation when miner receive the reward.
I am not talking about existing coins that are collected at the time of mining.

Can somebody guide me, where exactly this generation of new coins takes place?

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in main.cpp.

CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return 0;

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
 nHeight is the number of blocks that have been found.
 consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
 COIN is 10^8, the number of satoshi in one bitcoin
 nSubsidy finally gives the number of satoshi that the coinbase may create


Stopping Hash field in GetBlocks Message Reading Bitcoin Developer Guide, I couldn't fully answer following question:  What is the exact purpose of the Stopping Hash field inside a GetBlocks Message?

Node1 announces block B3, using an 'inv' message with B3's gash.

Node2 does not know about B3, or its parent B2, but does know the grandparent B1. It sends a getblocks message, starting from B1, but stopping at B3.

Node1 replies with an inv for B2, but not with B3 or any potential successor B4 thay may have appeared.

The purpose is just avoiding sending too many hashes in case the sender already knows some successor.

Note that since Bitcoin Core 0.10.0, getblocks is no longer used. getheaders has similar logic though.


Why doesn't Bitcoin use a DHT for choosing peers? Why does Bitcoin use a gossip protocol rather than a DHT for peer discovery? I believe that kademlia XOR distance helps shape the network topology so that peers are more evenly disturbed.

DHTs are built so that nodes keep only a small portion of other nodes addresses in their routing table (the closest ones). This means that when you send a message to a DHT to put("foo", "bar"), only specific peers are going to see it (in fact as little as possible) and even fewer are going to store it. So if you want to do "peer lookup" using DHTs, it wouldn't work because nodes aren't programmed to send messages through a path to all nodes.

Also I think you may be confused with BitTorrent's DHT. They store IP addressed of peers downloading torrents as values of keys in the DHT. So in that sense, they do use the DHT to "lookup peers" downloading a specific torrent. BitTorrent is a different system than Bitcoin, which is not a file-transfer protocol, and therefore I don't see how a DHT can be useful to Bitcoin's design.


How does an anonymous cryptocurrency encode coin values I'm pretty sure I understand how cryptographic accumulators work to anonymize a coin's history, for example as described here: https://anoncoin.net/Cryptographic_accumulator/ but I have read that ZCash anonymizes the value of a coin as well. Presumably this means that somehow the coin and its value are somehow deposited in the accumulator. How is this done? Is it just an extra hash of the coin serial and the value, or something more elaborate/better?

Suppose Alice has an output with 1 unit of value we'll call AO1 (Alice output 1). And suppose Bob has an output with 2 units of value we'll call BO1 (Bob output 1).

Alice sends AO1 to Charlie, forming CI1 (Charlie input 1), with one unit of value. Bob sends BO1 to Charlie, forming CO2, with two units of value.

Charlie now pulls CI1 (an input of Charlie's that claims CO1) and CI2 (an input of Charlie's that claims CO2) into a single output, CO3, with three unites of value.

Charlie now sends CI3 (an input that claims CO3) to Dave, forming DO1.

If this system provides privacy, nobody can map CI1 to CO1, nor can they map CI2 to CO2, nor can they tell that CO3 belongs to the same person that CI1 and CI2 belong to.

So while everyone can see that CI1+CI2=CO3, this really doesn't do them any good. Even if they can tell that CI1 has 1 unit, CI2 has 2 units, and CO3 has 3 units, this does them no good. They can't map CO3 to CI3, so they can't tell how much was sent to Dave. They can't map AO1 to AI2, so they can't tell how much Alice sent to Bob. And so on.

Once you can't tell which output an input claims, the rest is pretty easy.


How often should I back up my wallet if I use Bitcoin-Qt client? I am new to bitcoin and the first client I installed was Bitcoin-Qt (Bitcoin Core v0.9.3.0-gcea5e49-beta).

After installing and downloading the blockchain I immediately created a backup file. The other day I got my first bitcoins. Should I create a new backup file every time my wallet is updated (get more coins/spend coins) or its unnecessary (my first backup file contains all info needed for recovering all transaction history for my private key)?

If you use default settings you have to backup your wallet.dat after you unlock each 100 your addresses. You also must backup your wallet.dat after you set a passphase on it. Do not create backups by copying your file while your client is running. Eigher create backup with a client menu or shutdown client and copy file to a different folder.


How will other coins like LiteCoin influence market price of BTC? More generally, in economic aspect, when new currency are issued, and be accepted by groups of people, how will the new currency affect existing currency, ignoring other factors.

Ex. How will BTC affect existing USD?

Ex2. How will LTC affect existing BTC?

Ex3. If a country used to use USD as there currency, but they decide to use a new currency to replace USD, when this currency is becoming more and more important, how will USD be influenced?

It seems that it is more easier to develop new currency for people, not only country, how will BTC find a way out to win the competition with other currency like LTC. What will be the key point in the process?

New currencies that supply similar features to Bitcoins can increase the effective supply to the extent the coins are interchangeable in the market. Even if the other coin is worth, say, one tenth as much as a Bitcoin, ten of that coin can still be used as a market substitute for one Bitcoin.

Depending on the currency's properties, however, it can also increase the demand for Bitcoins, which can drive the price up. If it brings in new users, new merchants, or even new speculative interest, that can be an upward force.

But I think your question about competition, following the question about market price, just assumes that higher prices are good for currencies. I have to disagree with this for several reasons. First, Bitcoin is still in the early stages. It needs to be adopted as a means of exchange to survive long term. Increase in prices can discourage adoption because high prices can increase the fear of a "bubble burst" leading to a sudden drop. Currency risk drives down adoption.

The value of a Bitcoin can be a good measure of adoption because use as a means of exchange drives up demand which drives up price. But the converse doesn't follow. The absolute price of Bitcoin has no effect on its suitability for use as a means of exchange. If it's worth half as much, you just use twice as much.


Is there any software that allows me to make a single multi-recipient transaction? I would like to do a payment to multiple addresses in the same transaction on a regular basis. The scenario is this:

Collect addresses via QR or string (these may change on each occasion)
Use all the collected addresses to send an equal amount of BTC
pay an appropriate network fee
execute only one transaction

I don't thing QT or multibit can do this, but I could be wrong. If not are there any other software that could do this with relative ease?

Bitcoin-QT can do this.  When you click the "Send" tab you will see a button "Add Recipient" at the bottom of the screen.

You can also do it using the RPC interface, with the sendmany command.


How do you safely set up a offline deterministic wallet? There is a good tutorial for setting up a safe offline wallet with a regular bitcoin wallet here.

If I want to set up a safe deterministic offline wallet (i.e. Electrum). What would be the right steps?

Should I just store the seed, or also backup the private keys?

On a deterministic wallet the only thing you need to keep safe is your seed / passphrase to be able to restore it in the future

Here you can find a tutorial on how to make transactions with an offline Electrum wallet using your Master Public Key

http://electrum.org/tutorials.html#offline-mpk


How to verify signature in java using message and public key? I was trying different things to verify the signature but couldn't succeed.
I have got the following:
message in string or decimal array (ASCII code for each char)
public key in decimal array (which I can change it into HASH160(Publick Key) using RIPEMD160(SHA256(Public Key)))
signature in decimal array
Now I wanted to verify that the signature is valid or not using java8 (OpenJDK8), please help!

The code you are using to verify the signature is correct according to the bitcoinj-core 0.15.7 library. What may be wrong is the data you are verifying.

When spending a Transaction Output in a new transaction, the entire new transaction (with a few modifications) is signed to prevent malleability. For a simple transaction the "signing type", or SIGHASH, is typically SIGHASH_ALL and is represented by the number 0x01000000 (little-endian). This means that, for every transaction input you sign, the output's scriptSig is placed where the signature would go for that input, all other input signature fields are set to empty, and the SIGHASH is appended to the end of the transaction.

Details for verifying a standard transaction has already been answered, and includes step-by-step instructions: How to redeem a basic Tx?


How does a wallet get the public key from an address? I was under the impression that addresses are just an encoded, hashed public keys with a prefix and that only the public key is used on the blockchain (not the address) for transactions.
But if the public key is hashed, how does the wallet get the public key from the address to create a transaction?

I did some research which confirmed my doubts that this is not possible. So I was wondering, how does the wallet create a transaction if it doesn't have the public key?

EDIT:
I mean how does someone trying to send 10 BTC get the public key of the receiver for pay to public key from the receivers to address. I fully understand the cryptographic element of private & public keypairs and how bitcoin is spent just not how the public key of the receiver is derived from the address. What I have seen is that (most commonly) transactions are pay to public key hash (P2PKH) rather than what I originally thought which was all txns are pay to public key (P2PK).

Perhaps you're confused by the phrasing "the wallet", as it's only the receiver's wallet who needs to know the public key, and he has it, because he created the address in the first place.

In what follows, I'm going to assume a standard 1... address (pay to pubkey hash). That's not the only type of address, but similar ressonings apply to every type of addresses.

In the normal workflow, there are two wallets involved. Let's call them Suzy (the sender) and Rudy (the receiver).

Rudy generates a private key x.
Rudy computes the public key corresonding to x, called P.
Rudy computes the addreds A corresponding to P by hashing it.
Rudy sends A to Suzy (by sending it in person, or putting it on a website, or showing it as a QR code, or ...).
Suzy constructs a transaction that contains an output addressed to A. Suzy has no clue what public key A corresponds to, but also doesn't care. This address really encodes "require a public key and a signature valid for that key, and the hash of the public key needs to be A".
Suzy broadcasts the transaction on the network, where it will be picked up by miners who put it in a block, finalizing the transfer.
Now when Rudy wants to spend the coins he received from Suzy, he needs to satisfy the condition that Suzy put in the transaction. This requires the public key P (as that's the only known public key whose hash is A), and a signature created using private key x (which is the only private key that can construct signatures that are valid for P). Thankfully, Rudy has both x and P, because he was the one who created them.


Are price movements of Bitcoin and altcoins inversely coupled? It is said that when the value of Bitcoin rises altcoins lose value, or at least their price in BTC falls, and I would like to understand exactly why.

If I have spend $10 in BTC to buy BLK, and BLK doubles its BTC price, but in the meanwhile the BTC value rises 6%, too (in reference to USD), I have $10 * 2 * 1.06 = $21.20, so, there's no loss of value.

However, on yobit at least, there was altcoins which saw a generalized selling, and other altcoins that just saw a tiny activity. In other words, the market was mostly paralyzed or only selling. Why is that?

The idea that bitcoin rising leads to altcoins falling is an unproven hypothesis, it is something that traders have noticed, but due to the various flaws in human observation, we cannot say for certain it is true.

That said, there are several factors that could lead to this effect in the short term - but these are all speculative.

Traders are attracted to liquidity. Bitcoin has the most liquid leveraged markets of any crypto currency, or at least historically that has been the case.  While the relative swings of bitcoin are smaller than for altcoins, the use of leverage allows traders to create large profits off of those swings in highly liquid, leveraged environments. When bitcoin is climbing rapidly, traders might be incentivized to reduce altcoin positions in order to increase their available bitcoin capital for leveraged trading.
Arbitrage against US dollar. Many altcoins are traded against the US dollar as well as against bitcoin. Let's say ETH is $50 USD, and .05 BTC/unit, and bitcoin is $1000. Bitcoin suddenly spikes to $2000 - the standing order books for the BTC/ETH pair will still show a price of .05, but that .05 is now worth $100. An arbitrage trader can buy ETH on the USD market and sell it on the BTC market for a near-instant profit - this drives down the BTC value and drives up the USD value until equilibrium is reached.
Bandwagon effect. The idea has become axiomatic so when bitcoin spikes, traders may be psychologically primed to sell altcoins in response.

Note: in many situations these factors are overwhelmed by other market forces, and it is not entirely uncommon for altcoins to outpace bitcoin during sustained price increases - this is demonstrably the case for most of the early 2017 bull market.


Is it legal to embed a miner in another open source program for benifit of the programmer? So say I am writing an open source program, or any program really, and I embed a Bitcoin miner in the code, so that when people run my program, they would be earning Bitcoins for me.

Would this be legal?

Would I get sued for doing this?

The reason why this is important is because I love free and open source software, the only problem being that this doesn't pay the bills. I fully intend to at least inform the users of my program that there is a Bitcoin miner embedded in the program, if not also make a non-miner version available.

Well, lets look at the outcomes for the user:

your user burns hundreds of times their normal power usage mining, thousands of dollars of their money goes into their power bill
your user potentially ruins their hardware (Mac hardware will die, there's no question of that)
your users computer becomes sluggish and unresponsive
their virus protection removes the miner, as they're almost always marked as malware

The outcomes for you:

you make a couple of cents a day
you look like a complete dirtbag to your users

Doesn't seem worthwhile to me. Just ask them for donations if you really think your software deserves financing.


Is there a list of available APIs for Bitcoin exchanges? So far I have seen some Perl modules; Finance:MtGox and Webservice:MtGox for interacting with Mt.Gox, a Ruby gem for Mt.Gox and a Python based command line client for again, Mt.Gox.

I'm wondering if there are any other language APIs for other exchanges?

I'd especially like to find a Java API for more than one exchange.

There is now the XChange library

This is a pure Java library that has been released under the MIT license. It currently supports Mt Gox, but there are simple hooks to allow other exchanges such as Intersango and CryptoXChange to be supported.

It is currently used by the MultiBit client.


What redeem script is used in bitcoin core wallet when generate the address? I'm trying to generate the address 38DGj87axzmQiZeAd1w1y5FEmuu5a7pfBa in my bitcoin core wallet with code.

First, I dump the private key from the address, then I calculate the address from the private key. As the address is start form m, which is of P2SH bitcoin address type. And the P2SH address is constructed as

base58-encode: [one-byte version][20-byte hash][4-byte checksum]

Here I don't know what the script used to calculate the [20-byte hash] in the bitcoin core wallet?

You can use the getaddressinfo RPC command in the latest version of bitcoin core to get the hex encoded script for that address. But note that because you were able to get a private key, I assume this is a P2SH wrapped segwit address, which means the script is just an OP_0 opcode followed by the hash160 of the public key corresponding to that private key.


Does Bitcoin Cash validate the fears about larger block sizes? I read on this forum that a larger block size wouldn't necessarily mean less blocks since blocks are mined every ten minutes, and this is why block size should remain smaller --
Wouldn't a full node use nearly the same space for large or small block sizes? .  The argument was that larger blocks lead to less decentralization, which is bad for some reason.  So now Bitcoin Cash is out with its larger block sizes.  So have all the fears of larger block sizes come to bass with Bitcoin Cash?

So have all the fears of larger block sizes come to bass with Bitcoin Cash?

I think most BTC proponents would say no, the fears have not passed. It is not a black/white situation in which a cryptocurrency immediately fails or succeeds, the effects of the engineering decisions may take years to play out fully.

For example: in regards to the extra load put on full nodes by larger block sizes, over the last seven days the average BCH block has been ~1/3 the size of the average BTC block. So at this point it is not valid to say "big blocks work, proven by BCH", since the average BCH node load has actually been lower than the average BTC node load. The BCH network will have to grow substantially in order to give an accurate, real-world look at the effects of larger blocks. It is perhaps worth noting that I don't think anyone will argue larger blocks will increase decentralization, some users simply argue that decentralization is less important than a quick, linear scaling solution.

In general, remaining decentralized is important, it helps ensure the individual user retains their sovereignty. Centralization reduces the ability of the user to have a say in the code that governs their value.