As a miner can i mine my own transaction to speed up the confirmation? So i found here:
What can I do to make my stuck transaction confirm?
one of the options was:
Ask a miner for help
Some mining pools and miners offer services to allow you to prioritize your transaction in their mempool so that it is chosen sooner for inclusion in a block. One such service is https://pool.viabtc.com/tools/txaccelerator/. Note that ViaBTC does have a limit the accelerator to 100 transactions every hour and requires that it pays a minimum fee rate of 10 satoshis/byte, so their accelerator may not necessarily work. Another such service is https://pushtx.btc.com/#/. Not that BTC.com does require another form of payment in order to "accelerate" your transaction.

Also note that if you attempt a Replace-By-Fee transaction, both the original transaction and the RBF transaction will be considered double spends. Miners will likely not help with any transactions marked as double spends.

So i was curious if i had my own bitcoin mining device node if i could start mining that to push it through like other mines do. I do not care about the reward of mining it just that my confirmation speeds up.

I see these other people doing it so i know there is a way.

No, you can only confirm a transaction if you found a new block, but this is very unlikely to happen when solo mining.


New to the world of Bitcoin I'm an amateur who's yet to dive into the game of cryptocurrency. I've never even played around in stock markets. Ok so the price of Bitcoin fluctuates, and you can do things like buy, sell, trade, wire transfer, and even cash out. But here's my question.

Can I walk away from the table temporarily and come back in at a later time or date? I'm a guy that likes to pick his spots, sort of speak. Can you pull in and pull out as you wish? Or are my options only to remain on the table, buy, sell, trade our cash out?

I wouldn't want to have to buy back in at a higher price.

Can I walk away from the table temporarily and come back in at a later time or date?

Sure you can.

It isn't a perfect analogy, but think about bitcoin as if it were a dollar bill in your pocket. Some people will obtain a dollar bill, and then stash it away in a safe, not touching it for years. Others will take that dollar bill straight to the casino, keeping it on the table to bet and play with.

There is no requirement to continuously buy/sell, bitcoin is not some sort of game. It is just an asset you can own, and do with as you see fit.


Is it possible to add a transaction input to a transaction in the mempool? Is it possible to add an input to a transaction that is in the mempool?

For example, if someone is paying 1 BTC to their friend, I can get the raw hex data of this transaction from the mempool before it is mined.

