"Fidor to integrate Ripple protocol", what does that mean? On Monday Ripple Labs announced that Fidor Bank AG will be integrating the Ripple protocol later this year.

Has somebody found concrete statements what this will entail? Will Fidor Bank AG only become a user on the Ripple network, or are they planning to become a Gateway?

Coindesk seems to be suggesting that they will provide Gateway services, other sources seem to be suggesting that Fidor only wants to use it on the back-end to transfer money to other countries.

After digging some more and finding pretty much every possible interpretation on different media outlets, I just called Nick Riegger, the press spokesman of Fidor Bank AG.

According to my conversation with Nick Riegger:

  Fidor Bank AG has already started implementing support for Ripple on their back end. They will first be on the lookout for business partners also using Ripple, in order improve channels for sending money abroad to other banks and business partners. Long-term they want to offer their customers access to any major payment protocol, including Ripple and Bitcoin. To that end they are closely watching the development of the Ripple network just as they are already doing with Bitcoin.

To me it sounded as if they will first use Ripple as a user, but are also considering to provide gateway services long-term.

Update:
At Bitcoin2014, I had the chance to talk to a Ripple Labs employee and fellow SE user, who outlined to me the immediate problem that Fidor Bank AG was hoping to solve: Previously, Fidor had been paying a third party to transfer funds between its own subsidiaries in different federal states of Germany. As the counterparty of such a transaction is still part of the own company, this was like "paying someone to transfer money bills from my left pocket to my right pocket", as he put it. Fidor is hoping that using Ripple for this purpose will substantially lower the cost for such in-company balancing at low risk, while Ripple Labs is hoping that the demonstration of such a use-case would find mimics, or perhaps will convince Fidor to use Ripple for a broader range of purposes, such as transfering money to business partners using Ripple, or even providing their customers access to Ripple by becoming a Gateway in the long run.


How to re-secure a multisignature wallet if private key is stolen Here are two attack scenarios on bitcoin private keys:

1) Assume  that,  BitCorp has just noticed that a Mallory  has just compromised one of their servers holding their Bitcoin Private keys. Luckily, they are using a 2-out-3 multi-signature wallet, so Mallory has learnt only one of the 3 sets of keys. The other two sets are on different servers that Mallory cannot access. How do that re-secure their wallet and effectively revoke the information that Mallory has learned?

2) If BitCorp uses 2-out-,2 instead of 2-out-3 wallet, what steps can they take 'in advance' so that they can recover, even in the event of one of their servers getting broken into(and Mallory not just learning but also potentially 'deleting' the key material on that server)?

How do that re-secure their wallet and effectively revoke the information that Mallory has learned?

They would have to generate new keys and send the Bitcoin to the multisig address that uses those new keys. If Mallory has/had access to one wallet, she could record any and all keys in that wallet. Thus all keys in that wallet must be considered compromised and never used again. Any Bitcoin associated with those keys should be moved to a newly generated wallet that is not compromised.

  2) If BitCorp uses 2-out-,2 instead of 2-out-3 wallet, what steps can they take 'in advance' so that they can recover, even in the event of one of their servers getting broken into(and Mallory not just learning but also potentially 'deleting' the key material on that server)?

They can create pre-signed timelocked transactions that send the coins to another address that they control where those private keys are stored on separate servers. In the event that Mallory compromises and deletes the private key for one key in the 2-of-2, that transaction can be broadcast after the timelock and the coins moved to a new address where the private keys exist.


Best place to buy bitcoins? Possible Duplicate:
  How do you obtain bitcoins?

I live in Europe and, because of that, I would like to buy some bitcoins with my savings "just in case". I'm a student, so I'm talking about between 500 and 1000 € (it is not much money, I know).

What I would like to know is a trustful website to buy bitcoins. I plan to have my wallet encrypted in my computer, so its not about the security of the wallet, but the security of the transaction. Is Mt. Gox safe? Can I buy there with euros? Can I avoid paying a fee?

I'm sorry if these are very basic questions, but I haven't found any similar question, and I think that newbies (like me) will appreciate it.

You should generally have a look at the charts:

http://bitcoincharts.com/markets/

A good rule of thumb to judge how much people trust a website is how large is the volume of transactions - the more, the better.

In all regards, Mt.Gox is safe, you can buy there in euros, and I don't think you can bypass the fees. If you worry about the last one, you can try finding someone willing to trade Bitcoins with you that you can trust (which can be difficult at times).


Preventing theft of Bitcoin ATM I am considering buying a Lamassu Bitcoin ATM machine.

The small machine is apparently "grab resistant". Does anyone know how the grab resistant mechanism works? Are there hooks on the back?

According to the website:

  The machine will be smash and grab resistant. It is not meant for
  unattended or outdoor use, but it will have thick metal mounting
  plates, a dual locking system and an internal strong box for the cash.

According to this site:

  The outer casing is a custom steel case made in Portugal. There’s a
  Protec cylinder lock holding it closed. Inside, there’s yet another
  steel case and another Protec lock. The tablet that runs the software
  has no open ports, and all outgoing connections are via https.


Updating a lightning node to latest version I'm running a lightning node on a Raspberry Pi. I'm still learning about the technology and linux as well. But I'm not sure how to securely update my node to the new LND version 0.4.1 and I'd like some directions.

I already downloaded LND binaries and checked the keys.

$ wget https://github.com/lightningnetwork/lnd/releases/download/v0.4.1-beta/lnd-linux-arm-v0.4.1-beta.tar.gz

I used this to install the previous version (0.4-beta)

