Are Bitcoins destined to forever increase in value? The idea of a currency with a limited number of units seems to me to be fundamentally different to existing currencies.  While other currencies are generally based on permanent inflation - more 'units' coming into the currency pool - which causes each unit to be worth less, Bitcoin is based on a fixed number of 'units', never changing.  Does this mean that, as usage increases and time passes, each 'unit' will necessarily be worth more and more and have to be split into smaller and smaller amounts?

In theory yes. If demand grows at a steady rate this will certainly be the case, as less coins will be produced making what is available more desirable.

In reality there are other factors which could affect the value of bitcoins.

Alternate chain could supersede bitcoins (unlikely at this time)
Vulnerabilities like what has appeared (with hacking) already in the main markets
Overspeculation of market trends

Think of it more like gold than a fiat currency in the likelihood of behaviour (nb. my opinion, may not be the case)

If the value does keep increasing it can split into eight decimal places to make a very large number of potential units of currency.


Are there any places where should not use compressed public keys? It is always worthwhile to use compressed keys to save size. Or somewhere in the Bitcoin code, exactly uncompressed keys are needed?

There is no one advantage to use uncompressed key vs compressed.
So, there is no one place in code where uncompressed key is allowed and compressed key is disallowed


Does IOTA really have a Documentation? I hear a lot about IOTA, but on the official site I found very little.

I read the WP:
https://iota.org/IOTA_Whitepaper.pdf

but that's just concepts, I want to know details about software like "iotacore"

https://dev.iota.org/#

The link is broken.

can anyone tell me where I find reliable information about this  cryptocurrency?

Great IOTA tutorial playlist
https://www.youtube.com/playlist?list=PLmL13yqb6OxdIf6CQMHf7hUcDZBbxHyza

IOTA tools from the playlist
https://www.mobilefish.com/services/cryptocurrency/cryptocurrency.php

IOTA and NodeJS tutorial
https://youtu.be/Z-NN0rRcwY0

Repository for above tutorial
https://github.com/iota-community/iota-workshop


sendrawtransaction and txn-mempool-conflict When i sendrawtransaction to bitcoind, i get error (exceptions) 18: txn-mempool-conflict (use Bitcoin JSON-RPC denpamusic/php-bitcoinrpc)
But the transaction is sent to the network and is subsequently confirmed.

Example one decoded transaction : https://jsfiddle.net/rn58a4j6/

then i send this transaction:
94ec12fc463230b4285a29b047608627c05572a4c6eabe6688a201ce49ae72f7

To solve this problem, I restarted bitcoind.

I think that maybe when i was developing my project, I made a bad transaction and it saved in mempool


What is the difference between Consensus and Distributed Consensus? This is more of a clarification than as a question. Since I didn't have the rep to post a comment in this question, I'm putting this itself as a question.
Sources I've referred till now:

A fundamental problem in distributed computing and multi-agent systems is to achieve overall system reliability in the presence of a number of faulty processes. -Wikipedia

It explicitly indicates that consensus is a fundamental problem in Distributed Systems.
However,

"Consensus" means when everyone is on the same page. -Bitcoin SE.

My understanding till now is that if every node had one vote, then for the whole network of nodes to agree on a decision, use of consensus is required. If the system at hand is not distributed, then the environment reduces to just one node which doesn't need consensus mechanism at all to come to a decision. So my confusion is, are there any situations where consensus is required even when the system is not distributed?
If yes, please explain what's the difference between the terms "Consensus" and "Distributed Consensus". If possible, present an example.
If no, does that mean the terms are the same?

A consensus is an agreement between several agents. So it's always distributed in that sense.
But here it is about the process of how to achieve such consensus.
It's not dictated by one master. But agreed on by distributed voting.
Due to temporal logic being a nasty beast, you can't assume everyone to be on the same page at a specific point of time. But eventually everyone will reach a certain state of consensus.


lncli pendingchannels output: difference between `pending_closing_channels` and `waiting_close_channels` When plotting lncli pendingchannels, two of the outputs are oddly similar:

pending_closing_channels and waiting_close_channels. I have only seen my closed channels either as the output closedchannels or as waiting_close_channels. I suppose pending_closing_channels refer to the step previous of negotiation for cooperative close? or is it after, during the amount of confirmations needed to wait?

Found an answer for this by asking the slack community:

pending_closing_channels: waiting for confirmation blockheight after cooperative closing and publishing on the blockchain (standard case)
waiting_close_channels: closing request being processed
'pending_force_closing_channels': waiting for confirmation blockheight of unilaterally closing the channel (Commitment Transaction)


in transaction, what is 'hash' data? i'm studying Bitcoin: A Peer-to-Peer Electronic Cash System Satoshi Nakamoto

and this paper introduce a transaction model. (above picture)

but i don't understand what is 'Hash' means exactly

i think Hash is same  Bitcoin API JSON-RPC - signrawtransaction function

