How many MB of data does my bitcoin client have to download to be fully sync'd? Best guess/calculation?

I transferred some bitcoins to my new wallet after generating an address. This was this morning, and have had my bitcoin wallet syncing all afternoon (5 hours), so far it has downloaded 1.5GB of data and maxed out my 3G broadband quota for the month :-(

It is also really slow towards the end, sitting at 80% now and ticking over verrrry slow. Is this because the latest blocks contain more transactions (as doesn't every block contain history of all transactions before it?).

Will that mean future new bitcoin users are going to have to deal with a huge download size/ sync quota?

My current Bitcoin folder, May 28th 2012, is 2.16 GB. Of which maybe 60MB is data personally to me like my wallet, addresses, logs and transaction history.
So basicly you will have to download a little over 2 GB for being in sync with the network.

To answer your second question: I think yes. Bitcoin exists out of a long chain with blocks containing all the transactions that were ever made. So the longer Bitcoin lives and the more it is used, the bigger this block chain will grow and the more data every user will have to download before they can use the Bitcoin client safely.

EDIT: blockchain.info charts the pure blockchain size here: https://blockchain.info/charts/blocks-size

If this growth rate stays the same, bitcoin can get in trouble...


Electrum Server running. Now what? I finally found time to build a full bitcoind node and run electrs (not Electrum Personal Server).
What things can I do now? I know about only these:

Point my Electrum wallet client to my electrs, even over Tor (main-use case).
Searching here, some people write scripts or custom apps to talk to their Electrum Server (ElectrumX, electrs). I assume for block explorer type queries.
My own BTC RPC Block Explorer would query my Electrum Server (and bitcoind?)

Questions:

Can non-Electrum wallets talk to Electrum Server? Is there an easy way to find which ones?

I'd like to make my own mempool observer app. Maybe I would query Electrum Server, or is bitcoind better?

In what situations would I call Electrum Server's api vs. calling bitcoind?
Said another way: What API data does bitcoind provide vs. Electrum Server, and is there any overlap in info they both provide?

Here is the protocol: https://electrumx.readthedocs.io/en/latest/protocol.html. If get_mempool serves your use-case then you may use it. You may need to experiment with it to find what is more convenient with Core.
Some apps might be using the Electrum protocol under the hood. Only Electrum allows setting the server manually.
Electrum protocol has blockchain.scripthash.get_mempool which doesn't help you build a mempool observer. You need to connect to Core directly then


How to create a Bech32 address from a public key? What are the steps to create a Bech32 address from an ECDSA public key? Bitcoin wiki has a nice step-by-step guide to create an address from a public key but what about Bech32 addresses? I've read BIP173 but I don't understand what to give as an input.

Ok, I figured out how to do it.

You need 3 pieces of information to construct the bech32 address.

hrp: the human-readable part. This is bc for mainnet and tb for testnet
witver: the witness version. This is 0 at the moment represented by the byte 0x00 but it can go up to 16 when they add more versions.
witprog: the witness programm. In case you want a Pay-to-witness-public-key (P2WPK) address which is the most common ones, this is the 20-byte hash160 of the compressed public key i.e ripemd160(sha256(compressed_pub_key)). In case you want a Pay-to-witness-script-hash (P2WSH) address, this is the 32-byte sha256 of the scriptPubKey which is the script that will need to evaluate to True for someone to be able to spend the output. More on this in BIP141

Once you have those 3 pieces, you can use the encode function in one of the reference implementations

I have put together a small pure Python library for anyone interested how all this stuff works behind the hood.


UASF, what do I need to do? With the upcoming UASF activation what do I need to do to come out okay? I have my coins sitting on my Trezor in cold storage.

If I just leave them as is, what happens?

If I switch my Trezor to UASF, what happens?

Do I get coins from both chains? Do I need to pick one before August 1st?

If I just leave them as is, what happens?

Nothing, if a fork occurs, you get coins on the two sides of it.

  If I switch my Trezor to UASF, what happens?

If you do not spend your coins after a fork happens, nothing happens. If you spend coins after the fork, you might expose yourself to replay attacks even though you are transacting on the UASF chain. That means your transaction on the UASF chain might also happen on the other chain without you intending to. You can find more information about replay attacks here.

  Do I get coins from both chains? Do I need to pick one before August 1st?

You'll get coins from both chains for all the coins you have before the split occurs. If you buy coins after the split, you'll only get coins from the chain you bought them on.


Hardened Keys vs Normal Keys - A Simpler Explanation I'm trying to better understand hardened keys and normal keys and how the former protects the rest of and HD wallet.

Following on from the answer provided here: ELI5: What's the difference between a child-key and a hardened child-key in BIP32

I'd like to know "how an attacker would be able to work out the private key of the extended public key, and therefore get every key that can be derived from that, hardened and non-hardened." should they manage to "1) gain access to  the extended public key and 2) one of the non-hardened private keys that was derived from it"

Thanks in advance!

A non-hardened private key is derived using the equations shown below. Here small case letter represents private keys and large case represents public keys. G is the generator point, c is the chain code and i is the index number of the key generated. Kpar and cpar together represent the extended public key. kpar and cpar together represents the extended privat key.

k(i) = kpar + hash(Kpar, cpar, i)
rearranging you get, kpar = k(i) - hash(Kpar, cpar, i)

Now, let us say the attacker gets his hands on k(i) and xpub. You can generate public keys without the need of private keys using the xpub with the following equation: K(i) = Kpar + hash(Kpar, cpar, i)*G (check why this equation holds below in Appendix). The attacker is going to increment the index (i) in a loop until it generates the public key associated with k(i). When K(i) = k(i) * G the attacker knows the index number.

Thus with the index in his hand, he can just calculate the kpar from the equation kpar = k(i) - hash(Kpar, cpar, i).

Hardened keys prevent this by using the equation: k(i) = kpar + hash(kpar, cpar, i). So, although you get your hands on the xpub and the k(i), you will not be able to reverse engineer kpar as that variable is in the hash function which is one-way.

Appendix:

we saw above that k(i) = kpar + hash(Kpar, cpar, i)
=> k(i) *G = kpar*g + hash(Kpar, cpar, i)*G
=> K(i) = Kpar + hash(Kpar, cpar, i)*G


Is Hashgraph a serious competitor for the blockchain? What is going to be the effect of the recently publicized Hashgraph technology developed by Leemon Baird going to be on the Bitcoin and other blockchains? It is obviously not open source since a company called Swirld Inc holds a patent on it, but it does look like it could make the blockchain obsolete. Is this a serious worry for those invested in the latter?

The Hashgraph consensus mechanism achieves Byzantine Fault Tolerance (BFT) using voting on a braided tree of hashed events (the "hashgraph") that is faster and more lightweight than Nakamoto consensus on blockchain using Proof of Work (PoW). However, it is being positioned for different use cases than cryptocurrency.  Whether its consensus mechanism is better PoW really depends on the use case. Hashgraph actually layers nicely on top of blockchain, e.g., by using Bitcoin for Proof of Stake or Proof of Burn. That said, it will certainly be more suitable than blockchain for many commercial applications that need distributed shared memory and high transactions per second on consumer grade nodes.

In addition to the consensus algorithm, when comparing the two it also makes sense to consider the full range of features that would be supported by a bonafide cryptocurrency platform, which for Bitcoin would mean duplicating the features in its proposed payment platform, Lightning. Is it Hashgraph's express goal to replace Bitcoin+Lightning?  Clearly not at this time. Can it? That is not yet clear, and whether it can will be determined as much by additional factors including licensing and developer community support as by the consensus algorithm. Lightning will support blockchain contracts, bidirectional payment transactions and payment routing. Hashgraph could conceivably be used to implement the off-chain transaction ledgers, though that could require dozens and possibly up to thousands of such Hashgraph ledgers to satisfy the millions to billions of transactions per second that Lightning is targeting.

I hope that helps, best of luck to you.


Do miners verify address checksums? I understand how the checksum included in Bitcoin addresses can help prevent someone from sending coins to a wrong address. Or at least make it highly improbable.
And I read in answers to another question Stackoverflow about how compliant Bitcoin clients will verify the checksum and prevent you from sending to wrong addresses.
My question is, does a compliant mining software also perform this check when validating transactions?
Thanks!

No. The address in the format you're used to seeing it isn't encoded like that in the transaction.
When you send a Bitcoin transaction to someone, your wallet will verify that their address is formatted correctly by validating its checksum, then it decodes the public key hash or script hash that is encoded in the address, and this hash is what is included in the transaction output. The purpose of the address checksum is just to prevent typos; it is not included in the transaction itself.


After downloading the entire Bitcoiin blockchain from a torrent, what are my next steps to link it to Bitcoin Core 0.17.1? I downloaded the entire bitcoiin blockchain into my external mounted drive as seen below and named the directory bcore.

I then did a symlink to that folder like this in my home folder (~) location :

ln -s /mnt/xxxx/bcore .bitcoin

I then ran .bitcoind, but I thought I downloaded the entire blockchain. How do I know if its just syncing with what I already downloaded or is it literally downloading everything again? Is there a way to just skip verifying blocks if that is what it is doing. I don't have the time to wait hours for this since I already waited 23 hours to download the blockchain already.

Is there a file I can just download where it skips the block verification?

Also another reason why I think its downloading it again is because when i run bitcoin-qt on the bottom it says: "Syncing with Network" Which leaves me a bit confused.

You should not use a torrent to download the blockchain.  There is no general purpose to using a torrent, as using it makes synchronization slower because validation (which is the slow part) cannot proceed concurrently with download.  Because there is no purpose to using a torrent, I wouldn't trust that any particular torrent wasn't made maliciously and didn't contain things that might be used to exploit your computer.


I just made my altcoin, should I list my source code at Github? It seems to me that every new coin introduced, they list source code in Github.
Is that customary in the industry?

Most users are not going to trust a closed-source altcoin, so you should make its code available to the public. This board also doesn't support closed-source cryptocurrencies.

GitHub provides free hosting for open-source projects and has become a standard in the open source community so (primary opinion-based statement follows) it's probably a good idea to put your code there.


Creating address from private key (bitcoin puzzle) I saw a puzzle here and I'm having problems understanding how the addresses are created. So the post there has a list of addresses like:

Address 5:

KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7Dq8Au4Pv
1E6NuFjCi27W5zoXg8TRdcSRq84zJeBW3k
Biginteger PVK value: 21
Hex PVK value: 15

Address 6:

KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7Tmu6qHxS
1PitScNLyp2HCygzadCh7FveTnfmpPbfp8
Biginteger PVK value: 49
Hex PVK value: 31

Address 7:

KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7hDgvu64y
1McVt1vMtCC7yn5b9wgX1833yCcLXzueeC
Biginteger PVK value: 76
Hex PVK value: 4C

So, taking Address 7 as an example, I believe the address is 1McVt1vMtCC7yn5b9wgX1833yCcLXzueeC and the private key is 76 in decimal and 4C in hex.

What is KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7hDgvu64y ? Is that the public key?

And how do you go from that private key and the other value to the address?

I tried this answer but didn't get the same result

Any help would be very useful. Thanks

Don't mix priv with pub keys. You're on the right track. Usually keys with length of 52 bytes beginning with "K" are the privkeys. Keys with "1" at the beginning would be the public keys, derived from the privkey.
So e.g. the private key "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7hDgvu64y" results in public key "1McVt1vMtCC7yn5b9wgX1833yCcLXzueeC".
A good playground for keys is here http://gobittest.appspot.com/Address and here https://www.bitaddress.org - warning: never use your own production private keys on such public tools, they might get stolen.


Public Chain Code and MPK When the Master Private Key and the Master Public Key are generated, can I disclose the chain code as say BIP32? If not, how can is possible verify a child public key with public parameters?

This is an important question for me because it's necessary give the possibility to verify the generated child public key to another user in my scenario.

Could the Master Private Key generated by using a random integer 0< k < n where n is the curve group order?

You can share an extended public key (xpub key), and the recipient will be able to generate child pubkeys (and thus, verify and child pubkeys provided to them). An extended public key is defined as (K,c), where K is the parent public key, and c is the chain code.

Keep in mind: anyone with the xpub key will not only be able to verify that an address you give them is derived from the xpub key, they will be able to derive all addresses related to the xpub key themselves. Depending on the situation, this may be a privacy concern.

Worth mentioning: for most applications you should not share a master extended public key. Instead, you should share an extended public key that is located at a deeper level of the derivation tree. It may also be worth looking at the benefits of using a hardened key derivation scheme, so you can create a firewall at a certain derivation depth, meaning an attacker will not be able to work back past that level in case your system is compromised.


Safely transferring from a paper wallet I am holding for the long term and have a significant amount of bitcoin (~10) in a paper wallet (the actual private key is printed on a piece of paper). To improve security measures and possibly sell forked coins, I would like to transfer the funds to a new address (paper or hardware wallet).

I understand the technical procedure - sweep the private key into a wallet software and send to the new address. I am concerned about taking the proper security measures.

Some online resources recommend myCelium, but while I am cautious I do not trust my Android devices to be free of malware. I plan on using a PC with a Live CD Linux distribution (e.g. Ubuntu) installed on a fresh USB disk and connected behind a home router.

Are there any other security measures I can take besides running an OS with no malware and a reputable wallet software?
Are there any specific disadvantages to using Electrum for this vs. running a full node wallet such as Bitcoin QT (besides privacy)?
Does the Electrum Cold Storage feature (signing transactions on an offline machine) has any benefits for a one time transaction?

Just go ahead with Bitcoin-core. Which is much more secure than the others.
Encrypt your wallet with some long strong password and you're good to go.

Electrum recently had a critical security vulnerability. Read More About it.


How can extended public keys generate child public keys without generating the child private key in HD wallets? According to the documentation on bitcoin.org and the Mastering Bitcoin book, you can use an extended public key to create child public keys in HD wallets by combining the lefthand side of the hash output of the parent chain code + parent public key + index:

  The seemingly-random 256 bits on the lefthand side of the hash output are used as the integer value to be combined with either the parent private key or parent public key to, respectively, create either a child private key or child public key

I understand how this lefthand side output can be combined with the parent private key to generate the child private key, which in turn can be used to generate a valid child public key.

How is it possible that the child public key generated by combining the hash output with the parent public key corresponds to the child private key generated separately by combining the same hash output with the parent private key?

I thought that in was impossible to generate a public key without knowing exactly what the private key was. How is the relationship between child private and public keys (K = k*G) maintained when they are generated separately in this way?.

Upon a bit more searching, I found the derivation for getting the child public key without the private key here:

child_private_key == (parent_private_key + lefthand_hash_output) % G
child_public_key == point( (parent_private_key + lefthand_hash_output) % G )
child_public_key == point(child_private_key) == parent_public_key + point(lefthand_hash_output)

In terms of K, k and G where prime denotes the child and h denotes the left-hand hash output:

k' = (k + h) % G
K' = point ( (k + h) % G)
K' = point (k')
K' = K + point(h)

Here are the exact implementation details from the BIP 32 documentation


Difference between Bitcoin blockchain and Ripple ledger? The Bitcoin blockchain stores history of transactions. Blockchain blocks are interconnected via pointer to previous hash.

Meanwhile, the Ripple ledger instead of transactions stores account info such as balances. The Ripple ledger has a ledger number.

Does the Ripple ledger store the history of ledgers 0 to N or does it only store N? Does each Ripple ledger store every account info or just accounts on which transaction occur recently?

Ripple ledger stores history of ledgers 0 to N or it stores only N?

That's just a matter of definition. You can define the ledger to be just a single state of the network with a single sequence number. Or you can define the ledger to be every past state of the network as well.

Most commonly, we use the term "ledger" to refer to a single state of the network at a single time.

  Each Ripple ledger stores every account info or just accounts on which transaction occur recently?

Again, that's just a matter of definition. Most commonly, we use the term "ledger" to refer to all of the state entries (accounts, offers, trust lines, and so on) that were connected at a particular point in time.

The ledger design is passive. That is, a particular entry can be in ledgers 10,000,000 through 20,000,000 without anything special happening to it and without it requiring any processing as it just sits in the ledger and doesn't do anything.

If a new rippled server starts up with no data at all, it will not begin processing until it reaches some point where it knows every single currently valid/reachable ledger entry. That typically takes about two minutes (because the ledger's structure is specifically designed to make this efficient). At that point, it can process transactions and perform normal functions even though it doesn't have any network history. Of course, it can't tell you what happened in the past.


BTC Arbitrage Opportunity question I have an bank account that allows me to exchange between currencies at no extra premium other than the exchange rate.

I am noticing large spreads between some of the BTC prices in various currencies.

For example

1 BTC USD is 9283
1 BTC GBP is 5382 (7338 USD)

I am seeing this correctly, does it make sense .....is this an arbitrage opportunity?

Is this an arbitrage opportunity?

You also need to consider the exchange rate between the two currencies to determine if this truely is an arbitrage opportunity.

1 British Pound currently buys 1.39 US Dollars1 whereas the transfer via BTC using the figures you have quoted yeilds 1.724823486 times.

This is indeed an arbitrage opportuniy if you can buy BTC in British Pounds and sell them for more US Dollars, provided you have some British Pounds to buy them with initially (and allowing for any additional cost of buying them, and the transaction fees).

If you can instantly buy and instantly sell this is possibly (the disclaimer) a large opportunity.

rel:
1. According to Big Internet Search Engine.


Can a low fee unconfirmed transaction prevent confirmations of following transactions? To be more precise, consider the following situation:

Address A gets an input of 4 BTC.
You try to make a transaction from A to B with 1 BTC and a very low fee, which means its unconfirmed for a long while. The transaction's output are B and A (to account for the change of ~3 BTC after fees)
Before waiting for the previous transaction to be confirmed, you send again from A to B, this time you send 2 BTC with a higher fee, hoping it'll be confirmed fast.

My question is, since the output of the first transaction is the same address A, will it need to be confirmed first for the second transaction to follow through, because the input of the second transaction is A?

In this example I used amounts to make sure there's "enough" bitcoin for each transaction separately (since if you have 1 BTC and you try to send it twice intuitively see why it shouldn't work).

Assume no extra addresses are generated automatically by the wallet to handle it. I'm talking about this specific re-use of addresses scenario.

Yes, if the second transaction spends the output of the first one, then #2 cannot be confirmed until after #1 is confirmed.  (Though they can be confirmed in a single block, as long as #1 appears before #2 in that block, in which case the confirmations are effectively simultaneous.)

Most miners will consider transactions on a "child pays for parent" basis, so that a low fee for #1 could be compensated by a high fee in #2.  The two transactions would be considered as a single "lump" with their combined fee, and a miner would confirm them if the combined lump pays a higher fee than the next most lucrative transaction (or lump) that could fill that space.


difference between signing a message and signing a p2sh can i use the sign message function to sign the serialized hex for a p2sh transaction? Are the ecdsa functions used the same or are they different? It looks like the output is in a different format than a traditional tx signature? How can one use this function to sign?

You cannot. While both message and transaction signing use ECDSA and double sha256, signed messages slightly modify the message such that it is impossible to create a signature that works for that key in a transaction.

Specifically, bitcoin signed messages are prefixed with the string Bitcoin Signed Message:\n (\n is the newline character, not literally \ and n). This means that the data that is actually signed cannot be for a transaction since the data signed for a transaction cannot begin with that string. This design is intentional so that users cannot be tricked into signing a message which can be used in a transaction to take their money.

The output looks different just due to serialization. If the signatures were compatible, you would just deserialize the signed message signature and reserialize it differently. But because the signatures are not compatible, this point is moot.


Given an altcoin, how to find its mining pools? I wonder if it can be possibile to find all pools for a given altcoin.

For example, if an altcoin X has an official pool P and its official pool crashes or its not working, how we can find all the pools for the given coin?

It is supposed that the other pools aren't indexed on search engines.

It is impossible to identify who a miner or mining pool is based upon the coin's blockchain. If the mining pools are private or have poor search engine optimization, then it will not show up in search engine results. Given that you cannot deanonymize miners from the block data nor can you search for all of them, you cannot get a definitive list of mining pools for any coin.


Running bitcoind in a different directory I installed bitcoin core in windows 10 using ( Windows Subsystem for Linux ) . I installed ubuntu from the store and I used it to Install bitcoin core. The thing is everything was installed in the main hard disk C and it doesn't have enough space to download blocks. Is there a way to copy it to another partition (D partition because it has enough space) ? or while running bitcoind is there any way to run it with a specified path?

Ps: I hope the question is clear

Thank you

Make sure to stop bitcoind with bitcoin-cli stop, then move your data directory to a new folder and add the following line to your bitcoin.conf:

datadir=path/to/new/directory

This file should be somewhere in C:\Users\username\AppData\Roaming\Bitcoin\bitcoin.conf in Windows and ~/.bitcoin/bitcoin.conf in Linux.

As the user AntMor replied, you can also pass this configuration every time you run bitcoind.


What are the minimum security expectations of an online wallet service? If you wanted to assess the security of an online wallet service such as a bitcoin bank or ewallet, what would expect to see addressed?

Obviously SSL connections, but what about authentication, authorization, protection of staff from rubber hose attacks and so on?

It would be impractical to list every single expectation here, but the TradeHill exchange sets themselves up for PCI compliance. I think being PCI compliant is a great set of standards to keep your data safe and secure.

PCI compliance is basically security standards setup by the PCI Security Standards Concil for merchants who accept credit cards, online or offline. They have 4 sets of levels of PCI compliance, which I believe TradeHill to abide to the first level (at the bottom).

Common sense comes into play when storing Bitcoins. Keep a small percentage of them online for immediate usage, when your hot storage gets empty, fill it back up with funds stored offline. Keep multiple secure backups of your wallet files, so a 'bitomat' doesn't happen.

I don't think there is anything to protect a staff member from rubber hose attacks, but limiting the access of your staff members so that the information is accessed on a need-to-know basis through someone like you would help prevent sensitive data leaking. If they're attacking you, then you're fucked.


How can market-based transaction fees scale? Can someone please explain to me what I am missing?
I don't see how variable, market-based transaction fees can scale. I go to a merchant's website to buy, how do I select a mining peer to pay transaction fee to? Do I attach some bounty that any peer can earn if that peer wins the Proof-of-Work block? But what if my bounty isn't high enough to attract a peer given high transaction volume competing for priorities? Or not enough to cover any peer's mining overhead. How do I know how much to bid to be sure my transaction completed in a timely manner?
This sounds very complex and unreliable and not at all like something that can scale to customers. Customers want to click one button and be done with the purchase and not waiting unknown hours debugging their payment processing. Amazon's One Click.
I don't see how with different peers charging different fees (to match their market dynamics), the sender of a transaction can know the amount to bid to get in the next block? It is impossible because the tx fees are not uniform and the random selection of the next peer is not knowable in advance.

The blockchain is public, and every block has (amongst other things) the following information for each transaction (or it can be calculated):

The size of the transaction, in bytes
The fee paid by the initiator of the transaction

Miners in future are likely to calculate the earnings per byte for each transaction when selecting which ones to include in a block, so that they earn the maximum profit from the block. At the moment they mostly just include them all, provided there is at least a token fee.

Furthermore, transactions that have not yet been included in a block are publicly available.

From this information a user could estimate the transaction fee they will need to pay to get their transaction included in the next block, or within one of the next few blocks. Of course in the long run, it won't be a user that has to seek out this information; it'll just be part of the information readily available as they initiate a transaction. At least, that's how I see it working.

The idea has also been floated that the receiver of a transaction could pay a small fee to get the transaction into a block sooner (to ensure they receive their payment).

Reporting on the level of fees needed to process a transaction is minimal at the moment because it's not particularly difficult to get transactions included in a block with either no fee or just a token fee (say 0.00001BTC). This is because we haven't hit the block size limit (at least, we're not constantly hitting it).


When importing the mempool, my debug log mentions failed and expired imports I read in my debug file:

Imported mempool transactions from disk:
143751 successes, 235 failed, 1 expired

What does failed and expired mean in this context? How can I fix that?

You can't, and you don't have to.

Since Bitcoin Core 0.14.0, the mempool is saved to disk at shutdown, and read again in the background at startup. This helps in quickly establishing a realistic mempool to help with fee estimation and compact block relay.

However, time likely has passed since the mempool was saved and when the import happens. New blocks may have been created since, which likely contain many of the transactions that are being imported. Those will not be acceptable again to your mempool, and they will be listed as failed. Other reasons may include feerate changes, or conflicting transactions that were mined. Since the mempool import happens in the background, some part of it likely gets imported after processing the blocks with whom those transactions conflict.

Transactions that are older than the mempool expiration setting (default: 14 days) don't get imported either, and get listed as expired.


Slow starting bitcoind bitcoind is extremely slow to start (~5-20 minutes). I'm not talking about keeping up with the blockchain, that would be perfectly fine, I'm talking about an initial phase where it doesn't even respond to requests: any call to it returns "error: couldn't connect to server" (either from command line or from web).

Is it a known issue, is there a workaround?

OSX 10.6.8, bitcoind 0.7.0 (but happened with earlier versions too).

You very probably have a massive wallet.dat file.

This happens with Instawallet's bitcoind, it takes an hour to start up, it spends this time loading the wallet.

If you want to make sure :

Stop bitcoind
Open up a Terminal, and type :
$ tail -f ~/Library/Application\ Support/Bitcoin/debug.log
Press ⌘K to clear the scrollback and window
Start bitcoind

You should see some output when the client starts, if the problem is actually with loading the wallet the output should stop for a while on 'Loading wallet'.


The incident with 92 billion bitcoins There is a documented case from 2010 when a block with 92 billion bitcoins was discovered. The bug was found and software was patched within 5 hours and everyone had to "hit the load button" to an earlier blockchain. It was speculated to be malicious. My question is: did anyone try to make transactions with the hacked bitcoins? If not, is it possible the bug was exploited accidentally?

Someone might have a copy if they have a long-running node - they  would have had to have upgraded while the hard fork took place to be synchronized today

The transaction was executed by someone who knew of, and wanted to demonstrate the issue. The overflow meant the summed output value was less than the total input amount, despite actually minting billions of bitcoin out of thin air.

It's unlikely the problem would have happened accidentally, the amounts would have been crafted to trigger the bug: two outputs with amounts exceeding the 21 million limit are required to trigger it, so with just one, it would have been rejected.


What exactly is sol/s as far as a hash rate is concerned? What is sol/s? Is it the same as MH/s? Please don't answer it depends, because that makes no sense!
I have already tried googling this question but to no avail.

It means "solutions per second" and means the number of attempts per second made at generating a valid block.
In Bitcoin, where 1 hash is equivalent to 1 attempt at a potential valid block, it's equivalent to "hashes per second".


How to Actually get the money I have no idea on what lm doing l deposited  $50 to a gaming site and won a little so want to get some of my winnings back to my keycard savings account but l have no idea how to do this lll enclose a photo, the gaming place asks for a Wallet Address which l did and withdrew $40 to my Bitcoin Wallet Address but now l don't know what to do next how do l get it from now the Bitcoin Wallet to my actual Bank Account any help would be appreciated as lm so way outta what l need to do its all just so hard Regards Mark Brown

It looks as though you are not actually attempting to withdraw Bitcoin. Rather, it looks as though you have gambled with dollars, and are being asked how you would like to withdraw your money from the site. In this withdrawl, they are simply offering Bitcoin as one of their payout options.

Bitcoin is not something that can be 'withdrawn' in this regard; it is essentially a commodity that is exchanged between two people. You sell your Bitcoin to someone else who is willing to buy it at the agreed price.

With this 'Method: Bitcoin' you are seeing, you are essentially being asked to private a public key address in which the owner of Joe Fortune would deposit the equivalent market value of Bitcoin into. It's essentially like being asked to provide a bank account number in order for Joe Fortune to deposit funds into.

One Bitcoin is currently worth ~$4,635 USD, so instead of getting a payment of ~$310 USD, you would get a payment of ~0.07 Bitcoin (BTC).

Hope this helps! :)


Can I easily use Bitcoin as a inexpensive way to transfer my money into another currency? I have a home business in the US and I am spending a significant amount of time in Europe.I have both a US and a EU bank account as well as a coinbase account. I am wondering if I can by bitcoins in USD and then sell them back to my EU bank account in Euro? My normal bank charges $35 plus they give me an exchange rate 4.5% more than the market. So, for each $1,000 I send, I pay almost $45 in exchange fees plus the $35 transfer fee...I am wondering if using bitcoin can help me significantly reduce my costs for this type of international money movement? has anyone done this and can you tell me of any problems or pitfalls? Thank you!

I have done this successfully in the past, just like you for USD to EUR.
You'll pay probably pay around 0.5% to move USD into Bitcoin, then another 0.5% to move them to Euro. In any case, you should probably be able to stay below $80 on $1000. ;)

You might need a bank account denominated in Euros though, and it will take a few days. (For me it was something like 20 minutes for the exchange to confirm that the bank transfer to my account was on the way and two days until it was in my account.) Depending on the price movement of Bitcoin you might win or lose additional points.

I did this almost three years ago, so maybe it's not quite as easy anymore with the increased AML and KYC going on.


What means discovering a block? I'm reading about the miners and it always says that the miners are rewarded when a block is discovered.

What is that? What they discover are new bitcoin pieces, isn't it? When they find a new bitcoin they are rewarded with that value entirely or not?

Blockchain is a chain of blocks. Every node connected to blockchain have to come to consensus about the state of that blockchain.

If you and I have a different view of blockchain then some transactions that are valid for you might become invalid for me and it just doesn't work. To make this thing work every node in a decentralized network should have the same view of the history of transactions, also known as blockchain.

Now if we allow every node to add a block to blockchain, due to network latency every node will have different view of the blockchain. Thus, we need a way to somehow select nodes that can add a block to blockchain for a particular round. For this, every node has to solve a cryptographic puzzle. Nodes who solve this puzzle can add a block containing proof of the solution to the blockchain.

As you can see, nodes have to put in some effort to solve the puzzle and thus we have to give them some reward. In bitcoin, newly generated bitcoins and transaction fees are given as a reward.

And this process of
1) Competing with every node for solving a puzzle
2) Add a block to blockchain if you found solution before everyone else
is known as discovering a block.