I can then sign an unspent transaction (Let's say 3 BTC) with my own private key, list it as an input, and get the raw hex data for this. Then, I can add a 3 BTC output to someone else's address (who I want to pay), and re-broadcast this new transaction to the network.

What is stopping this from happening?

Short answer: no, this is impossible.

Longer answer: some transactions allow changing the inputs used (ANYONECANPAY inputs). It is also possible to have inputs which do not sign the outputs being created (SIGHASH_NONE). However, a transaction where all inputs are of this type, are worthless, as anyone could change the outputs to credit themselves instead.

Typically, when normal SIGHaSH_ALL signatures are used, pretty much everything of a transaction is signed (which input coins are used (and in which order), what output scripts are created, what value to assign to them, ... Everything except the signatures themselves really (which is what causes involuntary malleability).

If an input signature is marked ANYONECANPAY, it does not sign the other input coins being used. This means you can create a transaction meaning "i want x and y to be paid, but i don't care who provides the funds to do so". If all signatures in a transactioon are ANYONECANPAY, you could add extra inputs (or remove existing inputs. Just increasing the input funds would just burn them as fee, though.

On the other side, there is SIGHASH_NONE, which makes a signature not sign the transaction's outputs. This may seem to allow what you want to, but in case every signature is SIGHASH_NONE, the treansaction is completely unsafe, as anyone could replace where the outputs go.

So, even if a combination of those would in theory allow what you suggest, it is not true for typical tramsactions, amd would in fact be completely unsafe.


How does Bitcoin protect itself from invalid peers from being broadcasted? From what I've inferred, is that Bitcoin gets a list of peers from other nodes.  What is to prevent a malicious node from

Sharing many ip addresses that will cause timeouts and a delay in block replication?
Using the getpeers to cause a DOS attack on an unsuspecting person/website?

The client connects to peers in its database randomly (?) so even if given a set of IPs of peers in which all IPs are invalid (connection fails), the client will only be slightly disrupted by this.

A node with a lot of invalid IPs in its list of peers may take longer to find a peer that it can connect to, but at the same time that lack of connectivity prevents it from receiving any new transactions from the network as well.  So there's no increased risk of accepting a transaction that ends up being a double spnd.

This receipt of non-usable IPs can cause this specific node to not get a new block in a timely manner, but because nodes remain connected most of the time there isn't a system-wide issue just because some of the nodes remain disconnected longer than they should when switching to a new node.

When the node does come across a peer IP that it cannot connect to it will ban the node and not attempt to connect to it again for at least 24 hours.


scam with blockchain Recently a scammer contacted me to invest in Bitcoin. Well after losing my money with him, this person offered to return my money, and asked me to create a blockchain account. I did, then he asked me to share my id wallet and my password, because I did not know it. After a while he told me that my money was back, but it was not usable, if I wanted to have it. I thought it was strange, so I started to investigate, realizing it was a scam. I did not fall for his scam, but he still does not want to return my money.

My question is if I can get my money from the addresses that I leave, which by the way move a lot of money, it is possible to get the private key, hack those addresses, if they need the information I have the account still active.

The scams page is: https://kryptobinary.co.uk/

My non-spendable balance:

I'm afraid you were scammed.

The balance shown by your wallet software is not your money - it is that of someone else the scammed convinced you to "watch". Without access to the private key, there is nothing you can do. It isn't even necessarily the scammer's money either.


Transaction parsing - Satoshi value how exactly is the satoshi value in a raw transaction calculated to decimal? Because on blockchain.info, I cannot figure out how they parse the raw transaction from that value to the JSON result. I thought it would be just a hex to decimal parsing, but I cannot get the same results. Neither I understand it in here, how you get to 49.99990000 BTC (from https://developer.bitcoin.org/reference/transactions.html):
Sorry if it's a silly question.

The amount is encoded as a little endian signed 64 bits integer.
Here is how you would decode your sample in Python:
>>> int.from_bytes(bytes.fromhex("f0ca052a01000000"), "little")
4999990000


Connect to bitcoind from a different device within the same local network I have a full node running on a Linux device (A) with static IP 192.168.1.203 and I want to run bitcoin-cli commands or even eclair instances from a different device (B) within the same local network.

Device (A) has bitcoin.conf configured to accept RPC calls with this basic bitcoin.conf

server=1
daemon=1
txindex=1
rpcuser=<user_name>
rpcpassword=<password>

Actually I have an eclair running successfully on Device (A) and default RPC ports connect well. No typos on user_name and passwords.

When running the following command in device (B):

bitcoin-cli -rpcconnect=192.168.1.203 -rpcport=8332 -rpcuser=<user_name> -rpcpassword=<password> -getinfo

error: Could not connect to the server 192.168.1.203:8332 (error code 1 - "EOF reached")
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.

Any ideas what can be wrong?

If you're going to just use within the network and not outside of the LAN then as mention below, use rpcallowip=0.0.0.0/0 will work and also don't use rpcconnect as it may cause issues. If your planning future to use that option outside of the LAN (aka WAN) then there will be security issues so make sure to not use it outside of the LAN unless you can configure it correctly to not allow accept all ip.


pycrypto or libssl not found, decryption may be slow My wallet.dat file is corrupted and everytime i try to run Wallet QT client will shut down as unexpected error and i have no longer access at my wallet on this way.

I have tried to dump private keys through pywallet but everytime i execute commands it shows pywallet or libssl not found...

Actually i don't have much experience with this, Downloaded openssl and pycrypto then extracted both files to C:\Python27 , im doing this wrong if yes please help me to setup.

Your image shows two messages:

There is a message

  ERROR:root:Couldn't open wallet.dat/main

It suggests you should close Bitcoin if it is already running. I would use Windows' task-manager to see if bitcoin-qt, bitcoind etc are running (Ctrl+Alt+Del in Windows-10 should bring up a menu from which you can select task-manager). You can close those processes from task manager if necessary.

Since your screenshot shows a second attempt without this error, it looks like you shut down Botcoin-qt OK and the command completed OK.

and

  WARNING:root:pycrypto or libssl not found, decryption may be slow

This is just a warning, it doesn't mean that the command won't work, just that it may take longer than normal.

The message suggests pywallet will use slow internal cryptographic functions if it doesn't have access to a fast external library of cryptographic functions.

So your wallet.txt file should show you the information you wanted to extract.


Why does the median-past time average the last 11 block timestamps and not the last 12? As described in BIP-113. Wouldn't the last 12 blocks bring us closer to a one-hour offset (ie 120min, midpoint 60)?

BIP 113's goal is not to aim for a specific offset.

Its goal is guaranteeing monotonicity (treating every block's timestamp as strictly larger than the timestamp of each of its ancestors). It does this by leveraging the existing consensus rule which states that the median of the timestamp of a block has to be strictly larger than the median of its 11 predecessors.

As to why the number 11 eleven was chosen in that existing consensus rule, we don't know. It was chosen by Bitcoin's creator.


Lightning network channel capacities and gambling site jackpot payouts Let's say I want to make some kind of gambling app:

The user creates a channel with the business. (local_amt = 1000, remote_amt = 0, capacity = 1000)
User bets a few times and wins a jackpot of 5000 satoshis which is more than the capacity of existing channel.

How do I transfer the 5000 sats over lightning when the channel capacity is 1000? The only way I can see getting the jackpot money to the user is by me opening a new channel with extra capacity, but obviously that would take an undesirable amount of time.

In other words, I'm curious how a site like https://www.lightningspin.com/ accomplishes instant withdrawals.

3 possible ways:

Obviously the house can open a new channel with the user but that takes time.
There is still a lightning network So even if you have a small direct channel with the house you might have some inbound capacity from other nodes and the house has some larger channels to the network. So you might not need a channel at all. The house could route the payment to you through the network even though it has a direct channel with you.
Lightning invoices also have a fallback address. The house can use this address to do an onchain tx if there is no route found.


Is there an opensource crypto-currency exchanges engine? I'm looking for an opensource crypto-currency exchange engine.

My preference would be for something easy to use like joomla or drupal. My exchange setup needs support for alt-coins and bitcoin.

I have discovered intersango myself. However, sql file is corrupted, there is no creation of tables and import does not work. Plus it is bitcoin exchange only (and I need alt-coin support). Site of this exchange with "invites only", registration is closed.

Is there something super-simple that I can use to get started?

Yeah it's called buttercoin here is their code.


How is the transaction's nVersion field changed with segregated witness? Do transactions have to have a minimum version to denote that they are using seg-wit? What changes have been made to the transaction's version field?

The MAX_STANDARD_VERSION is still set to 2 in src/primitives/transaction.h, will that change when seg-wit reaches the soft-fork thresholds?

Segwit does not use the transaction version field at all.

One reason for this is that it isn't really the right scope. Outputs and inputs are witness-specific, but whole transactions are not.

The transaction version also cannot be used to indicate the presence of the optional witness record. Because the transaction version is part of the "base" transaction data (covered under the txid hash), you'd get compatibility problems when a segwit transaction would be relayed to an old node, and back to a new node. That new node would see the new transaction version number, expect a witness encoding, but the old node cannot give that. Instead, BIP144 introduces a new extensible transaction format with optional records. The encoding used is independent of any data "inside" the base transaction.

It also isn't needed. Specific template transaction outputs are fine to indicate new semantics.

All in all, segregated witness just adds extra records to existing transactions. It does not modify the structure of the existing base part (including the version number).


Is it possible to have a bitcoin private key (hex) with 34 length? Something like 111111111111111111111111111ABcDE1f.

Private keys are always 256 bits long, that is 64 hexadecimals.
The printed string is usually longer then that because format labels and redundancy are added.

Anything shorter cannot itself be a private key, but may be used to derive one (preferably with stretching).

The string given looks too non-random to be used to derive a private key.

In general, 34 random hexadecimals are adequate to derive private keys.


Allocation Unit Size (AUS) when formatting drive I'm formatting a SSD for a new node and searched here that Gavin said the typical blockchain file size was 250kb (2015), others showed 500kb (2018). I thought is was to remain constant, so perhaps one answer is wrong, then again it may be 999kb soon.  When formatting you can choose your AUS if you relatively know your file size to pack it more efficiently.

The first two AUS choices are 512kb and 1024kb. I think much better choices than the default 32,768kb. Am I missing something here or am I going to achieve a rough 4-5x benefit here? Thx

Blocks are stored in large contiguous files (gigabytes), and are effectively append only, so they don’t really make any sort of impact on performance.

The high write cycle is in a several gigabyte leveldb database, but this is heavily write cached. Performance is almost always single core limited on any sort of fast storage given sufficient memory, rather than any other other factor.

You’ll only see storage as a factor when using magnetic media or excruciatingly slow flash storage like a SD card.


How does a bitcoin wallet incorporate UTXOs for payment? How does the wallet choose the UTXOs it will use?Retrieve one by one until the number meets the number to be paid?

Early versions of Bitcoin used a simple knapsack solver to optimize for the least number of inputs possible given the available UTXOs in the wallet.

Modern versions have much more complicated selection logic, additionally attempting to not combine change from many unrelated transactions for the sake of privacy.

Other wallets have different selection criteria with differing payoffs. Historically many simple wallets attempted to just add the largest possible outputs until they satisfied the amount, however this optimized for low fees and transaction sizes at the expense of maximizing the amount of small dust UTXOs produced. These all have different trade offs, but the simple ones tend to be horrifically inefficient or lacking in even basic privacy.


Difference between having bitcoin in my wallet or in a third party like an exchange or an e-wallet Is there any difference or any problem or extra fees for having permanently (1 month, 6 months, etc..) my BTCs instead of having them in a local wallet like Bitcon-Qt or Multibit?

Only the respective trade-offs of trusting another party with your money vs trusting yourself not to lose your data.

When you keep your money on an exchange website or online wallet service, you are not only trusting their good intentions, but also that they stay in business and are running a secure service. A significant number of exchanges and OWS have been compromised or put out of business.

When you keep your money on your own devices, you are trusting yourself not to be hacked, fooled into sending money to a wrong address, and to keep your data safe. The latter requires you to engage in a decent backup policy and to have a basic understanding what you are doing. There have been numerous cases of personal computers being compromised (google for example "AllInVain"), people losing their data to hardware failure without having a backup, or recently, someone just throwing his hard drive worth $7Mio in the garbage.


Are the Mt.Gox markets for different currencies completely separated? MtGox supports multiple currencies. Usually referred to as f.e. mtgoxUSD, mtgoxEUR, ...

Now, MtGox has different market depth listings for it's different markets and keeps a separate price for them.

Are these markets completely separated, meaning that when I place a buying order in euros, it can only be matched with selling orders in euro? This would also mean that less popular markets inside MtGox, which have less average volume, can have the same delay effects as less volumous non-MtGox markets in let's say US dollars?

So, is it possible that I buy bitcoins with euros and that someone else receives dollars for the coins I bought?

There is only one order book in MtGox. Orders aren't segregated by currency, rather, all prices are relative to the currency with the highest volume (based off The European Central Bank's daily rates). In their own words,

  For example, if a buy order for bitcoins is placed in EUR, the order can be executed against another user selling bitcoins in any currency and not necessarily only against another user selling bitcoins in EUR.

That said, wallet currencies are completely separate. There's no converting between them unless you're transferring that value via bitcoins themselves. For example, you can buy bitcoins in a EUR wallet with EUR, transfer them to a USD wallet and sell them in USD. Of course, you have to consider how you'll withdraw the resulting currency.


In bitcoin network will there be a path from every node to every other node? In bitcoin's gossip network will there be a path from every node to every other node? It can certainly have different number of hops.

I have a private testnet in which I modified some source code. I get a graph like this

A->B->C

So we have a path from A to C but not C to A. So when C mines a block, the information is remained with it and it does not send inv messages out. Not sure if I am wrong or this is expected?

Edit:

The only change I did is to make testnet work on my localhost. Removed the IsLocal() check from IsRoutable() and added my own hardcoded seeds.

The bitcoin network is only as connected as each node wants to be. The protocol is designed in such a way as to incentivize being connected to the network, so in practice, almost every full node is connected to a lot of other nodes and hence, there's at least a very good chance of a short path between any two nodes.

However, that's not to say that every node is connected. It is entirely possible to run a full node that's not connected, like you seem to have done. In your case, it seems C does not have any peers, so C's mined block won't get to anyone else.

Run this command to see which peers it has:

$ bitcoin-cli getpeerinfo

You'll want to add connections this way:

$ bitcoin-cli addnode <node ip and port> add


When increase transaction fee three times in few minutes - transaction had an attempted double-spent? I make transaction from my wallet - send BTC.
After I send, I increase transaction fee three times, in a few minutes.
Now I see - Status: conflicted with a transaction with 21 confirmations
I use Bitcoin Core version v0.18.1 (64-bit)
In block explorer I see that this transaction had an attempted double-spent.
What can do in my case?

The double spend attempt is your fee increase. It is impossible to modify a transaction after it has been broadcast. So to increase the fee, your wallet intentionally creates a double spend of it that has a higher transaction fee.
However it isn't just a pure double spend; there are additional conditions the original transaction and its double spend must meet before nodes will replace the original. When you increase the transaction fee, the wallet checks that the original transaction met certain rules, then it creates the double spend to meet the replacement rules.
The wallet should recognize that the original transaction has been replaced, but if it does not, you should be able to force it to. Because the replacement confirmed, you should be able to right click on the original transaction entry and choose the "abandon transaction" option to keep it out of balance calculations other things. It will remain in your transaction history, but have no effect on anything.


How do I run the bitcoin bx tool in my terminal I am reading the book Mastering Bitcoin. At some point, I came accross the bx command and tried to run it in the same way as bitcoin-cli (I've got a bitcoin core node running). But I just get the command not found message. How should I go about it?

bx is found here: libbitcoin-explorer. There are copious notes there about how to install.

Can I also recommend noting btcdeb for assisting in debugging bitcoin script, should you get that deep.


Restoring from old paper Mycelium Wallet Backup I have an old Mycelium Wallet Backup on paper, created July 2014, Mycelium Wallet 1.2.12., Backup Format Mycelium Backup 1.0. It used a 15-character password + checksum character, which I have.
It also lists Bitcoin address, and Encrypted Private Key - both in QR-code and in string of characters.
How do I go about restoring this wallet to a current wallet, be it Mycelium or some other one?

I would suggest asking this question on the mycelium issue topic. Either for android or ios. Generally for the backups in that time bip39 was a main standard as per https://walletsrecovery.org/ - mycelium was supporting WIF (wallet import format). Knowing the derivation paths, one can recover from it in the wallet that supports WIF (like electrum?).


Deterministic wallet and address generation I have a ledger nano hd wallet and I actively used the Google Chrome plugin to receive some transactions. After that I linked the HD wallet to my mycelium tablet app.

If I receive more transactions using the tablet app how can the chrome plugin stay in sinc and create a new public address from the correct starting point?

How can multiple instances of deterministic wallets referring to the same wallet know where to start to create new addresses?

I guess they don't sinc up and address reuse seems inevitable

Im assuming the HD ledger nano  uses a deterministic wallet

Well, it's a deterministic wallet. There is a function f which for every n∈ℕ returns the nth address that will be produced.

An address is basically a hash of a public key (we can neglect the rest it's comprised of but it's deterministic as well).

You can get a public key from a private key deterministically.

Every 256 bit number is a private key.

So your wallet just needs to make 256 bit numbers deterministically and do calculations to get to addresses deterministically.

This can easily be done by picking a hash function which outputs 256 bit – let's choose sha256 – and a salt λ. A salt is just something that's added to the input of a hash function.

If your wallet knows λ, it can generate a practically arbitrary amount of bitcoin addresses.

g(n) for every n∈ℕ can be defined as g(n) := sha256sum(λ.n) where . is the concatenation operator. g(n) is the nth private key.

If you use a Linux computer, just open the terminal and type in:

echo "aR3Ba9raAi1" | sha256sum
echo "aR3Ba9raAi2" | sha256sum
echo "aR3Ba9raAi3" | sha256sum
echo "aR3Ba9raAi4" | sha256sum
echo "aR3Ba9raAi5" | sha256sum
echo "aR3Ba9raAi6" | sha256sum
.
.
.

aR3Ba9raAi is λ. The last digit of the parameter echo gets is n but of course it can be more than 1 digit.

Via the output you get:

g(1) = 49fc13b53bf8cbc8607c121066a974f5c803aee04629e11696946f93b16825a6
g(2) = 9462e18f435684eb8bf5008f8e7c717729fbfa505554ef4b3325a3eccc807519
g(3) = d7bde9e8c19959b0abaa5c476a3fc7a4eacf713fe78c9e2a66ac202419ddbf6f
g(4) = d08ddf753bb37b853407f1451334bb042d93ee2179c01244a019229a32fe9c03
g(5) = 4291513728b1a0d96b72df35bafa1f78db1ceaf135d874a3d8e5353aa9408893
g(6) = e04aba61558daaa532d252397e5d5467c8dd64552f987e54245ab759dd0517cb
.
.
.

Those would be the private keys. They are the same on every machine as long as λ stays the same. No between your machines is necessary after they all know λ. g(n) is deterministic and so is everything else afterwards on the way of generating an address. So f(n) can be calculated from g(n).

Of course that's only an example to show you the basic principle behind deterministic address generation. It's strongly simplified and major steps for generating addresses are omitted. This answer should only show you that something can be calculated the same way on different machines without the need of them being able to communicate with each other.

This is also great because everything you need to recover an HD wallet is a seed. You don't need the entire history of what's been generated from the seed because it can be generated the exact same way again.


How do I get Bitcoin block header data with nonce? How do I get Bitcoin block header data with nonce?

There are tens of so called blockchain explorer websites, tens more offering on-line Bitcoin blockchain parsing.

But all I need are historic Bitcoin blockchain header data only for off-line mode study.

In theory I can set up blockchain parser on my own but I need to download full blockchain first and set up parser.

Since I live on wireless Internet 3G, it's not feasible to download 500GB data, so I would prefer an option just to buy historic Bitcoin blockchain header only data, no overheads, no transaction data.

If you know such place or can offer such download, let me know your terms.

There is no need to buy any data, and if someone is offering to sell you block headers, then you are being scammed.

The Bitcoin network protocol supports transmitting just block headers. So you can just use or create a software which can speak the Bitcoin network protocol and download just the block headers. The getheaders message is what you need in order to request the headers from a node, in addition to the normal network protocol stuff. Since block headers are just 80 bytes, the entire download will be 80*506612 = 40528960 bytes = 40.528960 MB.

Instead of writing such a software, you can also use Electrum. Electrum is a SPV wallet, but it downloads all of the block headers. If you create an Electrum wallet and let it sync (syncs very quickly), you will find a file in the Electrum data directory named blockchain_headers. This file contains all of the block headers in raw form (so just as bytes). You can then parse that as per the block header format.


What if I create a new address and I'm given one which clashes (already exists, it is being used by other user) Addresses are like GUIDs, no? They are created randomly whenever you request the creation of a new address.

But what if when creating one, it clashes with one already created? I know that the probability of this is staggeringly low, but there is a probability, it is not impossible.

What would happen in this case?

A bitcoin address is a 20-byte hash of a 64-byte public key (plus an ID and checksum to bring it up to 25 bytes).  As such, there are two theoretical possibilities with a clash:

Two separate people own public keys which hash to the same value
Two separate people own the same public key

Due to the way that Bitcoin transactions work, either of these situations would be enough for one party to spend the funds attached to the address.

So it's worth considering the likelihood of such a scenario.  Let's assume we have 7 billion people on the planet and they all use Bitcoin.  For there to be a 0.00000000001% chance of just two of the total in-use addresses clashing somewhere each person would need to have 4 trillion active addresses.

(Note that this is just calculating the chance of a hash collision; the chance of hitting the same keypair is so much more remote it's not worth bothering with).


Ardor/NXT platform on Ubuntu When starting Ardor on Ubuntu, i have an error: "Could not find or load main class nxt.Nxt"

Any help?

The run-desktop.sh command must be issued from the Ardor install directory.  The command should do a 'cd' to the install directory at the beginning but it doesn't.  You can either do the 'cd' before issuing the command or add the 'cd' to run-desktop.sh.


I want to know how can get back my bch I have incorrectly sent bitcoincash to bitcoin wallet address. (from upbit exchange in korea to kucoin exchange in hongkong)

Is there any way to get my bitcoincash back?

As that address belongs to an exchange, the only thing you can do about it is contacting their support (the exchange you sent your coins to).


bitcoin knowledgeable attorneys? I'd like to accept freelance work with bitcoin, probably a large enough amount to consult a lawyer.

What kinds of questions would you ask to make sure they're competent? How would you go about finding such an attorney?

Just a few thoughts from someone with no experience with lawyers: since very few lawyers will have experience with Bitcoin, I personally would look for a lawyer familiar with (1) tax law, (2) currency trading and/or commodities trading, and (3) technology in general. Familiarity with technology may be the least important, and may actually not matter at all, except that the lawyer needs to understand the analogy between Bitcoin and a commodity/currency.

While it doesn't sound like you will be doing Bitcoin speculation, you will still, presumably, be trading services for Bitcoin, and then Bitcoin for a national currency. This is where the lawyers knowledge of currency/commodities trading comes into play. For example, do you pay taxes on the spot price of the Bitcoin at the point of transaction? At the end of the year? Or only when you trade the Bitcoin for national currency? What if you trade the Bitcoin for something other than national currency? Such as if you pay your web site hosting fees with Bitcoin? I'm assuming that these are the sorts of questions you'll need answered in the end. You might use these questions during a free/initial consultation to get a sense of the lawyers ability to field the sorts of questions you'll have.


Could you provide an example of a SegWit transaction? I'm looking for a transaction ID of a non-coinbase SegWit transaction on the Bitcoin network. Could you show me one? Google doesn't seem to do the trick.

Here is a non-coinbase segwit transaction https://www.smartbit.com.au/tx/c586389e5e4b3acb9d6c8be1c19ae8ab2795397633176f5a6442a261bbdefc3a


bitcoin address after transaction security questions I found an old paper wallet on an old computer of mine which is offline (I can count the number of coins with my fingers). I would like to distribute these coins now among 6-9 wallets (I want to give some family members coins) and have a few questions. Partially they are also out of curiousity, since I am learning more about bitcoin now that I have discovered the coins again.
1.) Is it safe if I create a raw transaction on the offline computer so I can execute it on my online computer?
2.) I read that making a transaction will reveal the public address of the current address. I also read that the signature of multiple transactions can help hackers to figure out my private key. It is therefore recommended to empty the old address when I move stuff around. Nevertheless, I am curious about the following:
However, wouldn't you say that the old address is still relatively secure after doing a single transaction? Meaning, while I should empty the old address at some point, a brute force attack would most likely not be able to hack the public key within a month of the transaction.
3.) If I send the bitcoins to multiple addresses in one multi-recipient transaction, will this raw transaction have a signature for each receiver? Or will I only sign with one signature (effectively the same as if I just moved money to one address)? Meaning, does an address become more exposed after a single multi-recipient transaction vs. a single one-recipient transaction?

1.) Is it safe if I create a raw transaction on the offline computer so I can execute it on my online computer?

Yes, this method, called using cold wallets is very effective at keeping coins safe.

An address either never spends (the public key is not revealed) or it spends (the public key is revealed). Spending fewer times from an address won't make it less secure (unless you use very old or home-made signing code). And the security difference between non-spending and spending wallet is negligible. (Otherwise, there would be a price crash and chaos)

Every input has its own signature, not every output. So, by making all those payments at once, you'll save lots of $ in transaction fees.


Is a 20% fee normal right now? I'm not an expert with BTC or other cryptocurrencies but It was a pleasant way to do some micro transactions and to deal with some vendors.

My question is, why the hell an average Fee is around 20% of the transaction? THIS IS HUGE.

Is anyone still using BTC? Maybe I'm doing something wrong here but after some checks on https://bitcoinfees.21.co/ and blockchain it seems that those are the real fees and people just keep paying them. Why?

Screenshot: http://take.ms/muElO

It's misleading to look at transaction fees as a percentage.  Bitcoin transaction fees are based on the size of the transaction in bytes, regardless of the value being transacted.

According to the site you linked,

  The fastest and cheapest transaction fee is currently 0.0000042 BTC/byte, shown in green at the top.
  For the median transaction size of 226 bytes, this results in a fee of 0.0009492 BTC.

If you are trying to send BTC 0.005, then yes, that is about 20%.  If you are trying to send BTC 0.5, then this will correspond to a fee of about 0.2%.  For comparison, credit cards typically have a fee of around 3%.

  Is anyone still using BTC?

Obviously yes.  Transaction fees are based on supply and demand - the network only allows so many (bytes of) transactions in each block, so fees are effectively bidding for space in a block.  If "nobody" was using Bitcoin, you would see fees become very low.

Note that there are several current proposals for increasing the block size, or otherwise allowing a higher volume of transactions on the network.  If and when any of those take effect, fees should come down.

  Maybe I'm doing something wrong here but after some checks on https://bitcoinfees.21.co/ and blockchain it seems that those are the real fees and people just keep paying them. Why?

Because paying a high fee to spend Bitcoins may still be better than not spending them at all?

See also Is it normal to not "own" your bitcoins? Are 6% transaction fees normal?


Could a miner set a maximium transaction fee rate? Could a miner set a maximimum transaction fee rate? I mean validate only transactions between x and y satoshis/byte?
I know is not clever. Is it possible?

Yes, miners can choose exactly what transactions to include in their candidate blocks, including the choice to not include anything at all.
Of course, if a high fee paying transaction is available, and one miner chooses to not include it, other miners still can. This is only untrue if an entire cartel with sufficient hashrate that is actively performing a 51% attack chooses not to include a transaction - in that case, it can be censored as long as the attack lasts.


How is the solution hash in a block generated? For example, in the Genesis block in Bitcoin, from which values was the solution hash "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" derived from? I understand that the nonce is applied to something to get the solution, but I can't seem to find what those values are.

The process of mining consists on constantly hashing the block header in order to obtain a hash lower than a specific target. The block header contains (from the bitcoin wiki):

Version
hashPrevBlock
hashMerkleRoot
Time
Bits
Nonce

So when the obtained hash does not meet the required conditions, the nonce value is increased by one, so that the hash of the block header changes. The miner keeps changing the nonce, trying to find a value that makes the hash of the header lower than the current target.


How to import my wallet? I used to run bitcoin on Ubuntu and I have a wallet with 1 coin in it.

I took a backup of my ~/.bitcoin directory which includes a wallet.dat file.

Now I'm running on a mac, using the bitcoint-qt client.

How do I get back the money from that wallet?

Can I just copy it over the existing wallet that the mac client generated?

Is there a way to run a command line client and point to my wallet then transfer coins from it to the new wallet?

I got it to work by simply copying the file over.

An important point to notice if you intend to follow this suggestion:

My mac wallet had 0 coins

If your mac wallet has coins, then don't follow this solution.

First I shut down the bitcoin-qt client. Not sure if this step is necessary but I think it's safer.

Then I copied the wallet.dat file over to

~/Library/Application Support/Bitcoin/wallet.dat

Then start the bitcoint-qt client again. It might take a bit longer to startup than usual. Don't panic and let it take its time.

Then you will see your coins in the client!


Mycelium: Restore backup from Android to iOS I used Mycelium wallet on Android quite a while ago. I created a printed backup which consists of a 15-character password and two QR codes: The bitcoin address and the encrypted private key.

Meanwhile I switched to iOS, installed the iOS app and wanted to import my old wallet (which still contains Bitcoins). However, when I open the app and select "Restore from backup" it asks me to enter my Master Seed separated by spaces.

Sure enough, the backup does not contain a master seed and and entering the 15 character password does not work.

How to import the old wallet?

After lots of suffering I managed to do it. Very unfortunately mycelium does not even support importing their old keys.

Fortunately they provide a backuputil which converts the private key in their format into WIF (Wallet Import Format): https://github.com/mycelium-com/wallet/tree/master/backuputil

I takes some effort to built this tool but afterwards you obtain the private key in WIF format. This in turn can be entered in the new Mycelium on iOS.

Again, very unfortunately, the key is NOT imported but rather the funds transfered to the Mycelium account. This results again in unnecessary transfer fees.


How can I know that my transaction has been confirmed on the longer chain? This question is more on the theory of bitcoin.  Let's say I receive a coin in a tx which has been confirmed with 6 blocks following the block that's been confirmed.  How can I be sure that there's no other place in cyberspace that has a longer chain  confirming a different transaction that transfers this coin to somebody else?

Building a chain longer than the best chain would require someone to have more Proof of Work hashpower than 51% or more of the total Bitcoin network hashpower.

The unlikelihood of this happening is the guarantee that the longest chain is the best chain.

To build a one block longer chain you'd have to assemble a block and find a nonce that produces a target less than or equal to the network target. Otherwise Bitcoin Core will discard your block as invalid. So to build a chain that is just 1 block longer than the current best chain you'd need massive amounts of hashpower, electricity, infrastructure and tens of millions of U$ investment. Again, all this for just one block.

The astronomic amount of work put into mining each block protects Bitcoin's consensus mechanism and assures everyone that the longest chain is correct.

If your TX was included in a block with depth 6 it means that for approximately one hour (~ 6 x 10 minute blocks) that chain where the block that holds your TX was included had the most work put into it all over the world.

There could be some other place where someone created an artificial chain with your TX in it but that chain will never be able to be longer than the main chain - unless they beat the network to find the next block. If they're unable to, then that chain will get ignored by everyone else in the network. That's how you know the TX you see on block explorers is in the longest/best chain.

For a more detailed reply you should read Antonopoulos' book (Mastering Bitcoin).


What is a compressed Bitcoin key? The standard Bitcoin client in version 0.6 apparently introduces compressed keys.

What are they? Are there any drawbacks to using them? Any incompatibilities with older software? Reductions in cryptographic strength?

A compressed key is just a way of storing a public key in fewer bytes (33 instead of 65). There are no compatibility or security issues because they are precisely the same keys, just stored in a different way. The original Bitcoin software didn't use compressed keys only because their use was poorly documented in OpenSSL. They have no disadvantages other than that a little bit of additional computation is needed before they can be used to validate a signature.

If you think of a public key as a point somewhere along a giant letter U, an uncompressed key is the x and y coordinates of the point. A compressed key is how high up on the U the point is along with a single bit indicating whether it's on the left or right side. As you can visualize, they both encode precisely the same thing, but the compressed form requires half as much space plus one bit. (Of course, they're really points on elliptic curve secp256k1, but the concept is the same.)


LTC transaction fees and p2pool I'm experimenting with LTC p2pool mining. However, it generates lots of micropayments (0.02 LTC). Such small payments generate big transaction fees (in latest litecoin-qt from github). Example: 0.6 LTC transaction fee for sending 0.3 LTC.

How can I avoid such big transaction fees?

Transaction fees are calculated according to priority and transaction size.

Priority is a function of age and value of a single input in the wallet. The larger the value and the older the input age the higher the priority will be. Input value and input bytesize are static values. Input age is a variable that increases with time. So, in short, you can decrease your fees by allowing the coins to "age" (aka wait).

priority = (input_value * input_age)/input_bytesize

priority >57600000 is free (not accounting for transaction size)

Transaction size is going to incur fees anytime 5 or more inputs are included in an output. The only way to avoid incurring transaction size fees is to create outputs containing 4 or less inputs. I am not aware of any coin control extensions for the litecoin client so achieving this will likely prove very difficult for very small inputs.

The litecoin client is expected to receive a significant update sometime in May 2013 that may address some of the transaction fee concerns in the current client.


How to calculate trading fees ahead of time? I'd like to determine what trading fees to expect before placing an order.

According to https://www.bitstamp.net/fee_schedule/ Bitstamp's trading fees depend upon the USD total of a customer’s last 30 days worth of transactions.

How can one calculate this amount using the Bitstamp API? It doesn't seem to be possible.

Those are Bitstamp trading fees, not Bitcoin transaction fees. Trading fees are automatically calculated and deducted by Bitstamp when executing a trade.

For choosing the right Bitcoin fee, use bitcoin-cli estimatesmartfee or one of the many web services.


Running poclbm miner in Ubuntu 13.04 without ATI card I am running Ubuntu 13.04 64bit with 16GB RAM and this is my VGA card:

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor     Graphics Controller (rev 09) (prog-if 00 [VGA controller])
Subsystem: Lenovo Device 2200
Flags: bus master, fast devsel, latency 0, IRQ 45
Memory at f1000000 (64-bit, non-prefetchable) [size=4M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
I/O ports at 6000 [size=64]
Expansion ROM at <unassigned> [disabled]
Capabilities: <access denied>
Kernel driver in use: i915

When I try to run poclbm miner, it doesn't list any openCL devices and says nothing to mine on ?
Is there any other miner that I can use on Ubuntu to use and maximize the performance from my VGA card ?

Your VGA card has no performance to maximise. Your CPU is more powerful for this kind of computation. I know, I have the same card.


Is there any way the Bitcoin network could resist a viral tainted-coin tagging system implemented by regulators? Already it's possible for MtGox etc. to detect spends of coins that have certain well-known thefts in their history. If regulators forced audits on exchanges and key popular merchants, as well as keeping track of coins they deemed to have been involved in illegal activities, they could make these exchanges and merchants pay a small tax on these 'tainted' transactions and pass this cost on to the consumer.  As the regulators 'tainted' coin list would be public, it would become in more and more peoples interest to use wallet software which subscribes to the 'taint' list in order to reject coins they know will incur a penalty upon spending. The more the regulator raises the tax at the exchanges and audited merchants, the more people must join.

Audited exchanges and merchants would have to submit batches of all bitcoin addresses involved in their transactions to the regulator. Agents could perform random transactions with exchanges and merchants to make sure 100% of transaction IDs are reported.

Is this scenario realistic, and wouldn't this make Bitcoin ultimately a very controlled environment indeed?

('tainted' coins would still have value on black markets, creating a split system where bitcoins are no longer completely fungible)

I don't think the scenario is realistic because it would only punish innocent people. By the time coins could be marked as tainted, they would already be in the hands of innocent people. Governments don't do similar things with other currencies. For example, if you deposit dollar bills in a bank that turn out to have been stolen, the government could charge the bank a "fee" to clean the bills which the bank could pass on to you. But governments don't do that because they recognize that by the time the bills could get on a "hot list", they're already in the hands of innocent people.

There are also specific features of Bitcoin that make this difficult. Transactions put all the input Bitcoins into a big pile which they dole out as outputs. There's no concept of particular output Bitcoins corresponding to particular inputs. Bitcoins don't have a serial number that can be traced through the block chain. So any such tracking rules would be basically arbitrary.

It's just not something realistic. It's more realistic with physical currencies which have serial numbers and are widely used to facilitate crimes and buy contraband. And governments don't do it with physical currencies -- largely because they know it would only punish the innocent.


MtGox http api "trades since" requests keep being timed out i wrote a simple function to retrieve trades from mtgox with following HTTP API call:

https://data.mtgox.com/api/1/BTCUSD/trades?since

documented here: https://en.bitcoin.it/wiki/MtGox/API/HTTP/v1#Multi_currency_trades

here's the function:

string GetTradesOnline(Int64 tid)
{
    Thread.Sleep(30000);

    // communicate
    string url = "https://data.mtgox.com/api/1/BTCUSD/trades?since=" + tid.ToString();
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    StreamReader reader = new StreamReader(response.GetResponseStream());

    string json = reader.ReadToEnd();
    return json;
}

i'm starting at tid=0 to get the data from the very beginning. it works fine for 5 requests & responses. but then the following line throws a "System.Net.WebException", saying that "The operation has timed out":

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

this exception keeps being thrown even if i catch it and retry. it's always exactly at 5 requests.

while it has been failing for a couple of minutes, i try the 6th request in the browser and it works just fine while the function continues to fail.

the strange thing is that it works for 5 requests everytime i start the application. currently, i always start at trade id 0 (tid=0).

i've increased the Sleep() inbetween requests to 2 minutes but it still behaves the same.

if i change the url to https://www.google.com, it doesn't timeout.

any ideas of what could be wrong?

MtGox uses CloudFlare for DDOS protection.  It's possible that your IP is being blocked.

Open a ticket with MtGox and tell them your IP... they may likely whitelist it.


Get OP_RETURN from bitcoin-cli Is there a way to extract old OP_RETURN transactions from the commandline with bitcoin-cli or something?
Something in the way of getAllOpRetFromBlock(345345) ...

There is not quite the method you are looking for, but you can use the getblock call which takes the block hash (not height, you can get the hash of a specific height using getblockhash method). That will give you the block, and you would then need to write a script to iterate through the transactions in the block and find ones which have an OP_RETURN output.


When the transaction been signed? I understand that if Bob gets a transaction (BTC) from Alice and want to send it to Charlie he must provide a key which proof that he is the owner of the transaction. But in what stage Bob actually signed the transaction? Can it be that Alice was the one who signed the transaction for Bob without knowing his private key?

Every bitcoin is locked by output script. Only when the result of output script returns true, bitcoin is allowed to spend.

In your case first bitcoins are locked with Alice's private key. Which means output script will return true only if Alice had signed the transaction with her private key. Alice signs the transaction with her private key to Bob's public key, and this will unlock the bitcoin as Alice has provided her private key and new output script will be generated for this bitcoin, which can be unlocked by Bob's private key.

Now, when Bob wants to spend bitcoin which is locked by his private key, he can sign the transaction with his private key to Charlie's public key.


If using Bitcoin core client am I constantly going to be downloading data from the blockchain? I understand you have to download the entire blockchain and sync in the beginning but don't you also have to constantly keep the software on if you want to buy/sell stuff, which means more data being downloaded to my personal comp every instant there is a transaction.

If this is true, what is the average amount of data per month being downloaded so that I can use bitcoin.

Also if this is true, why isn't this point highlighted on bitcoin.org, they say you have to initially download the blockchain but not that its constantly going to be downloading data on your comp, data is expensive!

At the time of writing, the blockchain is 24 GB in size after 5 years. This is an expansion of 0.12 kilobytes per second. However, this does not represent all of the bandwidth used by the Bitcoin client:

The Bitcoin client also relays transactions and blocks it downloads.
The protocol has overhead.
Sometimes the Bitcoin client will download transactions that don't get into the blockchain.

I tested the amount of bandwidth that Bitcoin uses by measuring it using bwm-ng, over the course of six and a half hours. I found that it uses 2.1 kilobytes per second, combining upload and download. Over a month, that would add up to 5.5 GB.

Note that my Bitcoin client did not accept incoming connections, which would have changed the result significantly.

This can be an expensive amount of bandwidth. In that circumstance, you can use an alternative, like BlockChain.info, or MultiBit, both of which use almost no bandwidth.


What underlying data structure is used to store wallet address on the blockchain? I'm curious how websites like bitref.com can determine the balance of a bitcoin wallet very quickly.

I understand that the blockchain stores every single transaction across the thousands of blocks, so it's possible to reconstruct the balance of any wallet with this ledger. But wouldn't it take a long time to scan all these transactions?

Instead, does the blockchain actually store every single address in some sort of map? Would this also contain the balance of each address? If so, I can't find a website where I could view all the addresses on the blockchain. Does anyone know where I can find that?

Bitcoin's blockchain does not track total amounts of bitcoin owned by individual addresses, only the changes in amounts (i.e. transactions between addresses).

To know the total amount of bitcoin a single address owns, wallet software must search the blockchain for transactions that reference that address. Then, using those transactions, the wallet software must sum the ins and outs of bitcoin coming from and going to that address.


What license is used for the content of Bitcoin.org? What license is used for the content of Bitcoin.org?

In the footer of the website we can find that the website is licensed under the MIT license, but the MIT licensed is used only for code, right? I also have looked at Legal disclaimer and the Frequently Asked Questions section, but I couldn't find the answer.

Under which license is the content of Bitcoin.org available? CC BY 3.0? CC BY 4.0? MIT?

I've posted this question on Bitcoin.org GitHub repository and I've got the answer.
According to @harding, from Github, the content of Bitcoin.org is commonly licensed under MIT, only not when specified. Here is his full answer:

the MIT license, as stated. You can also check the COPYING file in the repository, which says;
The intellectual property rights in the files are owned by the respective authors. Some of the files can be licensed under MIT License (MIT) available on http://opensource.org/licenses/MIT or other licenses. Appropriate licensing information can be found in the header of the file or in the folder containing the file.
In general, text files have the license information near the top and image files have the license information in a file in the directory.

@saivan commented:

[FAQ] certain pictures listed on the page are not MIT licensed (see the COPYING file here: https://github.com/bitcoin/bitcoin.org/tree/master/img/faq). This being said, although I am not a lawyer, I think you can easily use screenshots like this without much copyright issues

Thanks for your replies, guys, but I will elect this one as the best answer cause this is the response I really wanted.


In Ripple, what exactly is "Hash256"? In various places on Ripple Wiki we can see the type Hash256 (for example here). What data structure is it exactly? Is it just a 256 byte array, or are there some rules governing this type (and preventing potential misuse)?

The Hash256 is essentially a uint256.  However, after reading through much of the wiki and source, it appears that the Hash256 type is meant to be a generic, unsigned integer type that can store any form of hash that is larger than 128 bits.

As an example, all hashes mentioned in the Tree Formats portion of the wiki are stored in Hash256 fields.  Some are 256-bits (I think?) while other mentioned hashes are 160-bit hashes that are padded with 0's.

As an aside, I also noticed that when working with 256-bit hashes, Ripple often uses the first 256-bits of SHA-512 hash.  This is different than the typical SHA-256 hashes that are used with Bitcoin and most other alt-coins.

NOTE: I know that a few of the Ripple devs participate in this site.  I would be greatly interested in their input.  The wiki and the source is quite cryptic in design-- almost obfuscated.  I had to follow quite a few rabbit trails to come up with the answer that I've provided.


send bitcoin to mobile number or email address How I can send bitcoins to someone's phone number or email address. I explored this api but they have documentation only for sending bitcoins to an address directly. But here they have explained how to send directly to a mobile number or email address. I want to implement this idea in php, please let me know how I can do it or where I can find some relevant information.

First of all: You do not really send the bitcoins to an email-adress or a phone number. You can only transfer them from one bitcoin adress to another one.

My understanding: The internetsite / (software behind it) creates a keypair (private and public key) and generates a bitcoin adress. Then, the site tells the user to send x Btc to that adress and provides you a textfield to enter an email-adress of your fried for example. And after that, the site sends an email to the email adress like "Hey, someone sent you bitcoins. Visit our site http://...
And finally, you need to provide the 2nd person the opportunity to import the keypair into his wallet or you ask him for a passwort that the first person gave the second person and let him/her enter a new bitcoin adress where he/she than send the bitcoins to. And you should use https for such a project.


How do you check the validity of a signature while only having the hash of the public key So far as I understand it, a Bitcoin transaction is signed with a private key and the rest of the network can then use the public key to verify that it is indeed signed by the right private key. However, as public keys are hashed, how do I use them to verify the private key?

When an output is spent, the corresponding public key is disclosed and used in the verification.


Can you make a profit mining with CPU/GPU? A Radeon HD 7950 has the following hash rates:

Around 600 MH/s for Bitcoin
Around 600 KH/s for Litecoin

I used the profitability calculator at bitcoinwisdom to estimate revenue:

Bitcoin: 0.06148 USD / Month
Litecoin: 0.6661 USD / Month

Am I missing something? Less than 1 dollar per month? Is it because of the specialized mining hardware?

No you are not missing anything. CPU mining has been unprofitable since 2011, GPU mining just slightly later.

Today, ASICs rule mining. The Bitcoin network has more than 300 Phash/s by now, that is 300,000,000,000 Mhash/s.

The upcoming ASIC miner generation is announced to provide more than 9,000 Mhash/s per Dollar. Times for GPU/CPU mining are long gone.

The situation is largely the same for Litecoin with a slight delay.

Also see: Why does mining profitability tend towards zero?

There might be some altcoins that can still profitably CPU/GPU mined and traded for Bitcoin thereafter, but I am not sure even they are worth when you factor in time investment.


What is the alternative for an exchange which doesnt want to run a node of a coin traded? It seems to be best practice for
an exchange to run a node itself for a
coin traded there.
But, is there an alternative?
A third party service? If yes, which are recommended and why?

It seems to be best practice for an exchange to run a node itself for a coin traded there. But, is there an alternative?

Alternative is to rely on someone else as mentioned by sipa which isn't best practice although few exchanges do it and face consequences for it.
Example: https://www.reddit.com/r/Bitcoin/comments/hpg9j3/336_btc_hacked_from_cashaa_they_were_using/fxrrbiw/

A third party service? If yes, which are recommended and why?

Lot of third parties provide services that exchanges don't have to run their bitcoin full node. I would never use an exchange if I know they are not competent enough to run full node and manage users funds securely.
Also service recommendations are offtopic here: How should questions that function like reviews be handled?


What ways does a miner differ from a wallet? I'm trying to understand how transactions are broadcast, the time is synchronized, and the chain extended.

I have a wallet on OSX that required me to fully synchronize with the network.  Contrasting with this is the BitMinter client that doesn't need the historic chain.

Can someone help me understand how a wallet and a miner work in a P2P environment with respect to

Network (port) requirements and what protocol
locating peers
The actions taken with each peer

A wallet is a way of storing your private and public keypairs. It is used by various clients to check your balance and create new transactions. A client usually listens on port 8333, and has 8 other ports open for outgoing TCP/IP connections. It finds peers through various means - exchanging info with other peers, using fallback nodes, seed nodes and so forth. Its main purpose is to exchange information with its peers about new blocks, transactions and the like in a peer-to-peer fashion.

A miner is an application connected to a mining pool. The mining pool runs its own client to get the latest information on blocks and transactions, as well as handling the creation of new blocks. The pools generally use port 8332 for communicating with their miners. It is a server that communicates with a lot of miners through the use of HTTP JSON RPC, and usually comes with a website of some sorts. The miners find the pool, and the pool doesn't care about peers (it has a client for that).

A miner is an application that runs on local mining rigs (computers with high-end GPUs and other dedicated devices). It communicates with a mining pool through HTTP JSON RPC calls. The miner connects to (usually) one pool of a predetermined address, but the getwork protocol facilitates the use of backup pool addresses. The miner is responsible for getting "work" from a pool, processing it, and submitting shares back to the pool. A miner does not care about its peers, just the pool it is connected to.

I hope that clears out all the problems you had. You might also be interested in checking out my master thesis on Bitcoin for more information on numerous subjects related to Bitcoin, mining pools and security.


Bitmain Antminer S2 Bitcoin Miner Stopped Booting - How to get it to boot up again? I have a S2 Antminer since April 2014, and has been on for 6 months and stopped working recently (oct-2014). I can turn it on and it shows power, but the LCD is blank and when opening the cover to see if there is anything loose, everything seems fine. I tried to take out the microsd card that is connected to the controller card inside and I cannot seem to be able to see it on my computer. It doesnt detect at all.

I tried following the instructions here: https://bitcointalk.org/index.php?topic=671625

I purchased a Beaglebone Black Rev. C from Amazon. The instructions found on that page doesnt seem to be very clear as I needed to improvise on certain things. Does anyone have a better guide or tips on how to get this working?

I have a S2 Antminer since April 2014, and has been on for 6 months and stopped working recently (oct-2014). I can turn it on and it shows power, but the LCD is blank and when opening the cover to see if there is anything loose, everything seems fine. I tried to take out the MicroSD card that is connected to the controller card inside and I cannot seem to be able to see it on my computer. It doesnt detect at all.

If you bought your S2 from bitmain, ebay or amazon, contact the seller as the S2's have a 1 year warranty from manufacturer.

Bitmain now has a repair center in Denver, so the unit would not have to be shipped back to Hong Kong.


Bitcoin UTXO discrepancy in calculation I'm trying to understand the following two sites that display UTXO information. If I can figure out the method, that would be a bonus for this question but if I can't can someone explain why the two sites measure UTXO differently?

The following website I think adds utxo from the gensis block: https://statoshi.info/dashboard/db/unspent-transaction-output-set?panelId=6&fullscreen

This website's value is way higher than the one of the previous: https://charts.bitcoin.com/btc/chart/utxo-set-size#5moc

Am I missing that these are different charts? How can I reproduce them if I decide to create the charts myself?

How can I reproduce them if I decide to create the charts myself?

$ bitcoin-cli gettxoutsetinfo
{
  "height": 614643,
  "bestblock": "0000000000000000000323e3aff59d74ab52e74f4dc5cfb9696ddb69e9857d9c",
  "transactions": 38728071,
  "txouts": 65228219,
  "bogosize": 4902482106,
  "hash_serialized_2": "a153439cccb341a5ac149562c90bca499e3a809ccf2075e2de17bc2b9d83d0ee",
  "disk_size": 3922698456,
  "total_amount": 18182867.32125828
}

65M is most correct. It's unclear where the value of 106 Million could possibly be coming from.

  The following website I think adds utxo from the gensis block

It doesn't really matter, there's 3 outputs which are "created" but are invalid, one in the genesis block and two in duplicated coinbase transactions. In the scale of the chain this is almost entirely lost to display precision anyway,


How do I monitor the performance of my P2Pool instance? Specifically, how can I tell whether I'm finding any shares? It's not clear from the extensive log output. The relevant line seems to be...:

Pool stales: 12% Own: 50±48% Own efficiency: 57±54%

... after about an hour of mining. I'm using poclbm as the miner.

(My hashrate is a mere 30MH/s; I'm just trialling the software until I get a payout - of any size).

p2pool has a higher difficulty, so you won't be submitting many shares, with 30MH/s you will have a greater variance.  p2pool is not the perfect solution for those of us with a low hashrate unfortunately.

The p2pool tells you how many shares you submitted but it's in the lines above the one you pasted, look for where it says Shares: 3 (2 orphan, 0 dead)

Also compare the Pool stales to your own stales.  To have a reliable number, keep p2pool open for at least 24h, but the numbers should be almost the same.  If your own stales percentage is higher than the pool's, you are earning less than you should.  If it is below, you are earning more than you should.


C secp256k1: What do prefixes 0x06 and 0x07 in an uncompressed public key signify? In the eckey_impl.h header file, the implementation of secp256k1_eckey_pubkey_parse checks if the first byte of a 65-byte public key is 0x04, 0x06 or 0x07. Where can I find documentation regarding the 0x06 and 0x07 prefixes?

static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size) {
    if (size == 33 && (pub[0] == 0x02 || pub[0] == 0x03)) {
        secp256k1_fe x;
        return secp256k1_fe_set_b32(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == 0x03);
    } else if (size == 65 && (pub[0] == 0x04 || pub[0] == 0x06 || pub[0] == 0x07)) {
        secp256k1_fe x, y;
        if (!secp256k1_fe_set_b32(&x, pub+1) || !secp256k1_fe_set_b32(&y, pub+33)) {
            return 0;
        }
        secp256k1_ge_set_xy(elem, &x, &y);
        if ((pub[0] == 0x06 || pub[0] == 0x07) && secp256k1_fe_is_odd(&y) != (pub[0] == 0x07)) {
            return 0;
        }
        return secp256k1_ge_is_valid_var(elem);
    } else {
        return 0;
    }
}

These are used in the "hybrid" public key format, which is an uncompressed format (it has both X and Y coordinates, like 0x04) that still stores the odd/evenness of the Y coordinate (like 0x02/0x03).

It is defined in ANSI X9.62-1998 Sections 4.3.6 and 4.3.7, and seems totally useless to me. However, OpenSSL supported it, thus when switching to libsecp256k1 for validation, it had to support it too, or we'd risk consensus failures in the network if such a pubkey would ever be used. Now we're pretty much stuck with it.


Which operating system would work best with pushpool? Which operating system would be best for pushpool?

I use debian. But ubuntu or any other *nix OS would be fine.


Can we make Sybil attacks virtually impossible? I suspect that we CAN make them virtually impossible, but that we have not yet done so.  We operate on the assumption that computing a private key from the public key is virtually impossible.  We also operate on the assumption that computing a pre-image from a SHA256 hash is virtually impossible.  We are comfortable with these assumptions because we have theoretical responses to handle their failure.  We are prepared, but we are doing nothing to implement the changes required to handle failures of these assumptions.

We are, however, doing a lot of work to avoid the problems that a Sybil attack can cause.  It would be nice if we established some prophylactics so that effort can be directed more toward improving bitcoin than toward handling Sybil attacks gracefully.

Specifically, we trust "the network" as represented by eight (or more, if you enable upnp) "random" peers that are part of it, but that trust only goes so far.  We still (by default) validate every transaction in every block.  We still haven't figured out how to compensate non-mining nodes for providing a route between whatever miner solves the next block and a peer who needs such a route.  And we resist sharding the blockchain because we don't want to have to trust strangers.

It seems to me that the difficulty of progress in those areas would be significantly reduced if A)the software made Sybil attacks virtually impossible, and B)the virtual impossibility was well established through the natural and existing bitcoin education channels.

Some methods I've been pondering are:

How many valid blocks would indicate that you are connected to the entire network?
Has the difficulty been relatively stable?
Cycle the set of peers you're using.
Make it easy for a node operator to provide IRL contact info, as that would make a node far more trustworthy.
Validate peers by requesting known information, like the firstbits of the first transaction hash in the blocktip, or of a transaction that should be in the mempool.  The bitcoin software would include instructions to get this, including a warning that a Sybil attack can include spoofing popular bitcoin data websites like blockchain.info.

Proof of work is what makes Sybil attacks very difficult. Put simply, you trust the chain with the most proof-of-work on it. This cannot easily be faked (at least without significant mining power). It is possible that all the peers you happen to connect to give you false information, but at any time, if you have even one peer that tells the truth, this can be determined cheaply and easily by seeing that the chain has more proof-of-work than the others.

Flooding the bitcoin network with nodes that don't tell the truth is possible, but as long as there are some nodes that tell the truth, it's easy enough to know which ones are telling the truth and therefore easy enough to thwart such Sybil attacks.


What does "buy the dip" mean? I keep hearing "buy the dip" constantly with Bitcoin people/comments.
I get that it means that you should buy Bitcoin while the price is temporarily low, but what do they mean by it? Do they assume that people have a bunch of money just sitting around waiting to be spent? If they have the ability to buy Bitcoin, and they have money, why would they not have already done so, and thus have no money to spare?
Am I just unique in that I don't have any massive streams of income constantly flowing into my bank account for me to "buy the dip"? For me to afford a single small purchase on Bisq, I'd need about $500, which translates to several full months of me saving all the money I don't absolutely need. To buy a little BTC once. And then my bank account is drained again, and I have to start over saving for months to make another such minor purchase.
What do they mean by "buying the dip"? Do people normally have enormous amounts of money piled up just "waiting for the right time to invest"? Are they deliberately acting arrogantly as to pretend that they are super rich and assume that everyone else also is? Do they genuinely not understand that others aren't as super-rich as they are? I don't understand it.

You're spot on!
I don't have enormous gobs of cash sitting around (who does?!) but as I get paid monthly I have some sitting ready for bills or going out next week. Buy the Dip - or more bluntly - Buy the F'ing Dip (BTFD) - is a reminder that:

The dip will be temporary
Don't later regret that you didn't buy
Consider buying a dip IF YOU ARE ABLE TO

Interesting commentary from Dr Adam Back talking with Preston Pysh and PlanB on Preston's podcast recently; accepted experience/wisdom was to ignore dips below 20% - that is a "dip" of 10% wasn't even worth the definition of "dip". Larger dips of 20%+ are therefor worth buying if you're able.
For me, I dollar cost average with a daily buy so I don't really watch the price - some days I get more sats, some days I get less sats, but at the end of every day I have more sats than yesterday.
Over the long term bitcoin will rise in value, and therefore I've protected my savings (future purchasing power). It's that simple. I'm not a trader. I don't have great gobs of cash sitting around. Work in a job and earn living, pay my bills, and save in bitcoin.
Do what you're able. :-)
PS - During the 2017 bull market there were about half a dozen dips of 30%; this dip is the first half decent one so far. aka: this is normal for bitcoin.


How exactly does bitcoin code change happen in a decentralized system I have long been under the assumption that bitcoin was just a "protocol" or a "contract“. Different nodes run their own implementation, on different hardwares. Some are efficient, some not, and they have to agree to the bitcoin protocol to function in this ecosystem.
But I found out there is actually a centralized bitcoin code base that's frequently updated! How do they even ensure that every nodes update to the newest code? And how do they ensure that the code compiles for every single hardware? Or, I guess most imporantly, were there any backward incompatible changes in the history that require every node to update?

I have long been under the assumption that bitcoin was just a "protocol" or a "contract“. Different nodes run their own implementation, on different hardwares. Some are efficient, some not, and they have to agree to the bitcoin protocol to function in this ecosystem.

That's correct. There are dozens of implementations of nodes, wallets, and various other pieces of software that speak the P2P protocol.
There are optional features, and new things that get added to the protocol, but these are almost exclusively done in a compatible way: negotiated between peers that support them, and falling back to older alternatives between peers that don't.
Part of this is negotiated through the protocol version, which used to be just the version number of the Bitcoin client, but since Dec 2011 these are separate.
Most Bitcoin protocol implementations these days are compatible back as far as the Bitcoin 0.2.10 release (from June 2010, a time when there was just a single implementation), when checksums were added to the protocol. Using a protocol adaptor (a node that speaks both the old and new version), software written today can even speak with the very first code (Bitcoin 0.1.0, January 2009).

But I found out there is actually a centralized bitcoin code base that's frequently updated!

Bitcoin Core is a project that maintains an implementation that is an evolution of the original codebase by Satoshi. It is often called a reference implementation, and a focal point for development. However, it is not the only implementation, not even the only fully validating node implementation, and it does not decide what the protocol rules are (though there are some optional protocol features that are only implemented in Bitcoin Core).

How do they even ensure that every nodes update to the newest code?

They don't; strictly speaking there is no need. The protocol rules and rules about which blocks are valid don't really change. There are good reasons to update (e.g. security improvements, speed improvements, new features), but that's anyone's individual choice. Bitcoin Core very deliberately does not have an auto-update feature, as that is deemed to give too much control over the network by the client's maintainers.

And how do they ensure that the code compiles for every single hardware?

Extensive continuous integration testing. All code changes are tested on a variety of platforms, including Windows, MacOS, Linux (for ARM32, ARM64, x86_64, RISC-V, POWER), and since recently also Android. More systems may work, but are not guaranteed to.

Or, I guess most imporantly, were there any backward incompatible changes in the history that require every node to update?

Yes, but they are very rare (and ancient history by now).
Bitcoin 0.2.9 (protocol version 209) introduced checksums in every protocol message. Initially these were negotiated, like very other protocol feature. However, Bitcoin 0.2.10 (June 2010), the feature was implemented so that as of February 2012, the checksum would become mandatory - and included in the messages used for negotiating versions themselves. This meant that by February 2012, node software before 0.2.9 stopped working.
Another source of incompatibility is the network's consensus rules. These are the rules that determine which transactions and blocks are valid, and the most complicated part of the system. The entire network has to effectively implement them identically, or there is a risk that the network splits into separate currencies. There are many questions on this site on this topic, if you want more information, but the short summary is that almost all changes to these rules are now done as so-called "soft forks": rules that only tighten which blocks are valid, which implies the network is safe from splits as long as a majority of the hashrate also enforces these rules. Other changes are called hard forks, and apart from an debatable one in 2013 (due to a change in the database layer, see BIP 50), there have not been any of these since August 2010. For more information, see https://blog.bitmex.com/bitcoins-consensus-forks/.
Disclaimer: I'm a contributor and maintainer for Bitcoin Core, and have been involved in some of the changes mentioned. The protocol 209 checksum change was before my time.


getblockfilter Error: Index is not enabled for filtertype basic I'm failing to run the getblockfilter example. What am I doing wrong?
$ bitcoin-cli help getblockfilter
getblockfilter "blockhash" ( "filtertype" )

Retrieve a BIP 157 content filter for a particular block.

Arguments:
1. blockhash     (string, required) The hash of the block
2. filtertype    (string, optional, default=basic) The type name of the filter

Result:
{                      (json object)
  "filter" : "hex",    (string) the hex-encoded filter data
  "header" : "hex"     (string) the hex-encoded filter header
}

Examples:
> bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

$ bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
error code: -1
error message:
Index is not enabled for filtertype basic

$ bitcoind --version
Bitcoin Core version v0.20.0.0-ga62f0ed64f8bbbdfe6467ac5ce92ef5b5222d1bd
...

Do I need to build a block filter index or something?

To enable the compact block filter, you need to start bitcoind with the -blockfilterindex=basic (or simply -blockfilterindex) command line option, or put that option in your bitcoin.conf file.
Depending on your hardware, it may take a few hours to build the compact block filter index. This is done in the background and does not affect normal node or wallet processing.


Is there a lower percentage cost to transfer from Coinbase or Coinbase Pro to my mobile wallet? I am trying a mobile wallet, so that I keep some bitcoin on my mobile phone.  So I downloaded Coinbase wallet, and tried to transfer 0.001 bitcoins from my Coinbase or Coinbase Pro to the Coinbase wallet.
However, the bitcoin is worth about $35, and the Network fee is about $1.40, so I am paying 5% fees right there?  There's more than an ATM that takes 3% of my hard earned cash. The money deposited in the bank for a whole year does not even get 2% interest.
Is there a way to transfer the money to my mobile wallet at a much lower fee?  A fee that is lower than 1% is more acceptable.
P.S. I finally got more deposit already settled, so I can transfer about 0.009 bitcoins away, and the fee still seem to be $1.60 or so, so that is a lot more reasonable, at about 0.45%
I also was able to transfer 0.03 bitcoins out of my account, and the fee is 0.00005619 bitcoins. So the value of the transfer is $1,422.49 and the fee is $2.66, which is much more reasonable, at 0.187%

So I downloaded Coinbase wallet, and tried to transfer 0.001 bitcoins from my Coinbase or Coinbase Pro to the Coinbase wallet

This fees is decided by Coinbase.

Is there a way to transfer the money to my mobile wallet at a much lower fee? A fee that is lower than 1% is more acceptable.

Use DEX or P2P exchanges like Bisq, HodlHodl, Localcryptos etc. and decide the fees yourself for on-chain bitcoin transactions.

Use open source wallets that support segwit. For mobile: Bluewallet and Samourai are good enough

Use layer 2 solutions like LN and Liquid if you need to make multiple transfers involving small amounts with no time to wait for confirmations.

Wallets for LN: https://link.medium.com/ltyID21izdb
Wallets for assets issued on Liquid including LBTC: Aqua, Green, Jade
Exchanges for LN: Bitfinex, Okex, Fixedfloat, Sideshift, Lnmarkets
Exchanges for Liquid: Bitfinex, BTSE, HodlHodl, Sideshift, Liquiditi
DEX: Bisq (Supports Liquid), OpenDEX (Supports LN), Sovryn (rBTC)


Why you need to rehash each block after a changed block when changing data in a blockchain? Maybe my question is stupid, but, why you need to rehash each block after a changed block when changing data in a blockchain?

Each block contains a hash of its data and hash of previous block. If I change the data in block № 9000, then block № 9001 will refer to a nonexistent block. The Chain will be broken. Every article that I read says something like:

  To make this work, you will need to rebuild and rehash each block
  following the tampered block, replacing the contents of the
  previous-block-hash pointers.

But, if block contains only hash of previous block, why can't I just change the previous' block hash value in block № 9001 if I change data in block № 9000? Wouldn't that restore the chain?

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

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

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


how to generate SECRET_KEY prefix? base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,176);