it means hash(txid + owner's public key)? then what method used hash function?

or  hash(result of signrawtransaction + RIPEMD160(sha256(pub k)) )? then what method used to hash?

The hash refers to the signature hash, to which all tx data except for the input script is committed to (unless you are signing with a sighash flag other than ALL).

The signature hash is what is signed with ECDSA to produce the signature.


I found a BTC hash. Now what? I used a mining program written in python and after a lot of time, it found a hash that looks something like this: 0000de957fbfdfc77582e0d0b20c53d2d1d83d8bb8cfe3693521f672bf2a6021 except it has 19 0's at the start and all the following text is also different. What do I do now? How do I get the bitcoin in my wallet?

If you have found a new valid block at the network's chaintip, then you should submit that block to your network peers as soon as possible, so that they will hopefully add it to their local blockchain record. If other miners build upon your block, then it should become a part of the valid chain, and you will eventually be able to spend the coinbase UTXO in it (after it has matured 100 blocks).
As an example, if you are running bitcoin-core then you can use the submitblock command to submit your valid block to the network.


anyonecanspend final condition of a script can be spotted just by looking at the script hash, without the redeem data? Consider the following scenario.

Alice, Carol and Bob create and fund a script with the following rules:
if now, alice pubkey, bob pubkey
else
if now+500 blocks, bob pubkey, carol pubkey
else
if now+1000 blocks, ANYONECANSPEND

The question is if anyone (besides Alice, Bob and Carol who have the redeem script) can tell by looking at the address (script hash) that its final condition is ANYONECANSPEND, and miners for example choose not to include it in a block until the last nLockTime passes and the miner can claim the entire output, not just the fee.

Based on my current understanding, just by looking at a native P2WSH address (hash of script) it tells you nothing about the redeem script, or am I wrong?

Also, can miners learn the final condition if the output is spent at its second nLockTime, like when Bob and Carol try to spend, they must also provide the redeem script, thus allowing miners to see that if they wait 500 more blocks they can claim the entire output, not just the fee, and not include it in a block until then. Thank you.

As there are no known preimage attacks on RIPEMD160 and SHA256, it is impossible to know what the contents of a redeemScript are given just the scriptHash. So yes, it is impossible to know what conditions are necessary to spend from an address given just the address. That is one of the main points of using scriptHashes: it hides the redeemScript from others until it is spent from.

  Also, can miners learn the final condition if the output is spent at its second nLockTime, like when Bob and Carol try to spend, they must also provide the redeem script, thus allowing miners to see that if they wait 500 more blocks they can claim the entire output, not just the fee, and not include it in a block until then.

Yes, this is currently a problem. If the transaction is signed and broadcast, the redeemScript will be revealed and miners could then see the ANYONECANSPEND condition in which case they may be incentivized to not let the transaction confirm. This is an issue.

However that issue is not without solution. This is specifically something that MAST (BIP 114) fixes. Basically un-visited branches in the script are hidden behind a hash. So if MAST were available and the redeemScript made use of it, then the conditions which were not used (e.g. the ANYONECANSPEND condition) would be hidden behind another hash and thus outside observers would not know about it.

Taproot is an expansion on MAST which adds further privacy by making it so that observers won't even know that there were other branches that were not used.


Is Google Authenticator really useful on blockchain.info? blockchain.info hosts encrypted wallets, and all decryption is done locally, so having a Google Authenticator bound to a wallet only prevents an attacker from downloading that encrypted wallet.

Now, assuming the passphrase is good, having an encrypted wallet is perfectly useless if you do not know the passphrase.

So the two-factor authentication would provide any benefit only to people with non-good passphrases... but that wouldn't be a real solution: they ought to change passphrase anyway!

Hence, I can't come up with any situation were enabling two-factor authentication on blockchain.info provides any meaningful benefit.

Am I missing something?

Two-factor authentication is generally useful in that it adds a different layer of security to your account. In addition to your password (which is something you know) two-factor authentication adds a key generated from a specific device (which is something you have.)

In my experience one can never be too cautious about their financies, especially when they are being hosted on a machine connected to the internet. If it were just the security vulnerabilities you knew you knew about (e.g., the strength of your passphrase) that would be one thing. Usually it is the security issues you do not know about that justify extra layers (like two-factor authentication).


Stuck Transaction for almost 2 days, have paid fees Can anybody please help with 1 transaction, its stuck already for 2 days, altho I did pay fees, not sure whats the issue, other payments sent after this has been confirmed already
https://blockchain.info/tx/89e3318664af7dc1e9f7ad7d20708e50c707ed706c7f6eae9a9fcf44af3295d2

Hi I had the same problem and was at the mercy of too low of a fee I sent.
I'd been waiting 36 hours and then tried this: https://www.viabtc.com/tools/txaccelerator/        I have no idea it might be a coincidence but it confirmed within the hour. Could just be coincidence. So I put your transaction in there for ya. let me know if anything changes!!!! :)


What benefit of Bitcoin (to governments) outweighs the cost of not being able to control the value of a fiat currency? I've read some books about finance / economics, and one of the things I've read is that governments often like having the ability to control the value of their own fiat currency.

This allows them to do things like wage a currency war, in which (to my understanding) they temporarily devalue the price of their currency in the international market in an effort to destroy or severely weaken the position of foreign corporations that are competing with local corporations.

Having a fiat currency also allows the state to debase its currency, effectively taxing the holders of that currency (citizens, bondholders, or foreign states using it as a reserve currency) in a hidden way.

Those seem like subtantial perks of having a fiat currency.

Using a foreign currency as legal tender can curb inflation and delimit deficit spending. It will also reduce friction for trade with other countries accepting the same currency.

In some cases the stability provided by using a foreign currency outweighs the benefits of controlling your own currency.
 [Wikipedia: Currency Substitution] lists for example
 ten countries that use the USD exclusively, as well as numerous other countries that do not maintain their own legal tender.


What are the pros/cons of the Multigateway service on NXT? I'm doing some research on the decentralized exchange multigateway on the NXT platform. I was wondering what are the pros/cons of this service compared to centralized exchanges like cryptsy?

The Multigateway (often abbreviated MGW) is a service that was built to run on top of Nxt and acts as a semi-decentralized exchange.  An asset is issued on the Nxt Asset Exchange (the AE) and users can buy and sell this asset.  The value of the asset is presumed value of the associated cryptocurrency, in Nxt.  For instance, a BTC Nxt asset should trade at the value of BTC in Nxt.

The idea for semi-decentralization is that N separate individuals agree to run a multigateway server for a specific, non-Nxt cryptocurrency that supports multisig transactions (BTC, LTC, DOGE, just to name a few.)

Each server manager contains a multi-key to the associated addresses that hold the funds for the exchange.  When a user makes a multigateway purchase on the Nxt Asset Exchange for the currency provided by the multigateway operator, they can request a withdrawal by sending a message over the blockchain.

For the withdrawal to take place, a majority of the keys, held by the MGW servers, from the payment address must sign the withdrawal transaction.  For instance, if 3 MGW servers manage a BTC asset on the AE, then 2 servers must sign the out-going BTC payment before it is considered valid by the BTC daemon.

The advantage to this setup is primarily two-fold.  First, if one of these MGW servers manages to get hacked, and the keys are stolen, the hacker can't take the coins.  He will have to also hack into at least one other server (assuming there are only 3) and still those keys as well, before he can clear out the exchanges wallet.

The second benefit is that those who run the servers can't withdraw funds on a whim.  The majority of the server managers must agree to make a manual withdrawal and sign the transaction together.  This means that no single manager of an MGW asset can withdraw any associated cryptocurrency that's being traded on the AE.  If a bogus-transaction occurs outside of the typical MGW functionality, then the MGW managers would have some explaining to do.

It must be understood that the 3-Server setup is most common but isn't the only setup possible.  There could just as well be 5, 6 or even 7 servers.  If there were 7 servers, then 4 of those servers would need to sign the withdrawal request.  Notion is why the MGW can claim to be "decentralized".


Breadwallet: Recovery Passphrase Breadwallet uses a recovery passphrase in case you loose your phone. I read that you can reimport your wallet using a private key only once and after that you have to export it again in order to be able to import it a second time (see Using Paper Wallets).

Is the key derivation method breadwallet uses also susceptible to that, or can I use this passphrase multiple times to recover the wallet?

You can use the wallet passphrase (Bip39 mnemonic) as many times as you like. You don't have to export it again.

But mind, breadwallet does not follow the bip44 chainpath scheme. Importing the passphrase into a different wallet application would first require to "convert the keypath" with a tool.

But i would recommend to not use the same wallet passphrase (bip39 mnemonic) on multiple devices simultaneous! You might reuse addresses and run into a chance of creating double spends.


Is there any way to estimate an average amount of transactions per user per month? I would like to get a general picture about Bitcoin ecosystem development and dynamic changes, based on some numbers. Is it possible to have an estimate of a number of active users somehow? Preferably, based on the data from blockchain itself. Is it possible to estimate an average amount of transactions per user per month?

While it is not possible to know the exact amount of users, there are still ways to estimate it by making assumptions and looking at online polls to utilize the wisdom of the crowd.

currently, my estimate is somewhere between 80 and 100 million users, although that refers to unique individuals who has ever used bitcoin, rather than unique individuals who are actively using it today.

furthermore, it is impossible to correlate transaction counts to this number as some services and systems generate automated transactions.

the other answe suggest that you look at bitcoin days destroyed, which is a measure for how long tokens have been stored sonce last transferred.

you could use that if you correlate it to other data sets, but beware that the time between broadcasted transaction and being mined in a block is unaccounted for.


Importing private keys into wallet - does the bitcoin disappear from the original wallet? If I import a bunch of private keys into a new wallet, will the funds be removed from the original wallet? Or do they both somehow point to the same money?

In my case, I wish to move funds from Bitcoin Core wallet to an Exodus wallet.

Bitcoins are never actually in a wallet. Bitcoins sit in the blockchain. Many copies of that blockchain resides in nodes (computers). Simply put, your wallet merely is a list of addresses on which according to the blockchain are (fractions of) bitcoins stored.

You can have as many of the same wallet s you like. When they all contain the same addresses, they will show the same balance as they are all looking to the same blockchain.


How to Install Copay desktop wallet in Ubuntu? Could someone publish a step by step instructions to install, in a simple way, the Bitcoin desktop wallet Copay?

I have read the "instructions" published in their Github account and believe me, it's not user friendly:

  Desktop versions (Windows, OS X, Linux)

  Copay uses NW.js (also know as node-webkit) for its desktop version.
  NW.js is an app runtime based on Chromium and node.js.

  -Install NW.js on your system from nwjs.io
  -Run grunt desktop

Thank you.

These are not instructions to install it. These instructions are for building Copay on your system.

Here are the instructions for end-users (non-developers):

  1) Download the latest binary

You should visit its Copay releases page on GitHub and choose the ZIP file for Linux.

After you download it, unzip it and make sure you moved its folder to somewhere you won't forget.

  2) Run it