$ tar -xzf lnd-linux-arm-v0.4-beta.tar.gz
$ ls -la
$ sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-arm-v0.4-beta/*

But how should I proceed if I just want to update, considering I'm not installing from scratch? What commands should I use? Should I backup anything before doing this (like channeldb.db)?

Generic update procedure from v0.4.0 to v0.4.1:

stop LND
delete macaroon files in LND directory (to prevent this issue)
install new version exactly like before (as documented above)
start LND
unlock wallet with lncli unlock to create new macaroon files

In case you are following my RaspiBolt guide, you might want to copy the macaroon file to the admin home directory again: sudo cp /home/bitcoin/.lnd/admin.macaroon /home/admin/.lnd/ (see more details here)


How to get Bitcoin Cash from Multibit HD wallet? Multibit HD still works but is no longer supported so I sent most of my bitcoins to my new ledger nano s hardware wallet.
I now gather there may be bitcoin cash associated with the old multibit wallet that could still be claimed. If so, how can I do that please?

You need to use a Bitcoin Cash specific wallet.  I won't recommend a specific one but here is a list:

https://www.bitcoincash.org/#wallets

Use at your own risk.


How can I assure my consumers they are actually paying the correct person? (prevent MITM attacks) There are many network level attacks that give someone Man in the Middle ability to replace my Bitcoin address with their own.

Since there is no way to cancel a transaction, and the best practice is to generate a unique address per sender...

How can I assure my consumers they are actually paying the correct person?

I want to avoid the situation where a sender actually sent payment to a spoofer (which can't be canceled), and still have a dynamic address that people can send money to based on the sender.

A similar question is here, but it doesn't focus on the safety and security of communicating the address from the (anonymous) merchant to the (anonymous) recipient.

There is a lot of evidence that man in the middle attacks are common, and this is a good question for the Bitcoin community to review.

When publishing the Bitcoin address on a web page, either you will be using a static address (one address for many senders) or generating a new address for that particular user.

Regardless of the frequency of generating a new address, the bottom line is if you send your Bitcoin address over HTTP you need to secure the DNS infrastructure, SSL, and make sure your site is protected from HTTP based XSS, CSRF attacks.

Here are some links to get you started with securing HTTP:

Send all traffic over SSL, and set cookies to Secure and HTTP Only
Use a well known Public Key vendor and ask visitors to run Convergence.IO to prevent a stolen/hacked key from being used.
Disable compression on the webserver or load balancer and configure SSL correctly
Scan the client's machine for old plugins and ask them to upgrade
Have a dedicated domain for purchases with only one "dot" in the name

Ultra-modern DNS Security

Use DNSSec with a trusted root domain that supports DNSSEC at the root (.com, .org, etc)
Use TLSA RFC6698 to self-publish SSL keys into DNS

For ToR clients

Have a .onion address  (users at Exit nodes can modify your HTTP/S session)
Detect that the user is using ToR and redirect them to your .onion address


Split coins in wallet using coins from coinbase.com Tell me if this is a valid / secure idea to split my coins in my wallet after a hard fork without replay protection (e.g. segwit2x).

I have read the question here, but I want to clarify how to use it with my wallet (Electrum, but probably similar for other wallets). My plan is basically to use the "taint" method, using coinbase.com to provide the "tainted" coins.

I have some pre-fork bitcoin on coinbase.com, so after the fork I'll be entitled to some BTC and B2X. I also have some pre-fork bitcoin in my own wallet. My plan is this:

Send a small amount of B2X from coinbase.com to my wallet
In my wallet, select a server on the segwit2x branch. I should see the transaction from (1).
Create a new wallet
Send all coins, including the new tainted coin, to an address in my new wallet
Change to a server on the non-segwit2x branch. I should see that my balance is unspent.

Done.

Now my new wallet will contain only coins valid on B2X, because the transaction in (4) would not be valid on BTC. My old wallet will contain only coins valid on BTC, because they've already been spent on B2X.

coinbase.com claim their sends have replay protection: "You can safely send any BTC or B2X from Coinbase without worrying about replays on the other chain."

Does this imply that the coins I get in (1) can be used as a "taint"?

I could repeat the procedure, sending a small amount of BTC to my old wallet, and sending this plus all my coins to a new address in the same wallet, to make sure any transactions using them are not replayable on the B2X branch. Is this necessary, or are my BTC coins immune to replay by virtue of already having been spent? Even if a transaction I did on BTC could be replayed on B2X, I wouldn't care, because my value on B2X is now in a different address. I'd like to skip this step to avoid the transaction fee.

Now that I have a wallet for each chain, will they remember which chain they belong to? If I use automatic server selection, then if I get the wrong server my wallet will show a balance of 0. This is more of an annoyance than an actual danger, because I can always manually select the server. Just wondering.

As an alternative to (3) and (4), I might just send this transaction directly back to coinbase.com to exchange the B2X. Should this modified procedure also work as I intend?

I know there are other methods, but I have my reasons for not preferring them, such as fiddliness or utilizing features not supported by my wallet.

coinbase.com claim their sends have replay protection: "You can safely send any BTC or B2X from Coinbase without worrying about replays on the other chain."
  Does this imply that the coins I get in (1) can be used as a "taint"?

Yes, if a transaction only exists on one blockchain, it is by definition only valid on that blockchain, so any other transaction which spends from it is also only valid on that chain.

  Is this necessary, or are my BTC coins immune to replay by virtue of already having been spent?

The latter, since your outputs have already been spent on the B2X chain, any replay of your BTC transaction would be rejected as a double-spend there, so you can safely just spend your BTC normally.

  Now that I have a wallet for each chain, will they remember which chain they belong to?

I assume that would be the case, but I'm not familiar with the wallet so I can't answer this.

I'm unsure what you mean in your last point, send which transaction back to coinbase?


Bitcoin Block Reward value How can someone calculate the current/real-time value of a Bitcoin block?

What is the equation/algorithm used to determine this?

I've found a few resource online, but I'm a little confused

How can someone calculate the current/real-time value of a Bitcoin
  block?

Steps:

run bitcoin-cli getblockcount to get current block_height
current_block_reward = 50 / [(block_height MOD 210000) + 1]

  What is the equation/algorithm used to determine this?

Value the of a Bitcoin block defined here. The default value is 50 * 100,000,000 Satoshis.

After every "SubsidyHalvingInterval" blocks, the reward of each block halved. The SubsidyHalvingInterval is defined here

CAmount GetBlockValue(int nHeight, const CAmount& nFees)
{
    CAmount nSubsidy = 50 * COIN;
    int halvings = nHeight / Params().SubsidyHalvingInterval();

    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return nFees;

    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;

    return nSubsidy + nFees;
}


Why destroy bitcoins? I keep seeing references to destroying bitcoins by sending them to addresses that nobody can own (e.g., addresses derived from impossible public keys). What would be the reason for doing this? It's discussed in such a cavalier manner in various posts that I'm assuming it's not an attempt to undermine the currency.

A non-malicious reason to deliberately destroy notable amounts of Bitcoins would be for a hypothetical alternative blockchain that recognizes Bitcoins sent to a special address as newly generated coins. One could for example try to establish a new "Altcoin" which is incompatible to Bitcoin, but every private key that signs a Bitcoin transaction to a special impossible Bitcoin address is eligible to also spend an according amount of Altcoins. This would enable a secure one-way conversion to a separate blockchain without the need for exchanges.


How does one mine Namecoins? In order to mine Bitcoins, one needs to start the bitcoind with "-server" flag and later request from it a getwork to solve. Does the Namecoin client operate in the same way, or is there some specific "namecoind" version one needs to use in order to generate coins? Where can one find the communication protocol for it?

The -gen flag actually started a CPU miner process in older versions of the Bitcoin client, before CPU mining became obsolete.

What you're probably thinking was more like bitcoind -server or `bitcoind -server -RPCALLOWIP=192.168.1.* -RPCPORT=8333 which would start a listening Bitcoin server from which a proper miner could obtain getworks. Since namecoind is a direct port of bitcoind with only the DNS-replacement functionality added, the flags are the same. Nothing special or fancy required, just follow any old "how to solo mine" tutorial and replace bitcoind with namecoind.


If you have a mobile wallet, do you lose your coins when you lose your phone? I'm new to this Bitcoin stuff and discussing it with friends. Somebody said, if you "have bitcoins on your phone" and you lose your phone, you also lose your bitcoins.

Is this true?

No, not necessarily. In fact, if you actually follow the instructions given by most wallet software, you won't lose your Bitcoin.

When you first setup a Bitcoin wallet, most modern wallet software will walk you through making backups of your wallet (which are not stored on your phone). Most will also force you to click through multiple dialogs of "I understand that not backing up means I can lose all of my coins" if you try to skip the backup process. If you have a backup, then you can restore your wallet on a new phone or on a computer with a different wallet software. If you do not have a backup, then yes, you will lose all of your Bitcoin.

Alternatively you could use a web wallet where the information necessary to spend your coins are stored on the internet with a third party. In this case, if you lose your phone, you won't lose your coins so long as you remember your login credentials. But I wouldn't recommend using a web wallet as they can cause many other security and privacy issues that can result in you losing all of your coins.


Which wallets support spending partial amounts of btc from a cold storage address? Which wallets let you spend partial amounts from your btc address from a cold storage address without the need to import / sweeping it? I know mycellium has the feature, but I'd like to know if there are others that can do this.

I have a "watch only address" of my cold storage in Electrum. In this watch only address I can see all tx, and as such also create tx. I just cannot sign it. So I create it, save it to USB stick, bring it to cold storage, sign it, and bring it back to deliver to the network. I would guess the same can also be done with core wallet.


how do devs upgrade bitcoin core without affecting the live active network? I've always wondered, how do devs developing on Bitcoin upgrade the system without affecting the live network? We typically see a site under maintenance when big companies revamp their site, but how does Bitcoin do it?

Most network changes are totally backward-compatible. When two Bitcoin nodes first contact each other, they tell each other the latest protocol version they support. They then use the oldest version of the two. In this way, even really old clients can connect to the network because all other nodes will switch to the old protocol version when talking to them.

Occasionally, it's necessary for all miners or (extremely rarely) all Bitcoin users to change some network rule at the same time to prevent the network from splitting in two. This is done by adding the change to the code, but only activating it at some particular time some weeks/months/years after the change is added. After the time has elapsed, most people will have upgraded to the new version of Bitcoin, and doing the change will cause minimal disruption. Instead of updating at a particular time, changes can sometimes also be activated when nodes detect via info inserted into the block chain that most other nodes have upgraded.


Can failed Transactions figure out which Channel is exhausted? According to information in this LND PR the sender of an TemporaryChannelFailure can be determined:

  In many cases it is impossible for the sender to determine which of the two nodes in a pair is responsible for the failure. In this situation, we now penalize bidirectionally. This does not hurt the good node of the pair, because only its connection to a bad node is penalized.

So my understanding of this comment is, the channel, or at least the node next to one of the exhausted channels can be identified quite easily. Is it really that easy? Can TemporaryChannelFailure and therefore channel exhaustions always be assigned to two nodes or one channel?

I always assumed, the error cannot be assigned to a node or channel at all.

This might simplify the work of some papers, such as On the Difficulty of Hiding the Balance
of Lightning Network Channels by J Herrera-Joancomarti et al., or open new attack vectors.

Edit: more links for further research

In case someone wants to give a more in-depth answer or do research on top of this, here are some links to the code in the lnd client github code base:

In lightningnetwork/lightning-onion crypto.go, function DecryptError, the client cycles through the secrets to unwrap the error and identify the sender index.
In lightningnetwork/lnd htlcswitch/switch.go, function parseFailedPayment this DecryptError function is used to access the failure.
Later this value will be accessed e. g. in missioncontrol.go or result_interpretation.go as FailureSourceIdx, failureSourceIdx or failureSrcIdx.

As far as I understand (but I did not double check the code) the answer is yes. The error messages in the onion seem to be encrypted in a way so that only the origanal sender of the onion can decrypt it. Since the error also had to be padded to keep the error onion of constant length the key derivation scheme for sending onions is kind of reused. In that sense the receiver of the error message unwraps all the envelopes and thus should know from which node the error arose.


How do you choose the correct fee with Bitcoin Core? I have the same problem with unconfirmed transaction and I already know how to solve it. But I don't know how to define transaction fee so that it doesn't happen again. I'm using the Bitcoin Core wallet and I chose the recommended option for transaction and fastest confirmation time. When I sent the transaction, a lower fee was applied than recommended and now the status of transaction is: 0/unconfirmed, in memory pool, broadcast through 1 node(s).

Bitcoin Core has updated their fee estimation logic several times in the past few years, another patch coming up shortly in Bitcoin Core 0.15.0. If you aren't running a current version of Bitcoin Core, you should first update your software to the most recent version.

If the problem occurred with a recent version of Bitcoin Core, you should consider checking different resources on the web to get a feeling for the current fee level on the network in order to sanity-check the fee level suggested by Bitcoin Core during the transaction generation process.

Some such sites are:

https://btc.com/stats/unconfirmed-tx
https://bitcoinfees.github.io/
https://bitcoinfees.21.co/

Another option would be to use the RBF feature, although this is currently only available for crafting transactions via commandline. A pullrequest to support it in the GUI is in the makings, I think that Bitcoin Knots (Luke Dashjr's client) already supports it in the GUI.


How to improve bitcoin-qt when downloading blockchain? (very technical, dev views appreciated) GitHub suggested discussing here before bothering developers with an issue.
So be it! :)
I'm running Bitcoin Core Version v0.20.1 and Linux Mint 18.3 on crappy old hardware. Pruning blockchain to 2 G and setting dbcache=2048 didn't help much. Moving datadir from HDD onto a USB-Stick did a little.
top says CPU around 20% can reach up to 40 if I manually drop slow or unresponsive nodes.
CPU frequency is rarely going up. So, no issue here.
Memory usage is fine too, actually a lot of headroom. Looks like bitcoin-qt doesn't need that much cache.
Swap is empty. (vm.swappiness=5)
iostat
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sdc               0,00     0,00  549,00    0,00 51125,00     0,00   186,25     1,06    1,92    1,92    0,00   1,70  93,60

Bottleneck seems to be file I/O. Which confuses me since that is what a cache is meant to fix, isn't it?
Now to my questions:
Is there anything I am missing to improve disk access?
Is there an open issue on GitHub regarding this already?
And secondly for the experts on dropping lazy nodes. Can you give me a hint at which classes I have to look to understand the strategy? Or even better a link to the discussions on that topic.
For I don't want to start an arms race between clients seeking faster download and nodes trying to serve fair.
Short summary what I've learned so far.

Don't use USB-Sticks for datadir. For bitcoin-qt might shutdown due to Fatal LevelDB errors.
Pruning increases disk I/O while saving disk space.
Even on crappy old hardware memory and CPU are most probably not the limiting factor.

Short and simple answer to my initial problem regarding downloading the blockchain: You might need better hardware! :)
In summary bitcoin-qt runs out of the box.
So do not fumble around. Unless you really need to.
Pruning saves disk space but increases disk I/O.
Increasing dbcache can help but not so much for pruning.
Both can be done in config-window. Thus, no need to change bitcoin.conf.
Plus, ... I haven't mentioned it lately, have I? ... don't use USB-Sticks! :)
Having that out of my way let's dive into my "real" question.
If we look at it from a queueing theory point of view we have three fields to consider.

Input that are the nodes you are feasting on.
Processing where your hardware and configuration comes into play.
Output writing to disk in our case.

Input side
At first glance it look like I had problems connecting to responsive nodes.
Looking deeper into it, I found the sending side was never really an issue.
The sending behaviour of nodes in average over a long period made me distinguish three main types.
A few are sending MB, some a few KB and a lot just 150 Bytes then drop out
Over time responsive nodes lower their data rate.
Data is usually coming in bulks. All nodes send in parallel many MB/s and then stop for several minutes. While my CPU and disk are constantly busy. So it looks like they are filling one input queue.
This is generally a usual behaviour for queued systems. They are pumping. That's why you have buffers.
Looks like increasing buffers will not help on my machine, since there is already plenty of headroom.
Sending at high data rates and slowing down over time makes sense for the nodes to distribute load on other nodes. From a clients view this is a preferable behaviour too.
Although my view as a user is bitcoin-qt can improve its dropping strategy, to not bother nodes who did their fair share and focus more on still very responsive nodes.
Sending KB even somewhat erratically at low data rates isn't really helpful.
Since in a free network you can't tell a node what to do, clients need a strategy to drop those nodes early.
Why do some nodes just show up to say hello and leave 150 behind?
Probably a kind of handshake. But do we actually need to hold them for a while?
In short: Yes, technically there is room for improvement. But is it worth the effort?
Processing side
I'd say everything is fine. Neither memory nor CPU are problematic.
Output side
Disk I/O is an issue, at least for me.
As Pieter pointed out pruning prevents optimal caching.
I'm reluctant to judge on this topic without thorough understanding.
But my first approach would be reducing the number of files involved.
Many thanks to Pieter and Murch for their quick response. Helped a lot!
Feedback and corrections highly appreciated!


Use several PC to generate vanity addresses I have seven PC and I want to generate a unique Bitcoin address. On one PC the speed to generate addresses is low.
How can I use vanitygen.exe on all of my computers to increase the speed of generating the intended vanity address?

Technically, you can simply run the software on all 7 machines and it will have the same expected completion time.

You will have the same mathematical probability of finding an address that matches what you're looking for in both cases.


Who gets Bitcoin transaction fees? Whenever I send bitcoins from one wallet or one exchange to the next there is always a fee. This makes sense with the exchange sites, they are just collecting the fee so they can make a living. What about the open source wallets that I've installed on my computer?
Surely, nobody is collecting my bitcoins because my transactions are too long! So, is the "fee" part of the Bitcoin algorithm? Do the coins that are confiscated in the fee go to Bitcoin miners?

Also, when does the fee start? I noticed, if I send like 0.05 bitcoins there is no fee, but if I send 0.1 bitcoins there is a fee.
What if I just sent 0.05 bit coins twice? Or is it if they are in the same block I will get a fee, so I'd have to send them twice (and 10 minutes apart)?

The fee goes to the miner who mines the block that includes your transaction. The fee is based on the size (in bytes) of the transaction and the age of its inputs (how long ago the coins spent were received).

Transactions get big if they have to "pull in" a lot of outputs from previous transactions and that raises the fee. So if you got a lot of small payments and then try to make a large payment, the transaction will be expensive because it needs to gather all those small payments.


Is there a way to create a transaction that it can only be confirmed after another unrelated transaction has been confirmed? Is there a way to create a transaction A that cannot be confirmed until B has been included in a block, although A does not build on any UTXO B creates?

B would have already been broadcast by another user at that point, and you'd only be able to control A.

Background:
I was following a discussion on reddit, where a user was entertaining the scenario that in the future a mining cartel might censor transactions. He suggested creating transactions A that would only become spendable in the event of a confirmation for the censored transaction B, i.e. lending your fee as additional financial incentive for some miner to include B and break the censorship.
I was wondering whether that would actually be possible. Sorry, I wasn't able to find the thread.

I assume A spending the UTXO of an intermediate transaction C, which spends a UTXO of B doesn't count as 'unrelated', as that's just two degrees of separation instead of one.

Here are three partial-solutions:

To state the obvious, you could simply wait until B is confirmed to publish A.
You could publish A with a lock time in the future and then update it at a regular interval with increasing sequences and extending the lock time each time, but that doesn't eliminate the possibility that earlier versions of A will get mined when their lock time expires. Then when B is mined you publish a new version of A without the lock time enabled.
If you only require that it doesn't affect the coins moving around in transaction B, You could add an output to B that doesn't have any coins in it, and is used only for the dependency tracking of transactions. This requires that you know that you plan to publish a dependent transaction, A, ahead of time though.

I think you'll find that there really isn't a good way to do what you are asking. Transaction dependencies are usually handled by referencing outputs of the previous transaction.

In terms of the scenario where you are trying to bribe miners to confirm transactions that they have been censoring, this is essentially trying to do Child-Pays-For-Parent with transactions that cannot reference outputs. While this is still not possible, you might be able to do something like this:

The community realizes that many transactions are being censored, and they want to pay miners to include their transactions. So everyone starts appending an extra OP_TRUE output to their transaction, with 0 coins in it. Then if you want to reward a miner for mining the transaction with an OP_TRUE output in it, you spend that output with an empty scriptSig and spend another output to provide some fees.

One downside to this is that a miner will only be able to accept one person's bribes, as there is only one OP_TRUE UTXO added. But, I think if Bitcoin gets to this point, then it will likely have failed.

You could also do an escrow, where you put coins into a 2-of-3 with you, the miner, and a trusted third party. If the miner mines B, then you sign the release transaction to take the coins out of escrow and give them to the miner. If the miner doesn't mine B after a certain amount of time, then you request that the trusted third party help you release your funds. This is a lot of work for a simple task, though.


Can someone explain this [outdated] BIP12 OP_EVAL exploit? I understand that BIP12 was withdrawn, and probably because of this exploit below.  Can someone explain how this attack would have worked and the effect it would have on the network?

 for (;;) {
    RAND_bytes(nonce.b, sizeof(nonce));
    RIPEMD160(nonce.b, sizeof(nonce), digest);
    if (
      digest[0] == 174 && // OP_CHECKMULTISIG
      digest[1] ==  76 && // OP_PUSHDATA1
      digest[2] ==  16    // 0x16
    ) {
      // We'll print status info on partial hits, just to make things more
      // interesting.
      printf("%llx\n", nonce.i);
      print_hex(digest, 20);

      // Check for full hit
      if (digest[19] == 117) // OP_DROP
        return;
    }

Each transaction has a certain number of "sigops", the number of signature validation script ops like OP_CHECKSIG in its scripts. These script ops are very expensive to compute. Transactions with too many sigops are considered non-standard and will not be relayed by most clients. Blocks with too many sigops in their transactions are illegal and will be rejected entirely.

That exploit allows you to include sigops in transactions without increasing the sigop count. It could be used to create a very slow-to-compute transaction that isn't very big size-wise. Not a huge exploit, and it could be worked around, but it demonstrates an important weakness in BIP 12: OP_EVAL scripts can't be analyzed accurately without running them first.


If miners switched to random pools every hour, would it help the network? A Miner is using Pool A

After 1 hour the Miner closes the mining software and switches to another pool (Pool B) that is randomly selected.

Would this be beneficial for the network as the hash power is now randomly spread out?

Would this also benefit the miner as they now have an increased luck % on finding the next block with the random pool?

Assumption: List of pools contains at least 5 non-connected pools.

Would this be beneficial for the network as the hash power is now randomly spread out?

The network itself would not really directly benefit, because the total hash rate remains the same, pools are just a secondary construction. Better distribution of who controls the hash rate, though, is good for the long term health of the network in terms of centralization (either in terms of more even distribution between existing pools, or more pools). If a lot of miners were part of a single large pool, the owner of that pool would be able to perform a 51% attack.

So no, randomly switching is pointless, but choosing a smaller pool to join and stick with is a good idea to help distribute the hashrate better.

  Would this also benefit the miner as they now have an increased luck % on finding the next block with the random pool?

No, you have the same probability of finding the next block no matter what pool you are connected to, because the only thing involved in finding a valid block is the number of hashes you can try.


Why did Satoshi not choose for Segwit? I know that the very early version of the Bitcoin code had a lot of advanced features, and was already very mature.

But Segwit (storing signatures separately from the transactions in the block) is a very simple change, and so obvious that I'm sure it must have passed Satoshi's mind many times.

So I'm wondering: what could be a reason that Satoshi choose to store the signatures inside the transaction? There is always the possibility that he just made a stupid mistake in the design, but I find that hard to believe.

Satoshi made many design decisions that are now criticized (like signatures in transactions, 2-week difficulty period, halvings, etc..). He also made some maths error in the whitepaper. Satoshi wasn't a perfect designer and his C++ code was not up to the highest standards.

We will maybe never know for sure why he chose what he chose, but I'd personally argue it was for simplicity sake.

On a more tangent note: while SegWit looks simple on paper (just put the signatures on the side), in practice, it's quite a complex change to implement. It took months for the most experienced developers to review it.


Can I recover my own wallet from the public key? I made a wallet years back. It has a good amount of Bitcoin then I wiped and sold my laptop. Now somehow I found my wallet address public key. Is it possible to get the private key somehow?

This is impossible.

The whole point of public key cryptography is that the public key can be shared with anybody, without compromising the private key.  If there were a way to recover the private key using the public key, this would all fall apart, and in particular Bitcoin would be horribly insecure.  This hasn't happened.

The public key could be used to determine how much Bitcoin is associated with that key, but it is no help at all in actually accessing those coins.  Sorry.


How to verify ASICMiner share ownership through Bitcoin address / blockchain.info? How do I verify ownership of ASICMiner shares through a Bitcoin address given that matches with a signed message I've been sent?

Go to https://blockchain.info/address/16fuoinLFjBmiCYmCYDXPNfERJtdPB5ASe

Check if the same address as he has signed the message with is on that page. This will only tell you that he had the shares the moment the dividend was paid.

Or you can ask friedcat on bitcointalk.org to confirm the ownership of shares.


How to determine if a public key point y is negative or positive, odd or even? Take a bitcoin public key (x, y) and its additive inverse (x, -y). How do you identify which is the positive point and which is the negative point?

Example

Private key 1 -> (x, y)

x =  0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798L

y =  0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8L

-y =  0xb7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777L

Private key 2 -> (x, y)

x =  0xc6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5L

y =  0x1ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52aL

-y =  0xe51e970159c23cc65c3a7be6b99315110809cd9acd992f1edc9bce55af301705L

Private key 3 -> (x, y)

x =  0xf9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9L

y =  0x388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672L

-y =  0xc77084f09cd217ebf01cc819d5c80ca99aff5666cb3ddce4934602897b4715bdL

Also, how can you identify which pub key is odd and which is even?

ex: private key 1 x,y is odd , private key 2 x,y is even

There is no concrete determination that makes one 'y' value negative or not in an EC point. Feel free to make your own convention, like y-values <= than half of p are negative, and > half of p are positive. That's just a convention, though.
Related:

What does the curve used in Bitcoin, secp256k1, look like?

Also, how can you identify which pub key is odd and which is even?
ex: private key 1 x,y is odd , private key 2 x,y is even

You can't! Not without knowing the private key itself. If you could, you would be part of the way towards solving the discrete log problem.


tracking Lost bitcoin wallet I bought bitcoin 3yrs ago (i did not know so much about it then, i was only playing with it).
I received the bitcoin via a particular address which I still have. How can i track the BTC wallet I used via BTC address?

The best way you can do is one of the below:

Check your computer for the wallet file of the BTC address if it was a desktop wallet
Check your home for any paper/computer for the private key/seed of that BTC address if it was a desktop wallet
Check your browser history for any exchange login and try to login and check for that balance.

With just the BTC address, you cannot find the info of the BTC wallet.


Mining with a geforce 315 I have a simple computer: 4GB ram, Intel core 2 duo E4500 and a Geforce 315 (i also have a Geforce 9400 but I don't know which is better) and I was wondering if it would be possible (without overheating my PC) to mine bitcoin with it. I dont care much about the electricity bill because i just want to do it for a hobby but if someone could let me know that would be great.

Cheers,

Ash

Just to discourage you further:

You'll have a very difficult time finding a mining client that will run GPUs at this point. You'll most likely have to compile it yourself.
Even with the best possible graphics card, it'll take you around 10,000 YEARS to find a POW-hash given the current difficulty.
You'll be making about 0.36 cents per day at the current bitcoin price with this amazing rig. Your card gets about 1/100th of that, so it'd be 0.004 cents a day, or a whole year to earn about 1.5 cents.

The wear on tear on your machine is insanely expensive compared to that.

If you're interested in making bitcoins with your machine, I would suggest you create an API service of some kind using 21.co's API.


What if I don't send the complete amount from my paper wallet? I have been trying to understand the concept of paper wallets. They seem to be secure in the sense of holding our bitcoins but no so much when we try to spend the bitcoins from the paper wallets. Now, I am supposed to transfer all the bitcoins from my paper wallet at once while importing the private key in blockchain.info. But what will happen if I spend a little bit from it?

From what I understand at this point, the rest of the amount won't be present in the paper wallet address. It will go to a "change" address. This is where it gets all confusing. How will I get access to the rest of the bitcoin amount then?

When you make a transaction, you will make a change output. This output can be to any address that you want, just as if you are sending Bitcoin to someone else. Depending on the software you are using, you can set the change address to whatever you want. You could send the coins back to your paper wallet address or you can create a new paper wallet and send the change there.

It is recommended that you do not reuse addresses, so you should create a new paper wallet and send the coins to that address.


BAMT Lan - Qualcomm Atheros AR8171 I got the the new MB http://www.asrock.com/mb/Intel/H87M/?cat=Specifications which comes with Qualcomm Atheros AR8171 Lan, and unfortunately BAMT 1.2 does not have a driver for it included.

Does exists the way to install the missing driver, does the driver exists at all? I'm totally new to Linux and don't know even how to open command line in BAMT.

I use USB boot image from: https://litecointalk.org/index.php?topic=2924.0

If there no option to install the driver, can I use USB to LAN adapter without additional headaches, or I will need to install the driver to?

Found the answer here:

http://forums.debian.net/viewtopic.php?t=105858#p506223

worked beautifully for me..


getrawtransaction seems to only work for certain transactions I am working through mastering bitcoin. I am confused by getrawtransaction. I would like to look at the first transaction in block 277316.

from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException

# rpc_user and rpc_password are set in the bitcoin.conf file
p = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(username, pw))

# look at specific block
blockheight = 277316

# get the hash of that block
block_hash = p.getblockhash(277316)

# get the block
block = p.getblock(block_hash)

# get the transactions in the block
transactions = block['tx']
first_transaction = transactions[0]
print p.getrawtransaction(first_transaction)

Gives this error:

bitcoinrpc.authproxy.JSONRPCException: -5: No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions.

It seems like it only wants to look in the mempool. How do I use the -txindex parameter it suggests?

If I run the below code, it works fine. This is also a transaction from the same block (64th transaction) and clearly not in the mempool. What is the difference between this and the how I get the transaction id in the above code?

print p.getrawtransaction('0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2')

getrawtransaction is only guaranteed to work for mempool transactions, unless you're running with the -txindex command line flag, or txindex=1 in your bitcoin.conf file.

In practice it works for all transactions that have at least one unspent output remaining, but it's relatively slow, and functionality that may be removed at some point.


What does "new block detected on network before long poll" mean? I'm new to mining and I'm mining doge coins. My mining client reported

new block detected on network before longpoll

but it doesn't seem like I'm actually mining anything. What does this mean?

It means a block has been found and what your currently mining is the past block.


Another Unconfirmed BTC transaction Sorry guys & gals - yet another "unconfirmed BTC transaction..".

Looks like the fee was too small, but this was sent 72 hours ago now (at the time of writing)

https://blockchain.info/tx/f81760ebe76ad0e64374ee3d243f0549fe809d61285c5631c01def84848dcdb2

Do I just need to be more patient?

Edit:12/06/16 - It has been over 120 hours now, are there any options for me to retract the transfer and re-submit with a higher fee?

Yes be more patient. In the future you can use this app or others like it to determine an appropriate fee for faster confirmation:

https://bitcoinfees.21.co/

"Which fee should I use?

The fastest and cheapest transaction fee is currently 50 satoshis/byte, shown in green at the top.
For the median transaction size of 226 bytes, this results in a fee of 11,300 satoshis (0.04$).

What are the fees shown here?

The fees displayed here are Satoshis (0.00000001 BTC) per byte of transaction data. Miners usually include transactions with the highest fee/byte first.
Wallets should base their fee calculations on this number, depending on how fast the user needs confirmations."


Obligatory transaction fee? I'm fairly new to bitcoin and today I sent 1 satoshi to my own adress using the standard wallet, and I was surprised that I couldn't do it without paying a 0.005 BTC (I think, can't remember the exact value) transaction fee.

As far as I knew transaction fee's were supposed to be voluntary, when did this get added? Is there no way to transfer bitcoins for free anymore?

Transaction fees are voluntary but the client application is forcing the minimum transaction amount of .005.  It's been a long time since I've used the standard client.  .005 sounds correct.


How can one read the value of a wallet from the blockchain? It seems like the blockchain transactions only stores the number of coins moving from one wallet to the other, but does not have the total amounts for each wallet.

Therefore it seems like if you want to get the value of any given wallet you would have to read every transaction in the ledger from the very beginning.

Is this correct or am I missing something?

Fyi, my goal is to understand the format of the blockchain better

Assuming you don't trust anyone, you need to read the entire blockchain history once to generate your own set of unspent transactions (UTXOs). You won't need then to read again the full history every time you want to see your balance. Unspent Transactions are enough to do so.

Your balance is the sum of the values of the unspent transactions your wallet has. Unspent means here that you didn't "spend" the previously received amounts on outgoing transactions.

Example:

Alice sends you 1 BTC. you now have an unspent transaction of 1 BTC. Your balance is the sum of unspent transactions, i.e. 1 BTC
Then Bob decides to send you 2 BTC. You have now two unspent transactions associated to your wallet, for a total balance of 3 BTC.
Let's assume now you want to send 1 BTC to Charlie. After checking that you have at least 1 unspent BTC (which is the case), your transaction would be processed and the amount that you spend would be removed from your "unspent" transaction. In that case, the transaction received from Alice would be now marked as spent and would be removed from your list of unspent transactions.
Your balance is still the sum of unspent transactions, i.e. 2 BTC (from Bob)


Is it safe to share my BTCGuild API key? Is there any risk in sharing my BTCGuild API key with someone else?  I want them to be able to see my hashing rate but I want to make sure it's not a bad idea or unsafe in anyway.

For example using this made up API key:
https://www.btcguild.com/api.php?api_key=a291130c92da4c27f4f2f69b89f63652

BTCGuild doesn't seem to have a public documentation on their api so I may be wrong, but from what google searches are bringing up the API is used to access stats on your account. So unless you don't want people to know how much you've mined, you can safely share it (probably).


Create multisignature wallet from xpub keys in bitcoin core I can create Multisignature wallet electrum with 2 xpub keys.

How can I create bitcoin core to do that?

Standart use;
Add a multisig address from 2 addresses

  bitcoin-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"

Is there way to do like;

  bitcoin-cli addmultisigaddress 2 "[\"tpubDAenfwNu5GyCJWv8oqRAckdKMSUoZjgVF5p8WvQwHQeXjDhAHmGrPa4a4y2Fn7HF2nfCLefJanHV3ny1UY25MRVogizB2zRUdAo7Tr9XAjm\",\"tprv8erNzbjXdtYpKbKF4HeZpBCQj2W64MS2SAJCcWxgqLueSZ9KLTPZGoDTu8NugecLLqeS2RYan2f6qcexUTjp3m2HGxmpAiP48BaUz7XHxzQ\"]"

This will be mostly possible in the upcoming Bitcoin Core 0.18 release.

First you need to understand that the sequence of such paired multisig addresses (with public keys generated from 2 xpubs in lockstep) can be described in the new descriptor language.

The syntax is sh(multi(2,XPUB/*,XPUB/*)). The sh indicates P2SH embedding, multi refers to multisig, the 2 means 2 signatures are required, and the two XPUB arguments are what the public keys are drawn from.

As descriptors are intended to be safe for human communication, they need a checksum in some cases. This checksum can be computed using the getdescriptorinfo RPC command, which will append a #CHECKSUM suffix.

Once you have the descriptor, you can do multiple things with it. One is determining the corresponding addresses using deriveaddresses.

bitcoin-cli deriveaddresses "DESC" [0,1000]

Will give you the first 1001 addresses (using keys with indexed 0 through 1000) for your descriptor.

You can also import them into a wallet, all at once using the flexible importmulti RPC, which in 0.18 is extended to support descriptors.

bitcoin-cli importmulti [{"desc" : "DESC", "range" : [0, 1000], "watchonly" : true, "timestamp" : "now"}]

Will import the first 1000 addresses, together will all information necessary to recognize payments to them, and sign for spending them (excluding the private keys, of course).

The watchonly indicates you're aware private keys are missing, but want to import as watched anyway.
The timestamp indicates the first time these keys may have been used. "now" means you know the keys haven't been used yet (or you don't care about their history); alternatively you can give a timestamp as the number of seconds since UNIX epoch to specify a birth time.

Note that this will not automatically watch for more than the first 1000 addresses as they get consumed - you'll need a new import command for that (for now).


What would happen if there were two "disjoined" versions of bitcoin with the same popularity? Right now, we have one accepted version of Bitcoin (the software) and most miners and full nodes are using some versions of that.

However, what can very well happen is some split within Bitcoin developers over some detail - say, halving time, block size, minimal fee, better hashing/encrypting algorithms after some successful cryptographic attack, you name it. (It happens with open source projects.)

Imagine this happened and there were two "versions" of bitcoin, that accept different blocks as valid - for the worst case scenario, imagine that the sets of valid blocks are suddenly disjoined (what is accepted for one version is not for the other). And for the worst case scenario, imagine that the distribution between both miners and full nodes is 50:50.

What exactly would happen? How exactly would the problem "resolved itself"? If we assume that regular transactions (not the mining ones) are sent between both of the versions, what would happen with them?

(Sorry if this question seems too theoretical, but I personally can see this hapenning.)

That is what is considered a hard fork, assuming that both halves have their reasons to not change it's versions and that previous blocks in the blockchain are considered valid in both clients then we will have 2 types of coins.

Coins generated before the fork (A) will be freely double spendable transactions using this kind of inputs will be accepted by both groups of miners and considered valid.
Coins generated after the fork (B, C), non double spendable and transaction that use this kind of coins will be accepted by only one of groups the other will discard it.

As long as you mix A with only B or C in your transactions they will be accepted by half of the miners, you could not mix B and C as you client will have only one blockhain.

Services and clients that are connected to the network will be using chain B or C, even swapping and having reorgs of really large portions of the chain if the client considers valid both chains, but on a given time a client can only have one chain or the other.

In such scenario clients and merchants will choose B or C for whatever reasons and get a client modified to only allow B or C blocks, that will disable double spending attacks agains the same merchant (but will still allow to double spend between merchants using different chains).
Maybe new clients will be created to block all transactions using A coins.

Anyway, in real life this would not matter, if such an event happens for more than a couple of hours, the fork and double spending problems will crash bitcoin value, merchants will disconnect from the network and stop accepting bitcoins and miners will have no reason to continue mining B or C, it would be better for them to start a new coin altogether (Bitcoin 2  and Bitcoin^2) than continue working on that.


malleability in 2-of-2 multisig payment channel I am having issues understanding 2-of-2 multisig, with regards to the malleability attack. Where Alice and Bob set up a multisig payment channel where Alice sends 1 BTC in order to do multiple tx afterwards in the payment channel. Where, before Alice can send, Bob needs to sign a 2-of-2 refund over n-locktime.

Alice to MultisigAddr:

1BTC , in: txid-A[n], out: MultisigAddr ---> txid-M[0]

Refund to Alice:

1BTC, in: txid-M[0],out: RefundAliceAddr ---> txid-R[0] with n-locktime, Signed by Bob

In the malleability attack the broadcasted txid-M[0] gets changed to another value, txid-C[0] in order to render the refund to Alice invalid, locking her funds in the multisig channel +-

What I don't understand is how txid-M[0] can be known for Bob to sign the 2of2 multisig transaction for the refund, since it requires the hashing of the transaction from Alice to MultisigAddr first. Did I make an error here somewhere in my construct?

Did I make an error here somewhere in my construct?

No, you did not. This is indeed an issue for payment channels which can be worked around but reduces the security of a payment channel and increases the complexity of creating a payment channel.

Because malleability poses a problem with payment channels, transactions used for payment channels used in the lightning network make use of Segwit which makes transactions that use Segwit non-malleable. Specifically, for a LN payment channel, the funding transaction must be non-malleable; it must spend from previous segwit outputs and create segwit outputs to allow for future non-malleable transactions.


How to recover from a double spending attack? I found myself incapable of answering what would happen in this case, so here it is:

A hacker (Mr Hacker) spends UTXO_1 and UTXO_2 in TX_1, depositing the monetary value of all TX_1's outputs into a Service (eg a payment processor).
A legitimate user (Mr Legit) spends UTXO_3 in TX_2. Again, TX_2's outputs targets the same Service
Both TX_1 and TX_2 make it into the same block and get one confirmation by the network.
The Service immediately spends UTXO_1 and UTXO_3 in TX_3 to pay Mr Legit and UTXO_2 in TX_4 to pay Mr Smith.
Mr Hacker then decides to double-spend TX_1 and for that reason he creates TX_5 which "redirects" all outputs to himself. Mr Hacker is a miner so he is able to perform all the hashing work to make the double-spend successful. He is also lucky and the double-spend succeeds.

So the question is:

Have all TXs before TX_5 (TXs: 1,2,3,4) been invalidated or just TX_1, TX_3and TX_4 (TX_3 and TX_4 spent an output previous controlled by TX_1 which was double-spent)?
Mr Legit could see 1 confirmation for TX_2 before the double-spending. What does he see now? What does Mr Smith see in his wallet, before and after the double-spending?
The Service realizes that a double-spending took place and needs to recover from that broken state. What does it have to do to get back to normal operation? Does it have to re-send all the TXs? Does it still have in place the deposits made by TX_2 after the double-spending or does it have to do something to re-claim these outputs?
How can the Service prevent Mr Hacker, who also has plenty of money to spend, from repeating the same process forever just to ruin the Service's smooth operation, rather than (the Service) waiting for more confirmations before sending out the payments?

I had to diagram this out as the transactions and block chain might actually appear:

    Inputs/Prev Outpoints    Outpoints
TX1 A:0                      TX1:0, TX1:1
TX2 B:0                      TX2:0
TX3 TX1:0, TX2:0             ?
TX4 TX1:1                    ?
TX5 A:0                      TX5:0

                (TX5)
Block A ------> Block C ----> Block D
         \
          ----> Block B
                (TX1, TX2)

To answer your questions:

TX3 and TX4 are not valid in any block chain which does not previously include TX1.  TX1 can't be included if TX5 is already a part of that chain because TX1 and TX5 both spend outpoint A:0.
TX2 is never invalid, so it If the wallet sending TX2 downloaded the now-stale block, it would've shown 1 confirmation. After the wallet switched to the new best block chain, it would show 0 confirmations again because neither block C nor block D includes it. After another block on the best block chain does include it, it'll return to 1 confirmation and increase from there.
If the service still wants to make the same payments, it has to create new transactions (TX6, TX7) using inputs that are still valid (e.g. TX2:0). If it attempts to resend TX3 or TX4, other nodes may ban it for attempting to relay invalid transactions.
To prevent future fork-based double spend attacks, the service either has to wait for more confirmations or find some non-Bitcoin way to collect money from double spenders, such as requiring registration with state-issued identification.  I know requiring more confirmations requires waiting more time, which is inconvenient, but it's the only decentralized method we have for reducing fraud risk.


signrawtransaction is not a function on bitcoin core V0.17.1 I'm using npm bitcoin-core ^2.0.0 to get access to my bitcoind (v0.17.1 MAC)

My code:

let signedRawTx = await btcClient.signRawTransaction(rawTx, [], [privateKey], 'ALL');

I get an error message telling me that signrawtransaction is deprecated, use signrawtransactionwithkey instead.

My problem: I tried to mixed uppercase letters like this:

btcClient.signRawTransactionWithKey(...)
btcClient.signrawtransactionwithkey(...)
btcClient.signRawTransactionWithkey(...)
...

with always the same kind of error:

signRawTransactionWithKey is not a function...

In my text editor, I can see all the available functions for btcClient, signRawTransaction is in the list but nothing like signRawTransactionWithKey.
If I type help in the console of bitcoind, I can see signrawtransaction and signrawtransactionwithkey.

Any advice ?

It looks like the new calls are not yet supported in btcClient.

https://github.com/ruimarinho/bitcoin-core/issues/77 refers generally to your issue.

v2.0.0 was released "a year ago" according to https://www.npmjs.com/package/bitcoin-core; v0.17 bitcoind, which made the change, four months ago.

If you're just tinkering, you might consider downgrading your bitcoind until the library catches up.


Want to Accept bitcoins from php form I want to exchange BTC with other payment methods on my website.

person A will fill the form with email, name or other required fields and then fill amount of BTC he want to exchange. that form will take him to payment form (like Paypal checkout form) after that, I will "manually" transfer him dollars to his bank account/paypal or any other payment service.

I've seen Paypal integration, and I've tested it with my sandbox account. but I don't find any tutorial for bitcoin.

I tried to use blockchain but for API they require website URL and currently I am developing on localhost.

Block.io is pretty easy to use, but their free api is limited.

Blocktrail is another option that is easy to sign up for, and relatively easy to use as well.

My personal favorite is still blockchain.info but you are not the first one to mention difficulties getting an API key.

I've noticed the same lack of tutorials for Bitcoin web development which is why I started my site and youtube channel 2 years ago. If you Google how to use block.it api or how to use blockchain.info api you should be able to find tutorials that will help you.


Protection against malware attacks Does bitcoin or Blockchain protect against malware attacks that install a trojan to steal data from a device, on which bitcoin application is installed? Cause a trojan can steal the user's private key, thus his bitcoins can be stolen.

I try to make it short (as this question spreads a wide range...): bitcoin or blockchain do not protect against malware. At the end, bitcoin can be considered as the software that runs a wallet on your computer/mobile. And blockchain is a public accessible data structure. We can forget about blockchain, cause this data structure doesn't help at all to protect against malware.
So for the wallet: this is a set of data on your harddrive, that contains (somehow) the priv key. As long as your operating system permits access to the storage area of your harddrive, it depends on the protection layer of the OS, how to secure this. Windows has a very long and very strong record of insecurities at all layers (any vulnerability you can think of), and the amount of "protection software" shows clearly, that this is not the optimal operating system for storing value(s). I am not strong enough an expert for mobile devices... When it comes to Unix type OS, the world looks far better, and there are less attack vectors, due to the segregation of duties in the system. Still there are possibilities to "steal" your data, e.g. when you install a (probably unverified) software as admin on your system.
Generally this OS protection topic should be further discussed in the information security area, not here. As long as you store only little value (like you would have Euros or Dollars or Pounds in your real wallet), any unix type OS would do, also mobile wallets. When you go above values of let's say 1000 Euros/Dollars/Pounds, start thinking about protecting your values (keywords: hardware wallet, cold storage). You find enough references here or in reddit.


Can spent transactions that get pruned lead to false payment claims? The bitcoin white paper says that spent transactions get pruned after being buried behind enough blocks:

  Reclaiming Disk Space
  Once the latest transaction in a coin is buried under enough blocks, the spent transactions before it can be discarded to save disk space.

At some future point after a transaction gets pruned, couldn't the original recipient of that transaction then claim that she did not receive the correct amount of payment without worrying about anyone being able to disprove her because the transaction no longer exists in the blockchain?

Sure, but so what? I can make all kinds of false claims that nobody can disprove.

We only care about two things:

1) Can someone who actually has funds prove that they have those funds?

2) Can we ensure that somebody who does not have funds cannot prove that they have funds?

So long as we meet these two criteria, there is no problem. It's perfectly fine if people can make claims to have funds that we cannot disprove, so long as they cannot prove them.


How much power for mining single Bitcoin or bitcoin cash? Is there a fixed amount, or maybe just the average, power used to mine one single bitcoin coin or single bitcoin cash coin?

How low can the price fall until miners start red numbers?

Here's the quick math I did:

According to Blockchain.info, the total hash power is about 20.1 million TH/s.
If this is all done by the most efficient AntMiner S9 hardware, at 13.5 TH/s, then there are around 1.5 million devices.

Each device draws around 30KWh each day, and they are probably paying around 8 cents KWh, for a daily cost of about $2.40 USD each.

So:

$2.40 per day * 1.5 million devices = $3.7 million daily electricity cost

How much is being earned?

There are around 144 blocks mined every day, with a value of 12.5 BTC, which currently goes for about $9,000.

So the total income is about $16.2 million every day.

How low could prices fall before miners can't even pay their electrical bill?

144 blocks * 12.5 BTC * $X cost == $3.7 million electricity cost
solve for X:
X = $2,055

So, when the price of a BTC gets close to $2,000, miners will no longer be able to even pay their electrical bills.  Then there is hardware, staff, maintenance, overhead, profit, etc.

Side issues:

I assumed the most efficient S9 hardware, but some devices are more wasteful.  It is possible that more efficient miners will be coming out too.

I used some of the lowest US costs for electricity.  Its likely that costs in other countries are less.  I also assumed perfectly efficient power supplies, but checking on some online posts, it seems real-world power consumption may be 30% higher than what I estimated.


Can you help me with a puzzle transaction? I am hoping there is someone out there that can help me with probably a simple bit coin scripting question...but maybe there is something more to it. I am trying to fully test a custom script on a regtest bitcoind node network. I have worked through some online tutorials and I can create the custom locking script, transform it into a P2SH, and send coin to it. The issue is when I try to unlock the script. I am trying to write the unlocking transaction by hand since this is a basic puzzle transaction...with no luck. Here is the detailed info:

Bitcoin Version: 16.0
Network: RegTest
Locking Script Hex: 0x93016387 (OP_ADD 99 OP_EQUAL)

Here is the base transaction serialized, please note this does reference a previous transaction that sends 1.0 coin to that wallet's address.
0200000001f5bbd0f99f94380cdff45f3eb689e62437df6e6519554a99ae4042b6499afee0000000006b483045022100e2382837f540c03bde1d3aafea0706c358db61b65d85aef9ea29350ecfb7c8dd02204244642b7166529085238527771ead376e1fa69d20dd23b49762014543d407ea0121036397e0c5c226797a1244f5c0736d7874b756cbc11fe39866c2c380403ca5bcdaffffffff0180c6ef050000000017a9143f58b4f7b14847a9083694b9b3b52a4cea2569ed8700000000
If you decode this, you will see a vout to the p2sh address:
 2My2ApqGcoNXYceZC4d7fipBu4GodkbefHD
The next transaction I generated is:
02000000014192c46838cfe8296c9189b7d7e51a57aad2ee31f931d5b9721908f13f87594b0000000000ffffffff0140b9ec05000000001976a914351ef68a632b634cdb63d0e2b58b7f795ba1233f88ac00000000
Which references the previous transaction but does not have a signature and it decodes properly. Then I try to insert the solution to the locking script, by adding: 3e5101620493016387a9143f58b4f7b14847a9083694b9b3b52a4cea2569ed87 in the correct spot...which it might not be makes this transaction:
02000000014192c46838cfe8296c9189b7d7e51a57aad2ee31f931d5b9721908f13f87594b00000000003e5101620493016387a9143f58b4f7b14847a9083694b9b3b52a4cea2569ed87ffffffff0140b9ec05000000001976a914351ef68a632b634cdb63d0e2b58b7f795ba1233f88ac00000000

And that is where it breaks, I try to decode it...doesn't work...I try to send it...doesn't work...I believe the hex is correct and I believe it is in the right spot...but any ideas or help you can provide will be helpful.

So I have resolved the issue, first a huge thanks to pebwindkraft for the direction and link to look at. Based on his breakdown of a transaction I was able to figure out where I was going wrong. I was missing the correct hex to unlock the previous transaction, once that was entered in the correct spot of the serialized transaction, it was broadcasted successfully. The breakdown of the transaction there, plus the bitcoin reference pages were huge helps in figuring this out.

Thanks again,

Dave


How to dump all of addresses from wallet.dat for other alt-coins? I'm on binarycoin now, with solo mining. Luck smile to me. I'm found 5 blocks. It is 100.0 binarycoins.

I'm trying to use "aggressive" speed-up, my daemon compiled with -O3.

After last block I caught crash of daemon. And fails of relaunching with err:

Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment
PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
wallet.dat: unable to flush page: 19
txn_checkpoint: failed to flush the buffer cache: DB_RUNRECOVERY: Fatal error, run database recovery

If I'm redownload the blockchain.

-rescan doesn't help.

I'm shutdown the network, clean everything in the .binarycoin/* except wallet.dat and binarycoin.conf. Launch the daemon. My wallet.dat remembered that there were blocks, every block was marked as orphan. I've start to sniffing for my coins. My account named as "" contain only one address. I've found a web-blockchain  www.binarycoin.info:8080/
There was no my address.

By tx ids in my wallet.dat, on this web-blockchain I've found addresses that received the bounties. I've dumped privkeys of this addresses, and cooled down.

My nerve continue playing. What if there is no side web-blockchain. How should I discovery the tx ids and thereafter my addresses, and thereafter dump my privkeys?

There is no option to get every address from wallet.dat, only one (default) address.

I found pywallet. It is for Bitcoin. Nevertheless, I've dump in plain-text my wallet.dat. 117 addresses with their privkeys.

I compare my real addresses with this 117. No one.

I compare privkeys. No one.

How to trully extract all addresses and all privkeys that wallet.dat contains?
( Specially for alt-coins )

now you can use bitcoin-cli dumpwallet command to export all your privkeys


Getting error while running Blockchain.info api I am getting error as {"error":"Not found"} when I am trying to run the blockchain.info wallet api service locally on my computer.
I was getting the error of "Address in Use " error when I ran it on http://127.0.0.1:3000/
after changing it to http://127.0.0.1:8000/ I am getting error.

Blockchain.info is really not working anymore, seems to be they are stopping API service or there's something wrong. Since API don't work anymore (callbacks - gap limit so far).


Need a random seed for vanitygen; where can I obtain one? Vanitygen has the option for a file to contain random numbers as an alternative to the built-in random number generator.

What is the correct way to generate this file on Windows, OSX? (and Linux)

What is the range of each number (upper and lower bound)?

What is the correct format of the file (CRLF, LF only)?

It uses RAND_load_file function from OpenSSL, which accepts any binary input - random bytes. Under Linux and OSX the /dev/random file can be used, I don't know  equivalent under Windows. However, OpenSSL uses /dev/random by default, so there is no improvement using it explicitly.

Only scenario might be when you need faster random numbers generator, as /dev/random is quite slow and you start vanitygen very often. Then you can for example use /dev/urandom (but in this case you expose yourself to small but perhaps exploitable possibility that the seeds for generated addresses will be related). Certified hardware random numbers generators would be preferred in this case (some recent Intel and VIA CPUs have one).


off-chain payment channels: Do we need to trust "Payment Service Providers"? A paper entitled: "Privacy in Bitcoin Transactions: New Challenges from Blockchain Scalability Solutions" has tried to investigate privacy issues of the Bitcoin influenced by the solutions for scalability of transaction throughput such that off-chain payment channels.

In this paper, we read:

  "Mixing services as described so far can be applied to standard
  bitcoin addresses and transactions but when off-chain payment
  channels are used, such mixing techniques cannot be applied in the
  same form. In off-chain payments, on one hand, users may be more
  restricted on the number of payment channels that they create (due to
  fee costs) but on the other hand, payments are processed with multiple
  hops through different Payment Service Providers, and such
  hops could remain secret since they take place in the off-chain payment network and there is no need to store them. So
  the natural idea to detach the link between source and
  destination in this scenario is to perform payments through secret
  multiple hop routes."

Of course, there is no need to store the intermediary hopes between source and destination. However,

(1) What happens if those Payment Service Providers decide to reveal the information of the payment ? (if they are able to do ?)

(2) How to perform payments through secret multiple hop routes ? Does it mean that we need to trust the intermediary hopes to keep them secret ?

In lightning network payments are onion routed.  The only thing a PSV could reveal is the previous and next hop, but they can not know the origin or the destination.  They know it came from Alice, and went to Bob, but they do not know where Alice may have gotten it from, or where Bob may send it to.


How do I decrypt a password protected, BIP0038 address? Services like bitaddress.org allow you to password encrypt a paper wallet. How would I decrypt it?

I found https://github.com/sour-is/bip38tool on github and after a little bit of struggle with the unfamilar golang ecosystem got it installed.

Once installed, the instructions for use are as follows:

export BIP38_PASS=<PASSWORD>
cd /usr/local/go/src/bip38tool
./bip38tool decrypt <KEY>

This produces your entire decrypted wallet including the plaintext private key which you can import into electrum or any other wallet application.


How to be sure that whole of block chain downloaded? I catch myself on the thought, that I don't know how to verify that block chain downloaded or not yet.

How exactly I can be sure that all is ok with bitcoind or altcoins?

E.g. "terracoind getinfo" brings:

terracoind getinfo

{
    "version" : 80002,
    "protocolversion" : 70001,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 142718,
    "timeoffset" : -6,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 13505.04606600,
    "testnet" : false,
    "keypoololdest" : 1380559952,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "errors" : ""
}

Or novacoind:

novacoind getinfo

{
    "version" : "v0.4.4.5-2-gde717f9-dirty-beta",
    "protocolversion" : 60010,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "newmint" : 0.00000000,
    "stake" : 0.00000000,
    "blocks" : 19043,
    "timeoffset" : -15,
    "moneysupply" : 384762.67195300,
    "connections" : 16,
    "proxy" : "",
    "ip" : "128.73.179.81",
    "difficulty" : 97.09844140,
    "testnet" : false,
    "keypoololdest" : 1380559917,
    "keypoolsize" : 101,
    "paytxfee" : 0.01000000,
    "errors" : ""
}

Here are 3 answers about bitcoind:

How to check Bitcoind block chain download progress level

And only about downloading side part block-chain info. Is it true, that nothing embedded into default bitcoind for that task?

You can either do a sanity check as also suggested in Anonymous' answer: The age of the last block shouldn't be more than a few minutes old (depending on the coin protocol), usually not more than twice the aimed .

The other option is to compare the id of the last block against one or several well connected websites which respectively would be your coin's blockexplorer.com or blockchain.info. If that website's latest block has the same block id as yours, it is reasonable to assume that you are up to date.


Bitcoin address generation and UTXO scanning I'm developing bitcoin payment processing application.

I've two question to ask:

In each bip32 address, How much UTXO each address should have to consider generating new address to avoid address re-using? for example If address A used twice should I generate a new address or does it have specified number for address re-use before generating new one?
When new address generated, from my understanding , I've to scan following address for each address derivation path to see if each index have fund or not:

Legacy
Segwit
Change address for Legacy
Change address for Segwit

What's best way to scan addresses without submitting so much request (for each index) to blockchain explorer to scan funds?

Thanks in advance.

How much UTXO each address should have to consider generating new address to avoid address re-using?

Preventing address re-use by itself means that an address should not be used more than once. So unless, someone sends you two outputs to the same address in the same transaction (highly unlikely) you are going to end up with one UTXO per address. Preventing address re-use helps your privacy. For example, say you used an address to receive funds from your customer. If you use the same address again, these customers can actually scan the blockchain to see how much amount you have received from others. Not re-using addresses more than once helps protect your privacy.

  When new address generated, from my understanding , I've to scan following address for each address derivation path to see if each index have fund or not?

Depends on what address format are you using for your payment gateway. If you have always generated bech32 addresses, you need not scan the blockchain for P2PKH addresses to see the amount received from your customers. You only need to scan the blockchain for the addresses that you have generated (receiving or change).


How to make free transactions? I have to send a small amount 0.00001 btc to someone. The client requires a fee of 0.0005 btc (much more than the amount). This seems absurd. There should be a way to send coins for free, as mentioned in several articles ("no transaction fee").
Please let me know if it is possible to send BTC for free and which client to use.

Those types of transactions are not desirable on the bitcoin network.   Each transaction takes up bandwidth and storage on each of the tens of thousands of nodes that exist.

If there were no fee, people that would like to harm Bitcoin would send those "spammy" types of transactions nonstop and the system would not be sustainable.

So the Bitcoin.org client takes a look at the transaction and if it is "spammy", it requires a minimum fee of 0.0005 BTC.

You can take the Bitcoin.org source and modify it so that no fee is ever required (or build from the branch that does this already), however your transaction will be rejected by most nodes and mining pools, and thus will likely not ever make it into a block.

You can, however, include many payment addresses in a single transaction. That way one small-ish fee will cover lost of small transactions, though as the amount of data the transaction consumes increases the fee may need to increase proportionally (0.0005 BTC per KB of data).

Be realistic though ... 0.0010 BTC is worth about a U.S. penny.  You are asking to send 0.00001 BTC -- an amount worth 1/100th of a penny.   There are very few reasons to ever need to send a payment to someone for a fraction of a penny.

In instances where earnings occur a fraction of a penny at a time (e.g., for each ad impression, or for each mining share earned), an EWallet account with that service where they are earned (e.g., mining pool) can be used to accumulate those earnings until a payout threshold (e.g., 0.1 BTC) is reached.  Then the payout can be sent without paying any fee.


Do confidential transactions produce an UTXO There must be magical cryptographic reason why CT doesn't create an UTXO.
If it did make an UTXO, it'd be trivial to calculate the input + output right?

In Confidential Transactions (as used in Blockstream's Elements and Liquid), there are still identifiable UTXOs.

The only change is that instead of the amount, a homomorphic commitment to the amount is stored. While not technically correct, you could see it as a form of encryption that is compatible with addition and subtraction. So if a+b=c+d then E(a)+E(b)=E(c)+E(d) (where E() is the encryption function). This lets the verifiers still ascertain that the amounts in input and outputs match up.


Determining xprv from xpub and child private key I'm confused by the wording in BIP0032:

  One weakness that may not be immediately obvious, is that knowledge of
  a parent extended public key plus any non-hardened private key
  descending from it is equivalent to knowing the parent extended
  private key (and thus every private and public key descending from
  it). This means that extended public keys must be treated more
  carefully than regular public keys. It is also the reason for the
  existence of hardened keys, and why they are used for the account
  level in the tree. This way, a leak of account-specific (or below)
  private key never risks compromising the master or other accounts.

The default recommended wallet layout is m/0'/0/i.

So if I leak the xpub of m/0'/0 (which, in theory, my auditor has) and a private key in m/0'/0/14, then wouldn't all keys in m/0'/0/i be compromised? I understand that m/1' and m are safe but now you've lost an entire account when all that needed to be done was harden the index. What is the cause for this recommendation?

This recommendation comes directly from one of security considerations from the same document:

  Note however that the following properties does not exist:
  (...) Given a parent extended public key (Kpar,cpar) and a non-hardened child private key (ki), it is hard to find kpar.

The reason for this recommendation is the fact all the non-hardened key derivation bases on some of the elliptic curve properties. One of them is that you can add some number to private key (which itself is ordinary number). When you convert the same number to the point on elliptic curve you can add it to public key (which itself is the point on elliptic curve). This new private key is exactly the private key for the new public key.

The problem is that this number we add  (parse256(IL)) can be calculated from parent public key and parent private key.

So, if we know the child private key kchild and before mentioned number parse256(IL) (which we know, because we know parent public key), then we can rearrange the equation from which this key was derived:

kchild = parse256(IL) + kpar (mod n)

and find kpar which is the parent private key.


Why use OP_RETURN for long-term timestamping if they are pruneable? There are some timestamping services such as proofofxistence.com that use OP_RETURNS transactions to store a document's hash, so in the future a 3rd party can verify the existence of the hash (and the document) at that particular time.

One of the assumptions of using the blockchain for trusted timestamping is that the data will be there for a long period of time. However, the OP_RETURN ouputs are unspendable (then pruneable). It can be theoretically forgotten by everybody without affecting the integrity of the blockchain.

Is it a good idea to use OP_RETURN transactions for long-term timestamping?

The point of timestamping is not data storage (that's a different use case). Timestamping is being able to prove that a particular piece of data existed before some point in time.

If you create a transaction that commits to a particular (hash of a) piece of data, you can always prove its presence in the blockchain by keeping the blockchain (including the block with your transaction) yourself.

In fact, that's not even necessary. Due to the fact that Bitcoin transactions are organized in a Merkle tree in blocks, you can just keep the transaction, and the hashes in the Merkle tree that connect your transaction hash to the Merkle root of that block. Anyone who has validated the chain (and thus has at least the block headers) can verify that implies your transaction was part of the chain.


Bitcoin Code and Transaction Model I'm Studying bitcoin from a while, focusing transaction model and I'm looking to extract transaction model only to try out some experiments to make the structure better from the current one. If anyone can guide me through, that will be very helpful.

See https://en.bitcoin.it/wiki/Transaction.

Transaction Format

Here's an example from my regtest network:

0200000000010111b6e0460bb810b05744f8d38262f95fbab02b168b070598a6f31fad438fced4000000001716001427c106013c0042da165c082b3870c31fb3ab4683feffffff0200ca9a3b0000000017a914d8b6fcc85a383261df05423ddf068a8987bf0287873067a3fa0100000017a914d5df0b9ca6c0e1ba60a9ff29359d2600d9c6659d870247304402203b85cb05b43cc68df72e2e54c6cb508aa324a5de0c53f1bbfe997cbd7509774d022041e1b1823bdaddcd6581d7cde6e6a4c4dbef483e42e59e04dbacbaf537c3e3e8012103fbbdb3b3fc3abbbd983b20a557445fb041d6f21cc5977d2121971cb1ce5298978c000000

From left to right:

Version: 02000000
Flag: 0001 (if present, indicates segwit)
Input Count: 01
Input 1 Previous Output Hash: 11b6e0460bb810b05744f8d38262f95fbab02b168b070598a6f31fad438fced4
Input 1 Previous Output Index: 00000000
Input 1 script length: 0x17 (23 bytes)
Input 1 signature script: 16001427c106013c0042da165c082b3870c31fb3ab4683
Input 1 sequence: feffffff
Output Count: 02
Output 1 Value: 00ca9a3b00000000 (1B satoshis / 10 BTC)
Output 1 public key script length: 0x17 (23 bytes)
Output 1 public key script: a914d8b6fcc85a383261df05423ddf068a8987bf028787
Output 2 Value: 3067a3fa01000000 (8499980080 sats / 84.9998008 BTC)
Output 2 public key script length: 0x17 (23 bytes)
Output 2 public key script: a914d5df0b9ca6c0e1ba60a9ff29359d2600d9c6659d87
Witness Count: 02
Witness 1 length: 0x47 (71 bytes)
Witness 1: 304402203b85cb05b43cc68df72e2e54c6cb508aa324a5de0c53f1bbfe997cbd7509774d022041e1b1823bdaddcd6581d7cde6e6a4c4dbef483e42e59e04dbacbaf537c3e3e801
Witness 2 length: 0x21 (33 bytes)
Witness 2: 03fbbdb3b3fc3abbbd983b20a557445fb041d6f21cc5977d2121971cb1ce529897
Locktime: 8c000000 (block 140)

Note: all values are little endian. Here is a description of all of the fields:


Personal computer to use for bitcoin client My understanding is that anyone with a computer can download a Bitcoin client such as Bitcoin Core, and then they can interact with the Bitcoin network: accept Bitcoin, pay Bitcoin, and view the state of the network (and unlike when using an exchange, fully control their own secret keys).

I also understand that operating such a client requires a full copy of the blockchain, which is ~100 GB at this point. This seems like a truckload of space for a typical personal computer. For example, my MacBook Air from a few years ago has 120 GB total, of which I have only 20 GB remaining.

1) Is my understanding of the situation correct?

2) Is it typical for people get separate computers to use specifically for operating their Bitcoin client (so they don't use almost all the space on their main personal computer)?

A full copy of the blockchain is needed by "full node" clients such as Bitcoin Core, correct.  (The current size is now over 109 GiB.) But Bitcoin Core now supports pruning, where it downloads and validates the entire blockchain but discards most of it. In that case you can use it with less than 1 GB of disk space.

There are also many "thin" clients that do not need to download the entire blockchain at all.  See the wallet list on Bitcoin.org and look for those marked "simplified validation".  These clients need only a small amount of disk space.  This approach slightly reduces the security, as it is theoretically possible to trick such a client into accepting an invalid transaction, but for average users it is likely sufficient.

In short, there are plenty of ways for anyone to use Bitcoin on a personal computer without needing 100 GB of disk space.


Invoking the listunspent command via json-rpc on a full node I am trying to use the following example code for C# programming, so I can connect to my own bitcoin full node:

https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#.NET_.28C.23.29

Which has resulted in something like this:

public static string RequestServer(string methodName, List<string> parameters)
{
    string ServerIp = "http://localhost:18332";
    string UserName = "user name goes here";
    string Password = "password goes here";

    HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(ServerIp);
    webRequest.Credentials = new NetworkCredential(UserName, Password);

    webRequest.ContentType = "application/json-rpc";
    webRequest.Method = "POST";

    string respVal = string.Empty;

    JObject joe = new JObject();
    joe.Add(new JProperty("jsonrpc", "1.0"));
    joe.Add(new JProperty("id", "1"));
    joe.Add(new JProperty("method", methodName));

    JArray props = new JArray();
    foreach (var parameter in parameters)
    {
        props.Add(parameter);
    }

    joe.Add(new JProperty("params", props));

    // serialize json for the request
    string s = JsonConvert.SerializeObject(joe);
    byte[] byteArray = Encoding.UTF8.GetBytes(s);
    webRequest.ContentLength = byteArray.Length;

    Stream dataStream = webRequest.GetRequestStream();
    dataStream.Write(byteArray, 0, byteArray.Length);
    dataStream.Close();

    StreamReader streamReader = null;
    try
    {
        WebResponse webResponse = webRequest.GetResponse();

        streamReader = new StreamReader(webResponse.GetResponseStream(), true);

        respVal = streamReader.ReadToEnd();
        var data = JsonConvert.DeserializeObject(respVal).ToString();
        return data;
    }
    catch (Exception exp)
    {
        throw (exp);
    }
    finally
    {
        if (streamReader != null)
        {
            streamReader.Close();
        }
    }

    return string.Empty;
}

The above code allows me to run the bitcoin command sendtoaddress.  For example, the following would work in the bitcoin console:

senttoaddress 2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF 0.01

Using the RequestServer function in the C# code above, I can do the same thing like this:

double AmountToSend = Convert.ToDouble(txtAmountToSend.Text);
string ReceivingAddress = txtSendToAddress.Text;
JObject data = JObject.Parse(RequestServer("sendtoaddress", new List<string>() { ReceivingAddress, Convert.ToString(AmountToSend) }));

All good so far.

Now I want to do the same with listunspent

In the bitcoin console, the following work examples work fine:

listunspent
listunspent 1000

Using the C# function above, the following works if I do not give it a parameter:

JObject data = JObject.Parse(RequestServer("listunspent", new List<string>() { }));

But when I add a parameter, it does not work:

JObject data = JObject.Parse(RequestServer("listunspent", new List<string>() { Convert.ToString(1000) }));

The error it gives is:

C:\Users\oshirowanen\Documents\Visual Studio 2017\Projects\ConsoleApp1\ConsoleApp1\bin\Debug>ConsoleApp1.exe

Unhandled Exception: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
   at ConsoleApp1.Program.RequestServer(String methodName, List`1 parameters) in C:\Users\oshirowanen\Documents\Visual Studio 2017\Projects\ConsoleApp1\ConsoleApp1\Program.cs:line 63
   at ConsoleApp1.Program.Main(String[] args) in C:\Users\oshirowanen\Documents\Visual Studio 2017\Projects\ConsoleApp1\ConsoleApp1\Program.cs:line 18

C:\Users\oshirowanen\Documents\Visual Studio 2017\Projects\ConsoleApp1\ConsoleApp1\bin\Debug>

Anyone know why that is?

The issue is that you are sending the 1000 parameter as a string, not as a number. The JSON type when the RPC server receives it will be a string, which is incorrect. It does not convert this to an integer implicitly so you need to explicitly set the type. So instead you should be doing:

JObject data = JObject.Parse(RequestServer("listunspent", new List<Integer>() { 1000 }));


Can Coinbase Bitcoin network fee really be 50% Ive just bough £47.81 of bitcoin.  After fees i'm left with 0.00375837 BTC.
I want to buy another cryptocurrency but the network fee is 0.00186539 so i'm left with only £24.41.

Can this fee be correct?  Thats close to 50%.  Is it the sum im trying to trade?

Transaction fees are calculated based upon the size of the tx in bytes, not the amount being transferred. Right now the network is very congested, so fees are higher than normal. In this case Coinbase is initiating the tx, so you are at their mercy to dictate the fee (that said, setting a lower fee may mean your tx does not confirm). If you trade within the coinbase exchange (not sending coins to another exchange), you should not be charged network tx fees.

Once the backlog of txs clears out, it will be cheaper to transact again.


i found bitcoin wallet I need qr private key where i can get that code? i found bitcoin wallet I need qr private key where i can get that code ?
Is it impossible to get qr private code ?

I need qr private key

QR codes are a 2D barcode typically used by cryptocurrency wallets to present a payment-address which someone else uses to send you payment. They are also sometimes used when printing a private-key as a paper wallet.

where i can get that code?

Non-custodial wallets generally provide a means to extract the private-key. For example with Bitcoin-core you can use the CLI command dumpprivkey
Most wallets are protected by a pass-phrase. If you don't know the pass-phrase, and can't guess it, you cannot extract the private-key.

If you believe the private-key was printed in QR-barcode form as a paper-wallet it will obviously be wherever the owner put it - we can't really help with that.

Found wallet
You have no access to the Bitcoins associated with a wallet if you don't have the wallet's passphrase and dont have the private-key and don't know where it is in printed form and don't know a seed-phrase used to generate the private keys.

Converting a private-key from text to QR-code
If you have full-access to the wallet you found and want to convert it to a paper wallet in QR-code form - you'll need the wallet to support that or export the private key in other form (e.g. WIF) and then import it into software (perhaps a different wallet) that has the features you need.
For those comfortable with programming, I've seen people suggest downloading the HTML from, say, https://www.bitaddress.org and running that on a disconnected PC. It looks like client-side Javascript and can generate QR-codes from a known private-key with some modification. The Javascript libraries used appear to be open-source so can be obtained from the usual repositories.


What is the superscript number in Bitcoinica prices? Since Bitcoinica has been released I've been reading a bit about Forex. But i don't know what the superscript number refers to in the price quotes on the front page. How is this number calculated and what does it indicate? Or are they just simply pips?

These are indeed pips, according to this comment by Bitcoinica's owner. That is, they are just an extra digit denoting multiplies of 0.00001 USD.


What is a Key pair? & relationship with adresses? does a generated private key, provide 1 public key? I mean, the pair is generated practically at once?
Then this only public key is used to create multiples “adresses” which will be used to make transactions?

Thank you a lot.

Generally, it's one address per keypair.  This is even true in deterministic wallets where you generate multiple keypairs based on a single seed.  Remember that there are still multiple keypairs in this scenario.  A private key is generated randomly (or deterministically from a seed), and then a public key is derived from it.  After that, an address is derived from the public key.

However, it's not quite that simple.  There are two different representations of elliptic curve public keys that bitcoin supports, meaning that you can generate two different address from the same private key...both of which can be claimed with that private key.  Wallets generally only use a single public key format (usually compressed), so within a wallet, there's one private key to one public key to one address.

Also, there are different types of addresses (pay-to-public-key-hash, pay-to-script-hash, mainnet, testnet, etc...), which each could use the same public key to generate different addresses based on their corresponding prefix.  This is why pay-to-public-key-hash addresses begin with '1' and pay-to-script-hash addresses begin with '3'.  To my knowledge, no wallets will generate two types of addresses from the same public key.  That would be similar to re-using addresses, and is generally considered to be a bad practice.