I need prefix L , but i cannot find how do this, please do not post link to prefix list bitcoin , it's only for address prefix.

i search all google end find noting.

Addresses and private keys are encoded using Base58Check Encoding. The prefix bytes are chosen such that once whatever you are encoding is actual encoded with Base58Check Encoding, you will end up with a string that has the intended prefix character.
The process of creating a Base58Check encoded string is described on the bitcoin wiki:

A Base58Check string is created from a version/application byte and payload as follows.

Take the version byte and payload bytes, and concatenate them together (bytewise).
Take the first four bytes of SHA256(SHA256(results of step 1))
3.Concatenate the results of step 1 and the results of step 2 together (bytewise).
Treating the results of step 3 - a series of bytes - as a single big-endian bignumber, convert to base-58 using normal mathematical steps (bignumber division) and the base-58 alphabet described below. The result should be normalized to not have any leading base-58 zeroes (character '1').
The leading character '1', which has a value of zero in base58, is reserved for representing an entire leading zero byte, as when it is in a leading position, has no value as a base-58 symbol. There can be one or more leading '1's when necessary to represent one or more leading zero bytes. Count the number of leading zero bytes that were the result of step 3 (for old Bitcoin addresses, there will always be at least one for the version/application byte; for new addresses, there will never be any). Each leading zero byte shall be represented by its own character '1' in the final result.
Concatenate the 1's from step 5 with the results of step 4. This is the Base58Check result.