What's the safest way to buy bitcoins in the UK? I have come across multiple websites offering bitcoins for UK bank transfer. What site have people had the best experience with?

I've come across a few so

www.quickbitcoin.co.uk

www.bitbargain.co.uk

www.blockchain.info

Ideas?

The safest way (though perhaps not convenient) is to create a two-party legal contract with signed witnesses. This way if either party reneges you have legal recourse in the civil courts. The contractual arrangement would be somewhat similar to when a freelancer charges bitcoins for their goods or services.

Escrow doesn't provide the same level of protection, as your legal contract with the escrow company (if any) usually includes a clause that final binding arbitration is made by the escrow company - not you. However, a reputable escrow service or currency exchange will typically suffice for people with moderate risk appetites.


Which BIP describes the structure and algorithm for creating a wallet file? My app is able to create a public and private key from BIP39. The uncompressed private key is concatenated with a sha256 (private key) and then encrypted via AES and saved to a file. To decrypt, you will need to decrypt the entire file, then take a hash from the first order of bytes and compare with the second half.

I plan to add support for BIP32, 43, 44 and am already working on it, but I am faced with the issue of storing information for creating backup.

My way of creating a file is not suitable, so I’m wondering if there is a ready-made BIP to solve this problem.

There is a list of BIPs at https://github.com/bitcoin/bips

