What BIPs are supported by the standard client Bitcoin Core?

The concept of 'accepted' is pretty fuzzy, as it depends on what a BIP affects. Some things are wallet-only, or only affect the protocol, or are optional to implement for different implementations. When BIPs affect the consensus rules of the protocol (the rules which determine which blocks are valid), the whole network needs to adopt them in lockstep, though (true for BIP 16, BIP 30, BIP 34, BIP 62, BIP 65).

Ultimately, BIPs are just proposals, and different pieces of software are free to implement them or not.

Here is a list of BIPs implemented in Bitcoin Core v0.13.0 (see this link for an up-to-date list):

BIP 9: The changes allowing multiple soft-forks to be deployed in parallel have been implemented since v0.12.1  (PR #7575)
BIP 11: Multisig outputs are standard since v0.6.0 (PR #669).
BIP 13: The address format for P2SH addresses has been implemented since v0.6.0 (PR #669).
BIP 14: The subversion string is being used as User Agent since v0.6.0 (PR #669).
BIP 16: The pay-to-script-hash evaluation rules have been implemented since v0.6.0, and took effect on April 1st 2012 (PR #748).
BIP 21: The URI format for Bitcoin payments has been implemented since v0.6.0 (PR #176).
BIP 22: The 'getblocktemplate' (GBT) RPC protocol for mining has been implemented since v0.7.0 (PR #936).
BIP 23: Some extensions to GBT have been implemented since v0.10.0rc1, including longpolling and block proposals (PR #1816).
BIP 30: The evaluation rules to forbid creating new transactions with the same txid as previous not-fully-spent transactions were implemented since v0.6.0, and the rule took effect on March 15th 2012 (PR #915).
BIP 31: The 'pong' protocol message (and the protocol version bump to 60001) has been implemented since v0.6.1 (PR #1081).
BIP 32: Hierarchical Deterministic Wallets has been implemented since v0.13.0 (PR #8035).
BIP 34: The rule that requires blocks to contain their height (number) in the coinbase input, and the introduction of version 2 blocks has been implemented since v0.7.0. The rule took effect for version 2 blocks as of block 224413 (March 5th 2013), and version 1 blocks are no longer allowed since block 227931 (March 25th 2013) (PR #1526).
BIP 35: The 'mempool' protocol message (and the protocol version bump to 60002) has been implemented since v0.7.0 (PR #1641).
BIP 37: The bloom filtering for transaction relaying, partial merkle trees for blocks, and the protocol version bump to 70001 (enabling low-bandwidth SPV clients) has been implemented since v0.8.0 (PR #1795).
BIP 42: The bug that would have caused the subsidy schedule to resume after block 13440000 was fixed in v0.9.2 (PR #3842).
BIP 61: The 'reject' protocol message (and the protocol version bump to 70002) was added in v0.9.0 (PR #3185).
BIP 65: The CHECKLOCKTIMEVERIFY softfork was merged in v0.12.0 (PR #6351), and backported to v0.11.2 and v0.10.4. Mempool-only CLTV was added in PR #6124.
BIP 66: The strict DER rules and associated version 3 blocks have been implemented since v0.10.0 (PR #5713).
BIP 68: Sequence locks have been implemented as of v0.12.1  (PR #7184), and have been activated since block 419328.
BIP 70 71 72: Payment Protocol support has been available in Bitcoin Core GUI since v0.9.0 (PR #5216).
BIP 111: NODE_BLOOM service bit added, and enforced for all peer versions as of v0.13.0 (PR #6579 and PR #6641).
BIP 112: The CHECKSEQUENCEVERIFY opcode has been implemented since v0.12.1 (PR #7524) and has been activated since block 419328.
BIP 113: Median time past lock-time calculations have been implemented since v0.12.1 (PR #6566) and have been activated since block 419328.
BIP 125: Opt-in full replace-by-fee signaling honoured in mempool and mining as of v0.12.0 (PR 6871).
BIP 130: direct headers announcement is negotiated with peer versions >=70012 as of v0.12.0 (PR 6494).
BIP 133: feefilter messages are respected and sent for peer versions >=70013 as of v0.13.0 (PR 7542).
BIP 152: Compact block transfer and related optimizations are used as of v0.13.0 (PR 8068).


Can you get the seed phrase of a HD wallet from the private key of one of the wallets?

Let us say I have a HD wallet. Can I get it’s seed phrase from the private key of one of its wallets?

No, the mathematical processes are one-way processes. See BIP 39 and PBKDF2

Also are seed phrases just easy to remember private keys?

Seed phrases are not intended to be memorised. They are intended to be written down and stored somewhere safe. For example you might use letter punches to stamp the phrase into stainless steel sheet and store the sheet in a safety deposit box.

from the seed phrase private key you can get a public key?

Yes. See BIP 32

if I send cryptos to this public key in which HD wallet is it going to appear in?

Money will appear in, and be spendable from, every appropriately-configured wallet created using that seed-phrase.
If you are thinking of each key pair derived from the master node as a wallet in its own right (which I think is a misleading way to think of things, or at least unhelpfully ambiguous) then the money is only associated with one of the key-pairs in one of the "wallets" derived from the "master node". But that "wallet" (depth 1 derivation) can exist in many wallets (multiple wallet software installations on one or many computers)


What do i do with Bitcoin? How to start my Bitcoin?

This is a bitcoin developer portal, here neither you will earn any bitcoin nor anybody will tell how how to earn it and stuff.  If you want to start with bitcoin developement start with fullnode. You will get all required information there


This means the pool has accepted 12 shares from your miner.  It indicates that you have configured the application correctly and the pool is accepting your workers shares.


Creating Testnet Bitcoin Transaction with bitcoinjs-lib

The input you are trying to spend appears to be vout 1 in the tx.

Your current code tries to spend vout 0, which has already been spent. Try changing transaction.addInput(input.sender_prev_txid, 0); to transaction.addInput(input.sender_prev_txid, 1);


You may just need to wait for the transactions to confirm. Be sure that your bitcoind is caught up.


How did these zero-transaction fee transactions make it into the Bitcoin network?

Zero- and low-fee transactions aren't relayed by default.  If you attempt to broadcast one over the Bitcoin peer-to-peer network, most nodes won't pass it along for you (and they might even "ban" you by refusing to relay any of your transactions for a while).  However, such transactions are still valid, and it is perfectly legal for a miner to confirm such a transaction by including it in a block, should they choose to do so.  So this raises two questions:

How would they get ahold of a zero-fee transaction, if they're not relayed?

The miner might have created the transaction for themselves.  For instance, if a mining pool needs to pay its members their earnings, the pool operator could create a transaction and include it in the blocks the pool is attempting to mine.  There's no point in including a fee, because the pool would just be paying the fee back to itself.
Some large miners may have alternate ways to receive transactions (e.g. a web site where anyone can paste a transaction and the miner will consider it).  This is also useful for people who want to create transactions which can't be relayed because they are not standard.

Why would they confirm it?

Obviously most miners are motivated by profit and so they would prefer to confirm transactions with higher fees.  But other than altruism or bugs, here are some reasons why they might choose to confirm a zero-fee transaction.

It's their own transaction, so there is no point in including a fee.  See above.
They've been paid in some other way.  Some miners have "transaction accelerators" where you can pay that specific miner some amount to "buy" faster confirmation.
"Child pays for parent."  If the zero-fee transaction is used as input by another "child" transaction which has a high fee, the two transactions together might have a higher average fee than any other two available transactions.  The miner can't confirm the child without also confirming the parent, but it might be worth it to collect the child's fee.


Why are there so many large transactions on the blockchain?

It's not always possible to tell, but often times it's been shown that large (100's to 1000's of bitcoin) transactions are related to exchanges settling with multiple clients or simply adjusting their cold storage around.

Exchanges holding coins on behalf of customers who move to take their Bitcoin off the exchange (which many people try to do before hardforks) would have many such transactions.


Disclaimer: There is no "proper" way to do anything :)

Some people think that P2Pool is hard to scale. But it can be scaled easily by dividing it into smaller pools that feed into the main pool.

This is beneficial for a lot of reasons but two important ones that come to mind are hardware restrictions (like what you seem to be getting into) and small miners being unable to revive payouts because of P2Pool's sharechain's difficulty.

This could be done any number of times, in a peer-to-peer way to achieve an acceptable difficulty; and eventually it will have to be done multiple times, if, for example, the P2Pool difficulty is in the petahashes, and people are still mining in the kilohashes

This could also be done with non-peer-to-peer, "standard" pools (and has been done), by having them feed into the P2Pool network.


TTOR (Topological Transaction Ordering) is used by Bitcoin and pre-CTOR Bitcoin Cash. In TTOR, there might be multiple possible ways to sort transactions. The only requirement is, chain of transactions should be sorted by time and the coinbase transaction must be the first.

Let's say there are A, B and C transactions, and assume that there's no coinbase transaction. A and B are usual transactions, but C spends at least one output of B. The possible orderings are:

A B C
B A C
B C A

Amaclin is right, SegWit didn't change anything related to them.


How to modify dynamically the fee of a transaction?

You can only do this if you set the RBF bit on the original transaction.


what is the Volume and BaseVolume reported from bittrex API?

Volume is the amount traded in that altcoin over the past 24 hours.

In the case of BTC-DGB, this is the amount of DGB that has been traded in 24 hours.

  BaseVolume is the total value traded in the base currency, for example Bitcoin.

Volume increases regardless if it is a buy or sell order.

To find the overall volume you can go to https://coinmarketcap.com.


Why does my freshly installed lightningd not show funds that I transferred to it?

Clightning actually needs to scan all blocks to check for output's and Adresses it controls.
I assume most likely your c-lightning node is so fresh that it has not seen such a late block yet. Once your c Lightning node is up to date funds appear directly in listfunds once they are confirmed. So I guess you can do two things.

Check your log file and see how far c Lightning is with parsing through blocks
Wait until clightning is finished


How do text, scripts, and other information get embedded inside the blockchain?

Richard Kiss covered this extremely well in his blog.

There's several ways to go about embedding data in the Blockchain:

OP_RETURN method embeds data to a single output and the script following the OP_CODE is hex encoded ASCII text
Use pubkeyScript fields to have ASCII (in hex) which can be concatenated across all the outputs (the addresses as hash160 are unspendable)
Coinbase field can hold hex data, such as the Genesis Block
BCI metadata notes which are not actually included in the Blockchain, but are visible on BCI

The first method is most common and accepted, allowing for 40 bytes of text.


Is it feasible to use the Blockchain technology without the Bitcoin?

Blockchain by definition is a data structure, in that sense we can and already have decoupled it from Bitcoin.  There are many alt-currencies that implement blockchain as a data structure and a data store.

Ethereum is building a blockchain based application platform.

Storj is an example of blockchain technology that also is trying to create a blockchain for data storage.

The SAFE(Secure Access For Everyone) network is attempting to build an entire computing platform built on a blockchain.

The key is incentivizing some form of participation by providing a service. On the Bitcoin blockchain the service being provided is the ability to send value globally very quickly.  Thus the reward that was created is financial.


Preventing sybil attacks : How does bitcoin get to know the computing power of a node?

Most nodes these days do not mine at all, nor do they care who exactly is contributing hashpower to the network.

Proof of work does not prevent a sybil attack from occurring, rather the required work to create a block makes it costly for a successful sybil attacker to feed the victim a tailored chain-tip. Unless uses immense hashpower, they can at best hand the victim a doublespend transaction while withholding the new blocks and transactions relayed on the rest of the network. Simply waiting for one or more confirmations corresponding to the value of the transaction largely mitigates the dangers of a sybil attack.

On the other hand, sybil attacks itself are difficult because Bitcoin nodes initiate eight outbound connections to random peers in the network preferring nodes in different IP ranges. Whereas an attacker could perhaps gain control of a lot of inbound connections after identifying the victim's IP address, replacing the outbound connections would be a lot more difficult. Yet, as long as the node connects to just a single honest peer, a doublespend attack as mentioned above would be foiled.


What kind of node connects to your full node and doesn't share blocks with you?

It could be a blockchain analysis node of some sort (eg. Chainalysis or similar), or it could be a pseudonode.


Why does bitcoin-cli return strange version numbers for blocks?

Great question. I had to do some research to find out.

Currently version is actually 4 bytes. In the case of this block (and many other recent blocks, as it turns out) it's 01000020. This is little endian, so when you reverse the bytes in hex it's:

0x20000001 = 536870913

Which in binary is:

00100000000000000000000000000001

It turns out that the bits here follow the BIP0009 spec. You can get a more user-friendly explanation of BIP0009 here. Essentially, BIP0009 specifies that version bits are to be used to signal support for a soft-fork. In this particular case by using that that extra "1" at the end, the miner that mined this block is expressing support for BIP0112 otherwise known as OP_CHECKSEQUENCEVERIFY.


When I'm downloading the blockchain for the first time, from whom am I downloading it from?

Blocks are downloaded from other nodes in Bitcoin's P2P network using a custom wire protocol. For the initial synch you can imagine it as a torrent with 5000 seeders, though the Bitcoin P2P protocol is more specialised and efficient for this task than BitTorrent.

The bottleneck is almost always CPU load on validation, rather than download speed.


Sending Bitcoins from a Mastercoin Address

No, it's completely safe.

To send mastercoins you have to use one of the mastercoin clients - you can't accidentally send mastercoins by working with a Bitcoin wallet.


Is there a way to change the wallet.dat location without changing the entire data directory?

A symlink will do it on Linux.

On Windows there's a symbolic link method as well:

http://en.wikipedia.org/wiki/Symbolic_link#Windows_7_.26_Vista_symbolic_link

A -walletdir= feature has been requested before:

http://bitcointalk.org/?topic=2730.0
https://github.com/bitcoin/bitcoin/issues/68


What role has bitcoin-init as a process?

With the order, I will try to response to your question.

  According to this thread I assume that the daemon process bitcoind has been renamed to bitcoin-init but I am not sure if I understood that correctly.

I don't think the bitcoind is rewriting to bitcoin-init, but I don't have a mode for testing bitcoin-core on raspberry, so I ask you if you can post "how you have installed the bitcoin-core?", with command sudo apt install or a zip directory on Github/official site bitcoin?

  My node seems to update the chain, but very slowly - 50GB after several weeks. And it is not reachable if I check my local IP via Coindance.

The answer is "depends", depends on your connection, in any case, is a little slow if you don't have an ADSL 7 mbs

  EDIT: The book (Antonopoulos) sais that bitcoind will give an error unless I set an rpcpassword in the configuration file. I don't have such a file, but bitcoind gives:

Is possible to configure the node bitcoind with the file config, "bitcoin.conf", you have a complete example here and here file must be inside the directory bitcoin, if you don't change it, will be in the folder /home/yourName/.bitcoin/bitcoin.conf or you can set the bitcoind from the command line, an example bitcoind -rpcuser=vincent

  I seem to have two seperate directories for .bitcoin. How can I tell bitcoind to use the other one?

If you have synchronized the bitcoin-core inside another directory (an example because you have a version bitcoin inside the external HDD) your command for bitcoin is similar this, bitcoind  -datadir=/media/vincenzo/Maxtor/BitcoinCore/node if you not call the bitcoind with the daradir, the bitcoind re-synchronized the blockchain of bitcoin inside the /home/yourName/.bitcoin/ directory

  If I run bitcoin-cli getinfo with my usual Rasperry user pi I get

The problem should be the datadir different from /home/yourName/.bitcoin/


Bitcoin Core is telling me that it needs to synchronize with the network and is 5 years and 4 months behind. Does anyone have any suggestions as to how to retrieve my BTC?

You have not synced bitcoin core full node yet.
If you want to check transactions associated with an address from this wallet or create unsigned transactions:
Create a watch-only wallet in Electrum by using the last option 'Import bitcoin addresses or private keys' while creating new wallet or you can create watch-only wallet in bitcoin core as well if you have it synced on other machine
If you want to sign and broadcast transactions using bitcoin core:
signrawtransactionwithwallet
sendrawtransaction


The green address is a third party trust trick and can help resolve most problems related to the need to wait for confirmations (slow transactions).
To make it very simple :
Service A publishes its green address, service B decides to trust service A.
When someone send bitcoins from service A to service B, he will send from the service A green address.
The service B knows he can trust the service A, he knows A won't double spend, so B can credit the sent bitcoins immediately, without waiting for confirmations ( or waiting for just one confirmation, which is probably wiser ).
This is mostly useful for transferring bitcoins b2b (business to business), typically it would help making arbitrage easier and faster between 2 bitcoin exchanges, if both decide to trust each other's green address.
This can also be useful to allow for POS (Point of sales) with instant transactions if the POS can trust the green address of your bitcoin bank (or online wallet)
As an individual, I could also negotiate with my local supermarket to trust my green address (providing them my IRL address, ID number and more if needed).  Once they decide to trust my green address, I can pay immediately with bitcoins at my local supermarket (they trust me and won't need to wait for confirmations).
The green address is just a bitcoin address, but it's a "from" address people decide to trust and accept transactions from this address without waiting for confirmations.
Possible drawbacks are :

Less anonymity, or even no anonimity at all ( always using the same public from address), which is not a problem for a business, and its even great for public accounting/auditing ( yes bitcoin can also help fighting corruption ! )

Blockchain spam (more transactions for the bitcoin network), which is a good thing if the blockchain can scale.

Encourages people to use trusted wallet providers (some kind of bitcoin banks). Here too, this have good and bad sides.

It's not enough to create a green address, you still need to be trusted so that your green address is useful

For now, afaik, only mtgox.com, btcpak.com and instawallet.org support the idea.  To be useful, green address system needs to be widely adopted by bitcoin pools, exchanges, online wallets, businesses, etc.
See also https://en.bitcoin.it/wiki/Green_address
( edit 11 years ago, october 2020 , this reference is no more very relevant, some people completely rewrote the wiki page years later,for obscure reasons . . . they even replaced the first line with a blockstream ad . . . but you can still go and check the earliest versions of this page, around 2011-2012 , by clicking the "history" tab of the wiki page )


How does the lightning network solve double spending?

To open a channel you have to lock funds in a multisig address. This is with an on-chain transaction. So those funds can't be used to pay Cindy on-chain. They can't be used to pay Cindy on LN either without both Alice and Bob's approval since it's a multisig address that requires both Alice's and Bob's signature.


Is there some kind of USB antenna I can buy to be able to use Bitcoin even when there is no Internet?

Blockstream have multiple satellite circling around the earth and broadcasting the blockchain or receiving and sending transaction without interruption.
https://blockstream.com/satellite/
They have their own kit to use the service:
https://store.blockstream.com/product/blockstream-satellite-basic-kit/


The Bitcoin-Qt/bitcoind client computes the balance as you describe, by summing up all the transactions for all the Bitcoin addresses in the wallet.dat.

The blockchain contains all transactions since the genesis block (block 0).  So the balances are simply all the unspent transaction outputs (UTXOs).

There are third party services which will monitor the blockchain to provide balance info for a specified address or addresses.  BTCBalance.net is one.


How would this double spend attack be prevented?

Transactions create Unspent Transaction Outputs utxo. UTXO are uniquely identifiable. UTXO are indivisible, they are destroyed completely, when money is spent from them. (Which is why you need to send change back to yourself.)
Naturally, this also means that you cannot chose what address you send money from, in fact the "sending address" only exists implicitly by being the address that received the funding payment.

So, putting all this together, whenever someone tries to spend money, the network's nodes check if the corresponding UTXO are available to be spent, i.e. listed in the set of UTXO.

If somebody tried to spend money twice, the UTXO would have been consumed by the first transaction already, and would therefore no longer be listed in the set of UTXO.


Does python-bitcoinlib and the Bitcoin Core functional test framework share code? Were changes ever pushed down/upstream?

script.py of the Bitcoin Core functional test framework contains a comment that it was initially modified from python-bitcoinlib.
There doesn't appear to have been any code sharing beyond that and certainly not any later changes pushed up/downstream.
I asked Kanzure (previous maintainer of python-bitcoinlib) on IRC about it and he said:

python-bitcoinlib is forked from a thing that was itself incorporated into bitcoin core's functional test framework or the thing it was forked from was from code in the bitcoin core repository, i forget the lineage exactly but python-bitcoinlib came later


There are two problems with scaling P2Pool:

The sharechain difficulty goes up as the pool gets bigger to maintain the rate of finding shares at around every 10 seconds.  If everyone was using P2Pool then the difficulty of finding a share would only be 60 times less than the difficulty of solo mining, and so varience would go right up.
As more miners join, it's likely that the latency goes up.  Since the share that the pool is working on changes every 10 seconds or so, a delay of just a few seconds is very significant.

In order to scale, there needs to be multiple P2Pools.  Maybe they can be nested in a tree structure: a level 1 P2Pool sets its difficulty so it finds shares every 5 minutes.  100 different level 2 P2Pools feed into it, finding shares every 1 minute, and 100 level 3 pools feed into each of the level 2 pools, finding blocks every 10 seconds.  Ideally this would all be managed automatically by the p2p network if that's possible.


A transaction (that is not a coinbase transaction) will have specified inputs and outputs. The inputs must be comprised of valid, existing UTXOs (referenced by transaction ID and output index number, called the 'outpoint'), which will be 'consumed' to create the outputs (newly created UTXOs).
To spend any UTXO, you need to satisfy the conditions of the locking script placed on it.

I presume that its inclusion here is a reference to the Output of the originating transaction i.e. the Input of the current transaction includes a part of the Output of the previous transaction to provide extra information to the user.

If we look under the hood at how transactions work:
The transaction input will include an outpoint, as well as an unlocking script that will satisfy the scriptPubKey, and a sequence number (which is not relevant to the question at hand). The scriptPubKey for an input isn't explicitly included in the transaction data, as that would be redundant. Instead, the scriptPubKey can be looked up via the outpoint.
The outputs created by a transaction will each include a value (amount of BTC), and a scriptPubKey.
A block explorer will likely just display all of this info together for ease of use though. So if you look up a transaction ID, the scriptPubKey of the inputs may be listed, despite the fact that the actual serialized transaction data doesn't explicitly include this data (it just includes the outpoint, which is used as reference to look up the relevant data).

You can think of the outpoint as the information about which UTXO is to be spent, the scriptPubKey as the 'lock' which must be opened in order to spend it, and the scriptsig as the 'key' which will open the lock.


Perhaps it is the receiving wallets problem. Some wallets can take dozens of confirmations, which can take up to 24 hours.


Problems in recovering from a seed of Multibit HD

The default MultiBit HD wallet uses an address generation scheme known as BIP32. Mycelium uses an address generation scheme known as BIP44.

BIP44 is what Trezor uses.

HD wallet interoperability is unfortunately a bit thorny. It's normally easier to have two wallets.


Right, figured it out. It's a matter of picking the correct output from the previous transaction and running signInputs. After that it works.


Can I rely on my full node to always have the most recent blocks?

how can I make sure that this block that my node received is a valid block

Bitcoin Core will only announce (through ZMQ) blocks that change the tip of the best-known valid chain. This implies they together with all their ancestors are fully valid.

  and it is not an orphan block

At the time it is announced, you know that it is part of the best-known valid chain. Of course, it's always possible that a better alternative branch is received later, which reorganizes the old one you heard about. In that case, you'll receive a new ZMQ notification for the new best tip.

  Can I rely on my full node to have the most recent blocks?

No, of course not. The speed of communication around the earth is finite; if a new block has been found somewhere on earth, there is no way you can know about it before it's had time to propagate to you.

Even ignoring that, it's always possible for the nodes you are connected to to be slow, broken, or malicious, in a way that prevents them from propagating blocks to you.

The only correct way to think about this is that there simply is no such thing as "the best/most recent block", and every node is continuously trying to catch up with new information. In theory, you never have any guarantees. In practice, usually nodes learn about blocks within seconds, and if it takes way too long (say, hours), you'll know something is wrong.


Copay Multi-Sig Wallet 2 of 3, possible issues

If such changes were made, the address would change so it would not effect you. You give out addresses that have a specific set of signers and that cannot change. A different set of signers would be a different address, and if you do not know about this different set of signers, you would not have these other addresses to even give out.

So no, it is impossible for a co-signer to change the other signers nor is it possible to add more co-signers to a given wallet.

It is possible for a co-signer to create a new set of addresses with other co-signers added and then give out those addresses. But unless you were specifically told about this, you would not be aware that you could sign for those addresses.


Does Mt. Gox's "Redeem a wallet.dat" feature require an unencrypted wallet?

To do this Mt.Gox must have unencrypted wallet.dat.  Technically, you will have to either unencrypt yourself, or provide passphrase to Mt.Gox.  Which depend how Mt.Gox manage feature.  Maybe both work.

Be very careful how transmit wallet and passphrase.  Use some good encryption, https if doing via web, PGP (encrypt mode, not sign mode) if doing via mail.  Transmit unencrypted wallet, or encrypted wallet with unencrypted passphrase, must have first secure channel.

Also must trust Mt.Gox.  Mt.Gox has US$5M seized from accounts in last few days, and now under investigation American gov't.  Maybe difficulty paying you, specially if paying US$.  Maybe motivated give up customer secrets.  Maybe American gov't right.  Something to think about.

Cant say for you, but I would never use such service.  Suspicious bastard, me.


What's the easiest way to hook into multiple BTC exchanges?

Yes, there are such services.

bitcoincharts.com offers such an overview, though you may get confused from the many fiat currencies.

CoinDesk's chart is much cleaner, only uses USD, and you can easily choose which exchanges to regard. However, CoinDesk lists far fewer exchanges than bitcoincharts.com.

There are several services – for example BitcoinAverage – which attempt to plot the average price.

If you want to, you can use the APIs of the exchanges you're interested in, and write a script or small program which shows the current prices.


Add them to Makefile.am. Search where net_processing.{cpp,h} are mentioned and add your own.


What are the effects of leaving Bitcoin-QT open?

Bitcoin-Qt is the original Bitcoin client.

Leaving it open has no real consequences considering yourself individually, but there are some minor effects.

Effects regarding you:

When you leave your client open, your client will always be in sync with the network, meaning that you can always see your accurate balance. If you should close it, it will have to catch up syncing before it can show you your addresses' balances.
As explained in this answer, when you send a transaction into the network, there is a small chance that it may get lost. In that case, when your client is still open, it will re-transmit the transaction automatically. When your client is closed, the transaction will be lost and never confirmed. Note that the chance that a transaction gets lost is very small.

Effects regarding the Bitcoin network as a whole:

Bitcoin is a peer-to-peer system, in which all Bitcoin clients function as nodes. But not every node knows of the existence of all other nodes. A transaction is made by sending it to all nodes in the network. When your client is open and connected to the network, it has a list of other nodes it knows about. When one of them sends a transaction to all the nodes it knows, you help him by sending it forth to all the node you know about. This way you can help reduce the time it takes for a transaction to reach the whole network.
Together with relaying transactions, your client will also check all transactions it receives. It is possible that some of them is malicious, meaning that the sender does not have the right to spend the bitcoins he is spending, or that these bitcoins are already spent. In that case, your client will ignore the transaction and not relay it.
Another thing your client does is helping new nodes synchronize. When a new client enters the network, it has to build the block chain from scratch. It will request other nodes to send parts of it to him so that he can save them. When your client is open, it will help other users download the block chain.

Note that it is not an effect of leaving your client open that your bitcoins are less protected. Encrypted wallets are only decrypted for spending bitcoins.

Also, your client will not mine while it is open, so the process it not very resource-consuming.


getting balance from my address using bitcoinj

I can offer you the workaround for this problem. I used web API for this feature. For example https://www.blockcypher.com/dev/bitcoin/#address-balance-endpoint.

It will allow you refuse block chain downloading part and make your code more simple.


Cannot sign txn with change address using bitcoinjs-lib psbt

Simple solution! index in input object was hardcoded to 0 instead of taking the vout nonce from UTXO list. I was going to delete, but I'll leave the post up.


I was tasked with installing a bitcoin core on ubuntu and I had questions

At least 1 GB of ram is needed. If that is not enough you can simply add some swap memory to build the daemon.
Disk space is required also and at the time of writing it is around 200 GB.

To Build

./autogen.sh
./configure
make
make install # optional

Required dependencies

Ubuntu & Debian

sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3

Now, you can either build from self-compiled depends or install the required dependencies:

sudo apt-get install libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev

BerkeleyDB is required for the wallet.

For Ubuntu only: db4.8 packages are available here. You can add the repository and install using the following commands:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev

Ubuntu and Debian have their own libdb-dev and libdb++-dev packages, but these will install BerkeleyDB 5.1 or later. This will break binary wallet compatibility with the distributed executables, which are based on BerkeleyDB 4.8. If you do not care about wallet compatibility, pass --with-incompatible-bdb to configure.

To build Bitcoin Core without wallet, see Disable-wallet mode

Optional (see --with-miniupnpc and --enable-upnp-default):

sudo apt-get install libminiupnpc-dev

ZMQ dependencies (provides ZMQ API):

sudo apt-get install libzmq3-dev

source: bitcoin github


Is 2016 a good time to buy an ASIC miner?

Although the miner you're considering is a great entry level unit, 2016 will bring in the "halving" of the reward on bitcoins mined. This means, once a solution is found, the reward will be half the number of bitcoin. (http://www.bitcoinblockhalf.com/) You may want to join a pool, which you can help mine bitcoin and the reward is split up depending on the rules of the pool. It's a good way to be a part of the community and possibly earn bitcoin.


Why does bitcoin use public keys as pseudonyms?

More accurately, the pseudonyms most commonly used are addresses, which are derived from public keys (not the longer public keys themselves).

In order for Bitcoin's idea to work, you must have coins that can only be spent by the owner of a given private key. This means that whatever you send to must be tied, in some way, to a public key.

Using arbitrary pseudonyms (e.g. user names) would mean that you'd have to then somehow link the pseudonym to a public key in order to enable public/private key crypto. This would remove the ability to securely create addresses/pseudonyms offline (e.g. before someone could send money to the user name "tdumidu", you'd have to announce in the blockchain that "tdumidu" is owned by public key "a1c...", and include a fee so others have a reason to announce it), reduce anonymity (by encouraging you to reuse pseudonyms), and needlessly bloat the size of the blockchain. It would also create a false sense of security that you're sending to who you think you are (if I take the name "Linus Torvalds" before he does, then it's mine and people might send money thinking they're paying the creator of Linux, not me).

Using a pseudonym that either is, or can be calculated from, the public key removes these problems: the mere act of sending the money also describes, in cryptographically secure detail, who can spend it. As the existence of vanity addresses shows, it also allows a small amount of customization.


How to find out the requirements for spending an output script?

I'm assuming you're talking about P2SH addresses here, since that's really the only time this matters.

For standard P2SH addresses, you cannot find the spending requirements by just looking at the address. Let's look at 3DzSVk4veMCkNbNT9CdETeE26uWxmNbBnD from a recent block as an example.

The output script of this address is a91486ed17bfa7bd80cf87cf7e80abd9289079b78c5b87. This alone simply amounts to HASH160 PUSHDATA(20)[86ed17bfa7bd80cf87cf7e80abd9289079b78c5b] EQUAL. This means that to spend the tx, you need to provide some input, that once run through HASH160 equals 86ed17bfa7bd80cf87cf7e80abd9289079b78c5b.

This is the general format for any P2SH output script. To actually know what kind of script it is, you need the redeem script, which can be found in your wallet. If the address is not one of your own, the redeemscript is revealed when an output to that address is first spent.

Looking at this tx for the above address, we can find the redeemscript as 5221038934160de8ad1dd529329f5bf51e3086cc0f6d19e10fb4120385f23d871c0c1d21021659435e23e3891d39ec2b0266b3c14a68cb4e45adb8543f31508310c98722d952ae (the final push in the script for the input).

Running the above redeemscript through the decodescript command gives us:

2 038934160de8ad1dd529329f5bf51e3086cc0f6d19e10fb4120385f23d871c0c1d 021659435e23e3891d39ec2b0266b3c14a68cb4e45adb8543f31508310c98722d9 2 OP_CHECKMULTISIG

This identifies the script as a 2of2 multisig.

This could very easily have been any other form of script, such as 2of3 multisig, or not multisig at all. It could even be a segwit address wrapped in a p2sh address. However, just by looking at the address, you cannot determine the type of script. You must have the redeemscript to determine the spending requirements.


Does Bitcoin Cash validate the fears about larger block sizes?

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

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

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

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


Error sending SegWit transaction: error code: -26 using bitcoin-cli

After writing up this question I finally figured out the answer from here: https://bitcointalk.org/index.php?topic=1680640.0.  I will answer my own question for anyone who might be having the same problem.  It turns out I needed to specify the amount of each input in signrawtransaction.

bitcoin-cli signrawtransaction 0200000001cb8f0219b52d37485a30f98f2441af957eadd160df863c2c0ddfbb6ef8a660e30000000000ffffffff010fe506000000000017a9149613523d8525c0c444209b73eefda15101d1750d8700000000 '[{"txid":"e360a6f86ebbdf0d2c3c86df60d1ad7e95af41248ff9305a48372db519028fcb","vout":0,"amount":0.00541855,"scriptPubKey":"a914184b69873b307dc7081f2541098aaf4881bac20187","redeemScript":"0014568db227e811df5f502df149c8c9d899492140c9"}]'
>> {"hex":"02000000000101cb8f0219b52d37485a30f98f2441af957eadd160df863c2c0ddfbb6ef8a660e30000000017160014568db227e811df5f502df149c8c9d899492140c9ffffffff010fe506000000000017a9149613523d8525c0c444209b73eefda15101d1750d8702473044022006f8822e2a56fb4c9defaca393a0c4ee29a32b4caecc15e457dff1b5993e88290220096b1bae9819d64f2b69a44881c033fb7c9fbde77c9d16347ef2439e831c192d012103ba8ae62944f27ce7a661866d6837ab3d6dd3fcd62bc6a09be5405074ec2473db00000000","complete": true}

This time sending it works:

bitcoin-cli sendrawtransaction 02000000000101cb8f0219b52d37485a30f98f2441af957eadd160df863c2c0ddfbb6ef8a660e30000000017160014568db227e811df5f502df149c8c9d899492140c9ffffffff010fe506000000000017a9149613523d8525c0c444209b73eefda15101d1750d8702473044022006f8822e2a56fb4c9defaca393a0c4ee29a32b4caecc15e457dff1b5993e88290220096b1bae9819d64f2b69a44881c033fb7c9fbde77c9d16347ef2439e831c192d012103ba8ae62944f27ce7a661866d6837ab3d6dd3fcd62bc6a09be5405074ec2473db00000000
f375de743834e041f42a19eceb39fb25b4e6ea5159b5450ea3fdac95d67062dc

For some reason this wasn't necessary for spending regular P2PKH outputs but it seems that for P2SH outputs it is.  I am curious as to why this might be the case and why signrawtransaction didn't throw any errors.  I have to say that the documentation is very poor as https://bitcoin.org/en/developer-reference#signrawtransaction says nothing about including an amount in the parameter #2.


I understand that a block is generated whenever a proof of work is
  submitted by a miner; this happens when the miner processes a
  transaction

That's not correct. The miners doesn't submit a found block (proof-of-work) when he processes a transaction. He does when he found a block hash that was valid.

That can take a long time and in the time he looks for a good block, he will receive probably thousands of transactions.

He will verify those as they come in and put them in the block he is currently working on, all of them, one by one (until the limit is reached). When he then finds a valid block hash, he will submit the entire block consisting of all, or most of, the transactions he received.

So, to answer your questions, transactions do not necessarily get slower over time, on the condition that the upper limit of transactions in a block is high enough. If the limit is too low, there can arise a bottleneck for transactions trying to be verified.

FYI: You can see that all miners have all those transactions in their working block, but only one of them can submit the block. To prevent transactions from occurring twice, once a miner receives a new valid block from a fellow miner, he checks what transactions in his pool are also in that block. He will remove them from his pool and continues mining for the next block with the transactions from his pool that were not in the block of the fellow miner.


The transaction was confirmed according to the transaction ID you provided (727 Confirmations as of this moment). Have whoever you sent to Bitcoin to check again.


Which notable Bitcoin-related sites offer referral rewards?

Between TradeHill, Bitcoin7 and a couple others the offering of affiliate rewards ended up spawning a spamfest.  Fortunately, TradeHill added terms and conditions that included no spamming and withheld commissions to spammers and the problem mostly went away.

Camp BX apparently is one that offers a referral.  10% discount on trading fees for them and 10% commission for you.
After login, click on "My Profile" (or https://campbx.com/in/userinfo.php )
then scroll down to Affiliate Program Link.

Others:

http://clients.microtronix-tech.com/aff.php


Get transaction details using bitcoinj library

maybe this helps

private void txHistory()
        {
            List<Transaction> txx = kit.wallet().getTransactionsByTime();
            if (!txx.isEmpty())
            {
                int i = 1;
                for (Transaction tx : txx)
                {
                    System.out.println(i + "  ________________________");
                    System.out.println("Date and Time: " + tx.getUpdateTime().toString());
                    System.out.println("From Address: " + tx.getOutput(1).getAddressFromP2PKHScript(params));
                    System.out.println("To Address: " + tx.getOutput(0).getAddressFromP2PKHScript(params));
                    System.out.println("Amount Sent to me: " + tx.getValueSentToMe(kit.wallet()).toFriendlyString());
                    System.out.println("Amount Sent from me: " + tx.getValueSentFromMe(kit.wallet()).toFriendlyString());
                    long fee = (tx.getInputSum().getValue() > 0 ? tx.getInputSum().getValue() - tx.getOutputSum().getValue() : 0);
                    System.out.println("Fee: " + Coin.valueOf(fee).toFriendlyString());
                    System.out.println("Transaction Depth: " + tx.getConfidence().getDepthInBlocks());
                    System.out.println("Transaction Blocks: " + tx.getConfidence().toString());
                    System.out.println("Tx Hex: " + tx.getHashAsString());
                    System.out.println("Tx: " + tx.toString());
                    i++;
                }
            }
            else
            {

                System.err.println("No Transaction Found");
            }
        }


Which BIP-148 branch is the most recommended?

As luke-jr (author of the code in one of the PRs) said in the comments right now, the branch is abandoned and the recommended code is in UASF/bitcoin repo.

(Again the answer might get outdated soon.)


Should block height or MTP or a mixture of both be used in a soft fork activation mechanism?

Should block height or MTP (median time past [...]) or a mixture of both be used in an activation mechanism like BIP 8 or BIP 9 for defining the timings of the state transitions?  What are the advantages and disadvantages of both and how do they compare?

The main advantage of MTP is that it usually roughly corresponds to wall time, so it's easy to communicate what a number means to humans.  For example, BIP141 says: "the BIP9 starttime will be midnight 15 november 2016 UTC [...] and BIP9 timeout will be midnight 15 november 2017 UTC".  When both of those MTP values were reached on the actual network, they were within three hours of actual UTC.
The main disadvantage of MTP is that it can be manipulated by miners.  MTP is the median of the value recorded in the nTime field of the current block header and the previous 10 blocks.  Miners can set their nTime values to any value greater than the current MTP and less than two hours in the future.  This makes it possible for a majority of miners working for an extended amount of time to hold MTP to an old value (say 3 months ago) and then, in the space of a single block, move to a much later time (say 1 month ago).  This can allow them to jump over MTP-based mandatory signaling periods such as specified in BIP148.
The main advantage of block heights is that there's no way to skip over a height-based threshold, so they make sense for flag day activations, mandatory signaling requirements, and other transitions we want to ensure happen (such as from BIP9 LOCKED_IN to ACTIVE, which happens using a relative height-based threshold of 2,016 blocks).
The main disadvantage of block heights is that they're not particularly consistent.  In an average year, we expect there to be 52,596 blocks, but it would not be extraordinary for there to be 58,440 blocks---reducing an intended 12-month deployment to 10.8 months.
There's no harm in mixing MTP times and heights, and there can be significant advantages if you can take advantage of both strengths at the same time without losing too much to their weaknesses.


math to make a full private key have a mini private key equivalent

You can't create a minikey for a private key - you need to create a private key once you've created a minikey.

You need to ensure that the SHA256 of the mini key plus a question mark after it has a hash starting with 00.

Or, in Python:

sha256(candidate + "?")[0] == chr(0)

The following Python program will generate mini keys:

import hashlib
from binascii import hexlify as hx
import random
rand = random.SystemRandom()

B58_ALPHA = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

def sha256(s):
    return hashlib.sha256(s).digest()

def gen_candidate():
    candidate = "S"
    for i in xrange(29):
        candidate = candidate + rand.choice(B58_ALPHA)
    return candidate

def test_candidate(candidate):
    return sha256(candidate + "?")[0] == chr(0)

while True:
    c = gen_candidate()
    if test_candidate(c):
        print c, hx(sha256(c))


Depending on the nature of the implementation, yes.

If you are considering hosted wallets such as exchanges, then yes - an MITM that is able to bypass SSL protections, a fairly common implementation on many corporate and organizational networks, will trivially be able to change data.

Certain wallets work around this by either storing the private keys locally and signing information retrieved from a remote server (such as metamask, or ledger live), which might still be susceptible to an MITM on the information being retrieved, or by using a local secret to sign requests to the remote server, which prevents in flight modification without detection.

Wallets further work around that by using systems such as the SPV protocol to both retrieve and verify data prior to signing it.


How do I retrieve bitcoins sent to my email address through coinbase.com?

When sending Bitcoin from Coinbase.com to an email address, you are sending the Bitcoin to another Coinbase.com account linked to that email address. So for example, if you had a friend who has a Coinbase.com account and you wanted to send them Bitcoin, you could ask them for their Coinbase.com email address and then send the Bitcoin to that email address, where they would claim it on Coinbase.com. Reference

If you simply want to move Bitcoin outside of Coinbase.com to a Bitcoin wallet, you will need to send the Bitcoin to your public address.


BIP34, BIP66 and BIP65 should have been enforced at unique block heights. Why do different sources claim different block heights for enforcement?

I'll start with explaining the confusing documentation.

  BIP34 says it activates when 950 out of 1000 blocks signal for Version 2. It is not clear if this includes the current block or refers to previous blocks

It refers to previous blocks. To determine whether the rules are active for the block at height n, we check whether 950 of the blocks from n-1001 to n-1 signal version 2 or greater.

  BIP66 says it activates when 950 of the previous 1000 blocks signal for Version 3. However, the client notes say 951 of the previous 1001 blocks. Then BIP66 says it activates using the protocol of BIP34. Now we have three possible methods. They do not match up.

There are only two possible methods, and they're actually the same thing. 950 of the previous 1000 block is the same as the BIP 34 method. And this is actually the same thing as the 951 out of the previous 1001 if you consider a slightly different perspective. Either way, BIP 66 uses the same mechanism as BIP 34. Specifically, they use a function called IsSuperMajority to determine whether they are active. So both use the same mechanism. The issue is with how we describe this mechanism.

The "950 out of the previous 1000 blocks" wording used in BIPs is as I described earlier. It is determining whether the rules are being enforced for block n by looking at the 1000 blocks that precede it. So here n is not included in the count or in the sequence.

The "951/1001" wording includes block n. It looks at the blocks from n-1001 to block n (inclusive) and checks whether 951 of those blocks have the right version number. These two wordings are identical because the 1001 one includes the activation block while the 1000 one does not.

One way to think of the 950/1000 is: after seeing a sequence of 1000 blocks where 950 blocks signal the new version, the next block to be mined must follow the new rules. The new rules are about to begin enforcement.

One way to think of the 951/1001 is: after seeing a sequence of 1001 blocks where 951 blocks signal the new version, the 1001st block in that sequence already enforced the new rules and enforcement has already begun.

Basically humans suck at describing things with words. It's all much clearer when you look at the code.

Now onto the discrepancies. I've written a python script that does the IsSuperMajority check to verify these numbers.

BIP 34

I'm not sure where BitMex got their block height from. Checking that height, and ones before and after it do not result in activation. So I believe this is just incorrect.

Now for 277930 vs 277931, this is an interpretation issue. Like I talked about previously with the 950/100 vs 951/1001, this depends on inclusivity and perspective. At height 277930, a sequence of 1000 blocks was found where 950 had block version 2. So this means that at height 277930, the rules were not enforced for that block, but would be for the next one, i.e. 277931. Bitcoin Core uses 277931 because that is the first block that the BIP 34 rules are being enforced for so that is the value that is in the source code.

BIP 66

The 363724 vs 363725 discrepancy is the same thing as the 277930 vs 277931 in BIP 34.

BitMex's number is a little more confusing. The only way that this makes sense is if they are looking at the slightly difficult activation BIP 66 had. Due to miners spy mining, there was an inadvertent chain fork when BIP 66 activated. Block 363725 was the first block where the new rules were to be enforced. However a miner who had not upgraded found a block 363725. Because he was not upgraded, this block was invalid under the new rules and most of the network rejected it. But a many miners did not fully validate that block and mined on top of it. This turned out to be a significant portion of the hashrate and they ended up producing a fork 6 blocks in length before the valid main chain caught up and overtook them. This happened with block 363731. So one could say that is when BIP 66 activated.

But that's not the end of that story. The next day, there was a 3 block fork due to the same issue. So you could also say that BIP 66 activated a day later.

Either way, BIP 66 began being enforced with block 363725 being the first block under the new rules.

BIP 65

The 388380 vs 388381 discrepancy is the same thing as the 277930 vs 277931 in BIP 34.


Accidentally sent BCH to BTC address... I tried to use the private keys in a BCH wallet to recover, and there's no coins showing

To recover Bitcoin Cash (BCH) from a Bitpay/Copay BTC wallet, please follow the steps below:
1. Within the Bitpay/Copay app, navigate to Settings
2. Select the desired Bitcoin wallet then tap on More Options
3. Tap on the Duplicate ( Bitcoin Cash ) option

Duplicating the BTC wallet will create a BCH wallet in your BitPay or Copay app with the BCH balance.

The option above to duplicate is not available for multi-sig BTC wallets, and you will need to use the recovery tool to recover BCH funds sent to a multi-sig BTC wallet.

Then, please clear your history cache. To do so, please open up your BitPay app and do the following steps:

Settings > Wallet > More Options > Transaction History > Clear cache

And finally, scan for addresses.

Settings > Wallet > More Options > Wallet Addresses > Scan addresses for funds


How does Abe or any blockchain explorer determine transaction size?

What you are looking at is the length of a string of hexadecimal characters. When representing data has a hex string, one byte is represented with two characters.  However the software does not store the block or transaction data as a hex string, it just stores it as an array of bytes which is later represented as a hex string with each byte having 2 characters. So when the software gets the size of the transaction, it just gets the number of bytes stored in the array, and since each byte corresponds to 2 characters in hexadecimal, when you get the hex string, the hex string will be twice as long as the number of bytes that the block or transaction actually is.


Is txindex=1 necessary in the latest versions?

getrawtransaction's behaviour has not changed since Bitcoin Core 0.8 (up until at least 0.14).

It will always work:

For mempool (unconfirmed) transactions
For confirmed transactions that have unspent outputs left.

So, -txindex=1 is only needed in order to query for confirmed transactions of which all the outputs are spent. It also speeds up querying for confirmed transactions in general.


Unconfirmed transaction for 10 days. Please help.

Your listed fee is 44 sat/B.

From this page, you can probably expect anywhere from 30 minutes to 12 hours at that rate.

Since your transaction was submitted more than 10 days ago, I wonder if there is some other reason it isn't getting confirmed?


Points are decompressed by solving for y in the equation used for secp256k1's elliptic curve where x is the last 32 bytes of your public key. The equation is y^2 = x^3 + 7. You will get 2 possible y values, one even and one odd. The correct one is indicated by the prefix byte of your public key which indicates whether y is even or odd.

Note that all operations must be modulo p which is defined by secp256k1's spec as being 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F.

This python script will decompress the two public keys that you have posted:

#! /usr/bin/env python3

import binascii

p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F

def decompress_pubkey(pk):
    x = int.from_bytes(pk[1:33], byteorder='big')
    y_sq = (pow(x, 3, p) + 7) % p
    y = pow(y_sq, (p + 1) // 4, p)
    if y % 2 != pk[0] % 2:
        y = p - y
    y = y.to_bytes(32, byteorder='big')
    return b'\x04' + pk[1:33] + y

print(binascii.hexlify(decompress_pubkey(binascii.unhexlify('0229b3e0919adc41a316aad4f41444d9bf3a9b639550f2aa735676ffff25ba3898'))).decode())
print(binascii.hexlify(decompress_pubkey(binascii.unhexlify('02f15446771c5c585dd25d8d62df5195b77799aa8eac2f2196c54b73ca05f72f27'))).decode())

The uncompressed public keys are:

0429b3e0919adc41a316aad4f41444d9bf3a9b639550f2aa735676ffff25ba3898d6881e81d2e0163348ff07b3a9a3968401572aa79c79e7edb522f41addc8e6ce
04f15446771c5c585dd25d8d62df5195b77799aa8eac2f2196c54b73ca05f72f274d335b71c85e064f80191e1f7e2437afa676a3e2a5a5fafcf0d27940cd33e4b4

Pubkey decompression is completely different and unrelated to address generation. Addresses are generated by taking a public key as is (either compressed or uncompressed) hashing it, and then encoding it. The compression matters because the resulting serialized public will produce one hash (and thus one address) when it is compressed, and a different hash (and thus different address) when uncompressed.

Addresses are encoded by hashing the serialized public key with SHA256 and then with RIPEMD160. The resulting hash is encoded using Base58 Check encoding.

In the transaction you provided, the three public keys:

04ad90e5b6bc86b3ec7fac2c5fbda7423fc8ef0d58df594c773fa05e2c281b2bfe877677c668bd13603944e34f4818ee03cadd81a88542b8b4d5431264180e2c28
0229b3e0919adc41a316aad4f41444d9bf3a9b639550f2aa735676ffff25ba3898
02f15446771c5c585dd25d8d62df5195b77799aa8eac2f2196c54b73ca05f72f27

have the following hashes respectively:

946cb2e08075bcbaf157e47bcb67eb2b2339d242
55af2ea3c45819c6c5ae710d29fcaaced5b00cc7
8b38a8d40e08362046dee55c1c94e7991d7dec75

Encoding those as version 0 addresses with Base 58 Check encoding results in the addresses you are expecting:

1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P
18p4JBHP3EAKCc4jqN8XzuEJtvq8G9NAot
1Dh8oSChJWZQx5sr7ePsBNtw7uKMsNnYNC

The code I used for this is:

#! /usr/bin/env python3

import binascii
import hashlib

b58_digits = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def sha256(s):
    return hashlib.new('sha256', s).digest()

def ripemd160(s):
    return hashlib.new('ripemd160', s).digest()

def hash256(s):
    return sha256(sha256(s))

def hash160(s):
    return ripemd160(sha256(s))

def encode(b):
    # Convert big-endian bytes to integer
    n = int('0x0' + binascii.hexlify(b).decode('utf8'), 16)

    # Divide that integer into bas58
    res = []
    while n > 0:
        n, r = divmod (n, 58)
        res.append(b58_digits[r])
    res = ''.join(res[::-1])

    # Encode leading zeros as base58 zeros
    import sys
    czero = b'\x00'
    if sys.version > '3':
        # In Python3 indexing a bytes returns numbers, not characters.
        czero = 0
    pad = 0
    for c in b:
        if c == czero: pad += 1
        else: break
    return b58_digits[0] * pad + res

def to_address(b, version):
    data = version + b
    checksum = hash256(data)[0:4]
    data += checksum
    return encode(data)

pk1 = binascii.unhexlify("0229b3e0919adc41a316aad4f41444d9bf3a9b639550f2aa735676ffff25ba3898")
pk2 = binascii.unhexlify("02f15446771c5c585dd25d8d62df5195b77799aa8eac2f2196c54b73ca05f72f27")
pk3 = binascii.unhexlify("04ad90e5b6bc86b3ec7fac2c5fbda7423fc8ef0d58df594c773fa05e2c281b2bfe877677c668bd13603944e34f4818ee03cadd81a88542b8b4d5431264180e2c28")

h1 = hash160(pk1)
h2 = hash160(pk2)
h3 = hash160(pk3)

print(to_address(h3, b'\x00'))
print(to_address(h1, b'\x00'))
print(to_address(h2, b'\x00'))

(Base58 encoding function from https://github.com/bitcoin-core/HWI/blob/master/hwilib/base58.py)

As you can see, this does not do any point compression or decompression. Rather it takes the public key as it is and encodes it.


Corrupt wallet.dat file - Try quitting bitcoin and running this again

You should try to recover the wallet.dat with a different data recovery tool, I have good experiences using GetDataBack and PhotoRec. GetDataBack lets you choose different backups/versions of the file system, try all of them.


Does the chainstate leveldb only contain "addresses" for P2PKH and P2SH?

Yes, Bitcoin Core does do some compression of standard output scripts in order to store the minimal amount of data needed.

  Anyway, would I be correct in assuming that you could only get an address from script types 0 and 1 (by base58 encoding the script data)?

Yes

  In other words, the chainstate leveldb does not include any witness data to allow you get addresses for utxos using P2WPKH and P2WSH scripts?

If by witness data you mean Segwit outputs, no. ALL output's scriptPubKeys are stored in the database, otherwise it would be unable to verify transactions that spend arbitrary scripts and segwit scripts. These scripts are stored without special compression (i.e. the type stuff going on here) and just serialized as is. Segwit outputs are already in a minimal form so there is no need for a type here.

Since all scriptPubKeys are stored in the database, you can compute the address for every UTXO if it has one, including segwit UTXOs.

Also, the term witness data refers to the signatures and input data for a transaction that spends a segwit output. It does not refer to anything that is segwit related. Using the term "witness data" in your question is confusing.


Paper wallet creation, how safe is this approach?

Sounds pretty safe to me. You should always consider that any machine that is connected to the internet at any time (and some that are not) can be compromised. The questions are, are you a likely target? Do you download or browse sites with questionable items (eg are you infected by something, or COULD you be)

Personally, i just run a VM, it's not connected to any network, i use the vmware client to reach it, i follow your steps 3 & 4 (although I use chrome) and then i reset the vm to a snapshot.


what happens to your funds when wallet provider packs up?

Electrum is an open source project, it is not a company. Even if all the volunteers working on the project right now decided to abandon the project, the wallet is all open source so anyone can pick up where they left off.

It is not possible for "Electrum wallet service" to no longer be available because anyone can run the Electrum server that Electrum requires. The 12 recovery words by itself are sufficient to recover all your funds. You will either need to connect to an Electrum server in order to do so or run you own Electrum server. Even if that's not an option for whatever reason, you could also regenerate all your private keys from the electrum seed and import them into any other wallet.


Why is my Bitcoin wallet always out of sync?

New blocks are continuously being created (about once every 10 minutes).

So if you don't leave your client continuously connected, or when you're connecting for the first time, then when you do connect it will be out of sync and need to download and verify new blocks.

There are SPV (Simplified Payment Verification) clients (e.g., MultiBit and Bitcoin Wallet for Android), client-server clients (e.g., Electrum), and hosted (shared) EWallet web services (e.g., CoinBase, Paytunia, and others) -- each of which either lessen or eliminate the need to sync.

One method that brings the convenience of an EWallet but keeps the private keys local and not stored with the provider is Blockchain.info/wallet.

http://www.Blockchain.info/wallet

That might be a better client if keeping your client connected continuously is a problem for you.


Bitmain says that have tested ASICBOOST on the Testnet but have never used ASICBOOST on the MainNet...

  Bitmain has tested ASICBOOST on the Testnet but has never used ASICBOOST on the mainnet as implied in Gregory Maxwell’s proposal. We ask conclusive proof from whoever claims this to be false because such baseless claims are toxic for the Bitcoin space. We also believe the math used by Gregory Maxwell is incorrect and that the method is not practical in a production environment.

They also say that the chips they use for their miners have a circuit design that supports ASICBOOST...

  Our ASIC chips, like those of some other manufacturers, have a circuit design that supports ASICBOOST. However, the ASICBOOST method has not been used by us on the mainnet. We have not seen any evidence yet on the main net that anyone has used it in the patented way.

They even hold the patent in China for ASICBOOST...

  Bitmain holds the ASICBOOST patent in China. We can legally use it in our own mining farms in China to profit from it and sell the cloud mining contracts to the public. This, however profitable, is not something we would do for the greater good of Bitcoin.

And They say they don't use ASICBOOST on their mining farms...

  The mining equipment produced by Bitmain for its own use is in no way intended to be technically superior or more power-efficient than the equipment it sells to the public. The ASICBOOST method has not been employed by Bitmain to increase the power-efficiency of the miners in its own mining farms.

But they also say that whether ASICBOOST is used or not, they will continue to produce more efficient miners...

  Bitcoin mining equipment depreciates rapidly. Bitmain has constantly been introducing newer more efficient miner models for all. As such the statement that the deployment of ASICBOOST, which can lead to a 20% difference in power efficiency, is some kind of negative development for Bitmain’s business model is false. Bitmain has shown the ability to adapt and thrive in the constantly changing and extremely challenging Bitcoin mining environment. Whether ASICBOOST is used or not, Bitmain will continue to produce more efficient miners.

Given on how secretive Bitmain is and the nature of their business they could be using ASICBOOST but they also could be telling the truth and not be using ASICBOOST. Right now it seems that you can't use ASICBOOST on an s9.

Source:

Bitmain Blog


How do I get transactions from the Bitcoin Blockchain with bcoin?

SPV Node

SPV node watches your addresses on network broadcasts.
So on SPV Nodes you won't be able to grab other transactions then your address. It communicates with other peers, fetches your transactions using bloom filters and then watches pool broadcasted transactions. So you only get transactions that are addressed to your wallet.

Full Node

With fullnode, there are two places bcoin looks for tx:

Mempool
Chain

Bcoin will always return transactions from mempool.
If you want to get transactions from chain, either by address or by transaction Hash, you need to enable indexing: index-address and index-tx respectively.

You can check RPC docs: RPC-Docs


Some more info by upb from #mtgox:

 so there IS some underlying bug which was triggered that caused invalid order matching
<@MagicalTux> yes, but it requires a large amount of funds to be triggered
<@MagicalTux> normal users, unless millionaire, wouldn't trigger it
< upb> must be some kind of integer overflow ;-)
<@MagicalTux> it happens when an order executes way too many orders at once
<@MagicalTux> I'm adding some code to avoid this from happening, but nobody in their right mind would do that

This actually reminded me of about 2-3 Weeks ago when I noticed a bug and reported it on #mtgox.

The bug worked as follows:

I had a buy order at, let's say 1 BTC for USD 10.0, last trade was 10.001
someone partly filled that order, let's say he filled 0.3 BTC
this had the effect of my order being in state "pending" with 0.7 BTC for USD 10.0
while my order was pending, a lower order (say at USD 9.99) was filled

I complained and a short while after, MagicalTux said he found the problem and fixed it.

I don't know if this could have anything to do with the current problem, but "it happens when an order executes way too many orders at once" sound kind of like this could be the case.

I also remember someone suggesting this above bug could be exploited to disable a lot of orders in order to "get to" an order that would normally be well out of spread. Maybe someone managed to pull off this exploit. That would also match MagicalTux saying something about 2000 accounts being created. Maybe these accounts were used to "disable" orders by filling a small part of them successively in order to execute an order well out of spread.


What is the purpose of the block time/ difficulty in mining?

Why can't a random miner just be selected instantly and therefore bypass any block time?

The problem is: how do you select a miner in a truly random way? If the mining process was just a simple random election, who gets to enter in that lottery? How would you stop someone from just running a million fake nodes, in order to increase their chance of being selected?

These are the sort of problems that are solved by Bitcoin's proof-of-work mining. In a proof-of-work scheme, a miner must expend computational resources in order to 'enter the lottery', there are no 'free tickets', if you will.

Proof-of-work also provides a mechanism of security: in order to change the blockchain history, an attacker would need to redo all of the work from the point of change onwards. To do so, they would need more computational power than the rest of the network (51% or more). A simple 'random election' would not include this 'real world resource expenditure', or the type of security it provides.


Why would the attacker target new cryptocurrencies?

Why not? He has the same reasons as you to create blocks

  What changes in the code i have to implement to prevent the 51% attack?

Disable decentralization. Allow mining from one pubkey/address only :)


"Relay fee" error when sending funds from one account to another

You need to increase your transaction fee to meet the minimums required by the node you are connected to. If you use a fee below that, the node (and other nodes on the network) will refuse to broadcast your transactions, preventing them from reaching miners.


Block height is by definition sequential in the sense that adjacent blocks will always have heights that differ by 1.  But there is a chicken-and-egg problem: in order to compute the height, you have to have access to all the blocks in between the genesis block and the current one.  (The height is not recorded in the block itself.)

There's also the issue that multiple blocks can have the same height, if they are on different branches of the chain.  So just because you have one block at every height, doesn't mean you have all the blocks on the main chain; some of them might be on orphan branches.


CGMiner doesn't come with support for that particular miner by default. I believe you have to get the driver for it. You can use bfgminer, which from 5.3.0 supports your miner out of the box.

Instructions from https://bitcointalk.org/index.php?topic=1173963.0

  The stickminer will enumerate as an antminer U3 on cgminer (if the version of cgminer you're using supports the U3), and should run fine.  It may give warnings about "no valid hashes within 3 seconds" but this is fine, as the U3 has a higher hashrate, confusing cgminer but not noticeably affecting performance.  If your hardware errors are low you're fine.  These older version of cgminer do not allow a clock rate over 250MHz.  This is pretty good for most people as that's moderately high power but in theory the chips will run up to 500MHz.

  Luke Jr added bfgminer support in bfgminer 5.3.0, so you may use that
  version of bfgminer.

  I (novak) have written a cgminer driver which enumerates the compacs
  as expected, removes the error, and ramps up the clock slowly to
  prevent spikes on USB power.  My custom cgminer can be found here:
  source code: gekkoscience.com/misc/cgminer-gekko.tar.gz win32 binary:
  gekkoscience.com/misc/cgminer-gekko-win32.zip EDIT: The current
  version supports bitshopper compacs as well, and can be (and is, in
  the case of windows) compiled with icarus support.

  I have not yet tested it but edonkey was nice enough to upload a
  custom minera image with cgminer-gekko enabled as a custom miner.  You
  can set the frequency under manual options as: --compac-freq 150.
  Link:
  https://dbtbmm05cubzd.cloudfront.net/cryptocurrency/mods/minera_compac_mod.zip

  On the engineering sample sticks you can only use old cgminer as the
  newer drivers for both cgminer and bfgminer depend on a hexfile
  flashed to the cp2102 which the engineering samples do not have.

  If you need to run cgminer on windows (either stock or mine), you'll
  need to install the zadig driver.  You can find it here:
  http://ck.kolivas.org/apps/cgminer/zadig/

  Run the program and install the winusb driver for the compac(s) that
  you have plugged into your windows machine.  You may need to replug
  the compacs afterwards while cgminer is running to get them to start
  mining.

  =========

  =How to Run=

  Old cgminer: To build use --enable-icarus flag.

  ./cgminer -o stratum+tcp://stratum.mining.eligius.st:3334 -u

  1BURGERAXHH6Yi6LRybRJK7ybEm5m5HwTr --au3-freq 150

  GekkoScience cgminer: To build use --enable-gekko flag.

  ./cgminer -o stratum+tcp://stratum.mining.eligius.st:3334 -u

  1BURGERAXHH6Yi6LRybRJK7ybEm5m5HwTr --compac-freq 150

  bfgminer:

  ./bfgminer -o stratum+tcp://stratum.mining.eligius.st:3334 -O

  1BURGERAXHH6Yi6LRybRJK7ybEm5m5HwTr --set compac:clock=x0b83


What are some http mining pools out there?

Sounds like you need to use getblocktemplate. If you do an http POST to http://gbt.mining.eligius.st:9337 with a body of:

{"id": 0, "method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}]}

You should get a transactions to process. See https://en.bitcoin.it/wiki/Getblocktemplate for more information.

I can't find many other sites that support GBT but there is a list of compatible pools in the above link as well.


There's 2 versions of ASICBOOST:

Overt where miners use bits in the version number as extra nonce space
Covert where miners "mine" merkle trees with 4 bytes collisions

The overt version is very easily detectable, whereas the covert one isn't.

To mine these merkle trees for the overt version, miners need to shuffle the transactions in the block.

Without Segwit transactions in a block, it is possible to do it in a very low number of SHA-256 operations ; with Segwit transactions, a change of order forces miners to recompute the witness commitment which is stored in the coinbase. That makes it way more expensive to mine merkle trees and destroys the advantage covert ASICBOOST provides.

You can find a detailed explanation here.


Is using a new address for each transaction pointless when applied to a donation button on a private website?

A new address for each transaction is used for anonymity most of the time. For a donation website this isn't isn't that useful. Most people reuse because they feel that their address could be remembered and identified later on, even though this is hard to do it is possible.

Unless you want it to be hard to tell who and where the bitcoins are, it's better to reuse and not have to have a complex system that generates and keeps track of generated addresses.


How do I create a wallet with a 24-word phrase?

Use the command make_seed(264) in console for Electrum wallet

A typical seed has 12 words, which results in 132 bits of entropy in the choice of the seed.

https://electrum.readthedocs.io/en/latest/seedphrase.html


Can someone explain those free 0.00000001 BTCs?

You are right. This is a kind of advertisement which targets bitcoin users to spend bitcoin in a particular service. Something like an booklet which people in store are giving you when you have used their service.

But keep in mind that blockchain public note is not a function of bitcoin itself (by this I mean that you can not add it though bitcoin client). This is a service offered by blockchain.info and they just add this by attaching a field to their database. You can read more about it by reading their FAQ in the section public note.


Why does bitcoind not recognize the uncompressed version of my address?

Compressed and uncompressed keys are treated completely separately. Funds sent to the compressed point address will not be available to a client that has the uncompressed key in their wallet.

That is to say, although mfjsW5m8CL5EazGBvjutZ4dgJwd6AjHM11 and n2HCyN8GWPuc8CrwbiiBASCS7iWku3Ke8S have the same private key, they are treated as completely separate to the Bitcoin network. Ideally they would be treated the same, but compressed ECDSA keys just weren't considered by Satoshi originally, it's only a more recent addition (sipa's, probably) to the client.


What is the difference between P2SH redeem script on Bitcoin and on Litecoin?

If you signed your Bitcoin transaction with only one key, you would see the same behavior.

What you are observing is how Electrum handles partially signed transactions. It does not produce the correct scripts until the transaction is fully signed. What you see as the public key in your transaction is just how Electrum internally represents public keys.


Will people not spending their Bitcoin cause Bitcoin to fail?

I beg to differ.  If you go to https://blockchain.info/, and look at the 'latest transactions', you'll see numerous transactions taking place continuously.  Also, there is a quite a bit of discussion within the bitcoin community about the need to increase the limit of 7 transactions per second, and ways that this limit can be increased.


How is Electrum able to find my default wallet even though I deleted it?

Oh, I had another instance open to another wallet. It must have kept all the wallets in memory. When I closed the last instance, it wrote another default_wallet to disk.


What happens to bitcoins if the site shuts down?

The ledger of Bitcoin balances is stored on a network comprised of thousands of individual computers around the world. Anyone can run the Bitcoin program which contributes to that network and stores the record of every transaction that has ever happened. This is what is called a peer-to-peer network or a decentralized network.

There is no website that controls Bitcoin, but there are websites that pull information from the network and present it to you. You can trust them to store and report to you that data, but using the program itself on your computer is the most secure way to handle your funds, and it has the added benefit of also securing the network a bit more.

There are many websites which do the work of downloading the program and managing your Bitcoins for you - in the same way that paypal manages your money on their website. If you trust paypal to not decide to "freeze" your funds for no apparent reason, which they have MANY TIMES before, you would deposit money into their website. It's exactly the same with a Bitcoin website that stores your funds. However, a very notable benefit of Bitcoin is the ability to securely store your coins on your PC, which is not possible with cash. Additionally, as long as you hold the wallet file or technically the private key that is assigned to the program on your PC, your Bitcoin can never be frozen by anyone. The only requirement for spending those Bitcoin in the future is that you have your wallet file (or your private key) and that the network still exists. Currently the network is only getting bigger as the days pass.

There are questions that follow after understanding this answer, such as how transactions are validated if there is no central authority, and there are considerably sufficient answers to those questions elsewhere on this forum and other places online.

I suggest you check out https://www.weusecoins.com/en/questions -- it has the answer to many of the preliminary questions you may have, and the main page also has a quick video which does a good job of explaining the concepts to newcomers.


How to generate multiple public addresses using one private key?

You can use extended private key, which is basically other form of expressing mnemonic words. It is string similar to normal private key, but is longer and begins always with "xpriv....". The idea is that you have extended private key and corresponding extended public key. The later enables to generate, say, unlimited amount of addresses and ext-priv-key enables to spend coins sent to that addresses.

If you have just single normal private key, there is no standardized way of generating multiple public keys.


How to change the data directory with bitcoin-cli?

you should use it like this bitcoin

bitcoind -datadir=/your/external/path

Hope this helps!


Nope. PC mining became unprofitable in ~2014 so you may not have mined bitcoins.

What you probably did was downloading Bitcoin Core and synchronising it (downloading and storing all the Bitcoin transactions)

Sorry, but you probably haven't earned bitcoins.


Are there any API servers available for alt-coins that allow for transactions to be broadcast into their networks?

I have written a program in python that does exactly this for Litecoin, Bitcoin, and Dogecoin. The program can connect to peers on any of the above mentioned crypto network and submit the transaction directly instead of relying on a third party central server to push the transaction out to the network.

It is available open source under https://github.com/kaykurokawa/pushtx


Does each miner in a bitcoin mining pool has a chance to win the block reward?

OR XYZ gathers together hashing power of miners 1 to 10 to try to be the first to solve the puzzle to win 12.5 BTC ?

XYZ assigns work to miners in its pool. The work mines blocks that pay BTC to the pool's distribution account. When a block is mined, the pool distributes from the distribution account.

  Is it possible for a solo miner with 10+ GPU rig to win 12.5 BTC block reward even though mining pool XYZ has much greater combined hashing power? I mean is there randomness also involved in wining block reward in addition to hashing power?

Yes. Everybody who is trying to mine a block has the same chance of succeeding with each hash they do. Mining a block is so hard that somebody somewhere succeeds on average once every ten minutes.


The data directory (~/.altcoin) is created when the software is run, not when it is being compiled. Compilation has nothing to do with the datadir.


TL;DR: Bitcoin has been declared a legal form of payment which is not the same as an official currency.

I think that it may not be clear what a "legal form of payment" means and how this differs from the official currency of a country.

"Currency" usually refers to a form of money issued by a government, which makes "cryptocurrency" a misnomer to some degree.
Currencies generally have a high level of protection and status in their country, for example the nation requires the taxes to be paid in terms of the currency and usually requires its population to accept the currency as a means of payment. However, first and foremost the currency defines the unit of account that is being predominantly used in the country.

Yet, nations recognize a number of different ways to settle obligations explicitly which are sometimes called "legal forms of payment". These may be different forms of transferring the nation's currency, but can also be other forms of money. For example, if you are using a form of money that the nation has not recognized as legal form of payment, in the case of legal dispute it may first need to be established whether the payment was valid in the first place, and if the payment is not recognized as such, the value may be lost.

Some examples of legal forms of payment are cash, money orders, checks, and wire transfers, and in most countries also digital payment networks such as PayPal. Although uncommon, payments settled in foreign currency will also be recognized. In some regions around the world there are local currencies that aim to encourage commerce in their region. Often these regional currencies are tied to the national currency, but given out at a discount, e.g. the Reka-checks can be bought by employees in Switzerland for 3-20% less than their face value but only used to pay for tourism services in Switzerland.

To my understanding, what happened in Japan a few days ago was the recognition of Bitcoin as a legal form of payment. This does not give Bitcoin a special status, except that value transfers performed with Bitcoin are now explicitly recognized as payments in Japan. Similar things have happened in the past, e.g. when Germany declared that Bitcoin would be treated alike to a complementary currency, or (IIRC) Belgium declared that it would treated like foreign currency.

An overview of the current legal status of Bitcoin in the world can be found on Coin Dance.

Note: I'm neither a lawyer, nor an economist.


Why do I have a socket.timeout with python-bitcoinlib?

Change the timeout inside the file bitcoin.conf or when you start the bitcoind,

This is an example

##
## bitcoin.conf configuration file. Lines beginning with # are comments.
##
# On client-side, you add the normal user/password pair to send commands:
rpcuser=alice
rpcpassword=bob
rpcclienttimeout=200

or you can run the bitcoind with this command bitcoind -rpcuser=alice -rpcpassword=bob -rpcclienttimeout=200

Or you can change the setting lib to the code, try this example

from bitcoin.rpc import RawProxy

# Create a connection to local Bitcoin Core node
p = RawProxy(None, None, None, 120)

# Run the getblockchaininfo command, store the resulting data in info
info = p.getblockchaininfo()

# Retrieve the 'blocks' element from the info
print(info['blocks'])


Can I spend from multiple wallets in Electrum (or somehow import/merge them)?

You could export the private keys from all the wallets you wish to send from, save them to a file. (Wallet->Private keys->Export (to .csv) , open in Excel and copy the private_key column to a new file)
Build a new wallet with imported private keys on Electrum (File->New/Restore->[+] Import Bitcoin Addresses or private keys)
The new wallet would contain all addresses you wish to spend from


What happens to bitcoin transactions that are unconfirmed during the hard fork?

If the transactions are still unconfirmed after the hard fork has occurred, you will only receive the coins on your Bitcoin wallet, not the Bitcoin Cash wallet. In that case, Coinbase still holds all of your Bitcoin Cash coins.


Unable to bind any endpoint for RPC server

Here's how you fix the rpcbind issue with the latest change in version 0.18.0.

Before 0.18,  if you put rpcallowip=0.0.0.0/0, the value of rpcbind didn't need to be set as it defaulted to all interfaces.

Now that is no longer the case.  Here's my setup, for running bitcoind in a container through Docker compose:

rpcallowip=0.0.0.0/0
rpcbind=127.0.0.1
# local DNS name (container name used in my Docker Compose file)
rpcbind=bitcoind

The first rpcbind is so I can make RPC calls from inside the container.  The second is so other containers can reach the bitcoind container.

I think this does what you want:

I can RPC from inside the bitcoind container
I can RPC from another container on the same network (as specified in the compose file) to the bitcoind container
I can RPC from my localhost outside the container.

For the last, I exposed port 8332 to my localhost in the compose file and I can curl to the container:

$ curl --user user --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }'  -H 'content-type: text/plain;' 127.0.0.1:8332/
Enter host password for user 'user':
{"result":"0000000000000000000ece9381a7e0a4020353f4adde7b560a6b2840d5d44cfa","error":null,"id":"curltest"}

The full details of my container setup are here, in case there's something I missed in writing up my answer.


Is the bit encoding format for the graphic in BIP 68 implicitly little-endian?

All fields in a Bitcoin transaction are little-endian encoded except for the signature fields and the public key fields which are both DER and big-endian encoded since they were originally produced by an external library that uses these encodings.

  Would it be prudent/responsible for the BIP 68 Standard to make it
  clear whether the bit-encoding is natively little-endian or
  big-endian?

I think this information belongs in the protocol documentation, not necessarily in the BIP.


Is it possible to collect bitcoins? (as a collectors item)

Well, first of all, there are the physical Bitcoins for one thing, which can be collected and traded neatly.

If you wanted to trade such historical Bitcoins, you'd probably need to follow some rules. For example, if you were interested in having pure Bitcoins and as close to the original transaction as possible:

Any Bitcoin that is a part of a given transaction, or a specific input is 100% pure and 0 removed.
Any Bitcoin coming from a transaction of purity p and removed status r is p% pure and r+1 removed.
Any Bitcoin coming from a set of transactions, one with purity p and quantity q1 and any others of total purity 0 and quantity q2, would be p*q1/(q1+q2) pure and again, r+1 removed.
You also have to take into considerations blocks that collect transaction fees for all of this, but I'd consider them to be 0% pure.

So, in the end you would be collecting your beloved Bitcoins to one or more addresses you
own and not spend them, you'd value transactions that are closer to the source and less diluted. If you'd want to flaunt your collection, you'd just show the unspent Tx list and sign some message with your private key. If you'd want to sell any collected Bitcoins, you'd just create a transaction from one of the unspent transactions, and hopefully not spend any coins on transaction fees, as that would make them more and more scarce.

I hope that covers everything. It was an interesting food for thought.


Grubles has written up a guide for how to set up a blockstream satellite node: https://medium.com/@notgrubles/building-your-own-bitcoin-satellite-node-6061d3c93e7. That should be helpful; it includes links to amazon where you can buy all of the materials required.


Sent Bitcoin to wrong email address on Coinbase.com

As MeshCollider suggested, try to create an account with that email and see what happens.


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

Bitcoin by default will not make more than 8 outgoing connections, and -maxconnections only controls how many incoming connections you allow. Feel free to set this higher, but it will take time before others connect to you in large numbers.

Please don't change this, as there is no need. Connectable peers on the network are a scarce resource, and essential to the decentralization. If people go try connect to all of them like some sites do, we'll very quickly run out.

In case you're a merchant or miner, you perhaps want to set up a few fixed connections to trusted others (see the -addnode command line/config option), but having more connections does not mean stronger verification (the reference client always verifies everything) or even faster relaying (as you'll slow down by distributing new blocks and transactions to all your peers). It is mostly a matter of providing a service to the network.


The 32-bit signed integer timestamp runs out in 2038. But Bitcoin uses a 32-bit unsigned integer for the timestamp. That runs out it the year 2106. We'll have to find a solution by then, not by 2038. Since that is still a long ways off, there is no plan for changing the timestamps yet.

Whatever happens would not affect existing blocks. The same thing would happen as with any other fork: blocks prior to the activation block are verified with the old rules, and blocks following activation are verified with the new ones. So old blocks would use the current timestamp stuff and new ones would use whatever new scheme is created.


Unconfirmed txes disappeared in my own bitcoind's mempool

Problem solved. I changed to maxmempool from 300MB to 1GB.

And Murch's comment is what I wanted to know how to transactions leave the memory pool. Thank you!

  Transactions that you're sending yourself should never leave your mempool unless manually evicted or becoming invalid when a doublespend is confirmed. Foreign transactions get evicted after 14 days (previously 3 days), or when mempool is full by lowest fee rate first. You might also be interested in How do transactions leave the memory pool?

Especially, I wanted to know the delete order.

  when mempool is full by lowest fee rate first.


Is the reward for successfully mining a block a transaction on the bitcoin network?

Yes, it is known as a coinbase transaction. It is the first transaction in every block and has some slightly different rules to all others. It has blank inputs, can not be spent for 100 confirmations, and can create a maximum of the current reward amount plus the fees collected in that block.


Bitcoind, Multisig, and the default account ""

If anyone is looking for the answer, Gavin Andresen posted it on bitcointalk.org.
https://bitcointalk.org/index.php?topic=567321

Transactions send via sendrawtransaction are always debited from the default "" account. Raw transactions and accounts are not designed to work together, use one or the other .
And preferably not accounts: unless somebody steps up and volunteers to make the accounts feature "industrial-strength" (scalable, integrates with whatever back-end database your company is using to track user information, can be robustly backed up, etc) it is very likely it will be deprecated and then dropped.


What's the minimum transaction with bitcoin?

You can send any number of bitcoins to anyone, even 1 satoshi (see exceptions below), which is 0.00000001 BTC (about 0.00001031 USD)

However for such small amounts you may not want to include a transaction fee.

There is no minimum transaction fee. However if you send a transaction without any fee you can expect a significant delay in it getting into the blockchain and therefore getting it confirmed. I have tried this recently and it took around 18 hours to get the first confirmation for my transaction. Others have mentioned even higher delays (up to 2 days) in some cases.

It is currently the norm to include a fee of 0.0001 to 0.0005 (approximately 10 to 50 US cents at current exchange rates), resulting in a fairly speedy entry into the blockchain (meaning on average 10 to 20 minutes wait for the first confirmation).

Please note it doesn't make a difference if the transaction happens on the same LAN or even between 2 of your own addresses in the same wallet. If it needs to go on the blockchain the fee should be included unless you are prepared to wait.

So in practice, the smallest amount you want to send is one that makes sense taking into account that fee.

In some circumstances, some bitcoin clients will not even allow you to send a transaction without a fee. This is when your transaction size (in bytes, not the BTC amount being transferred) is over a certain limit. In those cases the client will notify you and ask you to confirm the sending of the fee or cancel the transaction. You can bypass this limit with other clients, but for the same reasons explained above is not something I would recommend.

Finally, to take your example of $20 USD, at current BTC/USD exchange rate of $1034.52 you would simply send 0.01933264 BTC + 0.0001 fee.

Exceptions: As @CoinEnablers mentioned in the comments below, in order to fight transaction spam, some measures have been recently introduced to limit very small transactions (so called "dust" transactions). As far as I'm aware these are not changes to the protocol, but simply new default configurations on both clients and miners' software, that makes it fairly hard to get very small amounts accepted. Currently I believe the minimum value accepted by default is set at 5460 satoshi.


If I import/restore a deterministic wallet into Bitcoin Armory, how far into the dynamic addresses does it look for transactions?

By default, Armory will check 100 addresses, but this can be changed with --keypool command-line option.