The resulting prefix character is also dependent on the size of the data being encoded.
The only way to get a prefix byte that you want to use that has a specific character is to guess and check. The data you are encoding must be of a fixed length, and even when it is, you may still end up with multiple possible prefix characters for a given prefix byte.
A list of prefix values and the characters they produce for 20 byte values are also available on the bitcoin wiki


Is it time to move data storage (of things like music, images, virus definitions) out of the block chain? This is a technical question and I don't have the answer. I would like someone to explain why this data is necessary.

If your answer is receipts or smart contracts, then my question is, "Why not put that in side chains?" I see two problems with this data being in the bitcoin block chain: First, it allows malicious data to be inserted. Second, it takes up more block chain space. Here is the cointelegraph article about music:

http://cointelegraph.com/news/114172/music-copyrights-stored-on-the-bitcoin-blockchain-rock-band-22hertz-leads-the-way

This question is a copy of my post here:

https://www.reddit.com/r/rBitcoin/comments/355pvr/time_to_move_data_storage_of_things_like_music/

It certainly isn't "necessary" for proper functioning of the Bitcoin currency, it's just something that people noticed they could do.  But there isn't any obvious way to stop it, short of a complete overhaul of the Bitcoin protocol.  There are lots of ways to insert small pieces of arbitrary data in a Bitcoin transaction (including even the addresses themselves).  So I don't know how we would go about "moving data storage out of the block chain" even if we wanted to.  We certainly can't do anything about the data that is already there.