I don't see anything that specifies a wallet format.

To be honest I'd be surprised to see one. This is something that each implementation ought to determine for itself, Some wallets might use an embedded SQL DBMS, some a Berkely DB format, some a JSON store of some sort and so on. Similarly, the contents may depend on what unique features and facilities the wallet offers. Wallets might be multicurrency or even multiuser, they might have settings for GUI skins that need to be saved as part of a wallet backup, they might have IDs for associated exchange or other services.


Bitcoin.conf setting for CPFP - how can I enable longer 'chains' of unconfirmed transactions? I often receive an -32700 'Insufficient Funds' error when attempting to create 'child pays for parent' (CPFP) transactions using unconfirmed change output. This can be problematic since it can prevent me from sending further transactions until the parent transaction is confirmed.
My question:
Is there a bitcoin.conf setting (or other workaround/solution) that would allow for the acceptable length of chains of CPFP transactions/unconfirmed change outputs to be increased, and thereby avoid being stuck, unable to broadcast further bitcoin transactions until parent txs are confirmed?
A related side question - I have not yet discovered the logic behind how bitcoin core decides to allow an additional CPFP transaction to be chained, and when it gives an 'Insufficient Funds' error. It seems to be anywhere between a chain of 1 to ~5 (i.e. sometimes I get 'Insufficient Funds' error when there is only a 'chain' of one tx, other times, up to around 5) and it is not clear to me how this is determined. What is the logic here?

