How do I create a new address in Electrum? In Electrum, there is no "New Address" button to be found. I tried under the tab Addresses, but nothing there. If I go to Console and try create(), then it returns:

Traceback (most recent call last): NameError: name 'create' is not defined

(despite create being listed under help)

If I click new under Receive then it says No more addresses in your wallet. At this point I'm not sure what else I can try...

With Electrum 2.x, a wallet can contain either keys you've imported from elsewhere, or keys which are generated (deterministically) by Electrum. You cannot store both types of keys in a single Electrum 2.x wallet.

Since your wallet is of the former type, Electrum will refuse to generate any new keys for your wallet. I suspect the reason for this is to make it as clear as possible what you need to back up: with your type of wallet, you are responsible for backing up all of your individual keys. With a deterministic wallet, you need only write down and store your one recovery seed.

You have two options:

Create a new wallet (File -> New/Restore), choosing a new "Standard wallet" when prompted. Be sure to write down your recovery seed and keep it in a safe location!
Create additional keys via some other means, and import them into Electrum (Wallet -> Private keys -> Import), and handle your own backups.

I'd choose option 1 if I were you....


isn't miner collusion rational? suppose for the sake of argument that each individual miner has the same amount of hashing power of one hash per unit of time (a "tick").

the probability that a miner solves their block in the next tick increases with the number of hashes already checked, since the nonce space is finite.

colluding miners could agree to pay the coinbase transaction to the same address and thus work on solving exactly the same block.  they could divide the nonce space amongst them and thus exhaust the nonce space faster than solo miners.

by agreeing to redistribute the rewards of their mining amongst them, the colluding miners have an expected payout for the next tick that increases faster than that of solo miners, since they are exhausting their nonce space faster.

so isn't it rational for miners to collude?  could this create a tendency to monopoly in mining?

No. Your premise is wrong. There is no guarantee a solution exists in a range. If a miner exhausts a nonce range he changes other components of the block header. Mining is a Poisson process with each hash attempt independent of any others.

Hence, there is nothing to gain with this particular kind of collusion. Of course, pooled miners enjoy less variance than solo miners (which is legitimate), and there are other methods of attack.


Solving Bitcoin core's 'ActivateBestChain failed' I'm running bitcoin core version 0.16.2 on the Testnet and realized that it had stopped receving blocks after the 1414433.

I tried running bitcoin core with options -reindex and -reindex-chainstate without success.

I have delete all the data and restarted syncing again, but ended up in the same problem

PS: I am running in pruned mode

What I've encountered in the debug.log is:

2018-09-28 16:43:38 UpdateTip: new best=00000000cb7df9801f21ccb4192844281d7da224d2213514050a8ad9a6d9ec7e height=1414432 version=0x20000000 log2_work=71.629388 tx=47735936 date='2018-09-27 03:27:30' progress=0.999747 cache=81.4MiB(531804txo)
2018-09-28 16:43:38 UpdateTip: new best=00000000210004840364b52bc5e455d888f164e4264a4fec06a514b67e9d5722 height=1414433 version=0x20000000 log2_work=71.629388 tx=47735938 date='2018-09-27 04:03:19' progress=0.999751 cache=81.4MiB(531807txo)
2018-09-28 16:43:38 ERROR: DisconnectTip(): DisconnectBlock 00000000210004840364b52bc5e455d888f164e4264a4fec06a514b67e9d5722 failed
2018-09-28 16:43:38 ERROR: ProcessNewBlock: ActivateBestChain failed
2018-09-28 16:43:39 ERROR: DisconnectTip(): DisconnectBlock 00000000210004840364b52bc5e455d888f164e4264a4fec06a514b67e9d5722 failed
2018-09-28 16:43:39 ERROR: ProcessNewBlock: ActivateBestChain failed`

[...]

2018-09-28 16:56:17 connect() to 78.47.24.41:18333 failed after select(): Connection refused (111)
2018-09-28 16:56:44 connect() to [2001:0:5ef5:79fd:38b6:55d:3788:c387]:18333 failed: Network is unreachable (101)
2018-09-28 17:01:12 ERROR: DisconnectTip(): DisconnectBlock 00000000210004840364b52bc5e455d888f164e4264a4fec06a514b67e9d5722 failed
2018-09-28 17:01:12 ERROR: ProcessNewBlock: ActivateBestChain failed
2018-09-28 17:09:07 connect() to [2003:ea:9bde:5600:1180:6df2:ba35:efd]:18333 failed: Network is unreachable (101)
2018-09-28 17:13:23 connect() to 45.55.161.7:18333 failed after select(): Connection refused (111)
2018-09-28 17:14:19 Potential stale tip detected, will try using extra outbound peer (last tip update: 1841 seconds ago)
2018-09-28 17:14:24 New outbound peer connected: version: 70013, blocks=1414565, peer=24

It seems to me that maybe block 1414433 is orphaned. How can I overcome this problem?

That block is not just orphaned, it is actually invalid. It exploits CVE-2018-17144. The only way to fix this error is to upgrade to Bitcoin Core 0.16.3 and begin a reindex following the upgrade.


Multibit: Whats the best way to proceed if I have forgotten my password but my wallet is still open I am running multibit.  I have less than half a bitcoin.  I realised today that I have totally forgotten my password.  My wallet is still open so I can still use it to pay for stuff.  Can I create a new wallet in multibit and transfer the bitcoin balance to that without having to retype me password or logging out of my current wallet?

Multibit will prompt you for a password regardless of whether you are sending it to your own wallet or not. This is by design, since if it didn't do this, it would allow anyone who can access your laptop to transfer bitcoins from your encrypted wallet by sending it to the unencrypted wallet first.

Sorry but unless you made an unencrypted backup of the wallet in the past, your coins are lost if you can't recover your password.


blockchain size issue I am running full bitcoin node locally. Currently, the size of the blockchain is around 70 GB.
Blockchain size

Further, I stored all the blocks in a text file in json format. It turned out that the size of this text file is around 10 GB. I am wondering what is the rest of the 60 GB used for?

Your code stores only the results of the getblock call. This returns the block headers and the tx hashes of the block, but NOT the actual tx's themselves.

Each transaction hash is only 8 bytes, an actual transaction is roughly 500 bytes, so you're missing about 500 bytes per tx in each block.

There have been about 116 million transactions in the history of bitcoin, so 500 * 116 million ~ 60 billion bytes or about 60 GB that you're missing.


What are the major technical differences between Bitcoin and Bitcoin Cash? For a research project I'm trying to detect the major technical differences between Bitcoin and Bitcoin Cash. I know that BCH uses a larger block size and does not support SegWit. But what other differences are there?

I know this is a broad question - I'm looking for an overview only, not an exhaustive, detailed list.

In particular, but not exclusively, I'm interested in:

Which features are only implemented in one of both chains?
Do the data structures differ (blocks, transactions, inputs, outputs)?
Is there a difference in which script instructions are supported?
What about addresses and address types?
Do both chains commonly implement the same BIPs or are BIPs usually exclusive to one chain? Is there a list of which BIPs are implemented in which chain?
Overall, what's the best approach to track past and future changes in both chains? Can you recommend any resources on that issue?

Finding differences by looking at the code does not seem practical to me given the time it'd take me to pinpoint and understand all changes. I used git log --oneline master --reverse on both chains and diffed the results to get some insight, but it's still hard to detect changes that are relevant to me.

Bitcoin

Has SegWit and it's benefits and costs:

Code complexity (of acceptable amount)

Witness data is discounted in SegWit transactions, somewhat rectifying the fact that outputs are cheaper to create than to spend.

3rd person malleability fix for SegWit transactions

RBF transactions (optional, destroys 0-conf)

Compact Blocks

Ability to soft-forks to introduce new opcodes for SegWit transactions.

Quadratic hashing fix for SegWit transactions

Bech32 address format bc1... for SegWit transactions.

More secure P2SH addresses is Bech32 is used (no 160-bit hash function)

Signature covers value for SegWit transactions (useful for hardware wallets)

A longer list can be found here
Bitcoin Cash

Larger blocksize cap

Half-yearly hardfork (so lots of work for developers)

Obligatory quadratic-hashing solution (based on Bitcoin's segwit sighash algorithm) (In Bitcoin, it's opt-in, because SegWit is, hence Bitcoin doesn't solve the attack vector)

Signature covers value (useful for hardware wallets) (based on Bitcoin's segwit sighash algorithm)

220 bytes OP_RETURN (No incentive for destructive data publishing methods such as P2SH-wrapped multisig)

CTOR transaction ordering (permuting leaves of a merkle scheme is not allowed for block templates, only one possible order)

OP_CHECKDATASIG (based on a feature in the Elements Alpha project)

OP_: CAT AND OR DIV ...

Custom difficulty adjustment algorithm (This isn't feature. Little coins like BCH need more time-sensitive algorithms while large ones like Bitcoin need more precise ones that work over large time intervals)

Banned 64-byte transactions (Merkle leaf vulnerability resolved)

CashAddr address format (a modified version of the bech32 address format used for segwit addresses in Bitcoin)

Schnorr signatures beginning with 15th of May (using a specification based on a BIP originally proposed for Bitcoin)

Graphene, which is Compact Blocks but much more efficient since CTOR was introduced (it may work on Bitcoin too, this isn't a protocol feature)

And the larger difference is Bitcoin favors off-chain scaling while BCH favors on-chain. It won't matter in the long term, because off-chain protocols such as Lightning will come to BCH anyway while off-chain scaling needs on-chain scaling as well in the long term


Do miners check whether a transaction is segwit or non segwit? When a transaction is pushed directly to a miner does it check whether the transaction is segwit or not or only if it is valid?

The miner only determines if it is valid. Miners do not, in a sense, "discriminate" between Segwit or Legacy.


How do exchanges automatically forward deposited bitcoin? Most crypto exchanges have some sort of buffer address (unique for every person) where you deposit your bitcoin and then this is sent over to their main wallet and your account is credited with the amount you deposited. How does this work?

Generally, the exchange will use a full node that is continuously checking the network for received transactions. Once it detects a transaction has been made to your deposit address it waits for the transaction to be confirmed, then it will credit you the balance. This data is stored in a private database managed by the exchange where they keep track of each user's balance. The bitcoins you deposited are then either pooled to pay for someone else's withdrawals or sent to a cold wallet (an air-gapped device that is not connected to internet) where they are stored securely if they're not going to be used in the near future.


Can I transfer money from my Deferred Compensation Plan to buy Bitcoin? I have money in a Deferred Comp plan and want to use it to buy Bitcoin.

You can, but maybe you shouldn't.

Don't buy Bitcoin using money that you can't afford to lose.


Passphrase lost for my wallet.dat I need help to unlock my passphrase. I don't remember setting up one, but now there is a pasphrase. Eitherway I am unable to send out coins from my LitecoinQt to the exchange.

Did you:

Change your client software?
Change your operating system?
Install Updates eg. Java/Qt/...?
Swap ISP?
Checked blockchain.info (for transactions on your wallet?)

My first assumption would be that you got hacked (if your wallet.dat was in it's predefined environment) and that the one controlling has added as password or you have encountered a bug somewhere which has not been reported and fixed.

If you could add your litcoin address(es) I can do some investigation.

Thank you.

Best regards,

Nico


What does "Trailing Stop buy Order" on Bitstamp mean? a Trailing Stop limit Order is clear in my mind.
You want to sell your stock when the price starts to fall after reaching a max;
or you want to buy a stock after the price starts to rise after a minimum.
So far so good.

Bitstamp however only has the trailing options for stop loss orders
(see pic).

This does not make sense in my mind: "I would want to wait for a minimum price and than sell when it starts to grow again?" Non sense. The same non sense applies for stop buy trailing orders.

In the picture bellow i plot 4 graphs with MY UNDERSTANDING of these options.

Please help me understand what Bitstamp means with that.

Thx a lot!

You might have been confused about what a "Trailing Stop Loss" really is. (Or I do missunderstood your question.)

The answer can be found on Bitstamp's website: https://www.bitstamp.net/article/stop-orders-and-trailing-stop-orders/

  What is Trailing Stop Order and how to use it?

  The trailing stop is more flexible than a fixed stop loss, since it
  automatically tracks the bitcoin’s price direction and does not have
  to be manually reset like the fixed stop loss.

  For example: Market price of bitcoin is $480 and you placed a Stop
  Sell Order at $450, which is in our case $30 below the current market
  price. Suppose price of bitcoins suddenly increases to $550. You are
  now in chance of “locking in” even bigger profit by manually
  repositioning your Stop Sell Order to higher price.

  Repositioning your Stop Order can be done automatically for you by
  enabling “Trailing Stop” function. In our case Trailing Stop Order
  will automatically reposition active Stop Order if price of bitcoin
  increases while maintaining spread of $30 between the bitcoins spot
  price and Stop Order.


do the trezor wallets support all crypto currencies for strorage? I am considering buying a trezor wallet. I am wondering if this type of wallet can support all types of crypto currencies?

See "Which coins are currently supported?" on Trezor FAQ

  At this moment it is Bitcoin, Ethereum (+ all ERC-20 tokens), Ethereum Classic, ZCash, Litecoin, Namecoin, Dogecoin, Dash and Bitcoin Testnet

So the conclusion is, Trezor supports most of the altcoins, but the computer software doesn't. If you can't code a software that allows Trezor to hold more altcoins, you can only use the altcoins in the list, with the name of the wallet next to it.


To open “MultiBit” you need to install the legacy Java SE 6 runtime I am unable to resolve this. I have updated Java but it appears to require a previous version. Thank you.

if you are using OS X, you can just double click

/Applications/MultiBit.app/Contents/Resources/Java/multibit-exe.jar

works on OS X 10.10.1, Java 7 Update 71.

guess they need some minor adjust for less strict JVM/JRE version check...


Does segwit solve malleability of the witness part? I understand that after segwit the transaction ID can't be malleated,
but can't the witness part be malleated, just like the scriptSig can in a non-segwit transaction?

but can't the witness part be malleated, just like the scriptSig can in a non-segwit transaction?

Yes, absolutely.

But the witness does not contribute to the transaction id (txid), which is what subsequent transactions refer to. Because of this, malleating a witness in a given transaction does not invalidate follow-up transactions using this transaction as an input. This is important for any application where multiple parties rely on an unconfirmed transaction to keep a stable txid.


Pruned nodes update tip performance If I run a node with prune=550 does the Bitcoin Daemon still receive update tips (mined blocks) just as fast as a full node?

A pruned node is a full node.  "Full node" means fully validating and enforcing the Bitcoin rule.  Pruning just means that the node does not bother keeping old historical data that is never used for anything except helping new nodes sync up, wallet rescans, and similar.

Pruning will not impact validation performance other than perhaps there may be some small latency spikes created by periodically deleting old blockfiles, or small latency improvements from not participating in feeding historic blocks to newly syncing peers.


How to send bitcoins without the bitcoin client in PHP Is there a way to send bitcoins programmatically without the bitcoin client using PHP?

You will need to connect to a bitcoin node in one way or another to broardcast to the newtork.  There are a number of php and bitcoin open source repos that will do this, have a look here https://github.com/search?q=bitcoind+php&ref=cmdform

Another option if you do not want to run the bitcoin client locally is to connect to an api to broadcast your transaction.

An example I found for php connecting to blockchain.info is as follows

<?php

$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
              "'.$addressa.'": '.$amounta.',
              "'.$addressb.'": '.$amountb.'
           }');

$json_url = "http://blockchain.info/merchant/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$message = $json_feed->message;
$txid = $json_feed->tx_hash;

?>

Hope this helps

UPDATE: To run requests to the blockchain.info API you need to follow the setup instructions here https://www.blockchain.com/api/blockchain_wallet_api

NOTE To use this API, you will need to run small local service which be responsible for managing your Blockchain Wallet. Your application interacts with this service locally via HTTP API calls. Click here for complete setup instructions on GitHub.


How do I broadcast an OP_RETURN transaction using bitcoin cli I am using Bitcoin Testnet's command line (and GUI). I am curious how, using my own computer and equipment (I already used a faucet) I could send a transaction easily. I tried https://github.com/coinspark/python-OP_RETURN and it failed because it is a newer version of bitcoin. However, I think I could use the CLI to broadcast a message.

Bitcoin Core allows you to create transactions with up to 80 bytes of arbitrary data in an OP_RETURN output. You do this by using the raw transaction process (using createrawtransaction or fundrawtransaction) or the psbt process (using walletcreatefundedpsbt). For all of those commands, when you specify the outputs, you can specify one that is like: {"data":"<hex string>"} where <hex string> is the data you want to send as a hexadecimal string. This will create a transaction with an OP_RETURN output of 0 value with whatever data you specified in <hex string>. The transaction can then be signed and broadcast just like any other raw transaction or psbt.


what is the best software based solution to secure the private key in Bitcoin Would you mind telling me what is the best introduced approach to secure the private key in the wallet and a transaction which is done using Bitcoin? I do not want to use a separate hardware, I am seeking for the best software based approach to protect the private key.

Thanks in advance

Best Regards

Hm. Rather strange question you ask.

First of all: it depends mostly on the infrastructure you use for your bitcoin-client.

If your OperatingSystem is compromised, you probably can't guarantee security of your privateKey at all.

The Bitcoinclient supports a very strong encryption of the wallet (and ofc the private Key) since like 2 years natively.

I guess if you are paranoid and want extra security, use a VirtualMachine, install some hardened Linux-OS (DebianStable?), there make a TrueCrypt-Container with a hard password and install your Bitcoinclient there.

Ofcourse, as mentioned earlier, you can't be more secure than making an offline-wallet. Remebering your key instead of writing it down could also serve as the absolute security feature. - but i guess you don't want to go that far? :)

i saved my keys in a TrueCryp-container encrypted with sha512 and used a strong password - after this, backup copies of this container wherever you want, so you don't lose it. sha512 is not even crackable for the NSA.


How do I know when my mining GPU has been worn out? How do I know for sure when my mining hardware (GPU in particular) has failed?

How can I be certain that my card is at fault and not my software or overclock settings?

  Example: On my rig one of my card's hashrates updates the hash/sec display very slowly and after about 5 minutes of mining phoenix miner will crash and refuse to start up a new instance.

Thanks

You can try running different software for mining after restoring the overclock settings back to factory settings. This way if the graphic card fails, you know the problem exists regardless of the mining software and the overclocking.


Found old 'key' to bitcoin wallet but don't know which wallet? I was searching through my email today and I think I found a bitcoin private key from 2013. I think it's a BTC private key because I bought 1 BTC that day. It's 33 letters long but I don't know the wallet it's too! Can someone help? Thanks

I think I found a bitcoin private key

So far as I know, a private key is 64 characters long in Hexadecimal (a mix of digits 0-9 and letters A-F only) or 51 characters long in WIF/Base58 (which includes a mix of any uppercase and lowercase letters as well as digits). There's also a mini format that is 22 characters long.

It's 33 letters long

That's likely to be an address. If it starts with a 1 or a 3 then it is almost certainly an address.
You can't recover control over money if you only know an address.
If you are sure you have an address and not a private key, you can safely enter the address into any blockchain explorer to see if there is unspent money at that address.
Obviously you should never enter a possible private key into any website.

from 2013

In late 2013 BIP39 was published - which defined seed-phrases (also called recovery phrases or backup phrases). These consist of a list of 12, 18 or 24 words from a standard list. If you have a set of such words you may be able to use it to recover control.
If I remember correctly, at least one wallet, Electrum, had a different seed-phrase system earlier (maybe a year earlier). So if you find 12 random seeming words, you could try them in Electrum.
Many people startr in Bitcoin without finding out about custodial and non-custodial wallets. If you had an account with a custodial service, you might have old email that might help you recover access to money in and account with some business. However quite a few such businesses are no longer around.


Accurately calculate fees to sweep all coins We have an instance of bitcoin core running a watch only wallet. This wallet receives a lot of transactions that we need to (once a day) sweep and split into other personal wallets.

The distribution is a full sweep as follows:

Each vendor receives 95%, after fee deduction
The system collects 5%, after fee deduction

Currently we do it manually like so:

Create a new wallet in electrum with addresses that have balance
Manually calculate how much each partner is going to receive
Manually split the bitcoins for each partner
Check how much is the estimated fee for that transaction
Recalculate how much each partner is going to receive taking the fee out
Manually sign the transaction
Broadcast it

Example:

Inputs:
  Vendor A: 2 BTC in 5 inputs
  Vendor B: 1 BTC in 2 inputs
  Vendor C: 7 BTC in 20 inputs
Total input transactions: 10 BTC

Assuming fee: 0.0002
We send to each party's personal wallet:
  Vendor A: 1.89996200
  Vendor B: 0.94998100
  Vendor C: 6.64986700
    System: 0.49999000

Total sent: 10 BTC

I'm trying to automate the calculation of the distribution with the following script: (please assume Bitcoin.rpc is the same as bitcoin-cli)

balance = Bitcoin.rpc.getbalance '*', 1, true
estimatedFee = ???

vendorABalance = vendorAIncome * (balance - estimatedFee)/balance * 95%
vendorBBalance = vendorBIncome * (balance - estimatedFee)/balance * 95%
vendorCBalance = vendorCIncome * (balance - estimatedFee)/balance * 95%

systemBalance = balance - estimatedFee - vendorABalance - vendorBBalance - vendorCBalance

rtx = Bitcoin.rpc.createrawtransaction [], [
  { 'Vendor A wallet' => vendorABalance },
  { 'Vendor B wallet' => vendorBBalance },
  { 'Vendor C wallet' => vendorCBalance },
  { 'System wallet' => systemBalance },
]
Bitcoin.rpc.fundrawtransaction rtx, { includeWatching: true, conf_target: 6 }

# On a offline machine
rtx = bitcoin-cli signrawtransactionwithkey rtx ['private keys']

# Back on the online machine
Bitcoin.rpc.sendrawtransaction rtx

In theory this script does exactly what I need. If the estimatedFee variable gets the correct value

But I can't seem to find the sweet spot that will allow for the sweep of the wallet, I get Insufficient funds or there will be some leftovers.

What can I do?

It seems there is some discrepancy between your estimatedFee variable and the feerate being used in the fundrawtransaction step.

I think you could try simplifying your code to not use the estimatedFee during the vendorXBalance calculation, and then when calling fundrawtransaction, use the subtractFeeFromOutputs option to just have the fee deducted equally from all specified outputs. For example:

balance = Bitcoin.rpc.getbalance '*', 1, true

vendorABalance = vendorAIncome * 95%
vendorBBalance = vendorBIncome * 95%
vendorCBalance = vendorCIncome * 95%

systemBalance = balance - vendorABalance - vendorBBalance - vendorCBalance

rtx = Bitcoin.rpc.createrawtransaction [], [
  { 'Vendor A wallet' => vendorABalance },
  { 'Vendor B wallet' => vendorBBalance },
  { 'Vendor C wallet' => vendorCBalance },
  { 'System wallet' => systemBalance },
]
Bitcoin.rpc.fundrawtransaction rtx, { includeWatching: true, conf_target: 6, subtractFeeFromOutputs: [vout_index,...] }

# On a offline machine
rtx = bitcoin-cli signrawtransactionwithkey rtx ['private keys']

# Back on the online machine
Bitcoin.rpc.sendrawtransaction rtx

Here is some relevant text from bitcoin-cli help fundrawtransaction (v0.17.0.1):

"subtractFeeFromOutputs" (array, optional) A json array of integers.
     The fee will be equally deducted from the amount of each specified output.
     The outputs are specified by their zero-based index, before any change
     output is added.
     Those recipients will receive less bitcoins than you enter in their
     corresponding amount field.
     If no outputs are specified here, the sender pays the fee.
       [vout_index,...]


Are there any Bitcoin miners that run from a web page and use the GPU? Possible Duplicate:
  What is the status on webminers?

I love Bitcoin mining so far.

However, I need to do it without running a Java applet that I download {see BitMinter for an example of this} and without downloading a program.

Are there any Bitcoin miners that run from a web page and use the GPU? I couldn't find any.

Ideally, something similar to http://www.bitcoinplus.com/ but using the GPU with/instead of the CPU.

The rather new WebCL technology enables this, unfortunately WebCL is not directly supported by browsers yet.

See http://www.coined.com/ and http://webcl.nokiaresearch.com/jsoclbm/ for examples of such miners. I expect more will follow in the coming months.


Can bitcoind and btcd share a datadir? I've already fully synced the blockchain with btcd, can I point bitcoind at the same datadir and use its contents?


How will the new Internet Neutrality Act affect Bitcoin? How do you think the neutrality act that is being talked about as I write this post will affect the Bitcoin community. Not only in transactions, but mining, how will it affect Bitcoin economically with users and miners alike all on the same network? Can someone give the pros/cons to this question. Also, how could this propel bitcoin positively in anyway? This could affect the whole world but I feel like it could have a huge affect on Bitcoin more than what people think.

The Internet is a vital platform for innovation, economic growth and
  free expression in America. And yet, despite two prior FCC attempts,
  there are no rules on the books to prevent broadband providers from
  limiting Internet openness by blocking content or discriminating
  against consumers and entrepreneurs online.
  —Protecting and Promoting the Open Internet May 15, 2014 fcc.gov

There's a possibility that Internet Service Providers discriminate against bitcoin traffic either by making it more difficult, setting limits, charging a toll, or by blocking it altogether. This could prevent nodes from relaying transactions and relaying blocks, either of which would undermine the network.

The prodigiously talented members of the community would no doubt come up with  workarounds, perhaps ways of obfuscating bitcoin related traffic. This could possibly result in an arms race. It could ultimately drive the bitcoin community to build its own network which some have already proposed.


Transactions in Sidechain Suppose I have my own sidechain and have created a transaction of 100 BTCs from Bitcoin network to my Sidechain. To my understanding, this means 100 BTCs are now locked on Bitcoin Network and 100 pegged BTCs have been created in my sidechain.

Q1. What kind of address will hold these 100 pegged BTCs in my sidechain? Is it an address same as Bitocin wallet address?

Q2. Suppose Alice have 100 pegged BTCs in address A of sidechain, Alice made a transaction of 50 pegged BTCs to Bob which has another address (say address B). We now have 50 pegged BTCs in both address A and address B. How will Bob redeem pegged coins back to real BTCs in Bitcoin Network? Because if we see in Bitcoin's point of view, Alice is the authorized user to spend or redeem her 100 pegged BTCs back to real ones. Whereas Bob does not exist for Bitcoin Network who claims to possess 50 BTCs.

Q1: It depends on the sidechain. Every sidechain can implement their own rule to create and represent/encode adresses.

Q2: This is an active area of research. Some people propose implementing sidechains via Zero-Knowledge proofs or other ideas that either require Bitcoin rules to change or mining cooperation or both. Some sidechains already deployed, like RKS, propose there are a set of nodes you trust to hold custody of bitcoins transferred to the sidechain, much like a bank.


What are the additional benefits of having a blockchain behind a web service? I'm still in the process of trying to understand cryptocurrency markets, and the factors behind their monetary value.

Today, I have seen an ICO for a token called DetectorToken, which is a service that analyses markets and sends notifications to its users. From my understanding, although it seems an interesting idea, in the end, it is just another web service. The only thing I have found in the White Paper was the following:

  We intend to initiate a subscription model after the ICO thus helping investors to earn from the subscriptions made by users.

I do understand that they are trying to get their work funded, but how does such a project benefit from having a blockchain behind it, and why would it have a currency attached to it?

It has a blockchain behind it for one reason only: buzzword compliance.


Can you ever view your private keys on the TREZOR? ON a TREZOR, is there a way to see the private key after it has been generated from the seed?  One that you could then import into another wallet manually.  I don't know that I would ever want to do that but I am just curious..

Thanks in advance!!!

I don't think you can as the Trezor (and every other hardware wallet) does not expose your private keys to the computer it is connected to. This is how you can still securely spend your Bitcoin even with a computer that has malware on it.

However, the Trezor 24 word seed uses BIP 39 and BIP 32 so you can use that to derive your private keys on another machine.


Is support@pi.uk.com the real blockchain.info's support address? Currently blockchain.info lists that address in the "about us" page, but since the site is behaving erratically, I wonder if it's the real address or a phony one.

I.e. if the site was hacked, the address would likely be replaced with one the attacker has access to, so the info provided on the site itself is not very useful to determine if that address is genuine.

That's the address I used to contact Ben Reeves (blockchain.info's author) a few months ago, so it should be correct. Whether it is still in his control is a different question. He is also known as piuk in the bitcointalk forums.


Alternative incentives for miners Currently the incentives for miners are the block-awards and transaction fees. Suppose I want to create a Bitcoin-like hash-chain for other purposes than storing coins (for example: storing messages), how could one create an incentive for miners to do the work?

Transaction fees, just like in the bitcoin blockchain.

The level of mining would then adjust up and down with the amount of usage.  You might need to subsidize it to get any participation from the start.

If demand is too low where fees don't justify this, then demand is too low where fees don't justify this.

Perhaps you can use Namecoin, which already exists, to solve your problem?  Namecoin can be used for namespaces other than just .bit domains.


Is 'nLockTime' equal to 'lock_time' in transaction data structure? I understand how 'lock_time' field work in transaction data structure, but I also see some people talking about 'nLockTime' with similar function. So are they the same?

Yes, they are the same. nLockTime is the name used in the Bitcoin Core source code (e.g. here) , whereas locktime or lock_time might be more common in JSON input/output or other pieces of software. The Bitcoin Core RPC uses locktime for example, and blockchain.info uses lock_time in its rawtx/ endpoint


How was the overflow bug of 2010 detected? Should UINT64_MAX value transactions be considered suspicious? The overflow bug of 2010 was a result of a client that summed two values together and reaching INT64_MAX instead of UINT64_MAX.

Should transactions of INT64_MAX (or any similar constant) be treated with suspicion?
How was the overflow bug of 2010 detected?
Are there provisions in place for similar, future large transactions that may involve larger sums?  (128 bit values (if possible in the network))

Your first question is kind of a pointless retrospective question. Sure, now that we know that overflow can be a problem in this way, we should consider transactions that attempt to overflow to be suspicious.

The bug was detected by inspection of the blockchain. The bad transactions stood out. Had it not been detected by inspection, sooner or later it would have been detected by the presence of too many Bitcoins circulating.

There are no issues any more. Each individual output is now checked in a way that ensures that their sum cannot exceed the input to the transaction. Overflow is, so far as we know, no longer possible.

Your question seems to be asking if there's some "magic bullet" that can solve similar future problems that are presently unknown. The thing is, if there was, we wouldn't know it because we don't know what the future problems are likely to be. Sure, in retrospect, there are many things that could have been differently that would have made this particular exploit impossile.


How do I construct a Bitcoin transaction with the Bitcoin Core Console? How do I create a transaction using the debug console of Bitcoin Core v0.15.1 (64-bit)?

I have been able to use the commands to create addresses. I figured out how to create, sign, and send a raw transaction. However when I try to send the transaction, I get an erro saying that my fee is too low.

Am I getting this error because I'm resetting the console before I start my commands ? Should I let my console time add up or reset it before a transaction ?

Am I getting this error because I'm resetting the console before I start my commands ? Should I let my console time add up or reset it before a transaction ?

No, that is completely unrelated.

The transaction fee in a transaction is determined by the difference between the sum of the values of the outputs and the sum of the values of the inputs. Bitcoin Core will not accept a transaction which has a fee rate (in BTC/virtual-kilobyte) that is too low. You probably aren't setting a transaction fee or are setting one that is too low. To set a transaction fee, you need to decrease the values of your outputs so that the difference is larger.


What are the February 20 changes to the Bitcoin protocol? From the BitcoinJ mailing list:

  the Bitcoin protocol bizarrely changes itself on February 20th
  2012 in a backwards incompatible manner

What are these changes, why are they necessary, when was this announced and are there any plans for this to happen again?

What version of the official client supports the new protocol?

Really old versions of Bitcoin did not use checksums in network messages (Satoshi incorrectly assumed that the TCP checksum was sufficient). When Bitcoin was changed to start using its own checksums in network messages, version and verack messages could not be immediately updated to use checksums because old clients would be unable to understand checksum-protected messages from new clients and the network would split. Satoshi's solution was to keep using non-checksummed version and verack messages for two years and then have clients automatically start checksumming version/verack messages. At midnight UTC on February 20, this change will happen.

Versions of the official client later than 0.2.9 will apply the change automatically. Older versions will stop working. Existing connections will not be broken due to the change, so there should be very little disruption at the time of the change. It will probably only cause problems for alt clients and users with seriously-off clocks.


When update mining difficulty, Is the timespan of the past 2016 blocks approximated value? I know how to calculate difficulty, and I know it is increased or decreased by checking the timespan of the past 2016 blocks.

and I found actual code for calculating timespan: https://github.com/bitcoin/bitcoin/blob/master/src/pow.cpp#L55

actual_timespan = last_block->get_timestamp() - first_block->get_timestamp()

But, as I know timestamp in block is not the exact time of the mining:
https://en.bitcoin.it/wiki/Block_timestamp

So, the timespan which is used to calculate the next difficulty is not the exact timespan but approximate value. Am I right?

It is impossible to know that actual timespan due to network delays, malicious miner behavior, being offline, etc. The target readjustment just uses the closest thing it can get to the actual timespan which is the difference in the timestamps. However those timestamps can be faked as well, so it is just an estimate.


Transaction outputs with value 0 If I am correct, some transactions have outputs with "value" field equal to 0, and some even have all their output "value" fields equal to 0.
See for instance:
transaction 9173744691ac25f3cd94f35d4fc0e0a2b9d1ab17b4fe562acc07660552f95518
I wonder if this is a feature or a bug, and what it means to send 0. Any thoughts?

Outputs with 0 value are allowed by the protocol. It is a feature that allows for provably unspendable outputs to not have to have any value that then becomes burned. However 0 value outputs are not limited to just provably unspendable outputs, so transactions like the one that you have found are possible. It is also possible to spend those 0 value outputs, but this ends up just wasting money because there is a non-zero fee cost to spending them.


What are transactions from and to exchanges wallets? I am analyzing bitcoin blockchain data, I have the addresses corresponding to a set of exchanges (extracted from walletexplorer) and I'm looking at the transactions made from and to those addresses.

At the beginning I thought these transactions to exchanges' addresses corresponded to people selling their bitcoins (most probably for USD) when the transaction was made FROM an outside address TO an exchange addresses, or to people buying bitcoins when it was on the opposite direction.

Am I right on this statement? Or am I missing something?

Its not really possible to tell for sure, but if somehow you found a list of some deposit addresses for an exchange, then yes its likely that transactions sent TO the exchange were sent so that those users could exchange the bitcoin for another currency. And likewise, transactions FROM an exchange might be withdrawals from users' accounts. But each exchange might manage the funds sent differently, some might be transfers to cold wallets, or payments to service providers / employees for example, there could be many things you haven't considered.


In ListReceivedByAddress, what is the meaning of Confirmations if the address is reused? The API ListReceivedByAddress allows me to view a list a sum* of all the transactions that an address has received.   This returns an array listing the sum of what was sent.

If the address is reused for more than one transaction, what is the expected value of "confirmations"?
Is the value of confirmations the Max, Min, or Average?
Should there be an entry listing how many transactions were sent to that address?

*Footnote I'm not entirely sure that the ListReceivedByAddress actually returns a sum of all transactions to that address.  I assume it's possible that the value could be the first, last,or sum of all transactions to an address.

If the address is reused for more than one transaction, what is the expected value of "confirmations"?

Quote from bitcoin wiki:

"confirmations" : number of confirmations of the most recent transaction included

Also, I think you might want to change the value of minconf that you pass to listrecievedbyaddress if you're concerned about knowing how many confirmations a transaction has.

  Should there be an entry listing how many transactions were sent to that address?

Why would you use that though?


Address generator error with python I had created a script that creates a bitcoin private key, public key and address, for checking if all works fine I create one and check the private key on https://walletgenerator.net/, and it outputs a different address, every time I do that my script create a different addres that what walletgenerator returns.
Python script:
import secrets

import hashlib
import ecdsa
import codecs
import base64
class Address():
def init(self):
self.private_key = self.create_private_key()
self.public_key = self.private_key_to_public(self.private_key)
self.address = self.public_key_to_address(self.public_key)
@staticmethod
def create_private_key():
    bits = secrets.randbits(256)
    bits_hex = hex(bits)
    private_key = bits_hex[2:]
    return private_key

@staticmethod
def private_key_to_public(private_key):
    verify_key = ecdsa.SigningKey.from_string(codecs.decode(private_key, "hex"), curve=ecdsa.SECP256k1).verifying_key
    key_hex = codecs.encode(verify_key.to_string(), "hex")
    bitcoin_type = b'04'
    public_key = bitcoin_type + key_hex
    return public_key

@staticmethod
def public_key_to_address(public_key):
    public_key_bytes = codecs.decode(public_key, "hex")

    sha256_bpk = hashlib.sha256(public_key_bytes)
    sha256_bpk_digest = sha256_bpk.digest()

    ripemd160_bpk = hashlib.new("ripemd160")
    ripemd160_bpk.update(sha256_bpk_digest)
    ripemd160_bpk_digest = ripemd160_bpk.digest()
    ripemd160_bpk_hex = codecs.encode(ripemd160_bpk_digest, "hex")
    network_byte = b'00'
    network_bitcoin_public_key = network_byte + ripemd160_bpk_hex

    network_bitcoin_public_key_bytes = codecs.decode(network_bitcoin_public_key, 'hex')
    # Double SHA256 to get checksum
    sha256_nbpk = hashlib.sha256(network_bitcoin_public_key_bytes)
    sha256_nbpk_digest = sha256_nbpk.digest()
    sha256_2_nbpk = hashlib.sha256(sha256_nbpk_digest)
    sha256_2_nbpk_digest = sha256_2_nbpk.digest()
    sha256_2_hex = codecs.encode(sha256_2_nbpk_digest, "hex")
    checksum = sha256_2_hex[:8]

    address_hex = (network_bitcoin_public_key + checksum).decode('utf-8')
    return Address.base58(address_hex)

@staticmethod
def base58(address_hex):
    alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
    b58_string = ''
    # Get the number of leading zeros
    leading_zeros = len(address_hex) - len(address_hex.lstrip('0'))
    # Convert hex to decimal
    address_int = int(address_hex, 16)
    # Append digits to the start of string
    while address_int > 0:
        digit = address_int % 58
        digit_char = alphabet[digit]
        b58_string = digit_char + b58_string
        address_int //= 58
    # Add ‘1’ for each 2 leading zeros
    ones = leading_zeros // 2
    for _ in range(ones):
        b58_string = '1' + b58_string
    return b58_string

Doing
foo = Address()
print(foo.private_key, foo.public_key, foo.address)

returns
# 5598c164e8bcec667589267cdaf0f14a6b9399ae0b2a6b10972602a6feaf682d
# b'04cbeefab6ecfa84f5f120503de4574952f2d1fa5b11b8f6c80a13df02e6512090e6fede6dde3e65256c484162e38
# 39cf599c3d08a236432e8e307784b741ffca5' 18NFnELB9YpRiEbLMmRLKymYpvxC9yzkC2

And then, if I check the private key 5598c164e8bcec667589267cdaf0f14a6b9399ae0b2a6b10972602a6feaf682d on https://walletgenerator.net/, it returns:
Public address: 1LBLgjq3ntVdb8MqB41rHReWnrKgT41Lwv
Public address compressed: 1LBLgjq3ntVdb8MqB41rHReWnrKgT41Lwv

Your python scripts generate uncompressed public keys, and they seem to calculate correctly.
When I use my own scripts, the results are:
Private key: ---------------------------------------
5598c164e8bcec667589267cdaf0f14a6b9399ae0b2a6b10972602a6feaf682d
Private WIF: ---------------------------------------
Kz66jawQ5eb7pQYJx3tTNmFQBS46x1rg92To2js3bY1SKrPxVWvL
Public key: ----------------------------------------
04cbeefab6ecfa84f5f120503de4574952f2d1fa5b11b8f6c80a13df02e6512090e6fede6dde3e65256c484162e3839cf599c3d08a236432e8e307784b741ffca5
pubkeyhash: ----------------------------------------
50cdf408e049ddab4bd8ebda8a6500e93831a633
BTC Address: ---------------------------------------
18NFnELB9YpRiEbLMmRLKymYpvxC9yzkC2

No difference to your results.
But there seems to be a bug in walletgenerator.net's calculation:
They claim that the uncompressed address was the same as the compressed address, which cannot be correct. Which tab did you use on their site, was it Wallet Details?
As a compressed bitcoin address, I get 1KJKsAzDeH1127x6w8e2xZyzRdvFkiLhme when I use my own scripts, and my Electrum client confirms that result (when I use the private key import feature).
All that does not match the results of walletgenerator.net, so my conclusion is that their site is buggy.


Command line bitcoin cash wallet for linux? Is there a good command line Bitcoin cash wallet for linux available?

You can use Bitcoin-ABC or Bitcoin-unlimited, Both are Bitcoin-cash.

after you successsfully install it, you can just send the commands as follows:

bitcoin-cli getnewaddress "account"

to get new bitcoin cash address.

You can find all commands on bitcoin.org. This documention for Bitcoin core, but as Bitcoin cash is a fork of bitcoin, these commands should work with you. You can find new commands or changes on Bitcoin-ABC on Github


Buying large quantites I am new to this Bitcoin thing but I have a closing next week and will have $50K that I am looking to wire to someone to purchase Bitcoin.  Where is the best place to do this?  What about one that does not require ID as well?  Thank you for your help

You don't say what country, but I assume you are in the United States.

First things first: make sure you have the technical capability to handle the coins and understand how Bitcoin works. You don't want to buy those coins and then lose them due to a technical screwup. Practice first with a smaller amount of money until you are confident you securely handle and store coins.

The better known dealers will require identification. Genesis Trading in NY is one of the larger US brokers.

You can also use an exchange directly such as Bitstamp (in Luxembourg/London) or Bitfinex (Hong Kong) or Coinbase (San Francisco) or Kraken (San Francisco). All will require a lot of identification and verification information. There is an exchange in Bulgaria (?) called BTC-e that has a reputation for not requiring very much information, but they probably require at least a passport scan.

For anonymous trading you will have to use Local Bitcoins, ie individual small time dealers. Each dealer has their own policies.

Your question is kind of a basic question. That you would even ask a question like this suggests that either (1) you need to learn more before trading Bitcoins, or (2) you are some kind of Fed or narc who is looking for information about something they want to attack without really understanding it.


Generate cryptocurrency addresses on server I want to generate cryptocurrency addresses (e.g. for top 10 cryptocurrencies on CoinMarketCap) on my server and be able to send transactions when deposit arrives. Can I do that with CLIs or there is another/better way to do that? Or maybe there is a service that is suitable for cryptocurrency address generation?

yes you will need a bitcoin core installed and fully synced and after you have that, you can use this php library to help you (i used this before i recommended to you):

https://github.com/aceat64/EasyBitcoin-PHP


Which mining pools do not require account creation? I know Eligius doesn't have a lengthly setup process, you just use your payout address as the username.

Which other pools are this easy to start with?

You can try http://p2pool.info/

And P2Pool.info does not keep fees, they redistribute it ;)

In general you don't have to subscribe to P2P Pool (just search for "p2p bitcoin pool").


Bitcoin QT encryption / passphrase Installed the Bitcoin QT client only last week... synchronised it with the blockchain... and sent my bitcoins to this adress...
Now, when I want to send to some other address, it asks for the passphrase. However, have never had the option of providing a passphrase. Any thoughts on this?

However, have never had the option of providing a passphrase.

You must certainly have set a passphrase in the past. There's no way to remove it without knowing exactly what it is. If you can not recall what password you set, your funds are lost.


How does Whopper Coin released in the summer of 2017 on the Waves platform solve the native fee problem inherit with many colored coin approaches? Whopper Coin was recently released in Russia using the Waves platform, but what is the native fee a user has to pay when sending the Whopper coin back to the establishment? If a customer receives Whopper coin from Burger King, now the customer would have to redeem these coins by sending it back to Burger King. How are the fees paid? Are the fees in Whopper Coin or the main Waves coin? How did they solve this inherit problem when issuing coins like this on top of an existing blockchain platform.

On the Waves platform, it is possible for transaction fees to be paid in tokens. To do this, a full node with mining capabilities (anyone can run a node, but at least 10,000 WAVES is required to generate blocks) has to accept the particular token as a fee.

Thus, Burger King Russia could either host a full node or persuade another full node to accept Whoppercoin. Burger King Russia plans to have an app on both the Apple Store and on Google Play for the loyalty program.
These apps will likely make use of the Waves Node REST API by specifying the fee asset as Whoppercoin.

Here is the relevant API:

POST /assets/broadcast/transfer

Here are the relevant parameters:

"type" - Transaction type (4 for TransferTransaction)
"id" - Id(hash) of transaction, Base58-encoded
"assetId" - Asset ID in Base58 format, effectively equals transaction id
"timestamp" - Transaction timestamp
"sender" - Sender account's address, Base58-encoded
"senderPublicKey" - Sender account's public key, Base58-encoded
"recipient" - Recipient account's address, Base58-encoded
"feeAsset" - Asset ID of transaction fee, currently is null, i.e. WAVES
"fee" - Amount of transaction fee
"attachment" - Attachment, Base58-encoded
"signature" - Signature of all transaction data, Base58-encoded

Here is a request JSON example:

{
  "type": 4,
  "id": "3xPyT73TGV7c5PKEJpicwSsX7PXyi3Lm1JFNQivFRLuy",
  "sender": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
  "senderPublicKey": "CRxqEuxhdZBEHX42MU4FfyJxuHmbDBTaHMhM3Uki7pLw",
  "recipient": "3Mx2afTZ2KbRrLNbytyzTtXukZvqEB8SkW7",
  "assetId": "E9yZC4cVhCDfbjFJCc9CqkAtkoFy5KaCe64iaxHM2adG",
  "amount": 5500000000,
  "feeAsset": null,
  "fee": 100000,
  "timestamp": 1479222433704,
  "attachment": "BJa6cfyGUmzBFTj3vvvaew",
  "signature": "2TyN8pNS7mS9gfCbX2ktpkWVYckoAmRmDZzKH3K35DKs6sUoXHArzukV5hvveK9t79uzT3cA8CYZ9z3Utj6CnCEo"
}

On Waves platform right now, you can buy Whoppercoin on the Waves DEX, and the fee is 0.003 Waves. I demonstrated this here: https://youtu.be/ZAFZNEwIooM

Additionally, you can transfer Whoppercoin between accounts, and the fee is 0.001 Waves. I demonstrated this here: https://youtu.be/OYHPlgj0HjY


How does Trezor recover all public keys from different blockchains? I understand that the Trezor is a HD wallet, meaning private-public keys are generated through a deterministic, hierarchical expansion of the root seed. However, when I am in a process of recovering my wallet with a seed, how does it figure out which private-public key pairs map to which accounts on which blockchain? Is it just some sort of brute-force expand and check (see of Bitcoin blockchain has the following address or no) algorithm?

Trezor follows (and helped design) BIP44.

BIP44 details how a single mnemonic may be used to create individual keychains for different blockchains, and how multiple accounts may work within those keychains.

This is not a foolproof system - if you deviate from the expectations of BIP 44 (such as using addresses beyond the 20 address gap limit) automated recovery software will not be able to locate all of the used addresses - This makes it somewhat unfit for commercial uses, since most companies and exchanges need to give out addresses without assuming they will be used sequentially.

For individual wallets, this is a safe assumption, and one that Trezor makes.


How Can the Bitcoin Wallet Blockchain Size Be So Small? I have recently been studying more in-depth how bitcoin actually operates, and I have repeatedly heard that the blockchain in its entirety is many Gigabytes in size. As such, how can the storage space taken up by end-user bitcoin clients by anything less than that, because, for example, satoshi him/herself could send you some bitcoins, and the system would need to reference some really early blocks to verify that transaction?

Essentially, could someone explain to me or point to a resource detailing why wallet clients only download the 'most recent blocks,' and how this cut-off is decided?

Most bitcoin guides assume every user contains a copy of the entire blockchain, but, in practice, that seems to be incorrect.

Assuming you are talking about a full node,
It does indeed need to download the full blockchain, to verify it and build up a set of Unspent Transaction Outputs (UTXOs). But the thing is, once it's downloaded all those blocks, its not going to go back looking through them, it just uses the UTXO set to verify new transactions. All those old blocks are basically stored solely for sending to other nodes. So if we have a checkpoint at some block hash, we can say that all blocks before that are legitimate and stop storing them, just store the UTXOs, and then just keep the most recent blocks so we can still propagate them around the network. This greatly reduces the amount of disk space used.

Of course, there are also SPV nodes which just store block headers and rely on full nodes for specific transaction data, so they have blockchains in the megabytes rather than gigabytes.


Is this thing on? (How to tell if my cpuminer is working?) I have pretty much no idea what I'm doing. But I've had cpuminer running on my laptop for a half hour or so, just playing around. I know it's not near worth the time or electricity, I'm just having some fun.

I'm using Slush's pool, and ran the program:

./minerd --url http://api.bitcoin.cz:8332 --user <me> --pass <pass> --threads 8

And I seem to be generating normal output:

[2013-11-27 13:28:05] thread 7: 291732 hashes, 5.18 khash/s
[2013-11-27 13:28:05] accepted: 0/151 (0.00%), 41.48 khash/s (booooo)
[2013-11-27 13:28:08] Stratum detected new block
[2013-11-27 13:28:08] thread 3: 183216 hashes, 5.18 khash/s
[2013-11-27 13:28:08] thread 7: 17988 hashes, 5.28 khash/s
[2013-11-27 13:28:08] thread 1: 38664 hashes, 5.26 khash/s
[2013-11-27 13:28:08] thread 6: 151224 hashes, 5.16 khash/s
[2013-11-27 13:28:08] thread 4: 161664 hashes, 5.18 khash/s
[2013-11-27 13:28:08] thread 2: 79848 hashes, 5.16 khash/s
[2013-11-27 13:28:08] thread 5: 60576 hashes, 5.21 khash/s
[2013-11-27 13:28:08] thread 0: 164808 hashes, 5.17 khash/s
[2013-11-27 13:28:09] thread 3: 5484 hashes, 5.33 khash/s
[2013-11-27 13:28:10] accepted: 0/152 (0.00%), 41.74 khash/s (booooo)

But I don't know how long it normally takes for my account to begin displaying any kind of progress:

My CPU usage is pegged at around 750%, which makes sense - but I'm not sure how I'll know if/when they're contributing to anything.

You're using the wrong hash algorithm for Bitcoin mining. Bitcoin uses SHA256d (d = double), but cpuminer (at least the version 2.3.2 on my system) defaults to scrypt (for Litecoin) instead:

-a, --algo=ALGO       specify the algorithm to use
                      scrypt    scrypt(1024, 1, 1) (default)
                      sha256d   SHA-256d

Slush's pool is Bitcoin, so you should add -a sha256d to your command line. You'll see a much higher hash rate (scrypt is intentionally much slower to compute than SHA256) and you'll get yay!!! instead of booooo after some time in your log:

[2013-12-09 21:51:25] thread 0: 49985792 hashes, 832.61 khash/s
[2013-12-09 21:51:29] thread 1: 51072988 hashes, 841.16 khash/s
[2013-12-09 21:52:23] thread 0: 49956628 hashes, 864.18 khash/s
[2013-12-09 21:52:32] thread 1: 50469540 hashes, 808.16 khash/s
[2013-12-09 21:53:26] thread 0: 51850904 hashes, 833.58 khash/s
[2013-12-09 21:53:29] thread 1: 48489516 hashes, 855.40 khash/s
[2013-12-09 21:54:25] thread 1: 46821320 hashes, 834.33 khash/s
[2013-12-09 21:54:25] accepted: 1/1 (100.00%), 1668 khash/s (yay!!!)
[2013-12-09 21:54:25] thread 0: 50014552 hashes, 838.40 khash/s
[2013-12-09 21:54:41] thread 1: 13586032 hashes, 850.75 khash/s
[2013-12-09 21:54:41] accepted: 2/2 (100.00%), 1689 khash/s (yay!!!)

For best results, you should also use the above mentioned stratum+tcp protocol and adjust --threads to the number of cores in the system.


How to get Mutlibit Hd private keys from mnemonic I'm trying to use this tool: https://dcpos.github.io/bip39/ but none of the addresses match. I would really appreciate some help.

In multibit HD clicking wallet dashboard under wallet capabilities the BIP32 derivation path was shown as m/0h but as per this post https://github.com/keepkey/multibit-hd/issues/445 the derivation path is m/0'/0 which gave me the correct addresses and private keys.


Does the MultiBit linux jar file run in windows? A windows system has a standalone java and is not recognized by the installer. A jar file can be run on the command line. Is the MultiBit linux jar and the windows installed one the same?

The Linux installer is slightly different to the windows installer in that there are different scripts to get the host machine to recognise the bitcoin URIs.

What ARE very similar is the multibit-exe.jar (used on Linux and Mac) and the multibit.exe (used in Windows). The exe is basically a wrapped jar file.

On any operating system you can run MultiBit jar file by running:

cd 'the MultiBit installation directory'

'path to java'/java -jar multibit-exe.jar

Make sure you cd to the install directory first as it uses that to pick up some files.


Cost/space effective transaction? Is there a more, or most, cost/space effective way to create a transaction with say 100 outputs and 1 input?  Is there a limit to the number of outputs in a transaction (aside from any limitation upon blockspace)?

There is no explicit limit on the transaction outputs, however, transactions bigger than 100kB are non-standard and will not be relayed by most nodes. As P2PKH outputs are 34 bytes, you'd be able to create a transaction with more than 2,900 outputs.

Since I don't know what your use case exactly is, note that if the outputs are too small, they might make the transaction non-standard (when they are below the dust threshold), and even above that threshold it could be cost prohibitive to spend very small outputs at current fee levels.


Difference in hash rates between Bitcoins and Litecoins calculation I recently discovered the Hash rate of my graphic card is different with Bitcoins than Litecoins. I understand this is due to the difference in the algorithm. Bitcoin has a double sha256 instead of Litecoins.

If I have a Miner of 1THash/s at Bitcoins what will be the average hash rate I get on calculating the Litecoins?

If you are using general purpose mining hardware (i.e. CPU, GPU) then it really depends on lots of factors, not only hardware, but also mining software and even its configuration.

For details on mining hardware you can check the tables for Bitcoin and Litecoin.

But with the inevitable introduction of ASIC miners (already for Bitcoin, and soon for Litecoin) the question is actually irrelevant.

ASIC miners can only work with the hashing function for which they were designed.
So a Bitcoin ASIC miner (SHA256) cannot mine Litecoin (scrypt) at all, and vice-versa.


How does one attain 1,000+ connections like blockchain.info? At this moment, blockchain.info has over 1,900 nodes connected to their bitcoin client.

I have been running an m1.small ubuntu 12.04 server and bitcoind for ~4 days straight now with no reboots. My bitcoind client still only shows ~60 connections maximum when performing a "./bitcoind getinfo" command.

How can I achieve 1,000+ connections to my bitcoind client? And is it "worth it" in your opinion?

EDIT: I have re-started my bitcoind client with the -maxconnections=1000 and -timeout=15000 parameters but after ~12 hours of running bitcoind, the number of connections is only up to ~40. And I don't seem to be maxing out my CPU, RAM, or bandwidth just yet.

EDIT 2: I have not seen a "connected time" over 8 hours in the list provided by blockchain.info so that tells me they must restart their server every 8 hours or so. Either that, or connections drop and refresh after 8 hours? I am beginning to think that blockchain.info keeps track of IP addresses running bitcoin in a database of sorts... and forefully connects to them every time their bitcoind reboots. Am I right?

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.


What information will someone need to give me money? I want to use BitCoin to earn money from someone else for working for them.
I want to give them as little information about me as possible

What will I HAVE to give them so I can accept money, what personal info will have to be given?

Bitcoin relies on disclosing as little information about yourself as needed in order to accomplish its functions. In order to receive coins, you only need to provide a Bitcoin address, like such:

1Br7vQZjkrJxhQEALt4ReL9hTqvQj4Xqge

If you are worried about your anonymity, you should generate a new address in the standard client that you will use only once. Should anyone wish for you to confirm that you own a given address, you can use the private key you have to sign some meaningful message.

Note however, that it is possible to try connecting your Bitcoin address to your online identity if you are not careful. It is very unlikely, unless someone REALLY wants to find out who you are.


How do you access the NXT testnet to test out new features of the system? I downloaded the new nxt platform and want to try out the testnet system for new features. How do you get the testnet running on your local system?

Download the latest NXT, and goto your conf folder and there is a nxt configuration file there. Open it with a text editor and find the line that mentions "testnet = false" - Change that false to true and then launch the NXT application. (run.bat on windows) Once its booted up you'll see in "NXT server started" message. Then you goto:

http://localhost:6876

NXT testnet is port: 6876


block hash and list since block? I am writing transaction monitoring service but I am having some problems with listing since block hash. I have bitcoind daemon and when I execute listTransactions some transactions have same block hash so if I would try to listSinceBlock I would have problems. How this all works?

The block hash identifies a block. A block can contain multiple transactions, so listsinceblock lists all transactions in blocks newer than the given block hash.

So f.e., if you have this block structure:

block 5 hash: qwertyyuiop
|   tx100,tx101,tx102,tx103
v
block 6 hash: asdfghjklkl
|   tx104,tx105,tx106,tx107,tx108
v
block 7 hash: zxcvbnmnbvc
    tx109,tx110,tx111

When you would do listsinceblock qwertyyuiop, you would get all transactions in blocks older than block 5, so tx104 all the way up to tx111.


What is the point of downloading the blockchain? I have Bitcoin-core on my mac, and currently it is syncing.

But what exactly is the point of having the entire blockchain downloaded onto your computer? Is it only there so that you can have an offline wallet?

Or, are there other benefits to having it on your computer...and if so, what would they be?

Some good reasons to download the whole blockchain:

You can verify the entire blockchain and confirm the longest chain. This means you literally have to trust nobody. You can verify everything.
Along the same lines, you don't have to trust anyone about the actual balance in your wallet. It's impossible to know for certain unless you have the entire blockchain.
You contribute to the bitcoin network by being a relay node that verifies transactions and passes on only what's standard or has enough fees for the age/size of the transaction.
If you run SPV wallets elsewhere, this will mean you have a trusted place where you can find out about various addresses and transactions.

Basically, it comes down to, do you want to trust someone else or do you want to see it for yourself. Trusting others works if you have a big enough pool of other people, but it doesn't work if there's only a few, so that's why you would have the entire blockchain on your computer.


Do we know who runs the big mining pools? After looking at the hashrate repartition https://blockchain.info/fr/pools.
It seems to me that bitcoin is quite centralized, and that two big actors (mining pools company who run the bitcoind server) like BTC guild and GHash.IO suffice to obtain the mythical 51% computing power, allowing various kinds of attacks.

How do we know that these two guilds are not the same person, or will not collude?
In the event that such collusion happens, and malicious double spending* occurs or other attack occurs, how do we detect it? What happens when we do detect it?

*Double spending doesn't have to be malicious: https://blockchain.info/fr/double-spends

This list is not exhaustive, and the information is based on bitcointalk and coindesk discussion and articles. As of 1 Dec 2014, based on pool stats from few websites including https://blockchain.info/pools

GHASH.io is at 13 % , it is based out of Europe.
GHASH is closely related to CEX.io BitFury, Jeffrey Smith is the technical person at CEX.io.
Eligius 4 % is operated by Luke.Jr
Discus Fish 25%  is based out of china & coowned by Wang Chun.
Megabig power 2% in Washington operated by Dave Carlson.
KNC 8% is based out of Sweden , Sam Cole & Marcus Erlandsson.
Cointerra 2%  is based out of Texas. Timo Hanke & Ravi Iyengar.


How are Bitcoin Core GUI nodes properly connected and disconnected in regtest mode? I'm trying to set up a private Bitcoin network using Bitcoin Core in regtest mode. However, there are two problems:

the port reported by the Bitcoin Core GUI doesn't match the one the node is running at; and
when a peer is disconnected (or even banned) it re-connects automatically.

Here's what I did. I create two folders, alice and bob. I then launch the GUI from the OSX Terminal:

# start Alice node
$ open -n /Applications/Bitcoin-Qt.app --args -regtest -datadir=/Users/{username}/Desktop/alice/ -port=18444

# start Bob node
$ open -n /Applications/Bitcoin-Qt.app --args -regtest -datadir=/Users/{username}/Desktop/bob/ -port=18445

From Alice's Console, I do:

addnode 127.0.0.1:18445 add

This creates a connection to both nodes.

I want to disconnect both nodes from each other.

From Alice's Console, I use:

addnode 127.0.0.1:18445 remove

On Alice's node, the peer is:

127.0.0.1:18445

However, on Bob's node, the peer is

127.0.0.1:57594

but I expect it to be:

127.0.0.1:18444

I try to remove Bob's node from Alice with:

addnode 127.0.0.1:18445 remove

Console returns null but doesn't remove the node.

When I try this from Alice's node:

addnode 127.0.0.1:57549 remove

I get Error: Node has not been added. (code -24)

I then try to disconnect Bob's node from Alice's node using the the Peers tab. Right click on peer (Bob) and choose disconnect.

The node is disconnected for about 45 seconds, then reconnects.

To summarize, I have two questions:

Why doesn't the port number on Bob's node match the port number I gave it?
How can I keep regtest nodes permanently disconnected for arbitrary periods of time and then reconnect them?

I want to disconnect both nodes from each other.

  From Alice's Console, I use:

addnode 127.0.0.1:18445 remove

This is incorrect. This command will only remove Bob's node from the list of addnode'd peers. The correct command to actually disconnect Bob's node is

disconnectnode "127.0.0.1:18445"

  On Alice's node, the peer is:

  127.0.0.1:18445

  However, on Bob's node, the peer is

  127.0.0.1:57594

  but I expect it to be:

  127.0.0.1:18444

Outbound connections are not made from the P2P port. Rather a random high numbered port is chosen to bind to and the outbound connection is made from there. IIRC this is done by the kernel and not the software itself. This behavior is standard for most software that make outbound connections.

  I then try to disconnect Bob's node from Alice's node using the the Peers tab. Right click on peer (Bob) and choose disconnect.

  The node is disconnected for about 45 seconds, then reconnects.

A connection is still being made because you did not remove the other node from both nodes (i.e. one node still has the other one in its peers database).

The proper way to do this would be to use the onetry option as that means that the node is not actually added to the peers database but rather tried once. To disconnect, you should be using the disconnectnode command.


Loosing 20 ripples for resetting ledger nano for new seed I setup my ledger nano s properly and transferred my Ripple to ledger nano. Now I want to reset my ledger nano and generate new seed. I have transferred Ripple to some other exchange to reset my ledger but last 20 ripple can't be transferred as it is required for any ripple account. Once I will reset my device, can I use the same ripple wallet so that my 20 ripples won't be lost or I will have to forget these 20 ripples in terms of resetting my ledger nano? Is there any other way to save these 20 ripples?

Since your Ledger's Ripple address is tied to the seed, if you reset the device and choose a new seed, you will lose those 20 XRP.

If you reset the device and restore the old seed, you can reuse the address.

There is no way to use a new seed and the old Ripple address on a single ledger.


How to generate mycelium addresses from the 12 words in python I am trying to re-generate the receiving addresses (and change addresses, for that matter) my mycelium wallet has generated.

So far I've used trezor's implementation of BIP39 to generate the entropy from the 12 words, and a BIP32 implementation I have used previously (successfully, to generate the same addresses as bitcoin core, which uses a different subkeys scheme but from a tpub, not from entropy), to produce the keys from the entropy.

Here's the code:

from bip32utils import BIP32Key
from bip32utils import BIP32_HARDEN
import bip39

wallet_generator = bip39.Mnemonic('english')
entropy = wallet_generator.to_entropy('12 words here')
key = BIP32Key.fromEntropy(entropy)
account_number = 0
i = 0
print key.ChildKey(44 + BIP32_HARDEN) \
         .ChildKey(0 + BIP32_HARDEN) \
         .ChildKey(account_number + BIP32_HARDEN) \
         .ChildKey(0) \
         .ChildKey(i) \
         .Address()

I am trying to follow BIP44's scheme as described here.

I am getting a key, but not the one that appear in my first mycelium transaction. I've tried to search the first 100 i with account_number 0 to 9, to no avail. Using bip32gen from the command line does not produce the correct key either:

echo YOUR_ENTROPY_IN_HEX_HERE | \
    bip32gen -v \
    -i entropy -f - -x \
    -o addr -F - -X \
    m/44h/0h/0h/0/0

With entropy converted to hex with print ''.join('{:02X}'.format(x) for x in entropy)

What am I missing? Is the entropy with BIP39 part wrong? Is that BIP32 library yielding erroneous addresses? What alternatives are there?

UPDATE:

Thanks to this site, I've seen that the xprv generated from the 12 words is incorrect. So either the bip39 is faulty, or the way I'm using it is.

The difficulty is with the poorly named BIP32Key.fromEntropy.

Typically to create a new wallet, you:

Get some entropy from a cryptographically secure random source, at least 128 bits and must be a multiple of 32 bits.
Convert the entropy to a mnemonic (this conversion is not a one-way function, it's bijective).
Convert the mnemonic to a 512-bit seed (this conversion is one way).
Convert the seed to an extended private key (also one way).
Do the BIP-32 derivation and all the rest....

BIP32Key.fromEntropy really should have been named BIP32Key.fromSeed.

Here's an example:

from bip32utils import BIP32Key
from bip32utils import BIP32_HARDEN
import os, bip39

strength_bits = 128
entropy = os.urandom(strength_bits // 8)
wallet_generator = bip39.Mnemonic('english')
mnemonic = wallet_generator.to_mnemonic(entropy)
assert wallet_generator.to_entropy(mnemonic) == entropy  # see, bijective!

# Or specify the mnemonic directly if you prefer:
mnemonic = 'aware report movie exile buyer drum poverty supreme gym oppose float elegant'

print mnemonic
seed = bip39.Mnemonic.to_seed(mnemonic)
key = BIP32Key.fromEntropy(seed)
account_number = 0
i = 0
print key.ChildKey(44 + BIP32_HARDEN) \
         .ChildKey(0 + BIP32_HARDEN) \
         .ChildKey(account_number + BIP32_HARDEN) \
         .ChildKey(0) \
         .ChildKey(i) \
         .Address()


Some miners set the nVersion field of the block header to 0x8000004. What were they signalling for? Was this an error? Some miners set the nVersion field of the block header to 0x8000004. What were they signalling for? Is this an error? I have been through a lot of the BIP documentations, but cannot seem to find any references for it.
The first one occurred at block height 416,832. The last at block height 455,757.
https://www.blockchain.com/btc/block/416832
https://www.blockchain.com/btc/block/455757

This block signaled support for BitPay's adaptive Block Size Proposal and was mined by slush pool.
I asked slush this exact question on twitter back in 2016!
https://twitter.com/slush_pool/status/744461234389524480
Note that this answer is not entirely complete, because the BitPay proposal specifies:

Miners express their support for this BIP by setting the
fifth-highest-bit in the block's 32-bit version number (0x08000000 in
hex)

But these blocks as you note also set bit 2 (0x00000004) which was not addressed by slush in his answer.
During this era, several other soft-fork proposals were being floated around that (due to lack of coordination a.k.a. decentralization) collided on their BIP9 signals. One was Extension Blocks. I'm having trouble finding links but I believe also at that time there was Rootstock (RSK) proposal that defined bit 2 as the signal, and an anti-asicboost proposal by Greg Maxwell that also signalled bit 2.


Bitcoin RPC ECONNREFUSED Trying to RPC my local active Bitcoin Full Node, but getting ECONNREFUSED on client.getBalance. Am I missing additional configuration? Is there a better RPC wrapper to use? Any advice or working examples would be greatly appreciated!

CODE:

var bitcoin=require("bitcoin");

var client = new bitcoin.Client({
  host: 'localhost',
  port: 8332,
  user: 'username',
  pass: 'password',
  timeout: 30000
});

client.getBalance('*', 6, function(err, balance, resHeaders) {
  if (err) return console.log(err);
  console.log('Balance:', balance);
});

CONFIGURATION FILE:

server=1
rpcuser=username
rpcpassword=password
rpcport=8332
rpcallowip=127.0.0.1

ERROR:

{ Error: connect ECONNREFUSED 127.0.0.1:8332
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 8332 }

Here is the solution that worked for me...

bictcoin.conf

txindex=1
server=1
rpcuser=username
rpcpassword=password
port=8444
rpcport=8332
rpcbind=127.0.0.1
rpcallowip=127.0.0.1

Bitcoin Daemon must be running
DOS CMD: netstat -a -n  must show listening for both ports 8444 and 8332

Good luck!


What is min time to get first confirmation for transaction? How much time does it take to get first confirmation for transaction? I don't need the exact number of minutes, just some useful approximation.

I found this chart of average confirmation times, but I'm not sure that it's the time just for first confirmation.
When a transaction isn't confirmed, lets say n hours, will it be in the getrawmempool list all that time?

The time to get a confirmation varies by the transaction fee, the transaction priority, and the rate of block creation.  In the upcoming Bitcoin 0.10, two new RPCs will be introduced that will help you estimate the number of blocks a transaction will take to get confirmation based on fee and priority (see notes below).  The rate of block creation is unpredictable over short spans of time---a single block can be found seconds after the previous block or take more than an hour. Over longer spans of time, it averages about one block every 10 minutes.
If the transaction is ever going to get confirmed, it must be in some miner's memory pool.  If it was broadcast by a full node which has that transaction in its wallet, it will also be in that node's memory pool.  If you have access to either of those nodes, the getrawmemorypool will return the transaction.

As for whether it's in any other node's memory pool, that depends on whether or not it propagated to that node---assuming it pays a reasonable fee and is a standard transaction, it should propagate to most nodes within a few minutes (see BitcoinStats) and should stay there until the nodes shutdown.

Appendix

Here's an example of the new estimatefee RPC from Bitcoin Core 0.10.  The argument 6 says "tell me how much fee I need to pay per kilobyte to make it statistically likely my transaction will be included in the next 6 blocks":

bitcoin-cli estimatefee 6
0.00026809

Here's an example of the new estimatepriority RPC.  The same deal, except priority is based on per-byte.  (Here's a SE answer about priority.)

bitcoin-cli estimatepriority 6
728784383.01282048

And here's the chance of finding a block within a certain number of minutes:

Variance http://dtrt.org/tmp/en-block-variance.png

The code to produce that plot in gnuplot is: plot [0:60] 1-exp(-1/(600./60)*x) where 600 is the average number of seconds between blocks (10 minutes) and 60 is the number of seconds in a minute.


Debugging Bitcoin Unit Tests I am running the unit tests from bitcoin source using make check, and would like to debug the tests using LogPrint in the bitcoin source files. I read in the Test Docs that logs are only output to test_framework.log, but I'm unable to locate this file. Where should I be able to find it? Or perhaps there is a better approach?

You are confusing the two kinds of tests. Unit tests are compiled into a separate binary and run by make check. Functional tests are testing the RPC commands and have to be run explicitly using the test_runner.py script. test_framework.log is only created by the functional tests. The documentation for the unit tests can be found here.

To print messages in the unit tests, you cannot use LogPrintf. Instead use BOOST_TEST_MESSAGE and BOOST_CHECK_MESSAGE to print messages from the tests. You will have to run the test binary directly (src/test/test_bitcoin) with --log_level=all to see the messages.

To print from the source files themselves, you could use fprintf() and print your messages to stderr.


bitcoin-cli getbalance 0 after restart I am working on a private chain using regtest mode. I have a strange behaviour if i restart the bitcoind process the balance becomes 0.?

i generate 101 new block to get the reward 50BTC. I repeat this operation to be sure but always i get the same result the balance is 0.

before
C:\WINDOWS\system32>bitcoin-cli -regtest getbalance
8800.00000000
after
C:\WINDOWS\system32>bitcoin-cli -regtest getbalance
0.00000000

update : the problem was the use of CTRL+C to stop the bitcoind deamon

You probably haven't gracefully shutdown your node during the first run.

Make sure you always stop your node(s) with ./bitcoin-cli -regtest stop


Amount of block locator hashes in "getblocks" message How many block locator hashes are sent in a getblocks message? And how distant are these locator hashes from one another?

getblocks message pushes a maximum of 500 block invs to the caller. It will lookup the given block locater in the active chain and pushes up to 500 MSG_BLOCK invs to the caller (it might stop earlier because the called node reaches the chain tip). The corresponding code for bitcoin-core 0.10 can be found here (https://github.com/bitcoin/bitcoin/blob/0.10/src/main.cpp#L3888).

Also notice that bitcoin-core now uses the headers first approach and therefore getblocks is no longer in use when acting as a "calling node".


How to use "lockunspent" in bitcoin core wallet console? Try to use the Lockunspend RPC in bitcoin core wallet console. But always get wrong, and google it can't find answer.

My input is:

lockunspent false "[{"txid":"c3fa34606ae3ea416ff640d97414ef6a0a8afcebfbe2c60403ad60c0d961f04c","vout":0}]"

Is anyone can teach me where I am wrong? Thanks

The problem is, you should to escape the inner quotes:

lockunspent false "[{\"txid\":\"c3fa34606ae3ea416ff640d97414ef6a0a8afcebfbe2c60403ad60c0d961f04c\",\"vout\":0}]"


Channels state validation in lightning network? I looked into docs but didn't find any information, how do client get information about the state of intermediate channels? Since  channel transactions are offchain, and only channel participants knows current channel state (each peer balance) how can the sender be sure that all channels on the route have sufficient credit to forward the payment?

Thank you in advance.

Let's say Alice wants to send a payment of 0.01 BTC to Dave and checks the following route through Bob and Carol, i.e.:

Alice ––– Bob –0.005–––0.02– Carol ––– Dave

Bob and Carol have a payment channel with a balance of 0.025 of which 0.005 are Bob's. If Bob now claims to be able to forward Alice's payment, this will only slow down Alice, but he would never be able to trick her. As the payment contract is crafted in cooperation of all four users along the route, Carol would also have to sign it. Since Carol shares the channel with Bob, she knows that Bob cannot sign over sufficient bitcoins to her to cover the payment, and would not agree to the payment.

Therefore, no one would have anything to gain by overstating their balance (except perhaps obstruction of payments), because their channel partner is also part of the contract and would deny a payment that exceeded the available balance.


Sending BTC using Seed Hex or mnemonic I’m interested in sending BTC from wallet to another and probably automate it through some libraries.

I have a question: if I have a seed hex or 12 words I can generate all my wallets (addresses, private keys) with BIP39 mnemonic tool.

How could I know what of external wallets (private keys) I should use to send btc using libraries assuming it usually changes?

How could I basically send BTC to some wallet having only seed hex or 12 words?

How could I know what of external wallets (private keys) I should use to send btc using libraries assuming it usually changes?

You can't without scanning the entire blockchain to find out what addresses have been used before.

  How could I basically send BTC to some wallet having only seed hex or 12 words?

You can't without scanning the entire blockchain to find the UTXOs that you can spend.

In general, a mnemonic phrase or a seed is not enough to be able to send Bitcoin to someone else. You need to generate keys and scan the entire blockchain to find UTXOs that you can spend. This is why many wallets store more than just the seed phrase in their wallet files.


What is pool hopping? What is pool hopping and how do pool hoppers affect other miners?

Are there ways to prevent it?

Some mining pools have a reward method for which some times are better to mine than others; normally, miners contribute to the pool equally through good and bad times, and their reward averages out to what is statistically expected.

Pool-hopping is the practice of mining in a pool only during the good times, and leaving during the bad times; by so doing, a pool-hopper can get more out of the pool than the value they contribute to it, increasing their rewards at the expense of other miners. Pool-hopping gets its name from the act of constantly hopping into and out of the pool (to either other pools or solo mining).

The most well-known form of pool-hopping is with pools using the proportional method, which is among the oldest, simplest, most widely used and most prone to hopping. By all accounts hopping in this context was first discussed in a paper from January 2011 by Nakamoto Ryo; a more accurate analysis was given shortly after in Optimal pool abuse strategy by Raulo; these results were extended in Analysis of Bitcoin Pooled Mining Reward Systems by myself.

In the proportional method, a block's reward is distributed between miners in proportion to the number of shares each of them submitted since the previous block; the reward per share is the block reward divided by the number of shares in the round. Because of this, the reward of a share submitted at any given time is affected by the number of shares already submitted since the last block; a share submitted early in the round will have a higher reward on average than a share submitted later.

It can be shown that until the number of shares in the round is 43.5% of the difficulty, a submitted share will have higher than normal reward on average; the optimal way to exploit a single proportional pool is to mine in it until this point is reached, hop to a different pool, and return when a block is found. The gain that can be achieved by following this strategy is up to 28.1%, depending on the ratio between the hashrates of hoppers and continuous miners in this pool (the more hoppers, the less they will gain). The gain can be higher if more than one proportional pool is taken advantage of (for example, 51.6% can be achieved with 2 pools).

The extra profits of hoppers come at the expense of the continuous miners. The exact loss depends on the ratio between hoppers and continuous miners; when they are equal the loss is about 17.1%, and the theoretical limit when there are only hoppers is 43.5%.

Slush's method, which scores shares based on the time they are submitted, was designed to combat pool-hopping, but is only an incomplete solution. SMPPS which strives to converge to the full value of each share in the long run can only be hopped to minimize the time until being paid in full, not to increase the expected reward.

Modern methods make sure that the reward per share depends only on the future of the pool, not its past. This way, without being able to divine future random events, any time is as good as any other to mine, so there can never be any gain or loss from hopping (with the exception of block-withholding attacks). The most popular such methods are PPS, PPLNS and DGM.

Advanced forms of pool-hopping, possible in some naive reward method implementations, include difficulty retarget hopping, tx fee hopping and hashrate fluctuation hopping.


Procedure for calculating taint? I'd like to understand taint analysis quantitatively. Blockchain.info offers a service that will calculate taint, but I've found no good explanation for how taint is calculated.

The best (and only) explanation I've found so far appears in the paper Anonymity of Bitcoin Transactions:

  The taint analysis works by calculating the percentage of the
  amount of bitcoins that might origin from another address,
  thus revealing connections in the transaction graph. In the
  simplified example in Figure 4, A1 and A3 would have a taint of 75% and A2 a taint of 25%. However, it can only detect direct connections in the graph and does not consider any
  context information.

This explanation is confusing. Taint is measured between two pseudonyms (addresses). It's not a property of a particular pseudonym. The paper seems to be missing the part that says the taint scores for A1, A2, and A3 are relative to A4. If so, then the scores make sense.

However, it's not clear what would happen for more complex chains of ownership. For example, imagine another pseudonym, A5 that pays A1 5 BTC. What would be the taint score between A5 and A4?

I've seen this, but it doesn't discuss how to compute a taint score between two pseudonyms.

What I'd like to see is the outline of a step-by-step procedure for calculating taint, as done by Blockchain.info. If I had to guess, here's how the procedure would look:

Find two pseudonyms, S (source) and T (target). Funds flow from S to T.
Using the block chain, find a chain of ownership Ci from each coin controlled by S to T.
For each chain of ownership Ci, find the lowest valued coin transfer mi.
Sum all mi, giving m.
Sum the value of all outputs received through T, giving s.
Taint is defined as m/s.

Using this procedure would give a taint score of 50% between A5 and A4 (2 / 4).

Is this correct?

I think I have an answer. It's not clear if this is how blockchain.info does it, but I'm not sure it matters, either.

Taint is very similar to the everyday experience of diluting a liquid.

Imagine starting with three glasses. One glass contains orange juice. The second contains water. The third is empty.

Pouring some or all of the orange juice into the empty glass doesn't dilute it at all. However, pouring a 1:1 mixture of orange juice and water into the empty glass dilutes the orange juice.

We can define a metric called dilution factor. Dilution factor equals the final volume contained in the formerly empty glass divided by the volume of orange juice added. The dilution factor for a 1:1 mixture is therefore 2 (2 / 1). If no dilution takes place, then the dilution factor is 1. More generally:

dilution factor = V2 / V1 if V2 > V1

dilution factor = 1 if V2 <= V1

We can add another empty glass and dilute again. For example, we can take half of the diluted orange juice and dilute it with an equal volume of water. This gives a second dilution factor of 2.

The overall dilution factor equals the cumulative product of the dilution factor at each step. In this case, it is 4 (2 x 2).

Now imagine that monetary value is like a liquid, and an output is like a container. We can do dilution analysis just like we did with orange juice.

In this case, the dilution factor tells us how diluted the value of an output in a chain of ownership has become relative to a downstream output. Provided that the limits of this metric are clear, it can be useful.

The liquid being diluted is "taint". In this model, "taint" would be the multiplicative inverse of dilution factor. A dilution factor of 2 implies a taint of 50% (1/2).

Returning to the question posed above, given this chain of ownership, find the dilution factor between A5 and A4:

A5(5 BTC)->A1(2 BTC)->A3(3 BTC)->A4(4 BTC)

The dilution factors are, from left to right: 1; 3/2; 4/3. Multiplying them together gives 1 x 3/2 x 4/3, or 2. This is a 50% taint, the same answer as I got above.

However, the answer postulated in my original question is wrong in that it doesn't account for serial dilution. Consider this chain of ownership:

A5(1 BTC)->A1(5 BTC)->A3(3 BTC)->A4(4 BTC)

The serial dilution factor is 5 x 1 x 4/3, or 20/3.

Simply dividing the final value by the minimum value upstream gives a dilution factor between A5 and A4 of 4/1.


Will DHS eventually stop wire transfers to/from Mt Gox? This past week the US Dept of Homeland Security stopped all Dwolla transfers to/from Mt Gox.  Do wire transfers to/from Mt Gox still work?  Will the US DHS eventually shut down wire transfers to/from Mt Gox?

Take a look at beta bitinstant at https://new.bitinstant.com/ No longer option for cash to mtgox.  Could be possible indicator.


ASIC-Resistant Proof of Work Bitcoin uses a Proof of Work algorithm that makes it the perfect victim of ASIC mining. As a result, it is not very decentralized (more than 50% of Bitcoin's hash power is concentrated in China and most of that is concentrated in a small area). Furthermore, considering the fact that just a handful of companies produce efficient ASIC hardware those companies essentially have complete control over the hashing power of the entire network.
Other algorithms have been developed that are memory intensive and are ASIC resistant.
Is there a reason why Bitcoin won't move to ASIC resistant algorithms (aside from the fact that it would require a hard fork)? In other words, do ASIC-prone algorithms fundamentally provide any benefit (in terms of security or scalability) over ASIC resistant algorithms?
Thanks

The downsides outweigh the upsides: as you mentioned this would require a hard fork, and would leave everyone (not just mining farms) who owns a Bitcoin miner with a very expensive paperweight, and as such it's unlikely a large enough portion of the community is willing to make the change for it to be successful. It would require throwing away a significant amount of infrastructure.
I suppose one day if it were to become a problem where Bitcoin miners are colluding to try and rewrite the blockchain or censor transactions, then we could reevaluate this. However, mining already comes with such razor-thin margins that it is extremely unlikely miners will be throwing away their profits to do this: they would all have to agree to work against their own best interests.


Why did GLBSE close? I went to https://glbse.com/ and see it is closed. It was a stock exchange for shares of companies denominated in Bitcoins.

Does anyone know why it closed?

At this point in time only one person, Nefario, knows for sure why GLBSE closed.  He was the one who had the power to close it, and he did so, without giving any public explanation.

Everything else is either hearsay or speculation.


Can you send Bitcoins from Bitcoin-Qt without downloading the whole blockchain? If I have Bitcoins in my wallet and I have downloaded the blockchain far enough so that I can see that I have received them, can I send them without having a fully updated blockchain?

No, because Bitcoin-Qt still has no way of knowing if you actually have those bitcoins.

Imagine you had the same wallet on two separate computers one with the block chain fully downloaded and one with it only half downloaded. Now Imagine you have 10 bitcoins. On the wallet with the block chain fully downloaded you send all 10 coins to your friend. This computer now reflects that you have 0 bitcoins while the one with the half downloaded block chain still says you have 10. If Bitcoin-Qt allowed you to send those bitcoins, it would be opening the network up to double spending.


Setting up wallet on new machine with 12 word passphrase - next button greyed out I have Electrum 2.8.0 on a Mac with a wallet I'm logged into.

I've gone to Wallet / Seed to get the 12 word passphrase.

I then have a Windows 10 PC with Electrum 2.9.3 on. In the install Wizard I type in the 12 words, but then 'Next' button is still greyed out.

Shouldn't the Next button stop being greyed out when I've typed all 12 words (checked multiple times)? How do i restore using the passphrase seed on the new computer?

You can see this FAQ entry regarding this problem. It covers various possibilities.