The current standard way to achieve this is with the OP_RETURN opcode in a transaction script.  I understand the Bitcoin developers actually took steps to make this feature easier to use: not particularly because they wanted to encourage people adding data to the block chain (as you say it takes up space), but because OP_RETURN is less disruptive than some alternative methods (for one thing, it is limited to fairly small payloads).


How does Bitcoin keep track of account balances? I downloaded the latest bitcoin client and am waiting for it to connect. How does it remember how much money a person has? Do I create an account and the balance is associated with the account each time I log in?

Another thing I don't get is how come there's ways to get free bitcoins, such as through mining or websites? Isn't it unfair that some have their money they worked for transferred to bitcoins where others depend on the strength of their computer to make them money? Is it that the free ways of getting bitcoins never give out that much it's not a problem?

Those are quite some widespread questions.
Tracking of account balances
There are two parts that keep track of an accounts balance:

each node keeps track of the transaction history
a node keeps track of the private keys for the accounts it owns

Bitcoin at its core is a distributed ledger that keeps track of every transaction ever executed. Every node in the network stores a copy of the complete transaction history and can therefore reconstruct the balance for each account. Catching up with the rest of the network will take quite some time exactly because you need to download and verify the whole transaction history.
The private keys come into play when bitcoins are transferred from one account to another. To spend bitcoins you have to create a transaction and the owner of the sending account has to authorize the transaction by signing it with the private key associated with the account. So anybody that knows the private key to an account may spend the bitcoins that are in that account. Bitcoin-QT (the client you downloaded) creates a file on the harddisk called wallet.dat, which contains all the private keys for your accounts, so don't lose it. Other clients use different methods of storing the private keys.
Mining (or "free" bitcoins)
Mining is Bitcoin's way of minting new currency. There is no central bank that prints bitcoins, instead nodes are rewarded for their help in the network. They help the network by verifying and confirming the validity of transactions in the network.
As others have pointed out mining is not free: the initial investment in mining equipment has to be amortized and electricity has to be paid. While initially it was easy to mine, the fact that you compete with all the other miners about a limited supply of new bitcoins mined has quickly driven the cost of mining up.
Mining nowadays requires such a high investment that some miners never break even.