The maximum unconfirmed descendant count is a mempool setting, not a wallet one. Assuming most of the network run with the default of 25, even if you changed your own mempool to accept a longer chain the last child transaction would not relay.
Anyways, in such an extreme case (a chain of >25 unconfirmed transactions) you likely want to bump your fees already. And batch your transaction next time..

how bitcoin core decides to allow an additional CPFP transaction to be chained, and when it gives an 'Insufficient Funds' error.

The wallet will by default spend unconfirmed change (transactions it itself created), but not unconfirmed incoming payments.


Beginner, how to get bitcoins to invest? What would be the best way to start from scratch in the bitcoin world without investing capital at first?

If you don't want to invest capital but still want to obtain some BTC, you will either need to earn it or be given it. Bitcoin faucets give a small reward for visiting the site, usually because of ad revenue the site obtains by the visits. The most reliable way to earn larger amounts of BTC would be to sell products or services in exchange for bitcoin (obviously selling products is similar to investing capital, but services such as freelance programming, etc. can pay well)


Stratum mining, jobID and stale/rejected shares Let's imagine following situation:

I've got a job from stratum pool, miner found golden nonce and sending it over the pool.

While waiting for pool response, miner found another satisfying nonce within the same job.

Question1: will stratum mark second nonce as stale or reject it when submitted to the pool?
Question2: if I found another nonce by increasing nonce2 field for the same job ID, will it be accepted by the pool?

This depends on the Stratum implementation. There are many. The Stratum protocol does not require implementations to accept or reject the second proof of work you send in with this scenario.

Most likely the pool will quickly send you new work data after you send in the block solution. After that it will receive your second proof of work and it will be rejected as stale.

There will always be some stale work as new blocks are found.

Clients should submit their data as quickly as possible. Pools should distribute new work data as quickly as possible when new blocks appear, to reduce the amount of wasted work. Pools should also distribute blocks to other pools as quickly as possible, to reduce the amount of orphaned blocks.


How does getblocktemplate select transactions? I wrote a script that compares the transactions listed in the memory pool with the transactions included in getblocktemplate:

http://learnmeabitcoin.com/explorer/node/memorypool