Open the Linux Terminal (Press Ctrl + Alt + T to open Terminal if you're on Linux Mint or Ubuntu)

Open Copay's folder (which you just unzipped and moved).

There should be ~ 20 files and folders in that folder.

Find the file named "Copay" (without quotes and its icon may look like a document), drag that file onto Terminal and press Enter.

Now its GUI should open. Please note that you have to do Step 2 everytime you want to run it.


Forking PIVX - ERROR: CheckBlockHeader() : proof of work failed I have forked PIVX and generated new genesis block hash, merkle root and nonce, and changed the rewards parameters.

It compiles fine and the daemon starts, I have even got 2 nodes connected, but attempting to mine the first block with setgenerate true -1 does not work. getmininginfo says mining = true but the hashratepersec is 0.

My debug.log shows pages and pages of this:

2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed
2018-02-01 13:16:55 ERROR: CheckBlock() : CheckBlockHeader failed
2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed
2018-02-01 13:16:55 ERROR: CheckBlock() : CheckBlockHeader failed
2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed
2018-02-01 13:16:55 ERROR: CheckBlock() : CheckBlockHeader failed
2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed

I think this maybe a small error somewhere but not exactly sure where. Maybe someone would know from experience?

If you are commenting to say "not another coin clone" please save your energy for something more productive.

Thanks!

Create the first block manually.  I believe that is how Satoshi Nakamoto did it.  I think there is a uniqueness to the first block and I've read that it's funds can't be used for some reason.


A limit on privpub key pairs in a wallet Is there a limit on the number of private/public key pairs one can have inside a wallet? For instance if I have, say, a 1M transactions could I have a million unique bitcoin addresses...each address created with a different private key?

As far as I know there is no limit of keys you can keep in Bitcoin-Qt. Beware though that Bitcoin-Qt only creates 100 addresses in advance with default settings and you should create backups at least every 100 transactions, or set it to generate more private-keys in advance.


What is the fee charged by MtGox to receive a wire transfer in AUD? I know my bank (HSBC) charges me $20 AUD to make a wire transfer. But how much is charged by MtGox to receive this wire transfer on say $1000 AUD?

I'm tossing up between cryptoxchange and MtGox - MyGox has better prices to buy bitcoins in AUD, but I have to know how much it will cost to send them my money. I can deposit $1000 AUS in cryptoxchange with no fees.

From the International Wire Transfers - Deposits section of MtGox's FAQ:

  Our bank charges a receiving fee of 1,000 Yen.  You can send wires in
  any currency to our bank in Japan. Funds sent in non-USD will either
  be added to your wallet in that currency if you have one, or converted
  to USD with a 2.5% exchange fee. Any fee charged by your bank or an
  intermediate bank will be deducted.

  If you plan to invest more than 50000 USD or equivalent on the long
  term in bitcoins, we need to know about you. In this case please use
  our verification system to get your account verified first. Submission
  of forged documents will result in declaration to the appropriate
  authorities.

  Not following the instructions written below can result in your funds
  being lost, or handed over to the local authorities while pending
  investigation.

  Also note that International deposits lower than 75 USD (or
  equivalent) typically result in only a small amount of funds being
  deposited into the receiving account or may be rejected because the
  amount of fees went over the amount of sent funds. This is due to
  intermediaries and banking fees.

Google tells me that 1000JPY is worth about 12AUD.

There is a mention of another method "Technocash" having issues, which likely means it's no longer available. It also mentions that AurumXChange will soon accept Australian bank deposits (no mention of withdrawals, but you could hope!).


Is asic-resistance obsolete? Since the early days of cryptocurrencies, we have seen attempts to utilize ASIC-resistant mining puzzles. The idea behind that was to keep rich influential custom-hardware manufacturers out of game and make mining viable on commodity hardware. But as it turnd out lately, all such current attempts are doomed to fail. And the actual higher difficulty of producing ASICs for ASIC-resistant puzzles brings even more corruption and controversy.

It feels like there's no point in trying to come up with some memory hardness anymore. There will always be one company willing to spend $200M on custom hardware, because in the end it does not really matter whether it's 10x or 100000x more effective. It's frankly not possible to stay competetive against it. Wasn't it better if all currencies just utilized Blake2, or dSHA256 right now? How did we even arrive in this situation? Did nobody anticipate it to happen if the Market-cap raises this significantly? Are there any new ideas or Mining-puzzles being provably nonASICable, e. g. some memory-superhardness or whatever, or is the era of evading ASICs over?

In the linked article the author describes in quite some detail the failure of asic-resistance. (Thank you @Jannes for finding it.)

  ASIC Resistance

  We’ve been pessimistic on ASIC resistance for a long time, and our journey into the hardware world solidly confirmed our position. Hardware is extremely flexible. General purpose computational devices like CPUs, GPUs, and even DRAM all make substantial compromises to their true potential in order to be useful for general computation. For basic hardware development, most algorithms can see substantial optimization just by taking away all of that generality and focusing on one specific thing.

  The vast majority of ASIC-resistant algorithms were designed by software engineers making assumptions about the limitations of custom hardware. These assumptions tend to be incorrect.

  https://blog.sia.tech/the-state-of-cryptocurrency-mining-538004a37f9b

It seems, on the basis that the article is both articulate sufficiently and, correct, that there is no actual hope for asic-resistance in any currency of potential future value.


The only way to know which signers signed is to verify the signatures against the public keys. Each signature will only verify with one of the pubkeys.


Would a service for automated repurchasing of Bitcoins encourage spending? We launched Reload, an online service that binds your bitcoin wallet to your bitcoin exchange account (16 supported so far): whenever you spend bitcoins from your wallet, Reload will use your exchange account to immediately repurchase the same amount of bitcoins. Reload also enables automated reporting and bookkeeping. Do you think such services might encourage Bitcoin spending? Are you repurchasing Bitcoins automatically with some other service already? Do you find this kind of service useful?

This seems rather odd to me. I try to time my purchases with Bitcoins for times when the price is high. And I try to time my purchases of Bitcoins for times when the price is low. If I use a service like this, I'll either be buying high or selling low, which is not my personal preference.


In the QBundle Burstcoin Wallet, why is a fee of 1 BURST required to set the account info? The QBundle Burstcoin Wallet (v2.0.4, installed to Windows 10) requires a fee of 1 BURST to set the Name, Description, and Passphrase for the wallet.

Admittedly, the fee is very low (worth about 2.5 cents at the moment), but why is a fee required? Who receives it?

You are claiming an address on the blockchain. The fee makes sure no one will (try to) claim all addresses on the network.


Send coins from bitcoind full node to lnd without fee? I'm trying to fund my LND node, for that I put some dust on my BTC wallet address and now I want to send to my LND wallet address but when I try to send with fees "paytxfee": 0.00000000 returns an error saying:

  Error: This transaction requires a transaction fee of at least
  0.00012192

So I'm wondering if there's a way to reduce this fee or something?

Your lnd node contains a regular Bitcoin wallet. In order to open a channel you currently need to do on chain transactions (which obviously require fees)

You need to send Bitcoins to your lnd wallet
You need to open a channel which is another on chain transaction.

Theoretically the first tx could be omitted if lnd would support the import of other private keys (I think no lightning wallet currently does this as it seems to be of lower priority at this time)

Also you could ask Simone to open a channel with you and use loop or a submarine swap to get your channel refilled in exchange for you sending your btc onchain. In that case it is still 2 tx but only one for which you pay on chain fees. The onchain fees for Opening the channel are paid by your channel partner.


multiple block on the same height? Just a quick question , in the blockchain api quoting from the documentation it says:

get_block_height

Get an **array** of blocks at the specified height. Returns an array of Block objects.

Params:

height : int - block height

why will it be an array? because i thought the blocks that are not on the main branch will be disregarded thus one height will only be one block?

Blockchain.com is not a blockchain node, it is an explorer. They have no constraint on following the same rules as a Bitcoin Core node, and can keep orphaned and forked blocks available if they wish to, and return all blocks they know of for a block height if they wish to.

In the main Bitcoin chain, things are as you say - Only a single block may survive at a given block height. If multiple blocks are mined for a given block height, the chain with the most amount of work done (essentially the block with the longest chain of descendant blocks) will be kept, and the other will be orphaned.


I found the problem, in the bip143 tx digest preimage, the scriptCode needs to be preceded by the length of the scriptCode. In this case 0x47


OP_RETURN max bytes clarification I've read that an OP_RETURN opcode allows up to 80 arbitrary bytes to be used in an unspendable transaction.
My question is, how is it possible that in this famous transaction (d29c9c0e8e4d2a9790922af73f0b8d51f0bd4bb19940d9cf910ead8fbe85bc9b) are being pushed 983 bytes?

In detail:

 Push data having size of 893 bytes. OP_CODES:

     6a             4d                    d7 03
 OP_RETURN    OP_PUSHDATA2    (03d7 = 983 following bytes)

The limitation is a relay standard, but not a consensus rule. This can be modified on a per-node basis with $ bicoind -datacarriersize flag. The consensus rule that would limit this is the max block size, if I'm not mistaken. So, presumably, miners connected to the node that accepted that non-standard transaction mined that block, thus it was non-standard, but still valid.

Standards

These rules are enforced during mempool acceptance. Each node can decide to implement different rules, provided they follow consensus rules, but many just accept the Bitcoin-core defaults upon installation. In this case 80 bytes is the default setting for OP_RETURN data size.

Consensus Rules

These rules are enforced at the block validation phase. These cannot be different between nodes or it would be considered a hard fork and the chains would diverge.


Can a scriptPubKey have multiple addresses? When working directly with bitcoind, I can getRawTransaction for any transaction in the network. The vout has multiple outgoing addresses usually which contain a scriptPubKey. The scriptPubKey has a field called addresses, which is an array. I've only seen transactions with one address in this field. Is it possible to have more, if so, what does that mean?

Any of the addresses in that array can spend that output. Multisig transactions will give you multiple addresses there.


BIP32 Neutered function Can the following be clarified, where I am wrong:

The Xpriv can derive a hardened xpriv.

It can also derive a non hardened xpriv, which we will use with the neutered function to make it an xpub.

The xpub derived, is the same xpub that we would get if we had done CKDpub on the original Xpub.

Xpirv and Xpub with the capital 'X' can be seen as parent keys.

So a diagram would look like:

Xpriv -> xprivH (hardened)

Xpriv -> xprivN -> xpubN (Normal: This is the path from the xpriv using Neuter)

Xpub -> xpubN (Normal: This is the same path from the Xpub using CKDpub)

My other question on top of this, is if a Wallet software has the mnemonic key, would it be better to always derive from the mnemonic?

Or would they keep the account level xpriv, it seems like a waste to have both the mnemonic and the account level xpriv on the device.

Also, Is the extended private key, the (private key + chain code), or is it the (magic + depth + fingerprint + index + chain + key) ?

It can also derive a non hardened xpriv, which we will use with the neutered function to make it an xpub.
The xpub derived, is the same xpub that we would get if we had done CKDpub on the original Xpub.

Yes. Neutering really means "Do CKDpub and delete the Xpriv". There is no neuter function on Xprivs; it's for the wallet software, not the key derivation.

My other question on top of this, is if a Wallet software has the mnemonic key, would it be better to always derive from the mnemonic?

Deriving from the mnemonic requires additional computation, however requires less storage space. I don't think it really matter.

Also, Is the extended private key, the (private key + chain code), or is it the (magic + depth + fingerprint + index + chain + key) ?

The second.


Where can I look up the best ASICS under certain conditions I have found a lot of helpful websites showing the best hardware for mining in general. However, is there a list of any kind where I can choose the criteria?

For example: I want an ASIC that has a high hash rate, does not cost over 200 dollars, but I do not really care about power consumption. Or the other way round, I want an ASIC that has a good hash rate, a moderate power consumption but I do not care about the costs.

I could not find any website that provides such services

http://www.bitcoinx.com/bitcoin-mining-hardware/

But you probably don't want to mine...


Should I use getwork or getblocktemplate I am working on an fpga mining device just for fun. I realized that there is a getblocktemplate function which replaces the getwork Json-rpc call. So do I need to switch over to it and change all the code or can I continue using it . Will getwork be removed from bitcoin later or will it still be supported?

The advantage of getblocktemplate is that work units from it last longer, because you can change the extraNonce field. That's nice if you're writing an fpga miner, because it saves bandwidth.

getwork will probably never go away. It's useful and not very hard to maintain. Note that that's a personal opinion; I'm not one of the Bitcoin developers.

Edit: getwork has been removed in v0.10.0, so you have to use getblocktemplate.


If I send bitcoin or some other crypto from my wallet to Binance and I don't see a deposit, what could be going wrong? I am still very new to the world of cryptocurrency but as of a couple of years ago I realized its significance and now I am afraid I have a lot of catching up.

Anyway, what happens if I send Bitcoin, Ether, XRP or Dash from my wallet to Binance and I don't see a deposit, what could be going wrong there? How do I troubleshoot something like that?

If you don’t see your deposit right after you made the transaction, you should wait a little bit, it shouldn’t take so long to have your transaction/s into the blockchain of x cryptocurrency.

Transactions can take minutes and even hours in order to go through the verification process which is basically a process for the network to make sure your transaction is legit in all possible ways, after such process your transaction is added to a block and thus to the blockchain for good.

However, there are a few cases where a transaction won’t appear:

You put the wrong address
number 1

Make sure you put the right information before making a transaction, if it doesn’t appear just give it a little of time and you’ll be fine, but notice that if you put a wrong address or any other parameter required to make a transaction YOU WONT BE ABLE TO REVERSE/TROUBLESHOOT this event and thus, you will loose your money

pd: Crypto-exchanges like Binance or coinbase, they all have a certain number of verification in order to have your transaction shown. I don’t know how many binance uses, but I think after 4 verifications (BTC) your transaction will appear on your wallet, however, such parameters are different among cryptocurrencies, ripple just takes 1 verification and you’ll be all set to spend your money.


Hypothetical situation: the Internet gets split in two, what happens with Bitcoin? Let's suppose, that at some time the Internet gets split in two, possibly because of wartime, or another possibilities (there was once a situation, when Egypt managed to split the internet in their country from the outside).

There begins to exist two versions of the blockchain, eg. USACoin and ChinaCoin
There are some people with access to both internets ("pirate joins")
Eventually, the internets join back

How would Bitcoin software react to those splits, how would it react to the "pirate joins", how would it handle the final internet join? What would be the "Plan B" of the Bitcoin community?

Any of the "pirates" with nodes on both networks and who have unspent coins in the blockchain before the split would be able to spend those on both networks, for as long as the network is split.

Upon joining again, the longest chain will always prevail. So anyone who mined any new coins after the split and those were mined on the shorter of the two chains will lose all those new coins -- they will become invalid.

Anyone who spent coins that existed before the split, but spent them only on the shorter chain, will have those coins returned to him/her after the join, because they were only spent on the shorter chain (which is discarded and invalidated)

In short, the bitcoin network will take it in stride :) but some people will lose, and some will benefit doubly.