What happens if a miner confirms their own double spend? Suppose an attacker makes a double-spend and controls the mining pool that happens to find the good which confirms the transactions.  What happens?  I suppose the network hopes that a vigilante sees the double spend on the block chain and notifies everyone. Then what happens?  Do the mining pools coordinate and remine the block?  Seems like a big disruption.  Is there a more elegant solution?

Every single Bitcoin node in the network will reject and ignore the block as invalid if there is a double spend in it. The block won't even spread very far, because the peers that first receive it will ban the miner who sent it and not forward on the block to any other nodes.

It is not a big disruption as the check for this is fast. Other mining pools don't need to "remine" it , they'll just recognize the submitted block as invalid, and keep working on their own block.


Building from source static bitcoind on Ubuntu I'm trying to build bitcoind from source on Ubuntu 13.04:

$ apt-get install libboost-all-dev ccache pkg-config # deps
$ git clone https://github.com/bitcoin/bitcoin.git
$ cd bitcoin
$ ./configure --without-qt --with-incompatible-bdb
$ make

It works !

I'm looking for way to build static binary.

However, I can not find --enable-static option in configure. How should I build static bitcoind properly?

You might ind useful these quote from configure docs

Enabling static libraries for a package which consists of only dynamic modules makes no sense, and the package author would probably have decided to ignore such requests