(I've ordered the transactions by [current priority], and highlighted the ones included in getblocktemplate in blue.)

How does getblocktemplate choose which transactions to include from the memory pool in a candidate block?
Why aren't transactions being selected from highest to lowest priority?

The whole mempool won't fit in a block; getblocktemplate returns enough transactions for a block. Blocks are, by default, limited to 750kb by policy, but many miners increase the size to the block limit of 1mb (which can be done by command-line flag).

The specific piece of code that decides on the transactions that should be included in a block can be found here. It's reasonably well documented, and not terrible to read, I'd suggest taking a look through it to see where your script operates differently.


How can't a malicious attacker generate bitcoins on his private network? I'm new to the cryptocurrencies world and I'm trying to understand how all this stuff works, so expect a really noob question.

Suppose there's a user which generates a number of addresses and sets up his private blockchain. One of this address will start illegal transactions moving money that doesn't really exist. Since the other nodes of the network are controlled by him, the transaction will be validated. Now this address is moved from his private blockchain to a public pool.

How does the blockchain knows/prevents the malicious node from spending money that are not really there?

Thank you!

The blockchain will only accept blocks which are based on previously accepted blocks and have a hash value that satisfies the current difficulty requirements. A malicious attacker is in the same position as any other miner, so any block that he mines must satisfy the same conditions regarding validity. In fact, the bitcoin protocol is designed to be trustless, which means that even miners with malicious intentions are not able to destroy its integrity unless they manage to control a majority of the mining power.


Get bitcoins to self created Bitcoin address I created Bitcoin private and public key pair for Bitcoin. I am looking a way to receive funds to my Bitcoin address. The wallet apps which support buying or selling bitcoins are generating bitcoin addresses again. How can I buy bitcoins to my own account instead of wallet generated addresses?

I suppose you are using an HD wallet which all modern wallet apps use, the fact that a new address is created for you each time you want to receive bitcoin is in fact designed to improve privacy and security.

All of the address generated by your wallet which is called an HD wallet are derived from a seed and you are supposed to have a "Mnemonic phrase" (a list of words) which kind of act as your private key and must have been generated at the creation of your wallet.

You can still access the individual private key of each address, keep in mind that exposing them is not secure see @Chris Chen comment the procedure depend on each wallet software, accessing those are usually not necessary.

Here is more information about HD wallet and Mnemonic phrase


How can one simulate and analyze attacks on the Bitcoin network? Are there any other platforms or tools beside TestNet where I can simulate and analyze various attacks like double spending (finney/block withholding attacks etc.)?

The regtest operational mode of bitcoind is not as similar to testnet as you might think. The regtest mode offers you a totally local Bitcoin blockchain which is easily controlled by your local bitcoind with low difficulty. According to this post, it is furthermore possible to build a network out of multiple local bitcoind instances, such that you have a local Bitcoin network of your own.

You can control this network freely, but you can only simulate behavior that bitcoind allows you to assume. I am not aware of whether or not this is sufficient for your cases. If not, you could maybe try to fork bitcoind and somehow add the behavior you want to achieve...


Export from Bitcoin — import to Bitcoin Cash I have address 3GXXiZhq1MZFeWtM6wFUWDA9wSLQh2NU6E, generated by my Bitcoin Core v0.20.0. Accidently I sent Bitcoin Cash there. I use dumpprivkey 3GXXiZhq1MZFeWtM6wFUWDA9wSLQh2NU6E console command and get private key. Then I switch to BCH Unlimited v1.9.0.0-96d2de8d0 and do importprivkey ...... It imports as qqexcx5vkel7lcvny2nm7hq439cd4xvpdvuddlu0fh with zero balance. But address must be pz3tax8neurguwsdn538eh7hfyxmy2pznsgt5ajpk2. Same problem if I import it in blockchain.com. How to access my BCH at 3GXXiZhq1MZFeWtM6wFUWDA9wSLQh2NU6E now?

You are likely importing it as a legacy address, since Bitcoin Cash does not support segwit scripts.
In this scenario, you cannot actually recover the coins yourself. Since segwit isn't activated on the Bitcoin Cash chain, the coins are essentially anyone-can-spend - if you try and build a transaction yourself to move them, other parties on the network will notice that they can be spent by anyone, and there will likely be a few malicious ones who will attempt to take the coins for themselves.
Your best bet, if the value is significant, is to reach out directly to Bitcoin Cash mining pools and ask them to include a transaction directly in a block, without broadcasting it first. You should be able to provide them with the public key, which is sufficient to build the transaction required to move the coins.


Get transaction data from full node Background Information

I am building an application that requires the ability to query any bitcoin full node (from a python script using raw tcp sockets) in order to read the OP_Return value listed in the following transaction (https://live.blockcypher.com/btc-testnet/tx/2599dbe540a583ede3512fef9a0f26be718c039ffd4d04d85ff3b339f40e73b1/)

What I have done to date

I have successfully managed to establish the version + verack, however I was faced with two issues.

When I send a getdata for the necessary transaction Idit does not return the result. I have identified this is because my initial assumptions that getdata returns the necessary data was incorrect and instead it will only return transaction data for transactions still in mempool.
This lead me to my main issue, I was hoping to replicate the initial block download on my python script, starting from the block containing the transaction I'm interested in. However when I do getblocks/getheaders no matter what I seem to put in the hash filter I get a dump of 500 (or 2000) blocks/headers. Below is a hex dump of the requests I am making (just the bitcoin protocol frame):

getblocks
0b110907676574626c6f636b00000000450000002a0af9950100000001000000000000592589e55cda6e8a093998e8356ea770d4aaeb7c0f5439b147d7000000000000017a09017d52db538d7a9ddcc48311866d7e5fdbbbec7d0faad5
getheaders
0b110907676574686561646572730000450000002a0af9950100000001000000000000592589e55cda6e8a093998e8356ea770d4aaeb7c0f5439b147d7000000000000017a09017d52db538d7a9ddcc48311866d7e5fdbbbec7d0faad5

I am looking for the following help:

How can I query for transaction data without using bitcoin RPC if I can't use the getdata message?
How do I get my block or headers response to only contain 1 inv item instead of 500/5000

EDIT (4/5/20)
The implied requirement which wasn't made clear here was that we needed to do so in a decentralised way using the blockchain RPC api or equivalent.

I don't see any endpoint to get the whole transaction in Blockcypher API documentation, so I used blockstream.info API:

>https://blockstream.info/testnet/api/tx/2599dbe540a583ede3512fef9a0f26be718c039ffd4d04d85ff3b339f40e73b1
{
   "txid":"2599dbe540a583ede3512fef9a0f26be718c039ffd4d04d85ff3b339f40e73b1",
   "version":2,
   "locktime":0,
   "vin":[
      {
         "txid":"382bda6ee2bac22afd051104af16146436895ecca382a76c2d66535a837254bc",
         "vout":1,
         "prevout":{
            "scriptpubkey":"00144ecdb2867150ff16c7d6e3258adca9ed8bac3ac1",
            "scriptpubkey_asm":"OP_0 OP_PUSHBYTES_20 4ecdb2867150ff16c7d6e3258adca9ed8bac3ac1",
            "scriptpubkey_type":"v0_p2wpkh",
            "scriptpubkey_address":"tb1qfmxm9pn32rl3d37kuvjc4h9fak96cwkpjyyjmk",
            "value":2948920
         },
         "scriptsig":"",
         "scriptsig_asm":"",
         "witness":[
            "304402205e9b17758d1daf2a501a1fabe06bdbf15adaadfcf6ff80c4cfb34176bd988c0c02207450185bde5c20e06270b3b7e681e0042072c6af25fc10c62430df0f04ec5bf201",
            "023532fa6b866f37729719a3615ef3a776407048989736ac2b7fafa5678a519df3"
         ],
         "is_coinbase":false,
         "sequence":4294967295
      }
   ],
   "vout":[
      {
         "scriptpubkey":"6a0e3132372e302e302e313a38313831",
         "scriptpubkey_asm":"OP_RETURN OP_PUSHBYTES_14 3132372e302e302e313a38313831",
         "scriptpubkey_type":"op_return",
         "value":0
      },
      {
         "scriptpubkey":"a914171f697fe358f7d7238b6128930bb1fa7363b44d87",
         "scriptpubkey_asm":"OP_HASH160 OP_PUSHBYTES_20 171f697fe358f7d7238b6128930bb1fa7363b44d OP_EQUAL",
         "scriptpubkey_type":"p2sh",
         "scriptpubkey_address":"2MuMVAFK2gbTDNVBhLtpZfA4Xi62mWh6bU5",
         "value":948920
      },
      {
         "scriptpubkey":"0014af8abd63a00c40ad75e47870b1b0a1ddb2ba7e66",
         "scriptpubkey_asm":"OP_0 OP_PUSHBYTES_20 af8abd63a00c40ad75e47870b1b0a1ddb2ba7e66",
         "scriptpubkey_type":"v0_p2wpkh",
         "scriptpubkey_address":"tb1q479t6caqp3q26a0y0pctrv9pmket5lnx24twcx",
         "value":1500000
      }
   ],
   "size":248,
   "weight":665,
   "fee":500000,
   "status":{
      "confirmed":true,
      "block_height":1612110,
      "block_hash":"000000000000592589e55cda6e8a093998e8356ea770d4aaeb7c0f5439b147d7",
      "block_time":1576024567
   }
}

You can see here that the first output has the data is 3132372e302e302e313a38313831, which decoding to ASCII characters seems like a local URL:

hex = '3132372e302e302e313a38313831'
decoded = binascii.unhexlify(hex).decode('ascii')
print(decoded)

Prints: 127.0.0.1:8181

EDIT:

To get the transaction that interests you without using any external API you will need to run a full bitcoin node with the txindex=1 option. If this transaction is tracked by your wallet, a pruned node would suffice. Then you can get the information about the transaction with this command:

>bitcoin-cli getrawtransaction 2599dbe540a583ede3512fef9a0f26be718c039ffd4d04d85ff3b339f40e73b1 true

You should get something very similar to the answer from blockstream's API I pasted above


Sending from Coinbase to Blockchain wallet. Numbers explained? I recently sent some BTC from my Coinbase account to a Blockchain.info wallet, but the numbers I see are confusing.  According to my Blockchain app, the transaction had a fee of .0001 BTC (for the miners, I get that).  The BTC made it to my wallet, but the remaining .00120821 went somewhere else.  Because of this, I wonder where did the .00120821 BTC get sent?

Unspent transaction output (UTXO) can only be spent in full, so if they don't match the amount you are trying to send exactly the rest will be sent back to yourself.

Therefore I assume that you had a single UTXO in your wallet. When it was spent, the remainder was sent to a change address in your own wallet.


Steem - Who maintains the blockchain? I did some reading on the Steem currency, and as i understand it there is no mining of Steem. New coins are created automatically and distributed to the social media contributors..

What i don't understand is who's maintaining the public ledger (the blockchain)? In Bitcoin, miners get new bitcoins as a reward for mining, and maintaining the public ledger by verifying transactions. So if there are no miners in Steem, who is varifying the transactions on the ledger?

The Steem blockchain is verified by witnesses.

From the Steemit faq: The Steem blockchain requires a set of people to create blocks and uses a consensus mechanism called delegated proof of stake, or DPOS. The community elects 'witnesses' to act as the network's block producers and governance body. There are 20 full-time witnesses, producing a block every 63-second round. A 21st position is shared by the backup witnesses, who are scheduled proportionally to the amount of stake-weighted community approval they have. Witnesses are compensated with Steem Power for each block they create.

Each Steemit account can vote for up to 30 witnesses.


calculate transaction ID TXID from JSON or raw transaction consider an offline transaction that has not been posted yet, created through a method such as here:

http://brainwallet.org/#tx

a) how could I calculate the transaction ID from the raw transaction?
b) how could I calculate the transaction ID from the JSON transaction?

Both the reference client (Bitcoin-QT) and a service like http://brainwallet.org/ show the transaction ID after signing but before the transaction is broadcast.

Take for example, this valid binary transaction:

01000000017a06ea98cd40ba2e3288262b28638cec5337c1456aaf5eedc8e9e5a20f062bdf000000008b48304502200addea57dd4c2871357165ed6d2bc94b117e322918073ac4c66d535637e74600022100dfaa0dce9e2e61aa2867c87fadca4e0fa3c70e9852a4689b3ef24b3f94809b4a014104e0ba531dc5d2ad13e2178196ade1a23989088cfbeddc7886528412087f4bff2ebc19ce739f25a63056b6026a269987fcf5383131440501b583bab70a7254b09effffffff01b02e052a010000001976a9142dbde30815faee5bf221d6688ebad7e12f7b2b1a88ac00000000

In JSON it decodes to:

{
    "txid" : "46b690f548f6eb70dca7fb2020ff4be369c42f3ea2375fd3f6b34890b640f8e9",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        { [... snipped ...]}
        }
    ]
}

With the transaction ID in the first key. If you were doing the signing yoruself, the TXID is literally a double SHA256 hash of the raw transaction. There's some more information about raw transactions on the wiki.


How harder is it on average to find a block with one more zero in its hash? If

the size of the block hash, the one that has to be below a certain value, is fixed (256b, right?), and
finding a hash with one more bit set to zero is, I suspect, twice as hard, and
Moore's law (doubling of cpu power every 18 months. I know, that's not Moore's law, he meant storage in a given space) persists for long enough, and
the total hashing power follows Moore's law (bitcoin does not take over and remains somewhat underground)

then we can calculate when the protocol will have to change.

As far as I've seen on recent bloks, 17 hex characters are already zero in the hash, meaning 188 bits are left with a value. This means that in 188*1.5 years, we'll collectively be able to calculate an all-zero hash in less than 10 minutes.

So what did I miss ? Is my assumption about hash calculation difficulty correct ?

From Applied Cryptography, by Bruce Schneider (pp. 157-158):

One of the consequences of the second law of thermodynamics is that a certain amount of energy is necessary to represent information. To record a single bit by changing the state of a system requires an amount of energy no less than kT, where T is the absolute temperature of the system and k is the Boltzman constant. (Stick with me; the physics lesson is almost over.)
Given that k = 1.38×10^-16 erg/°Kelvin, and that the ambient temperature of the universe is 3.2°Kelvin, an ideal computer running at 3.2°K would consume 4.4×10^-16 ergs every time it set or cleared a bit. To run a computer any colder than the cosmic background radiation would require extra energy to run a heat pump.
Now, the annual energy output of our sun is about 1.21×10^41 ergs. This is enough to power about 2.7×10^56 single bit changes on our ideal computer; enough state changes to put a 187-bit counter through all its values. If we built a Dyson sphere around the sun and captured all its energy for 32 years, without any loss, we could power a computer to count up to 2^192. Of course, it wouldn't have the energy left over to perform any useful calculations with this counter.
But that's just one star, and a measly one at that. A typical supernova releases something like 10^51 ergs. (About a hundred times as much energy would be released in the form of neutrinos, but let them go for now.) If all of this energy could be channeled into a single orgy of computation, a 219-bit counter could be cycled through all of its states.
These numbers have nothing to do with the technology of the devices; they are the maximums that thermodynamics will allow. And they strongly imply that brute-force attacks against 256-bit keys will be infeasible until computers are built from something other than matter and occupy something other than space.