Is there a (potential) "Blockchain size problem", and what solutions are available? As more and more Bitcoin transactions are produced, the growth of the Blockchain may well, one day, become a problem for systems which want (need?) to store the whole blockchain.

Storage usage
Client startup time
First-time synchronisation

This answer to "Are there any studies into the size of the blockchain scaling over time?" suggests that Simplified Payment Verification is a good solution, but SPV, as far as I understand it, requires a degree of trust in individual peers that may not be to everyone's taste.

Although I don't really understand the blockchain well enough even to know if this is sensible, the sort of thing that occurs to me might be a mixture of SPV with partial blockchain caching (least frequently used?), where the client keeps a small piece of the blockchain.

Is this really a problem, and is there any work in progress to solve it?

Alternatively, if this isn't a problem, please help me to understand why.

Currently, only full-nodes, i.e. nodes that have the complete blockchain inventorized relay blocks. Personally, I've recently encountered the first problem, when my Linux partition ran out of storage, yet if I had chosen a bigger partition size, I'd be able to even afford a multiple of the 50GiB easily.

Storage usage: Currently, the blockchain is about 50GiB. If it continues to grow at 1MiB per 10 minutes, storing the complete blockchain should remain affordable for those that want to.
For all the others, there now exists the option to run a pruning node. Once pruning nodes will be enabled to relay blocks, I would expect that the number of serving nodes will start to climb again.
There would need to be some nodes with the complete blockchain to secure history, though.
Client startup time: This may become a problem at some point, but the blockchain data doesn't get checked every start-up, rather synchronization only runs once for each block. So, with a current computer, I don't think it is an issue now or in the foreseeable future.
First-time synchronization: Synchronization has been dramatically improved with the release of Bitcoin Core 0.10. Now, only the block headers have to be processed in order and all other block data may be processed in any order. This and other tweaks have drastically reduced the time necessary to catch up with the network. My computer can now do initial synchronization within a few hours. As processing power will scale, I expect this to remain manageable for the foreseeable future.
Update: The coming 0.12 release will additionally increase synchronization speed by x5, due to validation of signatures being run through libsecp256k1, a library that has been specifically coded to run Bitcoin operations more efficiently.


Possibility of hardware wallets being 'unsupported' in the future? I was reading online about getting a hardware wallet/vs a paper wallet, and some comments online were mentioning that "Tech changes so quickly that in 16 years the hardware wallet might be completely unsupported. Perhaps the usb connection it uses will no longer be available at all. Maybe the company that made that wallet goes under. Sound too risky to me". I  found this really interesting, as I had never thought about the technical limitations. At the same time, it seems a bit crazy that those things would happen. Even if the company goes under, you still have your wallet and keys. Even if it isnt the same type of USB, getting an older computer with a USB with it is definitely possible.

I thought a hardware wallet was one of the more secure ways to store crypto, are these fears legitimate?

Sure, it's possible that the physical hardware spec could cease to be commonplace (we've seen it before with floppy disks, tapes, PS/2 etc.)

However, Hardware wallets follow BIP39/44/49. In the event that the wallet is lost, unsupported, destroyed, or the company dies, you can always recover your coins by using a software wallet such as Electrum, or even manually. Many open source tools exist to recover coins from seeds.

If at any point the hardware wallets are being deprecated because of actual hardware reasons, it's almost a given that newer wallets will be created, and you will be able to just import your seed from the old one to carry on transacting as normal.


Can a bitcoin transaction from a specific bitcoin address be banned? (via mining pools) Can a bitcoin transaction from a specific bitcoin address be banned? (via mining pools)

Suppose Satoshi Nakamoto wants to send some bitcoin from one of his bitcoin address, can the mining pools refuse to process it? (Considering China has 81% total bitcoin hashrate with their pools combined).

I heard that a mining pool could (if they want to) refuse to put your transaction into the mining block, so your tx would be stuck into the mempool, until some other mining pool would put it into the next mining block, but I heard this could not be done forever.

Thoughts?

Yes, miners can censor transactions. A mining pool (or solo miner) can choose to not add a transaction to any blocks that they create. And, of course, this can be done dynamically so that transactions that match whatever arbitrary rules they want can be disallowed.

However this only effects one mining pool or miner. Other miners will not necessarily follow the same rules. So if one miner is censoring transactions, then some other miner will probably include them in a block.

But it is also stupid for a miner to censor transactions. All transactions pay a transaction fee and by refusing to add a transaction to their blocks, they are voluntarily taking a lower payout. The transaction fees are there to incentivize miners to include transactions.


What prevents Bitcoins for being used to avoid taxation? Today, states can follow money trails and transaction histories, usually involving checking bank accounts. As as I understand, It's impossible for anyone else to read your Bitcoin transactions and current balance without your consent.

In a Bitcoin world, how can a state monitor bank account when it's impossible to check their transactions?

What prevents Bitcoins for being used by criminals to avoid
  taxation?

nothing.  thats the price of anonymity:  it can be used for good and for bad.

  In a Bitcoin world, how can a state tax its citizens when it's
  impossible to check their transactions?

in a hypothetical purely bitcoin world, the state would have to find different ways of funding itself, if it existed at all.


Transaction was rejected - Bitcoin QT, recovered wallet.dat I recently installed a new version of Windows on a new HDD, but I'm having problems getting my old wallet.dat to work.

Here's what I've done:

Install latest Bitcoin Core.
Copied over the blocks and chainstate folders from the old hard drive.
Run Bitcoin Core and allowed it to sync up to date.
Closed Bitcoin Core
Removed Wallet.dat from my roaming\Bitcoin folder
Copied Wallet.dat from old HDD to the roaming\Bitcoin folder
Run Bitcoin Core with '-rescan' parameter.

When I run the software, I get the following message:

  Warning: Wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in C:\blah\de\blah

There's nothing wrong with the old HDD, or the previous wallet. In fact I could boot up the previous Windows install, but it's a ballache for various reasons involving symlinks and other such non-standard tomfoolary.

On subsequent runs, I receive the following message:

  Warning: error reading wallet.dat! All keys read correctly but transaction data or address book entries might be missing or incorrect.

So now I can see my coins in the wallet, and my transaction history - it looks like it's worked, except I can't spend any of the coins. I get a message stating:

  The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if yuo used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.

I've not made any use of the wallet since installing my new version of Windows, it's all up to date on the old HDD... so I can't see how it would be listing coins that have already been spent... but the start up message suggests that tansactions are missing from my history, so perhaps I have less than I think?

Can anyone shed light onto why this process hasn't worked?

Thanks.

So I had to fire up the OS on the old HD and run an older version of Bitcoin code - lo and behold, no problems with the wallet at all. Transferred balance to another address, installed new Bitcoin core and generated a new wallet.dat.

None of this fills me with confidence for long term storage of my coins!!


Is there a shortcut for a synchronized bitcoin core after txindex? I have downloaded the whole blockchain, but I was curious about the working environment after enabling txindex=1 and calling the -reindex command.