... `AC_DISABLE_STATIC'
These macros tell libtool to not try and build either shared or static libraries respectively. libtool will always try to build something however, so even if you turn off static library building in 'configure.in', building your package for a target host without shared library support will fallback to building static archives.

In other words, check your code for presence of particular macro in configure.in files across subtree. it may have been decided to prevent making it static.


Can we construct a UTXO which is spendable only via proof of work? Do the current Bitcoin opcodes and transaction size limit allow constructing a UTXO which is only spendable if a specified amount of work has been performed?

So the spender, would provide a nonce as input to the script. Then the script would essentially perform a highly simplified version of how bitcoin's block headers are verified (the nonce is combined with some other data, hashed, and the hash is compared with a "target.").

Without OP_CAT and with arithmetic limited to 4 byte inputs, do I understand correctly that the above would be impossible? Or is there some workaround?

The answer depends on what you are trying to accomplish with this construction. I have three guesses in this regard:

a set of determined recipients can spend if they perform the PoW: you can have a transaction that can be spent if someone provides: a value whose hash is less than a specified amount (that determines difficulty) AND a signature that describes the set of allowed entities (potentially any multisig).
anybody that performs the proof of work can spend (AND you can spend without PoW): this is trickier since a simple hash based PoW would not work, a miner can just change the destination address of the spending transaction to one under his control. You need to prove that you know a secret (the result of the PoW) without actually including it in the tx so that miners are not able to take the money without repeating the PoW: this is what digital signatures accomplish. As suggested in the comments you can contsruct a utxo that can be spent by signing with a certain private key known by you alone and that contains part of it under an op_return. So one has to try any private key in the set of the allowed ones until he can produce a valid signature. This does not leak the private key itself so the miner cannot sign the same tx with a different destination address.
anybody that performs the proof of work can spend (AND you can NOT spend without PoW): I thought about this a while and I can't find an easy construction for this, it might be hard even with stronger scripting capabilities than bitcoin's. My best guess is that you have a provably random public key (for instance using a VDF on the nonce of the last block) and everybody has to brute-force the private key to spend. I see two major issues: miners can have some advantage in selecting nonces to influence the randomness of the PK and it's hard to tune the difficulty, you need a custom signature scheme that has the security level you want and that's not trivial with bitcoin script.

This is NOT a complete list, it's just the first ideas that came to my mind. Especially the second case, which looks the most likely to me, can be constructed in several different ways: for instance you could also publish the hash of the private key in an op_return (so the private key doesn't have to be included in the transaction) and you would turn it into a hash-based PoW since hashing is a lot faster than signing.


Does GDAX charge network transaction fees? I've heard its free and when transferring your bitcoin out to an external wallet, but others are saying it's impossible. When I went to withdraw from GDAX I didn't notice and fees.  On the withdrawal screen it also says "BTC network transfers are fast and free."  What is right?

I could confirm GDAX does not have any network transfer fees. It could be unbelievable, specially if you started with Coinbase(like most people now), but it's the fact, as it's confirmed in all of their withdraw pages 'network transfers are fast and free'!


Encrypted wallet which is syncronizing I have a question, I have like 0.1 BTC on my wallet from FEB 2013.

I am 34 weeks behind sync with bitcoin-qt wallet, but the weird thing is its encrypted but I think that i never encrypted it.

Is it possible it says its encrypted because its out of sync? or it is encrypted?

and also if u set a bitcoin password can it be something like: hello123 (the reason for asking is because maybe I can figure it out) if its something hard I probably wont remember it (randoms chars, e.g symbols).

EDIT: thing also is that in the menu I cannot choose encryp wallet ..

If it says the wallet is encrypted, then it's encrypted. I can't imagine any way the wallet could be encrypted other than that you encrypted it. You can try as many passwords as quickly as you want, so maybe you'll remember it.