Essentially, the laws of physics prevent the existence of classical computers which can count to 2^256, let alone break 256-bit encryption. Moore's law alone won't ever stop Bitcoin's proof of work from working.
There are two ways around this, however. The first is a break in SHA-256. This is quite unlikely, as Bitcoin uses twice as many rounds of SHA-256 as the usual implementation, as block headers are actually hashed twice. If SHA-256
is ever broken, Bitcoin will actually probably be one of the last programs to suffer from the break, and will have ample time to switch algorithms.
The second way to get around the aforementioned laws of physics is with a computer not made of bits; a quantum computer. Any function can have its domain searched in O[N^(1/2)] on a quantum computer by Grover's algorithm. For SHA-256, with a domain and codomain size of N = 2^256, a string of zero bits twice as long as that of a classical computer running at the same speed can be found in the same time. This would still not be enough to exhaust the remaining bits, and in any case, an attacker with a quantum computer would make much more money by cracking Bitcoin public keys and stealing their balance.
EDIT: Fixed exponents getting mangled in the copy-pasting from PDF.


What does the Bitcoin client do when it receives conflicting transactions? I've been assuming that the second transaction will simply be discarded as invalid, while the first waits at 0/unconfirmed until it actually gets into a block (requiring a "-rescan" or similar if the second one actually ends up in the blockchain instead).  But is this the case?  What actually happens in the default client when two conflicting transactions are received?

For simplicity's sake assume the person running the client is the recipient of at least one of the transactions, and is not mining.