Now that I decided not to reindex the blockchain (didn't want to develop anything extreme and to wait that long), I disabled txindex=0 and bitcoind is downloading again all the blockchain!

Is there a shortcut to avoid it?

*I think the debug.log file is growing twice the initial size

When enabling or disabling txindex the blocks you already have are used, they are not re-downloaded. There is no shortcut, once you start you have to wait for it to finish. The process of re-indexing throws out the state you already have and rebuilds it completely from the block files where possible.


Can bitcoins be traced to scammers Was scammed recently of €5600 .Was approached online and encouraged to buy bitcoin through coinbase. I had no experience of it before. Was told to send my bitcoin to a company address which I now know was a scam. How can I trace my money. Have proof of all transactions

Bitcoin allows users to transact pseudonymously, so there is no data contained within the blockchain record itself tied to an identity. This is by design, anything else would be terrifyingly Orwellian. Transactions are final, once fully confirmed in the blockchain nobody can issue a reversal or cancellation. As a bitcoin user, you have ultimate responsibility over your funds.

However, it is possible that external data can link an identity to an address. For example, many exchanges that convert BTC <-> fiat money will require customers to undergo a ‘know your customer’ (KYC) procedure, in order to satisfy the regulators of the jurisdiction the exchange service operates within. So an exchange may have a record of customers and associated addresses (but that would not be a public record).

This means that if the scammer stole your coins and then sent them straight to an exchange, there may be a record that could allow the authorities to find the scammer. But keep in mind as well: bitcoins are fungible, so while there is a transaction history that can be traced, there is no way to track ‘this exact bitcoin’ through time. So a savvy scammer may be able to obfuscate their transaction history, to the point of it being functionally impossible to trace your stolen coins through time.

Your best bet is likely to file a report with your local authorities, but I am sorry to say that in many cases there will be little they can do. Best of luck, I hope you are able to recover your funds.


Possible to buy bitcoin at MtGox at $259 and sell for $635 at BitStamp at 18th February 2014? So would it really be possible to buy bitcoin at MtGox at $259 and sell for $635 at BitStamp at 18th February 2014? Because those are the bitcoin exchange prices at that moment?

In short: At this current time, you can buy BTC but you can not withdraw your BTC from Mt. Gox due to immaturity of their infrastructure and modified Bitcoin code. Time will tell if they survive this. So no, it is not possible to buy from GOX and then sell those at Bitstamp since Gox will not allow this until further notice expected before thursday.

  At the beginning they will do so at a moderated pace and with new
  daily/monthly limits in place to prevent any problems with the new
  system and to take into account current market conditions.


How to check if user sent me the BTC? I am developing JSP web. User will be redirected to another page only if he sends the certain amount of BTC, is there any listener which could check if money arrived to my wallet from the certain wallet address?
And after leaving the page is there possibility to automatically send the money back to the user?

Maybe some good tutorial on bitcoinj or something? Any suggestions?

I would suggest using a Web API to get notified when a transaction happens on the address(es) you're interested in, it's by far the simpler. Something like this may help:

http://dev.blockcypher.com/#websocket_webhook


Forking Bitcoin how to prevent a 51% majority attack Lets say I fork Bitcoin, to lets call it StackCoin. How do I prevent a 51% majority attack when miners are not in abundance? Would I have to setup a lot of miners to create the infrastructure of the network?

How do I prevent a 51% majority attack when miners are not in abundance?

If an amount of hashpower larger than your network decides to 51% attack, there isn't much you can do. Ways to mitigate this include:

-Using a hashing algorithm that does not place your miners in direct competition with a larger coin (note: relevant to ASIC mineable coins more than GPU mineable)

-Enticing a group of miners to join your network right off the start

-Create a coin with a unique value proposition, so that others are less likely to attack. A coin that wants to directly compete with btc may be attacked by btc miners, for example.

Remember that an attacker has opportunity costs to consider, if it is more profitable to just keep mining another coin, rather than destroy your network, then you'll have a better chance of bootstrapping your network.

There are likely other ways you can introduce (centralized) 'administrator controls' for your network, but I won't go into any details on those, as such a system would be counter to the ethos of cryptocurrencies in the first place.


How to anonymously and privately purchase Bitcoin through Tor? How can Bitcoin be anonymously purchased through Tor in a secure and private fashion?

My question is related to:

How can I setup Bitcoin to be anonymous with Tor?
Personal information and bitcoin purchasing

but more focused on anonymous and private purchasing transactions.

First of all, anonimity and privacy are two different things. Bitcoin is designed to be pseudonimous - which is close to anonimity, but instead of being completely anonimous, you're linked to your bitcoin address, or pseudonym.
You cannot make a private transaction on the Bitcoin network, but you can try to be as anonymous as possible.

It is possible to run Bitcoin Core as a Tor hidden service, and connect to such services.
The first step is running Bitcoin Core behind a Tor proxy. This will already anonymize all outgoing connections, but more is possible.

More instructions at github:
https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md


Why bitcoind will shutdown after encryptwallet? As mentioned in the bitcoin-cli document for encryptwallet command, bitcoin daemon will shut down after encrypting a new or unencrypted wallet. My question is about the reason for shutting the node down?

Also, I want to create another bitcoin wallet and it's very strange if I need to start after adding a new wallet. this pull request tried to remove shutdown after encrypting a wallet. is it safe? and what's the best way to deal with this problem?

  encryptwallet "passphrase"

  Encrypts the wallet with 'passphrase'. This is for first time
  encryption. After this, any calls that interact with private keys such
  as sending or  signing

  will require the passphrase to be set prior the making these calls.
  Use the walletpassphrase call for this, and then walletlock call. If
  the wallet is already encrypted, use the walletpassphrasechange call.
  Note that this will shutdown the server.

This behaviour has been resolved by 12493. As stated by Andrew Chow in the pull request, this was previously done to:

  ...prevent the BDB environment from
  writing unencrypted private keys to disk in the database log files, as
  was noted here. This PR replaces the shutdown behavior with a CDBEnv
  flush, close, and reopen which achieves the same effect: everything is
  cleanly flushed and closed, the log files are removed, and then the
  environment reopened to continue normal operation.

  To ensure that no unencrypted private keys are in the log files after
  encrypting the wallet, I wrote this script to pull private keys from
  the original wallet file and searches for these keys in the log files
  (note that you will have to change your file paths to make it work on
  your own machine).

  As for concerns about private keys being written to slack space or
  being kept in memory, these behaviors no longer exist after the
  original wallet encryption PR and the shutting down solution from
  2011.


Best method for getting bulk address information (total sent, received, and final balance) I need to go through a large list (about 100 000) of bitcoin addresses, and, if they have a final balance, find that as well as the total sent and recieved. I am working in python, and I have looked through the various API's, but so far I have found the best solution to be getting the JSON data from https://blockchain.info/

I use:

urllib.urlopen("https://blockchain.info/multiaddr?cors=true&active="+testStr)

where testStr is up to 23 addresses, separated by |

This returns a page which I dump into a json and parse for the data I need. I am just wondering if there is any faster method to get this information, rather than multiple calls to blockchain.info?
thanks

If you do scientific or academical research, you probably won't use blockchain.info. Because this would mean you basically trust bitcoin.info as blockchain source. It really would consider creating and querying your own blockchain copy by installing and syncing a Bitcoin-Core node.

A simple python (or different language) JSON RPC script could solve your problem.
(requires a synced bitcoin-core node)

Add 1000 (of the 100'000) addresses over RPC call importaddress
Get balance of each address by calling `listreceivedbyaddress
Stop bitcoin-core
Delete wallet.dat
Start bitcoin-core

--> go back to 1)

You might increase or decrease the address frame (1000) depending on your system CPU/Mem/Disk resources.


What API would I use to find the circulating supply of Ardor? Is there a way to use API to find the circulating supply of Ardor or any of the child chain tokens?

Yes, getConstants returns the totalAmount of tokens in each chain - inside the chainProperties field.


Who is for SegWit and who is against? And what is the consensus? I am a little lost in the whole political landscape of implementing SegWit, I understand that Bitcoin Core is for SegWit but are the miners against it? If not then who is against it and what is their proposal?

I have tried googling to no avail.

SegWit is a large protocol update developed by Bitcoin Core to address some protocol defects, increase the capacity, and lay the groundwork for further protocol improvements in the future. As such, it has broad support among the Bitcoin Core contributors. It also has broad support among node operators with 85%+ being segwit ready, and decent support among Bitcoin businesses. The softfork was ready for activation since November but had been lacking signalling by miners.
This impasse was broken by a combination of the New York Agreement (NYA) that spawned the segwit2x project and the pressure exerted by BIP148 (the UASF).

There is a vocal minority that proposes scale on-chain primarily. Some of them are opposed to segwit altogether, some want it in a different form as for example a hardfork, some of them just prefer bigger blocks but want segwit later as well. The NYA seems to have been found especially to satisfy their wish for a hardfork to a bigger blocksize, where some parts of the community aren't too keen on the 2x part of that. A small group of them has now decided to preempt the decision by creating Bitcoin Cash today which removed segwit and changed the blocksize to 8MB.


How many bytes does a Bitcoin address weight? One of the biggest issues of Bitcoin blockchain is the ever increasing size. Each address has a weight in bytes or bits. What’s holding someone from creating trillions of different addresses and breaking the block chain this way? Overflowing Bitcoin blockchain by creating addresses? Bitcoin blockchain is unbreakable so I heard. Can it be broken by forcing the size increase and making it unprofitable to run a full node?

Addresses don't get registered anywhere. You can create as many as you want without having impact on any other network participant.
Addresses only get tracked by others once funds get sent to them. Needing to tie up funds for each address suffices to curb the proposed attack.


How much hashpower is needed to double-spend? Is >50% a minimum? How much hashpower is needed to double-spend coins?

Some worry only about one entity getting over 50% of the hashpower, while others are complaining (at the time of writing) about an entity having more than 33%. What is the importance of 50%? Can a double-spend be done with less?

No, 50% is not a minimum to double-spend. From the Bitcoin-Wiki

  Brute force attack

  This attack has a chance to work even if the merchant waits for some confirmations, but requires relatively high hashrate.

  The attacker submits to the merchant/network a transaction which pays the merchant, while privately mining a blockchain fork in which a double-spending transaction is included instead. After waiting for n confirmations, the merchant sends the product. If the attacker happened to find more than n blocks at this point, he releases his fork and regains his coins; otherwise, he can try to continue extending his fork with the hope of being able to catch up with the network. If he never manages to do this, the attack fails and the payment to the merchant will go through.

  The probability of success is a function of the attacker's hashrate (as a proportion of the total network hashrate) and the number of confirmations the merchant waits for. For example, if the attacker controls 10% of the network hashrate but the merchant waits for 6 confirmations, the success probability is on the order of 0.1%

When you have more than 50% of the hashrate, the succeed chance is 100%:

  >50% attack

  If the attacker controls more than half of the network hashrate, the previous attack has a probability of 100% to succeed. Since the attacker can generate blocks faster than the rest of the network, he can simply persevere with his private fork until it becomes longer than the branch built by the honest network, from whatever disadvantage.

  No amount of confirmations can prevent this attack; however, waiting for confirmations does increase the aggregate resource cost of performing the attack, which could make it unprofitable or delay it long enough for the circumstances to change or slower-acting synchronization methods to kick in.


Can you detect that the addresses generated by an HD wallet came from a single wallet? Can someone who is looking at the blockchain detect that 2 or more addresses generated by a single HD wallet are actually generated by that single seed/HD wallet ?

Can someone who does know that 2 or more addresses came from a single HD wallet derive the seed or any keys ?

I'm using Bitpay's Copay app on Windows 10 mobile.
It's an HD wallet and it holds several addresses with a bitcoin balance.
As I understand it a HD wallet generates new addresses from an initial seed which I have backed up.

Out of curiosity I transferred some bits to a new receiving address generated by the same wallet, and I noticed the wallet UI says I "moved" the bits, not "sent" or "received" them.
I assume this is just the wallet being smart and letting me know the bits came from this same wallet, but this brings me to the question of, have I just linked these three (including change) addresses together for anyone on the blockchain to see ?

No.

All addresses generated by HD derivation are indistinguishable to someone who does not know the parent's master key (the private one for hardened derivation, the public one for normal derivation).


What if the mempool exceeds 300 MB? The bitcoin mempool size is at 108 MB and still climbing according to chain.so. It is slowly approaching 300 megabytes, which is said to be the mempool limit for BTC. What happens after 300 MB?

Each node maintains a separate, individual mempool. While the default limits its size to 300 MiB, each node operator can set their own value. Note that the mempool size limit does not pertain to the serialized data or the transaction weight of the queued transactions (which is what is written to the block and what you see listed on a mempool monitors respectively), but to the actual memory usage of the deserialized transaction data on the node. This memory usage is platform dependent. In result, transactions start getting dropped when mempool monitors reach a block depth of about 80-95 blocks.
When a node's mempool limit is reached, it will drop the transactions with the lowest feerate and increase its minMempoolFeeRate. It will communicate its new minMempoolFeeRate to its peers, basically telling peers not to forward transactions below that feerate for the time being. Note that every node does this individually, so a node with a larger mempool or different architecture may drop transactions earlier or later. Nodes will keep a copy of transactions that are relevant to their own wallet. Even if all other nodes have dropped a transaction, the sender and recipients of a transaction would retain a copy. The sender can either force his node to drop the original transaction and send another conflicting transaction to update it, or their node will continue to try to broadcast the transaction so that it will eventually get relayed on the network again once the backlog has receded.
After the backlog decreases under the 300 MB limit and with some added delay, a node will lower their minMempoolFeeRate and start accepting transactions again that it previously expelled.
You can currently observe this happening e.g. on Johoe's mempool monitor¹:
As you can see, the 1-2 sat/B band dropped around 7am that morning when the node's mempool exceeded its limit.

¹Note that there are two BTC views and the linked and relevant in this case is BTC (default mempool))


Import wallet programatically I am using the https://www.blockchain.com/ wallet API: https://github.com/blockchain/service-my-wallet-v3
I am not very deep into crypto, but is there a way to allow the user to import his existing wallet into my app and add it as an HD wallet into my main wallet ?
I do not see any API endpoint for that, also I cannot find an apporipriate support email for contact with technical support on https://www.blockchain.com/
Whatever I searched for it showed apps for importing my wallet into existing apps, but I want to make this functionality available in my app.

is there a way to allow the user to import his existing wallet into my app

That looks a bit like this API function:
https://www.blockchain.com/api/blockchain_wallet_api says

Create Wallet API

Create blockchain wallets programmatically
The create_wallet method can be used to create a new blockchain.info bitcoin wallet.
URL: http://localhost:3000/api/v2/create
Method: POST or GET

$password The password for the new wallet. Must be at least 10
characters in length.
$api_code An API code with create wallets permission.
$priv A private key to add to the wallet (Wallet import
format preferred). (Optional)
$label A label to set for the first> address in the wallet. Alphanumeric only. (Optional)
$email An email to associate with the new wallet i.e. the email address of the user
you are creating this wallet on behalf of. (Optional)

Please create an API code here including permissions to "Create Wallets".

Your app can read an existing wallet file, extract the private key (or keys) and use this function to create blockchain wallets containing those keys (and hence allowing the spending of all money "in" that existing wallet file)
Maybe there is some feature of this that you find unsuitable - but haven't explained fully why?
It is not unusual for businesses to require a different arrangement with merchants using their services commercially as a back-end. Whether your use might fit into this category is unclear, but a read of the Terms & Conditions for commercial use of their service might clarify this.


Finding Old Bitcoin Wallet I created a Bitcoin account back in 2014, but my computer crashed a couple of year ago and I don't remember which firm or site I did it through. Not sure if that even matters. I do have the Wallet Name, Wallet Address and Wallet Key, but having difficulty using the data to access my old wallet in my new Coinbase acct. Please help!

Thanks.

By Wallet key, do you mean private key ? If you have private key, you can use any bitcoin wallet to import the private key https://en.bitcoin.it/wiki/How_to_import_private_keys

A common bitcoin private key looks like this:

5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF

If your key doesn't look like this, its probably a password for the bitcoin service where you created the wallet. You need to locate that service and login into it with Wallet Name/Key to get to those bitcoins.


What is this extra address on blockchain.info? I sent bitcoins for the first time to my friend. He has an address 1JkqP4qMvVpQApqyH4m9J4LBdqfFacMKSf

I chose to send them through my wallet on Bitcoin-QT, but I was interested to check blockchain.info about the transaction as well.

I see that blockchain.info shows that I sent bitcoins to another address as well! Can anyone explain why it shows that I sent bitcoins (about $30) to the address 1NTyaVoNrQYx2PA5ce7bVmqA6jfmSSkvxU on blockchain.info? I definitely did not send to that address...

This is my Bitcoin-QT client window. It shows the correct transaction amount.

This is because you did not have a coin that exactly matched the amount you wanted to send to your friend.  So bitcoin had to split a larger coin into 2 coins... 1 with the amount to send to your friend and the rest as "change" to send back to you.  The address you don't recognize is a new address that was created for the change, and it's in your wallet.


Wasn't 0-conf more secure than Visa, before blocks got full and RBF was added? RBF and full blocks make 0-conf useless, because it's easy to override. Wasn't it once useful? I've heard without those it's more secure than Visa in terms of double spending.

No. A zero-confirmation transaction is not useful for anything. Satoshi used PoW specifically, because he was trying to answer how to trust a transaction(double-spending problem).

Secondly, transaction replacement was introduced by Satoshi in the first release of the Bitcoin software, but was later removed due to denial-of-service problems.


Why scriptPubKey is a series of commands? I am not fully understanding the design purpose of the scriptPubKey in the transaction output.

I think the tx's (say tx1 here) output could just be the receiver's public key's hash.

Then when the receiver want to send the money to another one, he only needs to create the transaction tx2 (with receiver's public key and the sig of the previous transaction).

Then the bitcoin net work could check:

Is the public hash(tx2.public_key) = t1.output.hash_public_key?
Verify(tx2.sign, tx2.public_key, tx1)

a+b can approve that this transaction is created by the receiver.

Therefore, I am not quite understanding why we need to save
OP_DUP OP_HASH160 next_receiver_public_key_hash OP_EQUALVERIFY OP_CHECKSIG
in the tx.output.

Therefore, I am not quite understand why we need to save

Because scripting system allows more possibilities. https://en.bitcoin.it/wiki/Script#Scripts


How to transfer all my funds to another wallet i"m a blockchain wallet user with multiple wallets for different businesses but i would like to centralize all my funds to one wallet so i want to know if it is possible to transfer all the funds from the other blockchain wallets to the central one?

Yes. Make transactions sending all of your coins from each wallet to one or more addresses in your central wallet. Note that this will require you to pay transaction fees. There is no way to move coins without making a transaction.


How can I use hashrate distribution to make inferences about when a specific pool will find a block? Miners find blocks randomly but also proportionally to the miner's hashrate. How can I best predict and express this 'chance' per mining pool?

For example, if F2Pool has had 10% of the total mining hashrate for the past week, does it make sense to say that they will probably find 10% of the blocks moving forward?

What's the best way to express the notion? I'd like to be able to say something like:

"F2Pool has a 10% chance to find the next block in the next 10 minutes, and this approaches 100% after 10 blocks. Ie. F2Pool has a very good chance to find at least one block within the next 100 minutes."

Obviously there is never a 100% chance to find a block in the next x blocks, so what's the accepted way of giving a number but also with that undertone of "or maybe never?"

Is there an API or library I can use to calculate/know these 'chance' values over time per mining pool?

For example, if F2Pool has had 10% of the total mining hashrate for the past week, does it make sense to say that they will probably find 10% of the blocks moving forward?

Assuming that a lot of miners don't switch, yes.

"F2Pool has a 10% chance to find the next block in the next 10 minutes, and this approaches 100% after 10 blocks. Ie. F2Pool has a very good chance to find at least one block within the next 100 minutes."

You're asking two subtly different questions here.

Will I find the next block?
Will I find a block in the next ten minutes?

You could find the next block, eleven minutes from now. You could find a block in five minutes, building on a block that was discovered four minutes ago.
Will I find the next block?
This is pretty straightforward. If you have 10% of the hashrate, there's a probability of 0.1 that you will find it. If you have p proportion of the hashrate, there's a probability (1-(1-p)^n) that you will find a block in the next n blocks. For 10% hashrate, and 10 blocks, that's a chance of 65%. Far from a sure thing.
p = 0.1
Blocks  Probability of you getting a block
0       0.00000
1       0.10000
5       0.40951
10      0.65132
30      0.95761
50      0.99485
100     0.99997

Will I find a block in the next ten minutes?
Block discovery follows a poisson distribution. A poisson distribution represents a bunch of independent events, where one event happening has no effect on it happening in the future.
We want to know the odds of k blocks being found by anyone in a ten minute period, when there is an average of 1 block every ten minutes. Wikipedia already has a table for us:
k   P(k)
0   0.368
1   0.368
2   0.184
3   0.061
4   0.015
5   0.003
6   0.0005

But this isn't quite what we need - if ten blocks are found, there is a much better chance that one of them is ours than if one block is found. Multiply by expression above, and substitute k for n, and 0.1 (our proportion of hashrate) for p.
k   P(k)    P(k)*(1-(1-0.1)^k)
0   0.368   0.0000
1   0.368   0.0368
2   0.184   0.0350
3   0.061   0.0165
4   0.015   0.0052
5   0.003   0.0012
6   0.0005  0.0002
    Sum:    0.0949

Sum up the last column. We get a 9.49% chance, which is the chance that you will get at least one block in the next ten minutes if you have 10% of the hashrate. But, that doesn't mean that there's a 95% chance of having a block in ten minutes with 100% of the hashrate. It's not linear. If you have 100% of the hashrate:
k   P(k)    P(k)*(1-(1-1.0)^k)
0   0.368   0.0000
1   0.368   0.3680
2   0.184   0.1840
3   0.061   0.0610
4   0.015   0.0150
5   0.003   0.0030
6   0.0005  0.0005
    Sum:    0.6315

...then you have a 63.2% chance of having a block in the next ten minutes if you have all of the hashpower.
(Our calculations are low by about a twentieth of a percent, because we didn't consider cases like k=7. But I figure this is a good approximation.)


Pycoin: How to send transaction? There is a problem in making and sending transaction.
I got UTXOS by using API(GreenAddress), and from utxos I made a transaction. But calculated fee is always larger than one in original GA service.
Sometimes success to send transaction.
Sometimes, receives error like this 'Invalid signature'.
I can't find out reason.
Help me.

Hard to say without looking at the code. Want to paste the relevant code?

When dealing with the GreenAddress api we generally sign using libsecp256k1 rather than pycoin (even when we use pycoin for other things)

For example see https://github.com/greenaddress/garecovery - it makes GA multisig transactions with pycoin and then signs them

Hope it helps!


What is transaction replay and replay protection? With everyone and their dog making new blockchains forked from the bitcoin blockchain, there is a lot of talk about replay protection.

What is a transaction replay?
What does replay protection do?

What is a transaction replay

In the context of forks, transaction replay is when a transaction is valid on both sides of the fork. So a transaction can be played (i.e. broadcast) on both chains after the fork and be a valid transaction and confirm. This means that if you intend on sending coins on one fork, you could accidentally end up sending your coins on the other fork as well since someone else could take your transaction and replay it (i.e. broadcast it) on the other chain's network.

  What does replay protection do?

Replay protection is something that makes it so that transactions on one chain are invalid on the other chain thus preventing transaction replay. This can be anything from having a blacklisted address or output type (e.g. if an output to address X is in the transaction, consider it invalid) to changing the signature scheme to changing the transaction format entirely. All this does it makes replaying some or all transactions impossible.


Can bitcoin node startup be secure without validating the entire blockchain? One of the largest hurdles in my mind to increasing the number of full nodes operating is the startup cost related to downloading the blockchain.  A similar but less important (in my mind) issue is the amount of disk space required by the full blockchain.

At Pruning the branches in Merkle Tree Nick ODell writes "[Bitcoin Core] was built on the assumption that you download and validate all blocks."  In Would moving a transaction from an old block to a new one allow more pruning? Murch suggested that some assumptions be checked, and I think one of them was my assumption that it isn't necessary to parse the entire blockchain.  Thanks to Murch, this question is intended to address that assumption.

Full nodes serve several functions on the network:

Validating the blockchain on behalf of their owner
Supplying previous blocks and transactions to other nodes
Relaying transactions and blocks to other nodes

Not validating the blockchain independently sacrifices each of these functions to a degree.

If the node does not independently validate the blockchain, the owner of the full node is still relying on trusting the peer nodes
If the node does not store previous transactions and blocks, it cannot supply them to other nodes that are catching up with the network
If the node hasn't validated the blockchain, it could be tricked into relaying invalid transactions and blocks.

So yes, a node can skip the important step of downloading and validating the blockchain, but I don't think I would consider it to be a "full node" anymore.  It would not be helping the overall network health, nor could it be completely trusted by its owner.  At that point, I would suggest simply running an SPV node.


Where do i start for creating altcoin? Where do i start for creating a bitcoin altcoin? Like for changing block times, names, coin max, etc? I know what i want to change but I don't know where to change the code for the basic things mentioned above.

This post on bitcointalk is a good starting point.

The basic idea is to:

fork an existing coin
Customize some values (block reward, block time, hash algorithm, etc.)
Boot strap the coin by mining then encoding some checkpoints.


Bitcoin money transfer I transferred money from circle to Bitcoin, the transaction showed it was successful however it did not go into my Bitcoin but went to blockchain. I saw the amount on blockchain as unspent but then after few days it was shown as spent. However it did not even reach me so can it show that and also why has it reached there and is there any way of getting it back. I look forward to hearing from you soon.

Weird. If you don't mind, could you add a transaction I'd and your bitcoin wallet address?

I'm guessing you withdrew into your bitcoin wallet from circle, but it didn't appear in your bitcoin wallet. You could however see it on the blockchain?

I have a couple of ideas:

Malware

You may have malware installed on your computer that swaps out your bitcoin address that you have copied down to the hacker's bitcoin address. Please verify that the recieving address in the blockchain is the same one as the one in your wallet.

Wallet not synced

If you're using a wallet like bitcoin core/qt, you will have to wait for your wallet to sync. It will show at the bottom of the client.


Unplugged Trezor when incoming transaction was unconfirmed I transferred some bitcoins from one of my online wallet to my Trezor. When the transaction is in unconfirmed mode I unplugged my Trezor. Then after I plugin my Trezor that transaction somehow did not show up on my Trezor. Now what should I do?

If the transaction has confirmed, then there is nothing that you need to do. Your Trezor device does not actually receive the transaction nor does it need to. All that matters is that the wallet software that you are using knows about the transaction, and if the transaction has confirmed, it is trivial for it to find out about the transaction. Check the wallet software that you are using and make sure that you see the transaction there.


How to prevent ASIC mining for my new altcoin? I want to create an altcoin that is a clone of Bitcoin. I want the mining to be ASIC resistant.
Are there any steps which I should include in my altcoin's mining algorithm to prevent ASIC mining?
Do I need to implement a completely new algorithm for mining?

Are there any steps which I should include in my altcoin's mining algorithm to prevent ASIC mining?

That's not really what you should be asking. You should be asking, "Can someone design an ASIC which is more effective at mining my altcoin than a general purpose CPU?" At sufficient scale, that is always possible.

However, you don't really care if someone can invest $1 trillion and get an ASIC that is 1% better than a CPU. If your attacker had that much money, they'd crush you no matter what. You care whether they can invest a reasonable amount of money and create something significantly more efficient. (Either in power consumption per hash, or capital cost per hash.)

Also, you want some other properties:

It must be reasonably fast to verify. (But doing so can weaken the algorithm, see Why did Litecoin choose the scrypt factors that they did? for an example.)
Switching chain tips must not cause a miner to lose a lot of progress. (Otherwise, miners have an incentive to ignore new blocks if they almost have a block of their own.)
Someone who modifies the block header must have to redo all of the work. (Otherwise, mining provides no protection.)
Mining speed must scale linearly with computing resources. In other words, you shouldn't be able to double the number of computers you have and quadruple your mining speed.

I don't know of an algorithm that satisfies these five properties, but the problem hasn't been proven impossible.

  What about EquiHash Algorithm?

Look at these two criticisms of EquiHash:

http://www.openwall.com/articles/Zcash-Equihash-Analysis
https://petertodd.org/2016/cypherpunk-desert-bus-zcash-trusted-setup-ceremony#equihash-proof-of-work

There are probably algorithmic improvements still available in EquiHash, and there is almost certainly a hardware speedup available.

(There is also an unverified claim that someone has created an FPGA Equihash miner.)

  Do I need to implement a completely new algorithm for mining?

You're unlikely to do much better than the attempts above.


Is it possible to Send the total balance of Bitcoin from the Wallet using rpc without having to specify the exact amount? I know we can send coins using the move, sendtoaddress and sendfrom commands from the console or commandline.

However these commands require to specify an "exact" amount, meaning you need to check the balance before you execute the commands.

Is it possible to just send all coins to an address or to oneself in the same wallet using just one command.

Hopefully someone understands what I"m talking about here.

Yes, this is possible, but you still need to check the wallet balance first.

However, you need to know the fee, as you usually specify how many BTC are supposed to arrive at the destination, rather than how much is being sent in total.

The sendtoaddress command takes 5 parameters: address, amount, comment, comment-to, subtractfeefromamount. This last option, subtractfeefromamount, is what you need.

So if your entire wallet balance is 0.1337 BTC, you could issue:

  bitcoin-cli sendtoaddress "address" 0.1337 "" "" true

Also, you can't use move, as that does not actually issue a Bitcoin transaction, but only updates internal balances.


How to get the historical data from bitfinex.com with out a limit? I am drawing a chart using the data pulled from bitfinex.com via a simple API query. As the result, i will need to render a chart which is going to show the historical data of BTCUSD for the past two years. Docs are available right here: https://bitfinex.readme.io/v2/reference#rest-public-candles Everything works fine except the limit of the retrieved data.

This is my request: https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?start=1514764800000&sort=1

The result can be seen over here or you can copy the request to the browser: https://docs.google.com/document/d/1sG11Ro0X21_UFgUtdqrlitcCchoSh30NzGCgAe6M0u0/edit?usp=sharing

The problem is that I receive candles for only 5 days no matter what dates or parameters I use. I can get more candles if i add the limit parameter to the string. But still, I can not get more than 1100-1000 candles. I even get the 500 error from the server:

Server error: GET https://api.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?limit=1100&start=1512086400000&end=1516233600000&sort=1 resulted in a 500 Internal Server Error response:\n ["error",10020,"limit: invalid"]. What should be the valid limit? There is no such information in the docs.

How can I get the desired amount of data for the two years period of time? I do not want to break my query down into smaller pieces and go step by step. It will look ugly.

My suggestion is to get data by fragments for example:

Jan 1 2017 - July 31 2017
Aug 1 2017 - Dec 31 2017

Then merge on your code


Adding an external key pair to a local bitcoinj wallet I need to add a vanity address to a local wallet that I maintain using bitcoinj APIs. I'm not able to search for the vanity using bitcoinj APIs directly, on my local PC, because my vanity is too fancy. However, I'm able to generate the pair online easily. What is the API I should use to add this key pair to my local wallet ?

I tried the following,

Say the required vanity is 1meowvYmB7ughhsRvUWfsac9LKDonh4cn (private key: 5JXFsJEAiqtTv95rSmw3KSJeAZ97SsmKWTQq5yqBzioSJ1guUHK). I generated this at bitcoinvanitygen, I converted this to hex at, Base58 Encode, Decode, and Validate. I tried the following.

Address vanity = new Address(networkParameters, networkParameters.getAddressHeader(), Hex.decode("000871DD31D517D15D7352139A44B07EBE97B1772C7F291357"));

I need to construct an Address from this string. I get the following error:

exception decoding Hex string: String index out of range: 47

After searching for a while I found this type that takes a private key (in base58), required network parameters, and constructs the public address. Please refer: DumpedPrivateKey. This was enough for me at least. I construct an address from the key so formed using the toAddress method exported from the type key.

DumpedPrivateKey vanityKey = DumpedPrivateKey.fromBase58(networkParameters, "5JXFsJEAiqtTv95rSmw3KSJeAZ97SsmKWTQq5yqBzioSJ1guUHK");
ECKey ECVanityKey = vanityKey.getKey();
Address vanityAddress = ECVanityKey.toAddress(networkParameters);


Is there a site that tracks volume over time? Coinmarketcap shows the current volume data. Is there a site that tracks volume over time in a graph and data table where you can sort by highest volume days? I'm looking to see if a specific coin has been increasing volume over time.

Try this site, data is shown graphically but can be downloaded in *.CSV or *.XLS file as well... http://data.bitcoinity.org/markets/volume/30d?c=e&t=b


Which version of the JSON-RPC does Bitcoin use? Which version of the JSON-RPC protocol does Bitcoin use? 1.0 or 2.0? (This question is asked, but that was almost 3 years ago. link)

If try to use version 2.0 all works well curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://bitcasino:qwerty@127.0.0.1:8332/
But named parameters are not supported (or I dont know right parameter names).

Also I fount in bitcoind repo file with declared json-rpc error codes: link. Codes named as Standard JSON-RPC 2.0 errors Is it metioned parts, that not specified in 1.0?

So what is the official position now? Still 1.0 ?

1.0, but with a couple of 2.0 features:

"Batch" calls are supported.

And the 2.0 error semantics are used.

Passing named parameters is not supported.  "Patches welcome" if you want to add full 2.0 support.


How to start using signrawtransactionwithkey instead of signrawtransaction I am following this tutorial, which says to use signrawtransaction. However, I get:

error code: -32
error message:
signrawtransaction was removed in v0.18.
Clients should transition to using signrawtransactionwithkey and signrawtransactionwithwallet

The API call in the tutorial shows this:

$ signedtx2=$(bitcoin-cli -named signrawtransaction hexstring=$rawtxhex2 | jq -r '.hex')

How do I do that same thing using the new signrawtransactionwithkey API? I started by generating a 256-bit private key:

https://gist.github.com/rietta/3640002

Now I'm not sure what to do. I guess I am to do something like this, but not sure exactly how to define it using CLI variables and such to make sure it's going to work.

signrawtransactionwithkey  "0200000001cfe62b9f1c52bc2998f9a0e6d6ee35430c93ec653d5691935178147a43090fee0000000000ffffffff01f0afd320766191d4c5c088ac00000000" "[\"cSXHtKRXWnCLWhuie8WC13cKF3qdnKL8vG3BiRpxgCXZkK2CHe9u\"]"  "[{\"txid\":\"ee0f09437a1478519391563d65ec930c4335eed6e6a0f99829bc521c9f2be6cf\",\"vout\":0,\"scriptPubKey\":\"a914111111111111111111111111111111111111111187\",\"redeemScript\":\"5221033d9aecbced8e776c03d283f6c0d64c6a301ad142d74d500fe8860c9b362fa4932102a4df3cb4e5286e180b7c68e323c778e32350a604d4f4a74c290d1c60c721687a52ae\"}]"

Looking further, I need to base58 encode the key.

If you just want to sign the raw transaction as it's shown in the tutorial, please use signrawtransactionwithwallet instead. It would be like below.

$ signedtx2=$(bitcoin-cli -named signrawtransactionwithwallet hexstring=$rawtxhex2 | jq -r '.hex')
$ bitcoin-cli -named sendrawtransaction hexstring=$signedtx2
69c9ef4d1adb48596c470146ee9b60593023b6eb870b79ef666a8c9369768469


Does the 1 MB block size limit include the header? I was able to follow the code to validation.cpp:

// Size limits
if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_BASE_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) > MAX_BLOCK_BASE_SIZE)
    return state.DoS(100, false, REJECT_INVALID, "bad-blk-length", false, "size limits failed");

and serialize.h:

template <typename T>
size_t GetSerializeSize(const T& t, int nType, int nVersion = 0)
{
    return (CSizeComputer(nType, nVersion) << t).size();
}

But for the life of me I can't figure out what CSizeComputer is doing. Does GetSerializeSize include the block header in the value it returns?

CSizeComputer is a serialization stream that discards all data written, and just counts how many bytes were produced. It is inlined, and the compiler in most cases actually avoids computing the bytes.

So, GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) just computes how many bytes would be produced when serializing a block for the network ignoring witnesses.

As blocks on the network indeed are prefixed by their header (and transaction count), those do contribute towards the maximum block size.


Which Wallet clients support a universal export .wallet file? Is there a universal export format for wallet clients where users can use in multiple programs?

What are the list of clients/apps/programs that support this format?

I want to be able to export my wallets to my other programs for a piece of mind. I'm particularly looking for cross compatibility for Android, Windows, and Mac.

There are a few different types of files which all contain the same basic information, an encrypted copy of private keys. In short there is no universal format yet.

The satoshi client uses a wallet.dat file, but as far as I know only
armory supports that format.
Blockchain.info and use uses an encrypted json file (wallet.aes.json)
Multibit uses a .wallet format which I believe is unencrypted.
Multibit also has the ability to import encrypted json files for
private keys (i.e. from Blockhain's backups)
Electrum uses a   .electrum file, but you can import and dump private    keys using
command line functionality.

It would seem that the easiest and most universal format for now would be an aes encrypted json file for exporting private keys.


Do Full Nodes validate all transactions and make new blocks after all bitcoin are mined? Do Full Nodes validate all transactions after all bitcoin are mined?
A fork of bitcoin core with all coins pre mined would be behaving in this way too I'd imagine..?
Also, would these nodes still create blocks of transactions, if so, why dont full nodes do this now? Is mining only a safety mechanism for a permissionless network?
See this quote at the link below:

Blockchain Validation vs Blockchain Consensus
It’s important to note that “validation” and “consensus” aren’t the same thing. A Blockchain Validator performs validation by verifying that transactions are legal (not malicious, double spends etc).
However, Consensus involves determining the ordering of events in the blockchain — and coming to agreement on that order.
Essentially, Consensus involves agreeing on the ordering of validated transactions.
The validation precedes the Consensus. We may very well have something that is “valid” that the network does not “agree” upon.

https://medium.com/@BitSongOfficial/blockchain-validation-vs-consensus-4adfce5ac030?_branch_match_id=601696356432534106

Do Full Nodes validate all transactions after all bitcoin are mined?

Yes.

  Also, would these nodes still create blocks of transactions

Yes

  if so, why dont full nodes do this now?

Do what? Validation? If so, full nodes certainly do validate now. In fact, full nodes validating is what keeps miners in check.

  Is mining only a safety mechanism for a permissionless network?

Mining is the mechanism in which the ordering of transactions is determined. It's sole purpose is to dictate which transaction came first in the event of a "double spend" and allow everyone to agree that that transaction was first. It is an integral part of achieving consensus. Mining doesn't actually validate anything; just that whatever goes into a block, and the block itself, must be valid, so miners should be validating incoming transactions before including them in a block.


What's the easiest way to create a backup node? My node recently had a data corruption and I had to re-sync it which was painful.
Presuming I don't use the node as a wallet, what's the easiest way to have a backup with the fully sync'd blockchain? Is it as simple as copying over the files from one external hard-drive over to the other?

You can just create a backup of the datadir folder, which could be saved on another hard drive in case your node’s chain state becomes corrupted. In case of corruption, just copy the saved data into the appropriate folder, and your node will then sync from that point in history, rather than starting from scratch. The datadir can be specified in your bitcoin.conf file, but will otherwise be found in the default path.
NOTE: you’ll want to stop the node before starting to copy the files. The normal operation of a node includes a lot of ~random reads and writes to the data directory files, so you’ll want to stop the node first to eliminate the chance of corrupting the data during the copy.


Why OP_RETURN should be used instead of raw data? I've read this great Explanation of what an OP_RETURN transaction looks like and now I have only one question. Imagine that someone want to store some data in Bitcoin's blockchain. Why should he use OP_RETURN?

I mean, I know that it's impolite to store a lot of data in blockchain as it is, because it makes blockchain bigger, pollutes it, etc. But in fact, is there any hindrance, which makes it at least difficult?

For example, is it possible to store string like >>> "123123" * 100 in transaction locking script field? Why?

There are two reasons why you should prefer a scriptPubKey of OP_RETURN <data> over <data>.

The first reason is that the non-OP_RETURN output is not prunable, and is actually anyone-can-spend if the data is non-zero. Non-prunable outputs make the unspent transaction set larger, which slows down initial block verification and block propagation times.

The second reason is that the non-OP_RETURN output is nonstandard, meaning that not all miners will mine it. Therefore, it will take longer to get into the blockchain.


Can rainbow tables be used to find private keys from public keys? I understand that the public key is kept hidden until a bitcoin transaction is made, at which point the public key has to be revealed to prove that you created the transaction with your private key. Until then, only a hash of your public key is ever shared, know as your bitcoin address.

Once my public key is known, would it be possible for someone to lookup my private key in a rainbow table ?

No.

A rainbow table is simply a memory-cpu tradeoff that allows you to find preimages of a function faster by having a precomputed table with some of the entries.

In order to construct a rainbow table for bitcoin private/public keys, you still have to first iterate through all the keys at least once. It doesn't matter that only part of the keypairs will end up in your rainbow table - you still have to go through all them.

That is an impossible task. There are 115,792,089,237,316,195,423,570,985,008,687,907,852,837,564,279,074,904,382,605,163,141,518,161,494,336 valid private keys to go through. To put that in perspective: if you would put a computer on every square micrometer of earth (1/1600th of the cross section of a human hair) that can compute as many public keys per second as the entire Bitcoin mining network does hashes per second at the time of writing (4 exahash/s), it would take you 120000 times the age of the universe to go through all keys.

And, even if somehow you had an oracle that could give you the rainbow table, it would need to be impossibly large to make cracking private keys practical. If your table had a trillion entries, it would only make cracking a trillion times faster. That's still utterly impossible.