I can't speak for what it does every time but I just tested Mr. Schwartz's comment, so I can speak for what it did this one time. I remote controlled a geographically distant machine running an identical copy of Bitcoin on it and my local PC (with identical wallets). I sent identical conflicting transactions for my entire balance within a few milliseconds of each other (atomic clock sync & timers - don't ask) and just as expected, both transactions showed in both clients at 0/unconfirmed and only one made it into a block. The other disappeared after a -rescan

Curiously, after the -rescan the second transaction doesn't even show in a bitcoind listtransactions dump which seems odd to me. It seems like such erroneous transactions should be recorded and marked with a special status, similar to how orphaned block rewards are - this is an accounting system after all and under certain circumstances this could be "destroying evidence." I'll make a comment next time I'm on GitHub and see if someone bites.


How does the blockchain prevent transaction based on outdated note This question borders along the line of cryptography and distributed systems, but I guess I have a strong chance of getting an answer if asked here. So here goes:
I understand that the blockchain is in essence a distributed ledger, and nodes taking part in both validation and just performing transaction do this based on their own copy of the distributed ledger.
Since this is distributed I assumed at any given point in time, not all node would have exactly the same data, as it takes some time for changes to propagate throughout the whole network.
Given this characteristics of distributed systems, the question then is, how does systems implemented using blockchains prevent erroneous transaction based on their outdated, and not yet up to date view of the network?
How does this problem get resolved?

the blockchain is in essence a distributed ledger

It is more accurate to think of it as a replicated journal for the following reasons:

unlike a distributed database, individual nodes hold a full copy (replica) of the whole data, not some coordinated subset of it.
Ledger and Journal are accounting terms. The Blockchain is a simple list of transactions in approximate chronological order. Just like an accounting journal. There are no accounts and no balances so it is unlike an accounting ledger.

how does systems implemented using blockchains prevent erroneous transaction based on their outdated, and not yet up to date view of the network?

The answer depends on what you mean by an erroneous transaction.
A network node that does not yet have the latest block of the blockchain will reject (or put aside) any transactions that depend on outputs of transactions in the missing block.
So it errs on the side of caution.
It will still reject new transactions that erroneously attempt to spend outputs of older blocks it knows about which have already been spent.
It will still reject new transactions that break any of the rules that don't depend on knowledge of prior transactions.
Bitcoin nodes don't need to know about people or balances because Bitcoin is electronic cash not an electronic bank account. Just as the person who sells you a cup of coffee doesn't care about your name or your bank balance, they only care that the coins you gave them look and feel genuine.


Adjustable block size We know that PoW difficulty is adjusted s.t a block is found roughly in every 10 minute. So, if nodes happen to mine a block too fast, difficulty is increased and vice versa.

I wonder if it's possible to apply the same mechanism to block size. I'd guess huge block sizes are bad in general as it takes longer to propagate them however, we also know that at certain intervals there are lots of unprocessed txs. So, would it make sense to increase block sizes at least for these intervals and decrease afterwards? Would such mechanism might help Bitcoin in a way ?

So, would it make sense to increase block sizes at least for these intervals and decrease afterwards?

The key problem here is miners can introduce transactions in a block for free. In other words, miners can create lots of transactions with high fees for free. And there is no easy way to distinguish these transactions from regular legitimate  user transactions. Therefore, there is no easy way to measure the actual demand of unprocessed txs. This essentially provides block-space for free to miners and opens up DoS attacks.

  Would such mechanism might help Bitcoin in a way ?

Such a mechanism would certainly be helpful, but as pointed above there is no easy to make it work.


Armory synchronization takes forever. How can I speed it up or retrieve my coins? I have an Armory wallet that has been offline for a long time. When I start up that computer it runs just fine, however it is taking forever to download the blockchain. Based on my estimate of the blockchain size 116 gigs, and how much space is on my computer, I estimate it will take another 12 days to finish. I can however run Armory in offline mode and view my private keys.

What is the best way to spend my bitcoins. I would like to set up a new wallet that does not require me to download the blockchain and import the bitcoin addresses from Armory, but I can't find information on how.

Thanks a lot

You can extract the private keys and import them in a lite wallet like Electrum.

You need to run Armory as expert, go to the Wallet's properties dialog and click on the backup center on the right side column


Will buy and sell offers from one trader be matched with each other? If one user made a buy and a sell order at the same time, would they be matched with each other or remain pending?

On "real" exchanges Trading Against Yourself or Wash Trades are usually forbidden. Either by a real time check when you enter the second order or after the fact with fines by the oversight agency.

As Bitcoin Exchanges are not regulated, it's their choice to either block you from doing it or not (earning fees for the exchange).

The spread is pretty wide, so it will probably cost you quite a bit of money to do this on a meaningful scale.


How do I recover an encrypted bitcoin wallet to which I don't know the password? My husband died recently.  He had a Bitcoin-Qt wallet with some bitcoins.  I don't know the password and the wallet is locked and encrypted.  Is there anyway to regain access to the wallet?

Sorry for your loss.

If he used early versions of Bitcoin, he may have made an unencrypted backup of his wallet.dat file somewhere. Cracking a password may be impossible, so this might be your next best option.

Wallet encryption is a feature that was implemented in version 0.4.0 on 23rd Sep 2011, so if you do find a wallet.dat file older than that it's probably not encrypted.

Bitcoin users that are aware they are holding a substantial amount of bitcoins also are probably aware that they need to back their wallet.dat file up to a location different to their PC's hard disk in case of failure. You might find it on a DVD, thumb drive, or maybe somewhere like Google Drive.


restore wallet using hd seed before 0.17.0 Hd wallets are supported from v0.13.0.
Currently it is easy to save hd seed and restore a wallet from it (due to changes in v0.17.0 and v0.18.0):

dumpwallet (read hdseed from it)

createwallet (blank wallet)

sethdseed (set hdseed on a blank wallet)

How to do this using v0.16.3?
Problems I encountered:

I cannot find hdseed in dumped wallet file, so I don't know hd seed to backup
creating new wallets is done by starting bitcoind and passing -wallet option, but I don't see a way to specify hd seed when creating a new wallet

Is that even possible without upgrading?

I cannot find hdseed in dumped wallet file, so I don't know hd seed to backup

It used to be called hdmaster rather than hdseed.

creating new wallets is done by starting bitcoind and passing -wallet option, but I don't see a way to specify hd seed when creating a new wallet

Is that even possible without upgrading?

No. sethdseed was added in 0.17. Before that, there was no way to restore a seed to a new wallet in Core.


How to connect to several Bitcoin nodes using Bitcoin I'm looking for a way to connect to several Bitcoin nodes using Python...
I've been looking in different Bitcoin-for-Python libraries, but I haven't found anything :(
What should I do?

If you want to communicate with several nodes, you can use existing JSON RPC libraries and issue requests via the API. Check out these libraries:

JSON-RPC
python-jsonrpc


Are SegWit signatures all required to follow BIP143? ...or is there any way for a SegWit witness to contain a "legacy" signature?

I don't think that's possible, even if you intentionally construct the transaction to be used as both segwit or non-segwit, and if you assume that there are segwit and non-segwit outputs for the same address.

The first ~36 bytes of a hashed transaction look like this:

non-segwit:

byte
count   field name
4       version
1-3     varint of number of txins
32      sha256d of previous transaction

segwit:

byte
count   field name
4       version
32      sha256d of concatenated prevout fields

You would need to find two pieces of data such that hash(x)[1:16] = hash(y)[0:15] or hash(x)[3:16] = hash(y)[0:13], which I think is about as difficult as a collision attack (to a factor of 2^24 :P).

You can try to get around this by setting SIGHASH_ANYONECANPAY on the segwit side, but that puts a zero where the number of inputs should go on the non-segwit transaction, and that's definitely not valid in any signature mode. I think even if you sign in SIGHASH_NONE, you can't convert a segwit transaction to a non-segwit transaction, or vice versa.


Clarifying descendants/ancestors in error cases for too-long-mempool-chain In practice I've seen two instances of the too-long-mempool-chain error when trying to send a transaction:
When there are too many unconfirmed transactions chained together:
"too many descendants for tx <txid> [limit: 25]"

When the chain of unconfirmed transactions is too big in size:
"exceeds descendant size limit for tx <txid> [limit: 101000]"

In the code I also see two more error cases that look similar, but I can't grasp what the difference is in these:
"exceeds ancestor size limit [limit: %u]"

and
"too many unconfirmed ancestors [limit: %u]"

The names "ancestor" and "descendant" seem backwards given that we use the reverse terminology in something like "child pays for parent". Am I thinking about this correctly? Also, when would the latter 2 error messages get triggered?

The ancestors of a mempool transaction T are unconfirmed transactions that this transaction T depends on in order to be included in the block chain (i.e. that are referenced by its inputs).
The descendants of a mempool transaction T are (necessarily unconfirmed) transactions that depend on this transaction T in order to be included in the block chain (i.e. that spend one or more of its outputs).
In both cases there can be multiple "generations" of descendants/ancestors (e.g. descendants of descendants):
         Tb
        /
Ta  ---
        \        Td
          Tc ---/
                 \--- Te
                  \___ Tf

(Here, Ta and Tc are ancestors of Te but Tb and Tf are not ancestors of Te. Td is a descendant of Tc but Tb is not.)
As you may picture from the above outstanding piece of art, their management can quickly start to be tedious hence resource intensive.
This resource usage (mostly RAM for storage and CPU to handle chain reorganization) impacts every single node not running with -blocksonly on the network, it is thus a DOS vector that must be limited. But how?
I can point you to the bitcoin-core dev wiki which reports the word of Suhas Daftuar -one of the main architects of the system that is currently in place- regarding the trade-offs of different approaches to usage limitation, but as a TL;DR:
The mempool needs to be in phase with miner incentives (don't drop the highest-paying transactions), while limiting its footprint on network nodes. Therefore, two limits are in place for the two "views" relative to a transaction:

The size limit, accounted for in virtual bytes, of both its descendants and ancestors.
The count limit, accounted for in number of transactions, of both its descendants and ancestors.


I have a Bitcoin ABC full node. How do I split off Bitcoin SV? I have some BCH in a Bitcoin ABC full node, which is currently running 0.18.5. I want to obtain the corresponding Bitcoin SV without spending on both chains at the same time and losing the BSV. I am capable of running a Bitcoin SV full node, with the same or a different wallet. Is it safe to spend these coins as is, or is there some special process for splitting them?

Unfortunately I haven't been able to find any useful information online, other than "send it to an exchange" which I really don't want to do. Even bitcoincash.org has no useful information and seems to want to pretend that nothing significant even happened.

I made a tool (linked by user MCCCS) but you can actually do the splitting in regular Electron Cash too. Electron Cash is great for this because unlike most wallets, you can connect to both BCH and BSV servers. Just get some free BCH-only 'split dust' from free.bitcoin.com or from forkfaucet.cash, and mix that with your coins. Then switch to BSV and make a distinct transaction there.

The key points are:

During splitting, only send amongst your own addresses. That way if you screw up, you haven't lost anything.
After splitting, wait then verify that your coins are split (have different transaction IDs)

Some guides:

https://www.reddit.com/r/btc/comments/9yefov/if_you_want_to_dump_bsv_some_tips_on_splitting/
https://news.bitcoin.com/follow-this-branch-a-guide-to-splitting-bch-and-bsv/
https://cdn.discordapp.com/attachments/412369923541565463/514774626849521672/bsvbch-2.pdf


How much bitcoin is being sent to someone else in this transaction? From this link which is a bitcoin testnet transaction.

How can we be sure that this transaction spent a certain amount of satoshis to an address from another wallet? In this case the transaction is spending 2000000 t-satoshis to mzTH5MV8AVuzu6PRL5NArsv6qNYro1P8Qm address.

UPDATE

It seems "blockcypher" system is doing this accurately for this transaction as well. So there must be a way to do it. How does this work?

Blockcypher displays that Estimated Value Sent : 0.01 t-BTC

Generally, there is no information in a bitcoin transaction which indicates the amount being transacted between two parties. An outside observer can view the value of inputs and outputs, but the ownership of each output will be unknown to them. More specifically, the change output is often indistinguishable from the other outputs, so an outside observer may not know which output is the change, and which is the actual amount transacted. This is important, because it helps preserve privacy!

Consider this simple example: User A sends a bitcoin transaction to User B, which looks like this on the blockchain (ignoring fees for simplicity):

Inputs:

Address 1: 5 BTC

Outputs:

Address 2: 2 BTC
Address 3: 3 BTC

As an outside observer, we cannot tell whether User B was sent 2 BTC, or 3 BTC. By design, there is no data to tell us this.

However, in the case of both transactions you linked, the input address has been re-used as the change address, which is not best practices, as it significantly degrades privacy. This allows us to know how much BTC was transacted, because the transaction now looks like this:

Inputs:

Address 1: 5 BTC

Outputs:

Address 2: 2 BTC
Address 1: 3 BTC

And so we can see that User A sent 3 BTC back to themselves, and thus 2 BTC were sent to User B.

NOTE: some block explorers will make a guess at "how many bitcoins were transacted" (sent from one user to another) in a given transaction, according to some logic written by the developers that built that explorer. But this is just a guess, there is fundamentally no way to be certain about this information.

When best practises are followed, it becomes impossible to tell how much BTC was 'transacted': this is by design, and it is important for privacy and fungibility.


Configure esplora to point to the bitcoind servers ip address - Part 2 Continuing on from this post: Configure esplora to point to the bitcoind servers ip address

Trying to run cargo run --release --bin electrs -- -vvv --daemon-dir ~/.bitcoin, but it kept saying that the .cookie file is missing.  I manually created the .cookie file with user:pass and I am now getting the following error message:

Any idea how to correct this?

"Address already in use"

It probably means you have another instance of the process running on the background


NXT, Ignis, and Ardor Confusion. Purpose of NXT when there is Ignis / Ardor? If NXT is switching to Ardor, what is the purpose of holding NXT? There is another snapshot that's happening with NXT for the coin Ignis, but how what's the purpose of Ardor then? So is Ignis the new NXT? Very confused.

If NXT is switching to Ardor, what is the purpose of holding NXT?

Nxt isn't switching to Ardor. It will still exist after Ardor launches. The purpose of holding NXT with this in mind is if you need to use the Nxt blockchain, either for personal use or projects, since one will need NXT for the transaction fees, etc. Another reason could be the speculation of that use, since the amount of NXT in the network is fixed. (I'm not saying one should or shouldn't buy NXT for these reasons. Just pointing out some possible reasons of holding NXT)

  There is another snapshot that's happening with NXT for the coin Ignis, but how what's the purpose of Ardor then?

Ignis will be the first child chain on Ardor. Think of Ardor as this giant mechanical robot torso and head. It has everything needed for processing but doesn't really have a lot of features beyond processing, and maybe transferring some data around itself. (There will be almost no features on the Ardor main chain and just the ability to transfer ARDR and forge) Child chains are like the limbs that can be attached to this robot. They can do all the cool things while being powered by the robot torso and head.

With Ardor, there can be multiple child chains. So, if one wants their own blockchain without the problems of having enough nodes, etc., then creating a child chain would be an ideal option. Transaction fees will be paid in the child chain token and not in ARDR, though each child chain will need a bundler in order to collect these fees and pay the main chain in ARDR for processing the bundled transactions.

  So is Ignis the new NXT?

Ignis will have a lot of the features on Nxt but will not be the new Nxt. Probably the biggest difference is that all transaction records of Ignis will be pruned after 1440 blocks (~24 hours). Meanwhile, transaction records on Nxt will not be pruned. While there will likely be a archival nodes for Ignis, this might not be desired by some people for their projects, so running it on Nxt would be better. This would also be true if the project doesn't necessarily require all of the features a child chain would bring as creating a child chain won't be cheap. I'm not sure what the price will be yet, but testnet will probably give us a better idea.


How many transaction can I broadcast simultaneously? Let's say I build two transactions, and in the second one I add an input which refers to an output of the first one. Then I broadcast simultaneously the two transactions.
Now, I know that in Bitcoin exists a Transaction Chaining mechanism, still there is a limit on how many transactions I can chain this way (25 as I remember).
When that limit is reached, do I have to wait for the next block to chain more transactions, or just a couple of seconds so that each node can reconstruct the chain ?
Thank you very much.

You need to wait for the transactions to be confirmed in a block. The limit is on the number of unconfirmed transactions that can be chained together and is completely unrelated to how quickly the transactions were received.

The chain can only be extended once the unconfirmed transaction chain shrinks, and that can only happen as transactions are confirmed. It is important to note that the entire chain may not be confirmed in the same block and that the next block may not include any transactions in the chain of unconfirmed transactions.


Coin selection algorithm Playing around with Bitcoin Core Client v0.18.0, I used this command:

$ bitcoin-cli sendtoaddress "mozazucvLK179u41bF5Vd2Agp4wsm7HsPo" 0.1

which created
this transaction.

I noticed that the transaction created consumed three inputs, even though there were UTXOs of the exact amount available.

Looking for the UTXO selection algorithm, I came across the Bound Coin Selection Algorithm, but I'm not really familiar with the codebase.

Is this the only coin selection algorithm used by the client? Can someone explain how does it work?

There are a lot of things that need to be considered when selecting coins. Just covering the amount that you want to send is not enough, you have not considered the transaction fees that you will be paying for your transaction. So even though you have UTXOs of 0.1 BTC in value, using just one of those means that you will not have enough value in the transaction to cover the transaction fee so your transaction won't be relayed or confirmed.

So if you have to go over the target value, now you need to have change outputs. But even here you have to be careful. If you choose just enough Bitcoin to cover the outgoing amount and the transaction fee, you may end up producing a very small change output that would be considered dust. Dust outputs are not good as they are uneconomical to spend, i.e. they cost more in transaction fees than they are worth.

Bitcoin Core uses two different coin selection algorithms for different cases, and they have different target values.

The first one (the one that you found), is known as Branch and Bound. It tries to exactly match the amount needed for the transaction (outgoing amount + transaction fees) and not produce change. There is a small buffer allowing the algorithm to select slightly more coins than necessary in order to have a better match and avoid producing change outputs.

The general idea for this buffer is that if you are willing to create a change output and have to consume the cost of spending that output in the future, then you are willing to take that cost now and simply not produce a change output. So long as the extra amount that was selected is less than the predicted cost of spending a change output in the future, it is worth it to burn that amount now as extra transaction fee rather than producing a change output. The cost to the user is at most the same, and more likely to be less.

In general, this will produce smaller transactions and thus pay less in fees due to avoiding change outputs. It also helps with privacy because there is no change to link back to your wallet.

If the Branch and Bound exact matcher fails and it must produce a change output, then Bitcoin Core falls back to its original algorithm. This original algorithm is largely also an exact matcher, it just has a bunch of random fixes and hacks that were put into it to fix various issues. At a high level, it randomly selects coins.

An important part of this fallback algorithm is that, because it must create a change output, it chooses to target a minimum change amount to avoid the dust issue I mentioned earlier. Bitcoin Core defaults a minimum change amount of 0.01 Bitcoin. Of course there are exceptions to this when there are not enough coins in the wallet.

So what happened here is that you did not have coins of the correct values to exactly match 0.01 BTC + transaction fees, so the Branch and Bound algorithm fails. It falls back to the fallback algorithm and now targets 0.01 BTC (outgoing) + 0.01 (minimum change) + transaction fees. The fallback algorithm is able to select coins for this target value and thus you get the transaction that you have.


What are the security implications of not hosting your own Electrum server? Bitcoin-Qt is getting require large and is taking up over 10% of the space on my little laptop. Looking for an alternative, I saw Electrum. I downloaded the app and I'm able to connect to a server, but I'm wondering: what would the security implications be of not connecting to your own server?

A dishonest server could lie to you about how many bitcoins you have.


What are sidechains and drivechains? Altcoins have existed for many years and there are many hundreds of different ones already. A more recent concept is sidechains and drivechains.

What are sidechains and drivechains?

How do they differ from regular altcoins?

Sidechains are supposed to make it possible for users to move bitcoins between different bitcoin-based blockchains with different rule sets. For example, in this way, new techniques for preserving the privacy of transactions or a smart contract system similar to ethereum's could be added to a bitcoin blockchain, without changing the bitcoin blockchain. They are as an architecture for building semi-decentralised products and services for Bitcoin that were simply impossible before. With sidechains, users won’t be affected at all by any new programming.

Drivechain is a two-way peg for interacting with the sidechain. The key difference between drivechains and regular sidechains is who ultimately submits the necessary information to transfer the bitcoins back and forth: the users or the miners.

The side chain idea allows the native cryptocurrency to compete and win out over other competitors, as they are faster confirmed.


Pass-through bank account, that transfers everything to your wallet Now you can buy everything worldwide with https://all4btc.com/ (former https://bitspend.net/ )

It would be nice to get money now also only in bitcoins.

I would like to configure a bank account in the way that if there are incomings on it, it automatically buys bitcoins somewhere for it to the current exchange-rate and transfers them to my wallet.

Is there an online-banking software, where I could configure those kind of macro?
which bitcoin-software can be completely automated to buy on certain events?
in which country would it be possible to open this kind of automatizeable bank account?

Bitcoin-Central is to-date the only exchange to describe the capability of an exchange account being integrated with a bank account.

It will be a EUR account.  There is no estimate on when this will be available.

Coinbase will draw funds from a bank account however they have not been able to keep up with the demand so there is no assurance that when funds are available in the bank account that a Coinbase order to draw those funds can be placed.

Dwolla is another method of drawing funds from a bank account for delivery to an exchange.  There is a several day delay between when the transfer request is placed and when the funds are made available in Dwolla for transfer to the exchange.


Can you have a password based cryptocurrency? Bitcoin is key based. Although it is possible to convert a password into a key, publishing the public key makes it vulnerable to brute force. Currently, passwords are used with Bitcoin, but only to protect keys (if the key is lost, your money is lost. Publishing the key in a public place is bad idea because brute force.) Is there a way to you can use passwords, but make checking the password require mining a block?

In particular, is there a way to make it so that it is impossible to know if a transaction signed with a password is correct unless its part of a mined block? This way, even if your password only requires 1,000,000 tries to crack, the attacker needs to mine 1,000,000 blocks to bruteforce the password?

In particular, once they have mined a block, if you change the password, the proof of work becomes invalid, and you need to generate a new one before you can check the new password.
Although it is tempting to say that blocks with invalid passwords are invalid (so our malicious miner doesn't even get to keep what he mined), this would put honest miners at risk of receiving invalid transactions and losing their mined coins. Therefore, invalid transactions would just have to be ignored.
Users could change their password by simply creating a new account and transferring their funds to that.

Is this possible? Does any cryptocurrency currently do this?

In particular, is there a way to make it so that it is impossible to know if a transaction signed with a password is correct unless its part of a mined block? This way, even if your password only requires 1,000,000 tries to crack, the attacker needs to mine 1,000,000 blocks to bruteforce the password?

I'm not aware of any cryptographic constructions that would let you do that. The closest thing I can think of is increasing the number of iterations of the password derivation function so that the amount of work required is similar to the amount of work required for creating a block.

  Although it is tempting to say that blocks with invalid passwords are invalid (so our malicious miner doesn't even get to keep what he mined), this would put honest miners at risk of receiving invalid transactions and losing their mined coins. Therefore, invalid transactions would just have to be ignored.

That doesn't completely fix things, though. If someone on the network is trying to bruteforce a password by submitting lots of transactions, the miner is going to see a thousand invalid transactions for each valid one. This means that the honest miners almost never earn fees for their block, and that legitimate transactions almost never go through.

You've got the right idea in trying to prevent an offline attack against a password, though. You should look at Peer Assisted Key Derivation.


I want to generate a BIP32 version number for Namecoin and other altcoins I want to make a BIP32 wallet for Namecoin and other alt coins. I just need to figure out how to generate a a public and private version number so that the BIP32 extended key prefix is something that makes sense like "nprv" for a Namecoin private key and "npub" for a public key.

Been struggling with this one

I can not tell you really how you generate them, but to partially answer your question, here is a list of known Bitcoin and Altcoin prefixes, including Litecoin and Darkcoin:

EXT_SECRET_KEY, EXT_PUBLIC_KEY # Network                 : Prefixes
----------------------------------------------------------------------
0x0488ADE4,     0x0488B21E     # BTC  Bitcoin    mainnet : xprv / xpub
0x04358394,     0x043587CF     # BTC  Bitcoin    testnet : tprv / tpub
0x019D9CFE,     0x019DA462     # LTC  Litecoin   mainnet : Ltpv / Ltub
0x0436EF7D,     0x0436F6E1     # LTC  Litecoin   testnet : ttpv / ttub
0x02FE52F8,     0x02FE52CC     # DRK  Darkcoin   mainnet : drkv / drkp
0x3A8061A0,     0x3A805837     # DRK  Darkcoin   testnet : DRKV / DRKP
0x0488ADE4,     0x0488B21E     # VIA  Viacoin    mainnet : xprv / xpub
0x04358394,     0x043587CF     # VIA  Viacoin    testnet : tprv / tpub
0x02FAC398,     0x02FACAFD     # DOGE Dogecoin   mainnet : dgpv / dgub
0x0488ADE4,     0x0488B21E     # VTC  Vertcoin   mainnet : vtcv / vtcp
0x02CFBF60,     0x02CFBEDE     # BC   Blackcoin  mainnet : bcpv / bcpb
0x03A04DB7,     0x03A04D8B     # MEC  Megacoin   mainnet : mecv / mecp
0x0488ADE4,     0x0488B21E     # MYR  Myriadcoin mainnet : myrv / myrp
0x0488ADE4,     0x0488B21E     # UNO  Unobtanium mainnet : unov / unop
0x037A6460,     0x037A689A     # JBS  Jumbucks   mainnet : jprv / jpub
0x0488ADE4,     0x0488B21E     # MZC  Mazacoin   mainnet : xprv / xpub

I've taken them from the pycoin api implementation which supports HD wallets.
https://github.com/richardkiss/pycoin/blob/master/pycoin/networks.py


Bitcoin CreateMultiSig in PHP always returning FALSE I am using bitcoind 0.8.5 with JSON to try and implement multisignature addresses locally on my server.
But when I try and create one from my code, it keeps returning FALSE.

$create_multisig = $bitcoin->createmultisig (2, '[ "02e280809f7a7e0fabb7404d68ef89b66e9cf63ecfffd37ef2c78d06c51d2247f6", "02f22be70ae35432c82e7b05846eeab1fec5b09ebe523bb98d6d6bbf1ff29d96c3"]');

var_dump($create_multisig);

I have tried variations of the quotes, I tried putting the public keys into variables, etc.. Can somebody tell me what I am doing wrong here? It won't create the multisignature address.

EDIT:

$pubkey_str = "";

$pubkey_str .= "\"02e280809f7a7e0fabb7404d68ef89b66e9cf63ecfffd37ef2c78d06c51d2247f6\",";

$pubkey_str .= "\"02f22be70ae35432c82e7b05846eeab1fec5b09ebe523bb98d6d6bbf1ff29d96c3\",";

$pubkey_str = substr($pubkey_str, 0, (strlen($pubkey_str)-1));

$pubkey_input = "'[$pubkey_str]'";

var_dump($pubkey_input);

$create_multisig = $bitcoin->addmultisigaddress (2, $pubkey_input);

var_dump($create_multisig);

And the resulting output

string(141) "'["02e280809f7a7e0fabb7404d68ef89b66e9cf63ecfffd37ef2c78d06c51d2247f6","02f22be70ae35432c82e7b05846eeab1fec5b09ebe523bb98d6d6bbf1ff29d96c3"]'"

bool(false)

I lost my guest session but I figured out the problem.

jsonRPCClient was not providing me any useful information as an output so serching Stack Exchange I was able to find somebody who changed the JSON library to output a useful error code.

    Add *'ignore_errors' => true* to the $opts array
    Change the error line that throws Request error to read throw new Exception('Request error: '.$response['error']['code'].' - '.$response['error']['message']);.

Then the output said that I was inputting a string and I should be inputting an array. So all I had to do, was put all the public keys into an array and plug it into the createmultisig function.

$pubkey_str = array();

$pubkey_str[] = "02e280809f7a7e0fabb7404d68ef89b66e9cf63ecfffd37ef2c78d06c51d2247f6";

$pubkey_str[] = "02f22be70ae35432c82e7b05846eeab1fec5b09ebe523bb98d6d6bbf1ff29d96c3";

$create_multisig = $bitcoin->createmultisig (2,$pubkey_str);
var_dump($create_multisig);

and this was the output

array(2) { ["address"]=> string(35) "2MtXTzX7pASPKr8VKmkyWKRNFt2o1oFxi9K" ["redeemScript"]=> string(142) "522102e280809f7a7e0fabb7404d68ef89b66e9cf63ecfffd37ef2c78d06c51d2247f62102f22be70ae35432c82e7b05846eeab1fec5b09ebe523bb98d6d6bbf1ff29d96c352ae"

Which is exactly what I expected. So maybe it was a stupid mistake on my behalf, but hopefully other people can benefit from it.