2 mBTC that was outputted as change in a transaction I just sent didn't come back to my wallet Hi I'm new to this so may be asking a stupid question.

I just sent a payment for 198.52 mBTC. There were two outputs. One for 196.39 mBTC that arrived. There was another output of 2 mBTC that didn't arrive and wasn't refunded to the first wallet. I looked on google and I read that the 2 mBTC was change for the transaction. Can somebody tell me how I retrieve this 2 mBTC as it's not in my wallet?

Many thanks

You don't need to retrieve it.

Your own wallet created that output, and sent it back to a different address under its own control. Your wallet's balance should reflect this change.


How does cryptsy.com currency trading works? I am using cryptsy and i am unclear how cryptsy works, At first i deposited dogecoin to newly generated address and then I made the sell offer for DOGE/LTC, now i am having some LTC but i don't see any Litecoin address in cryptsy

My questions are,

In which address my LTC balance available?
If coins are stored in db level, how it is possible to withdraw that coin?

You do not own a LTC-address (or BTC, or any other altcoin) on cryptsy or any other virtual currency exchange site. You can however see your balance of all crypto currencies in the 'Balance' tab. When you scroll down, you will see the LiteCoin with your current available balance and the balance that is in possible orders. If you want to have your LTC in an address, you should download an LTC-wallet app, and create a wallet in there, and then withdraw (from cryptsy) to that wallet.

And your second question: yes, cryptsy is a crypto currency exchange. So far there is no option to trade in any real currency, but I see that option is coming in a week or so, because this text is above the BTC/USD market

This market is for Verified Accounts Only. The User Verifications system will open within the next week.

Anyhow, what happens when you withdraw LTC to your own wallet, is that cryptsy looks at deposit wallets (for other people) they own. For example person A, B and C have all a different deposit wallet, and they deposited 1, 2 and 3 LTC respectively. You had fun trading, and want to withdraw 2.5 LTC. Cryptsy sends 2.5 LTC from the deposit wallet from person C, so there is only 0.5 LTC left in that wallet and you have (after confirmation) 2.5 LTC in your wallet.

When you trade, there is no 'real' LTC being transferred between wallets, only on withdrawl and deposits. Otherwise you cannot trade that fast (and other disadvantages, like fees and huge blocks)


Where can i see my BitCoin addresses? How can i see all my BitCoin addresses?

Background

If i send a payment to someone (e.g. 0.35 BTC), the BitCoin protocol is unable to send just 0.35 BTC to someone. For example, if i own 1 BTC, and want to spend 0.35 BTC, then a transaction is created so send my entire 1 BTC to two different people:

0.35 BTC to [destination addresses]
remaining 0.65 BTC to [an new randomly generated address that i own]

This was horribly confusing thing to me, and nearly everyone else. Most people assume that if they backup their public and private key, that they have backed up their wallet.

Unfortunately, you do not have just the one address that appears in BitCoin-qt, you own n secret addresses, that are not visible in your wallet.

A Concrete Example

Lets take a real transaction from the blockchain:

Source Address
 18888888PPJ8oGeqR6AKmoiKUme9da48Xf: 2.3899 BTC
Destination Addresses
 1FvLq2vz7neRJeLk1uXGjg1Jk8FCiaHnwk: 2 BTC
 18888888PPJ8oGeqR6AKmoiKUme9da48Xf: 0.3898 BTC

Out there is a guy who owns address 18888888PPJ8oGeqR6AKmoiKUme9da48Xf (which had a balance of 2.3899 BTC). He then spent 2 BTC on something. The "change" is then routed back to a new address inside his client (18888888PPJ8oGeqR6AKmoiKUme9da48Xf)

You never see this address

The problem is that now you own another address; another randomly generated public/private key pair. If you lost your wallet right now, and restored from a backup, you would not have access to that change, because you don't have the key pair for this new, secret, hidden, address.

You only backup the key pair for your single "real" address. With every transaction BitCoinQt creates internal, secret, invisible addresses. They are hidden inside your wallet.

i want to backup all my public-private key pairs to paper. But before i reach that point, i want to be see all my public-private key pairs. i need to see all my addresses.

How can i see all my BitCoin addresses?

BitCoinQt: v0.8.1-beta

Alternatively, in order to ensure the security of my BitCoins, after every transaction should i generate a transaction

From: me
To: me

so that all my coins end up in a "real" address, which i can then backup? Is that something that is a best practice.

Losing BitCoins because my money was sitting in secret addresses was...depressing.

Bonus Chatter

From the BitCoin wiki entry for Change:

  The wallet file contains the private keys for change addresses, and they can receive and send coins normally. However, the GUI in the default client does not display them in the address book.

Also note: i'm not talking about backing up to a wallet.dat file. That will backup my wallet, but to a file. i have a backup of my single address; which is insufficient because my single address no longer has any bitcoins.

You can use pywallet to look at all the addresses and keys.

The console command listaddressgroupings should also give you all your addresses, grouped by known co-ownership. You can then use dumpprivkey to get the corresponding key.

However, backing up just specific keys is not a recommend practice, you should back up the wallet file. If you do want a more concise method, you should use a client that supports deterministic wallets.


How to build a p2sh who's scriptsig contains a Signature I have created a P2SH address, funded it, and am attempting to move the funds with a TX.

The redeemScript for the TX requires the TX signature (OP_CHECKSIGVERIFY), but in order to create this signature, the TX preImage must be created and hashed.  However, the preImage for a P2SH contains the TX redeemScript itself...this seems to create a loop wherein this functionality is not possible.

Am I doing something incorrectly, or am I overthinking things?

You might want to review BIP16 (pay to script hash)
https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki

The signature is not included in the redeem script, typically just the public key. (Your script could be anything, all I know is it has a CHECKSIGVERIFY in it, so I'm answering broadly...)

The INPUT SCRIPT aka scriptSig of the transaction SPENDING from the P2SH output would then need to contain the signature and the entire serialized redeem script (the preimage to the script hash in the output).


What are the most notable cases of coins or wallet thefts? What are the most notable cases of coins or wallets being stolen from Bitcoin users or services? When did they occur, how many coins were stolen and has any of the thieves been identified?

In order of date:

13th June 2011, 25,000 BTC stolen from an early adopter "allinvain": A single user claims they were hacked and lost an enormous quantity of Bitcoins.
15th June 2011, 650 (?) BTC stolen from MtGox exchange: This attack probably made the news more than any other because the apparent market price plunged to $0.01/BTC, but withdrawal limits actually prevented a major loss. There was however substantial downtime and confusion amongst users while security issues were resolved. MtGox remains the largest exchange despite the issues, as at the time of writing.
31st July 2011, 27,000 BTC stolen from mybitcoin.com: This was a website that worked like an online wallet. After the website disappeared for several days, the owner reappeared claiming the site was hacked and is closing the site down, with a plan to refund 49% of each user's previous balance. There has been speculation that the owner of the site scammed the users.
1st August 2011, 17,000 BTC lost from Bitomat exchange: A surprisingly large Polish exchange was mistakenly (due to a technical misunderstanding) set up in an unstable hosting environment and lost its wallet file when the server crashed. The MtGox exchange took over Bitomat's business with an agreement to try to restore users Bitcoins.
1st March, 2012: More than 43,000 BTC were stolen from bitcoinica.com due to a Linode exploit, and another 3,000 from an individual programmer. The same exploit was used against Slush's Pool to steal 3094 BTC.
11th May, 2012: 18,547 BTC were stolen from bitcoinica.com.

I'm not aware of anyone being caught for any of these thefts.


Bitcoin Core crashes on XP twice I recently backed up my blockchain to an external drive and restored my computer from Windows 10 to XP. Afterwards, I copied the blockchain back to my hard drive and downloaded a portable copy of Bitcoin Core and ran it. It said it had many hours to sync, and I left it overnight. When I came back, it had crashed with XP's message about it needing to close. I opened it again and it said that some part of the blockchain files were corrupt and started syncing from 2009. I restored my backup again and it only had 34 hours to catch up on.

Today I got up and the same error was displayed. But this time when I reopened it, it only has to catch up on 2 hours. If it works then that's great, but does anyone know what's happening?

I have solved the problem by going back to Windows 10. Bitcoin Core no longer crashes, and my node has in fact been running nonstop for days.


Does the main Bitcoin client blacklist addresses? Does the main Bitcoin client blacklist any addresses that send too many erroneous messages? If so, how can one whitelist a particular address? I am developing an app that will be communicating with the main client and I don't want the program to ban it during testing.

There is a ban mechanism which is handled in net.cpp.

Any node which misbehave by more than -banscore (defaults to 100) is banned for -bantime (defaults to 60×60×24 seconds = 1 day).
However, nodes with a local ip address are exempted, and for those a warning is shown in the logs after each misbehavior.

Also bans are not persistent, they are lifted when the client is restarted.

So, during development, just make sure that your app connects with a local address to the bitcoin client, and you will not be bothered by bans.

Here is the relevant piece of code:

bool CNode::Misbehaving(int howmuch)
{
    if (addr.IsLocal())
    {
        printf("Warning: local node %s misbehaving\n", addr.ToString().c_str());
        return false;
    }

    nMisbehavior += howmuch;
    if (nMisbehavior >= GetArg("-banscore", 100))
    {
        int64 banTime = GetTime()+GetArg("-bantime", 60*60*24);  // Default 24-hour ban
        CRITICAL_BLOCK(cs_setBanned)
            if (setBanned[addr.ip] < banTime)
                setBanned[addr.ip] = banTime;
        CloseSocketDisconnect();
        printf("Disconnected %s for misbehavior (score=%d)\n", addr.ToString().c_str(), nMisbehavior);
        return true;
    }
    return false;
}


Bitcoin transaction 0/3 confirmation. How do i check on this? Bitcoin transaction received Nov. 10 and is still 0/3 confirmation.  How do i check on this?

If you want to view the details of the transaction, you can search for it (using the transaction id or sending or receiving address) on a block explorer website such as blockchain.info.

Once you have an understanding of the fee paid, in satoshi's per byte, you can see where that fits in the backlog of transactions, using a site that analyses unconfirmed transactions and their fees, like Johoe's Mempool Statistics

Further details on what to do are available on the canonical question about unconfirmed transactions.


2of2 multisig - redeem script required Normally somebody who signs a multisig transaction also needs the redeem script or all the public keys used for the creation of the redeem script, alongside their own private key.

No I was thinking, is this also required for a 2of2 multisig address. Let's say the 2 parties are Alice and Bob. Alice and Bob both generate a keypair. Bob sends his public key to Alice and she creates the redeem script. Now Alice knows both public keys but Bob does only know his public key. Alice now creates a transaction spending the funds and signs it with her private key. She sends this raw half signed transaction to Bob. So far so normal. But normally here Bob needs the redeem script or both public keys to generate the redeem script himself. I was wondering now: When signing the transaction Alice adds her signature to the transaction and also her public key so the signature can be verified. So Bob could extract Alice's public key from the raw transaction he just received and use that to generate the redeem script himself?

So my question is: Is this true? And if it is, does that mean that no matter if it is 2of2 or 4of4  the last signer can always recreate the redeem script from the received raw transaction?

It is, sort of, but some considerations have to be taken into account.

There are two ways of creating a multisig transaction: Pay-to-multisig, or a Pay-to-script-hash encapsulating a Pay-to-multisig. For how you are asking the question I guess that you are referring to the latter. However, I will give you both answers just in case.

Pay-to-script-hash (P2SH)

The scripts of a 2-3 multisig encapsulated in a P2SH transaction looks like:

ScriptSig: OP_0 [Sig 1] [Sig 2] OP_2 [PK 1][PK 2][PK 3] OP_3 OP_CHECKMULTISIG

ScriptPubKey: OP_HASH160 <ScriptHash> OP_EQUAL

As you mentioned, Bob will be able to recreate the script since the ScriptPubKey only required the hash of the generated scriptSig, and he will have all the information. However, order matters. In this case (a 2-3 multisig) Alice could have build the script in six different ways:

ScriptSig: ... OP_2 [PK 1][PK 2][PK 3] OP_3 OP_CHECKMULTISIG
ScriptSig: ... OP_2 [PK 1][PK 3][PK 2] OP_3 OP_CHECKMULTISIG
ScriptSig: ... OP_2 [PK 2][PK 1][PK 3] OP_3 OP_CHECKMULTISIG
ScriptSig: ... OP_2 [PK 2][PK 3][PK 1] OP_3 OP_CHECKMULTISIG
ScriptSig: ... OP_2 [PK 3][PK 1][PK 2] OP_3 OP_CHECKMULTISIG
ScriptSig: ... OP_2 [PK 3][PK 2][PK 1] OP_3 OP_CHECKMULTISIG

This have two consequences, the most straightforward is that if the script is not build in the same way, the hash will be different. Moreover, the order in which the keys are provided indicates how the signatures should be provided, that is, signatures and keys have to be provided in the same order.

e.g:

ScriptSig: OP_0 [Sig 2] [Sig 1] OP_2 [PK 2][PK 3][PK 1] OP_3 OP_CHECKMULTISIG

Then, in a n-m multisig, Alice will have n! ways of arranging the Public keys. If not provided in the right order, the evaluation of the script will fail, making the transaction invalid.

Pay-to-multisig

In the case of Pay-to-multisig, the solution is way more straightforward due the information that each script stores. Using the same 2-3 multisig example, the resulting scripts will be:

ScriptSig: OP_0 [Sig 1] [Sig 2]

ScriptPubKey: OP_2 [PK 1][PK 2][PK 3] OP_3 OP_CHECKMULTISIG

In this case, not just the latter, but every party involved will know how to build the ScriptSig, since how the ScripPubKey was build is accessible from the previous transaction.


Is this exchange legitimate? I was sent a discord message with an invitation to an exchange called www.doxxwallet.com. They offered me 0.21 bitcoin as a joining bonus, and I created the account and according to them do indeed have a wallet with .21 bitcoin. In order to withdraw the bitcoin, I have to transfer to the website 0.006 bitcoin and then I can withdraw the entire balance.
This sounds pretty scammy, but I wanted to see if anyone else had heard of them or had a way to verify that this website is legitimate? I have an image of the message I received below.

It is definitely fake, I got the same exact message saying I won the same amount. Please do not drop $200 to buy yourself .006 btc to get your prize, this oozes sketch in every way possible.
The site isn't even indexed by google, seriously. Google "Doxxwallet.com" and the only result that comes up (at the time of writing) is this thread.
Infact, you can view an IDENTICAL site at https://livebtctrader.com/ and at https://trading4crypto.com/
The only thing changed is the name
edit: holy wow, check out this google query. https://www.google.com/search?q="Justin+Hance+and+his+team". Too many for me to be willing to even count, all identical. This person has been doing this for a while


Bitcoin Insight API - How to create new address? I need to create new public address with private key. but there is no way to create new address using insight rest api. If you guys are aware about insight api then please share with me code snippet so, i can update my insight api library and i can create new public address using that.

Currently I have used: https://github.com/bitpay/insight-api

You can't "create new addresses" with the Insight API.
The Insight API is for querying the blockchain for information.

You want to use the Bitcore Wallet Service, THAT will manage a list of addresses/wallet for you:

Bitcore Wallet Service on Github


How do Bitcoin and Litecoin compare in scalability? Bitcoin and Litecoin are very similar, however they differ in the hash algorithm, the block interval and reward schedule. How do these characteristics impact the scalability in terms of e.g. transaction capacity, IBD, CONOP, light weight node requirements, and block verification times?

Litecoin is using largely the same consensus rules as Bitcoin with a few exceptions:

its blockchain derives from a distinct Genesis block
it targets a block interval of 2.5 minutes (10 minutes on Bitcoin)
halvings happen every 840,000 blocks (210,000 on Bitcoin)
block hashes are calculated with Scrypt instead of SHA-256d

Since the more costly Scrypt hashing algorithm needs to be only performed once per block in block validation, the effect on the IBD should be negligible compared to other steps in the validation. H/T @Nate Eldredge.

Since Litecoin has also activated segwit, its transaction capacity is roughly four times that of Bitcoin. Theoretically, this could cause Litecoin's blockchain footprint to increase at up to four times Bitcoin's rate, presumably increasing the IBD at least at the same rate. I surmise that the IBD might increase superlinearly to the blockchain footprint as it would likely correspond to a higher UTXO count as well. In practice, Litecoin is only using a fraction of its blockspace and should have a significantly faster IBD.


How many shares will be found for a given hashrate? Many pools offer a difficulty of 1 per share.

Since variable difficulty is a feature of a couple of pools, I'd like to understand how many shares would be created at varying levels of difficulty.

What is the formula to determine the average number of shares when the hashrate and difficulty are known?

This is a variation of the following question:

Given the probability of finding a block, and time taken, can I infer hashrate?

One difficulty-1 share takes on average 2^32 = 4.3 billion hashes to find.

If your hashrate is X GH/s, then in one day the number of difficulty-d shares you'll find is

(X * 1000000000 * 86400) / (2^32 * d)

Or simply

20,000 * X / d


Why is BIP32 not simply PublicKey multiplication? I understand that:
pubkey(a + b) = pubkey(a).combine(pubkey(b))

where a and b are secret keys.  (See: https://crypto.stackexchange.com/q/83694/17505)
If, under the circumstances:

Bob wants to pay Alice, by creating transaction output whose private key only Alice will know, yet whose public key different from Alice's public key.
Alice publishes pubkey(alice_secret).
Bob creates an one-use, random secret key x_secret.
Bob publishes x_secret.

Do the following conditions hold?

Only Alice can sign messages with the secret key (alice_secret + x_secret), as no-one else knows both secret keys.
Anyone can verify such a message's signature using pubkey(alice_secret).combine(pubkey(x_secret)), as pubkey(x_secret) can be calculated from the published x_secret.

If so, why is BIP32 more complex than this?

The purpose of BIP32 is to provide a standard for hierarchical deterministic (HD) key derivation. BIP32 allows users to back up the initial secret of their wallet, and then reconstitute all derived addresses from this initial backup in the future.
The mechanism you describe is essentially an application of an Elliptic Curve Diffie-Hellman (ECDH) to establish a shared secret. It relies on foreign input and therefore (as described) does not fulfill this backup function—each new address requires the sender's secret to be retained for the address to be recoverable in the future.
A similar approach is in use for  Monero's Stealth Addresses. AFAIU, Monero solved the backup concern by using OP_RETURN outputs on the Monero blockchain to establish the shared secret. This ensures that the recipient key is sufficient to rediscover the shared secrets when resyncing the blockchain. This comes with some trade-offs: finding all recipient keys is much slower (since the blockchain has to be parsed) instead of something that can be done with local data even on offline devices and each address creation adds more data to the blockchain.


Any Tutorial to send Bitcoin from Copay to Trezor? I am using Copay wallet, and feel comfortable with it.
Now, the tricky part is to send my Bitcoins to my Trezor wallet.

Any feedback on the subject?

Regards

Find (one of) your Trezor address(es). Open this menu on your computer:

You can read the details here: https://doc.satoshilabs.com/trezor-user/receivingpayments.html

Open CoPay wallet, press "Scan" at the bottom. Scan the QR code shown on your computer.

Choose "Send payment to this address"

It should be easy from now on.


bitcoind - sender and receiver address I'm using bitcoind. Now I would like to access the transactions list of a particular account using the bitcoin-cli.

I am using the listtransactions accountname command to get the transactions of a particular account.

Example:

listtransactions karthiktest

Result:

[
  {
    "account": "karthiktest",
    "address": "mnXEfvmLFWz7Exn9oGaEeTN8Ayu7Le5CCz",
    "category": "receive",
    "amount": 0.30000000,
    "label": "karthiktest",
    "vout": 1,
    "confirmations": 18,
    "blockhash": "000000009d17b7b32567f9730b50f2b7e8623ae6c9d20f84d4c414914e214283",
    "blockindex": 86,
    "blocktime": 1507963431,
    "txid": "c94307bef9ece4afe41384e2cd453f183aa7a438899723906e8967e624bc7d6f",
    "walletconflicts": [
    ],
    "time": 1507962288,
    "timereceived": 1507962288,
    "bip125-replaceable": "no",
    "comment": "hello karthik",
    "to": "from arun"
  },
  {
    "account": "karthiktest",
    "address": "miDMgiqduYevZMsRxX4qrY9BD5eXYFmEzg",
    "category": "send",
    "amount": -0.10000000,
    "label": "mahesh123",
    "vout": 0,
    "fee": -0.00000765,
    "confirmations": 17,
    "blockhash": "0000000079c79a5d21af138c80544b307d4ac764b4ed343b84752114c77fc893",
    "blockindex": 76,
    "blocktime": 1507964632,
    "txid": "516c64595c8b7be12419199dd81ae5edd3f4281aa3e52f88c7e3561b901bf881",
    "walletconflicts": [
    ],
    "time": 1507964172,
    "timereceived": 1507964172,
    "bip125-replaceable": "no",
    "comment": "hello mahesh",
    "to": "from karthik",
    "abandoned": false
  }
]

Here in the JSON, it is showing two transactions 1 receive and 1 send.

Now, My requirement is: for receive transaction, I need to get the sender address and for send transaction, I need to get the receiver address(this can be done using the account field).  But I'm confused to get it with receive transaction.

Can anyone help me on this?

Bitcoin does not have "sender addresses". It has transactions, which spend coins you have authority to spend from, and creates new coins with potentially different owners.

Listing the previous owners of coins as senders is a practice used by some block explorer websites, but is at best uninteresting and at worst may result in monetary loss:

Not every script has a corresponding address.
The previous owner is not necessarily the sender (e.g. in the case of a service with multiple users, the addresses belong to the service, not the users).
You can't use these to refund coins (a property that is usually expected of a "sender address"), as in the case of a shared account, the address may be associated with a different user of the service.
Widely deployed privacy improvement techniques like CoinJoin result in transactions where only one of the transaction's inputs is related to the sender you care about, with no way to identify which.

So what listtransactions shows you are always receive addresses:

For a send entry, it lists the address the money was sent to.
For a receive entry, it lists the address the money was received on.


Would it be possible to have an ARM hashing based Cryptocurrency? This was something that popped into my mind while I was thinking about CPU Only Alt-coins.
Would it be possible to have an ARM-based coin? That is, a coin that could only be mined on ARM devices (iPhone, Android device, etc. )?

You can pick a proof-of-work function that runs more efficiently on ARM architecture but you can't define something that's ARM-only. The same function can always be ported to run on Intel CPU or even MIPS.


How can I request payment to a set of addresses? I am building a payment processing service where a single payment may be split among multiple individuals. While it would be possible for me to write the service in such a manner that a customer pays to a single address, and then an secondary process creates the single-input-many-output transaction, it would be preferable if I could simply request that the transaction signed by the customer directly produce the desired outputs.

Is there any standard way to create such a payment request? Bitcoin URLs allow only a single address (and single amount) to be specified. Is there a way to create a partially complete transaction (specifying multiple outputs) in such a way that a customer's wallet software can correctly choose and fill in the appropriate UTXOs for inputs, and add an another output for the change?

Barring that, is there any precedent (and convenient method) for asking customers to provide UTXOs to use as inputs, and then generate the transaction for them to sign? I know that all this would be achievable if I were to provide custom wallet software, but that's certainly something I wish to avoid if possible.

EDIT:

I've found https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki, which seems to be close to what I want; how widely supported is this protocol?

It appears that the Payment Protocol is, indeed, what I want, and it is relatively widely supported according to this comparison page: https://bitpay.com/docs/wallets


Lightning Network: Isn't there a risk in spending more BTC than needed? Say, I want to establish a payment channel with an individual, Jim.  I want to make 10 monthly payments of 0.01BTC to him for a total of 0.1BTC.  I don't want to spend 0.1BTC at once, but in order to create a payment channel with 0.1BTC capacity, I have to send a 0.1BTC transaction to Jim to create the Payment and hope he doesn't close the channel.  If he does, then the 0.1BTC is sent to the main blockchain?

If all I have is 0.01BTC to start with, all I an send to Jim is 0.01BTC once.  The only way I can send more is if there are already other funded payment channels between myself, Jim, and another node that have remaining capacity?

I have to send a 0.1BTC transaction to Jim to create the Payment and hope he doesn't close the channel. If he does, then the 0.1BTC is sent to the main blockchain?

Opening a channel doesn't involve "sending coins to Jim", it involves "opening a channel with Jim". You do not need to trust Jim to not steal your funds, because of the threat of revocation if he misbehaves and attempts to publish an old channel state. If Jim closes the channel honestly, he will be paid out according to the current channel balance. The 0.1 BTC locked into that channel will be split according to the current state of the channel, with Jim's share going to Jim, and your share being returned to you.

  If all I have is 0.01BTC to start with, all I an send to Jim is 0.01BTC once. The only way I can send more is if there are already other funded payment channels between myself, Jim, and another node that have remaining capacity?

Yes, there is no such thing as debt on the Bitcoin or Lightning Network. In order to pay someone, you need the available funds or channel capacity. This capacity can come by routing a payment to Jim, using some other node(s) you are both connected to.


Unable to run the Miner using 2Pac BM1384 USB miner I have created a batch file and  I tried to run it. But when I click on the batch file to run it. But the command line window appears for a fraction of a second and then disappears.

cgminer.exe  --gekko-2pac-freq 200 -o stratum+tcp://peercoin.ecoining.com:3336 -u username.1 -p x

===========================================================
I have tried the below in a batch file,  it gives the below output in the command line

cgminer.exe  -o stratum+tcp://peercoin.ecoining.com:3336 -u username.1 -p x

       cgminer version 4.10.0 - Started: [2017-12-24 04:09:20.602]

 (5s):528.0M (1m):507.5M (5m):516.4M (15m):366.6M (avg):516.0Mh/s
 A:0  R:0  HW:2  WU:5.6/m
 Connected to peercoin.ecoining.com diff 16.4K with stratum as user username

      Block: c22a0a3f...  Diff:1.61G  Started: [04:15:53.420]  Best share: 98

 [U]SB management [P]ool management [S]ettings [D]isplay options [Q]uit

     0: AMU GS-10018:                         | 528.0M / 516.0Mh/s WU: 5.6/m

 [2017-12-24 04:09:16.557] Started cgminer 4.10.0
 [2017-12-24 04:09:19.601] Probing for an alive pool
 [2017-12-24 04:09:20.083] Pool 0 difficulty changed to 16384
 [2017-12-24 04:09:20.602] Network diff set to 1.61G
 [2017-12-24 04:15:53.420] Stratum from pool 0 detected new block at height 0

============================================================

Is the issue with the script for batch file?

The Syntax for the cgminer.

Run cgminer using following the commands below:

cgminer.exe --gekko-2pac-freq 200
-o stratum+tcp://solo.ckpool.org:3333
-u (your username here) -p (your password here)

Also how to verify the CGi miner is using the Gekko  2Pac BM1384 USB miner?

I had a similar problem when I first started with the 2pac. You didn't mention if you are using a Windows or Linux platform, but the solution is similar either way.

Solution: Ensure your CGMiner binary is compiled to support the Gekko 2Pac. It seems your BM1384 2Pac is not being recognized properly by CGMiner.

This output you provided:

"0: AMU GS-10018: | 528.0M / 516.0Mh/s WU: 5.6/m"

...shows that it is being enumerated as an "AMU" (which is usually ASICMINER block erupters ) It should be "GSC" for a GekkoScience device.  That's also why you are seeing the low hash rate and hardware errors.

So, be sure you have a gekko-enabled CGMiner binary, and also ensure your batch file points to that same correct binary. (correct path)

If you need more detailed help, please state whether you are on a Windows or Linux platform.


Bitcoin Cash testnet wallet Hey guys I've been searching for quite some time... Is there any good, except mycelium, wallet which supports testnet Bitcoin Cash?

Thanks for answers in advance!
Cheers!

Copay is a mobile wallet which supports Bitcoin Cash testnet.

Desktop wallets based on Bitcoin Core should also support testnet; e.g. Bitcoin ABC and Bitcoin Unlimited.


Is the date here true for live bitcoin and altcoin prices? i found this site: http://coinmarketprice.com
Its pretty easy to navigate i like it.
Are the list there true for market caps of the coins and are the live prices for bitcoin and other altcoins are latest data?

thanks

I don't think the prices are live and up to date.

Check this one out and compare them
http://bitcoincharts.com/markets/currency/USD.html

That's real time incl. BTCchina and other non-USD markets.

Well, if you need multi-coins prices, the USD price should be averaged somehow and you probably use the right tool to track them all.


What aspects of Money Order laws will apply to merchants who use Bitcoin? There are several money order laws that apply to merchants who accept them.   Bitcoin seems to have properties of a money order, but also some aspects of value that are driven by demand.

I'm looking for a clear and reasonable explanation of:

How do Bitcoins compare to (and differ from) Money Orders?
What aspects of laws that apply to Money Orders are likely to also apply to Bitcoin?

I'm most interested in US,  UK, and Australia, but any links would be beneficial.

In the U.S., FinCEN just determined that decentralized virtual currencies are not like money orders.

Money orders are the mechanism enabling the moving of currency or value that serves as currency from one person or location to another person or different location.

Using bitcoins for making a purchase from a merchant is not the same as moving currency.

Now if instead of providing goods or services the merchant instead delivers currency elsewhere, then that would be transmitting money and in the U.S. State laws specify the restrictions on money transmitters.  FinCEN requires that a money transmitter register a Money Service Business (MSB) and keep records according to guidelines.


How do faucets/micropayment-based services avoid/minimize transaction fees? Sites like bitvisitor or cointube give away very small amounts of bitcoins (I actually got a payment as small as .0000035 BTC when testing).
I am in the process of creating a service that awards users small amounts of bitcoins in exchange for doing some trivial work (akin to Amazon's Mechanical Turk). When experimenting, I tried using bitcoin-qt to send .0001 BTC to an address and it automatically added a .0005 fee onto it. Using Electrum, I couldn't get it to send until I set the fee to .0001 as well.

I highly doubt a fee like that was paid for the .0000035 BTC I received earlier), so how are these services eliminating or minimizing their fees? I know it's common to gather multiple "inputs" into a single transaction. Is it possible also to have a transaction with multiple outputs so that I can gather a hundred of these .0001 BTC payments into a single transaction and thus minimize the size (in kb) of the transactions and therefore the fees too?

EDIT
Sites like BitVisitor do indeed combine these payments (see here). So assuming there's no better way to minimize fees, how are they able to do this? I see no options in bitcoin-qt or Electrium for this.

You have two questions here, so I'll answer them separately.  As far as how do faucets they avoid transaction fees, the answer is that they don't.

Most of the faucet sites I've used use a service called Coinbox.me which collects requests for payments and bundles them up into one large chunk of payments.  This is how they minimize transaction fees - they don't send all the microtransactions at once, they wait until they have quite a few and then send them out.  I've looked at these transactions before when they're going through and they do have transaction fees that are being paid that is, as you said, larger than the amount being sent out.  But I have had transactions where it is being sent to at least a hundred addresses, so while one small amount may far less than the transaction fee, the total amount being sent out is significant enough that the service can pay a transaction fee while still paying out these microtransctions.


How is time measured in the context of updates to mining difficulty? So I understand that difficulty increases by some algorithm calculated every 2016 blocks. But my understanding is that this algorithm attempts to set a difficulty such that the average time it takes to mine a block is about 10 minutes. My understanding of verifiable time is that the only way to measure a time in minutes is by using trusted timestamping, which I assume bitcoin doesn't do (since it's not supposed to trust anyone).

So my question is, how does the bitcoin protocol measure time in seconds or minutes in order to determine what the difficulty should be?

I'm reading here that "every Bitcoin client compares the actual time it took to generate these blocks with the two week goal and modifies the target by the percentage difference". How does every bitcoin client affect the difficulty set by the network? Is this a scenario where there's minimum and maximum bounds on difficulty and any difficulty within those bounds is accepted by nodes in the network? Or is the calculation of difficulty something discrete and precise?

Yes, bitcoin should not trust anyone, but it trusts itself, i.e. its own blockchain. So, when the time comes to update the difficulty (as you said, every 2016 blocks), code grabs the timestamp of this last block, and the first block in this difficulty period (block with the index of: last index - 2016).

Comparing timestamps of those 2 blocks gives us the timespan between 2016 blocks, and allows for difficulty calculation.

You can check the code for it here:
https://github.com/bitcoin/bitcoin/blob/master/src/pow.cpp#L55

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

More information on what block timestamps are considered valid can be found here  http://en.bitcoin.it/wiki/Block_timestamp


Websocket API: Uknown mtgox message type Here's a bit of node.js code:

var WebSocket = require('ws');
var ws = new WebSocket('ws://websocket.mtgox.com:80/mtgox?Currency=USD');
ws.on('open', function() {
    console.log('Connection opened');
    ws.send(JSON.stringify({ "op": "mtgox.subscribe", "type": "depth.BTCUSD" }));
});
ws.on('message', function(message) { console.log(message); });

When this client sends {"op": "mtgox.subscribe", "type": "depth.BTCUSD" } the API returns {"message":"Unknown mtgox message type","op":"remark","success":false}.

What am I doing wrong?

try using socket.io-client

var io = require('socket.io-client');

then its as simple as

var socket = io.connect( 'https://socketio.mtgox.com/mtgox' );

and then to subscribe to a specific channel

var message = {
  "op": "subscribe",
  "channel": "24e67e0d-1cad-4cc0-9e7a-f8523ef460fe" // this is the market depth channel
};

socket.send(JSON.stringify(message));

socket.on('message', function(message) { console.log(message); });

should give you the results your looking for

I think your main problem is that your not using the channel id's in your connection message. Here is the Mtgox web sockets api which has a list of all the different channel id's. And heres a project which implements them generically.

Hope this helps


Encrypting wallet manually instead of using hardware wallet i am new to this community and like to know why one should prefer a hardware wallet instead of using encryption algorithm like AES-256 along with PKDF2 to secure crypto wallets ?
i currently hold btc in trezor wallet and planning to use AES to manually encrypt private keys by myself.
I have been playing around with the crypto wallet encryptor,

https://github.com/sufiyanghori1/crypto-wallet-encryptor

which seems to be pretty effective.
it takes private key and a custom password as an input and encrypt it using AES-256.

i have read on various forums people using it but not sure if its any better than actual hardware wallet ?

The benefit of hardware deterministic wallets is that your keys are permanently kept offline and secret, as long as you don't leak your seed words. To spend bitcoin, the transaction signing is performed on the device, keeping your keys safe.

If you encrypt the keys yourself (I'm assuming you're talking about bitcoin private keys, not an HD wallet seed), it depends how you store them. I can see three risks:

If you're planning on storing them online and encrypt them all with the same passphrase, then you're reducing the security of your keys to the single passphrase. If you leak your passphrase, anybody with access to your data can decrypt and use your keys. If you don't store them online (including on a system with access to the internet) however, this is less of a risk.
Signing transactions. In order to sign transactions, you're going to have to decrypt your key and run it through some software. If you do this online, it's very risky. If you do it offline, you're still at risk of keyloggers and other malicious software that could be present on your machine. This also applies to when you generate your keys in the first instance.
Loss. If you lose your encrypted data or your passphrase, your bitcoin is lost. With an HD wallet, if you lose the wallet you can recover with the seed words. If you lose the seed words you can still use the wallet to transfer to an alternative address.

If you do decide to use the passphrase method, note that there is already a standard for protecting a private key with a passphrase (example implementation - check the paper wallet section), so it's not necessary to encrypt it separately yourself.


Is there a maximum amount of money a transaction can handle? Apart from the limited transaction size in MB, which theoretically limits the maximum amount of money a transaction can handle, is there any standardized bound?

There is no limit on the per-input, per-output, fee, or total amount transacted, apart from the fact that all numbers need to be valid BTC amounts (which means not less than 0 and not more than 21M BTC).


In bfgminer, what does Accepted mean? While mining with a pool,
I recently noticed among the numerous "Stratum from pool 0 requested" lines that
bfgminer prints,   one saying

 Accepted (hex number) CPU 2 Diff 288/2

Does this mean that I found a valid block? Or something else?

Looking at my BTC Guild account, I see no evidence of any blocks found by my computer.

This means your pool server has accepted one block, generated your CPU, third thread, of difficulty 288 (with a minimum of two).


Restore a wallet from an external drive? I have an external drive where at some point I did a complete backup of my (linux) home directory.

There's a directory .bitcoin.

I now have a computer, and I just installed bitcoin-qt and other stuff. I started it and it generated a new receiver address.

If I copy the old .bitcoin directory from the external drive to my current new home, will it work?

To avoid any problem,in your source computer backup your private keys

bitcoind dumpprivkey

to answer your question, By default Bitcoin will put its data here:

~/.bitcoin/

I think the wallet is located in a file wallet.dat(https://en.bitcoin.it/wiki/Data_directory#Linux), so if you copy it, it will works.

fore a best security level, encrypt your wallet with a paraphrase before backaping it.


Bitcoin Transaction Detection With PHP I Hope this isn't a duplicated, however I couldn't find anything about this anywhere.
Anyways, I am searching for a way of detecting Bitcoin transactions to a given address. I stumbled across Lazy API, however I couldn't find anything about carrying out what it listed, and I am still not sure how to go about detecting transactions to a given address. I went ahead and went to the given link it provided here (and I stumbled across doing using Transaction By Address from the API reference on blockexplorer, but I am still not clear how to go about detecting if I received a transaction.

Please pardon if this is a stupid question, I am a little new to all of this.
Edit:
I dont wish to relay on another service, unless it is the way Lazy API does it. (Basically complete minimals, from other services.)
 Also someone asked to clarify what I meant by detect a transaction, what I mean is have server recognize when someone completed a transaction, either notifying me to do something (such as ship a package), or giving them some sort of virtual product.

Im guessing your on ubuntu because of your username ;)
Step 1 add the bitcoin ppa

sudo apt-add-repository ppa:bitcoin/bitcoin

Step 2 install bitcoind

sudo apt install bitcoind

Step 3 set bitcoind up

Make a config file with the following contents in /home/$USER/.bitcoin/bitcoin.conf
https://github.com/bitcoin/bitcoin/blob/master/contrib/debian/examples/bitcoin.conf
Replace some parts like rpc password etc

Step 4 add walletnotify

Walletnotify will run a shell command everytime something changes in your wallet.
I like this repo.
https://github.com/damonp/walletnotify

I hope this  helps!  :)


Electrum shows "No FX rate available" and balances show "No Data" and last transaction doesn't appear My Electrum 2.8.2 shows "No FX rate available" at the bottom and shows "No Data" for the balances. Also, I'm missing a transaction that someone said they sent to me. How do I fix this to see my latest transactions and USD balances?

I've just had this problem as well. It looks like Electrum gets its currency information by default from the BitcoinAverage website. You could try to select a different source of information. Try and see if this helps:

Go to Tools > Preferences > Fiat > Source > Select something like BlockchainInfo


Unlocking wallet, recovering password I want to send bitcoins, but cannot unlock my wallet. The rpc password located in \AppData\Roaming does not work. How can I unlock my wallet? Deleting the wallet.dat erases all my bitcoins, which I would like to keep.

If you forgot your encrypted wallet's password, there is nothing you can do.

Keep it anyway, just in case you remember it someday.

Of course, if you have a backup, you can use that one.


Why is the blockchain called Distributed Public "Ledger" and not "Journal"? Bitcoin (or more generally, blockchain) is a Distributed Public Ledger and as we know:

The Journal is a book where all the transactions are recorded immediately when they take place which is then classified and transferred into concerned account known as Ledger.
Source: keydifferences.com

This means that it's a "Ledger" that keeps classified and cleared transactions instead of a "Journal".
We know Bitcoin stores all transactions (UTXO - Unspent Transactions Output - is optional) so why do we call it Ledger instead of Journal?
Please add references to your answers!

You're right. The Bitcoin blockchain is not a ledger, but rather the network's transaction journal. It's actually the UTXO set that is the ledger of all Bitcoin balances.

(UTXO - Unspent Transactions Output - is optional)

If we take a step back and think about it, what are we more interested in? The compiled history of all payments, or the current state of the network's balances?
Obviously, the latter is more useful for anyone that wants to transact on the network. The UTXO set allows to check whether someone is able to pay, and upon update whether we were paid.
The blockchain is merely the means of converging on a common state of the UTXO set. We require the blockchain to compile the UTXO set, as the journal is used to derive the ledger. In fact, pruning full nodes throw away part of the blockchain after processing it, but they all keep the UTXO set. So, while it is conflating different aspects of the system, it seems to me that people speak about "Distributed Public Ledgers", because they care about the balances more than the transactions.


watch-only wallet with bitcoin-cli i'm trying to see all tx hashes and the balance for an address i don't own:

$ bitcoin-cli importaddress 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
$ # wait 5 minutes while bitcoind presumably scans all txs
$ # for this address
$ bitcoin-cli getbalance 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
0.00000000

bitcoind claims this address has no balance while blockchain.info currently shows a final balance of 0.00993754 BTC

why is this not working?

however the listunspent command appears to list the unspent transactions correctly:

$ bitcoin-cli listunspent 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
[
    {
        "txid" : "0fdcdeff329b91fb9888720c958d550c39716f92abec4e5b6ff7c53a22bb31c2",
        "vout" : 0,
        "address" : "1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA",
        "account" : "",
        "scriptPubKey" : "76a914dbf61ed2ce1def33a34d89ab7b05ccc25d9cf02288ac",
        "amount" : 0.00010000,
        "confirmations" : 3608,
        "spendable" : false
    },
    {
        "txid" : "db1beb183808e8b41064405d43bd6c684874b5f328bfb565c4e16cc2baaa0d18",
        "vout" : 1,
        "address" : "1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA",
        "account" : "",
        "scriptPubKey" : "76a914dbf61ed2ce1def33a34d89ab7b05ccc25d9cf02288ac",
        "amount" : 0.00983754,
        "confirmations" : 4459,
        "spendable" : false
    }
]

adding up the funds here: 0.00983754 + 0.00010000 = 0.00993754 matches the blockchain.info figure. maybe getbalance only shows spendable funds?

Try getbalance "*" 0 true.

help of getbalance says: getbalance ( "account" minconf includeWatchonly )


Automated transactions to addresses from database I want to create a website where people can submit their altcoin address and they receive some for free.

The addresses are saved in a MySQL database and the transactions are send from just one address.

How do I have to connect the database with the altcoin client so the transactions to the user addresses are processed automatically?

Thank you in advance!

You need to speak with each wallet through it's JSON RPC API. To speak with the wallet you need to write some code.

If you want to test this api go to your wallet in the menu Help->Debug->Console and write the 'help' command, it will give you the list of all the available commands.

To enable this RPC for external applications you need to create a .conf file. Try to run the wallet from the command line and it should complain that you must create this file. This file contains the credentials that external applications use to access the json-rpc api of the wallet. This is different than the password that you need in order to send the coins.

There are some security considerations that you need to keep in mind:

by default the JSON RPC calls are transmitted in plain text so you need to enable encryption explicitly
minimize the amount of coins you have in the server hot wallet. Instead use one external script to replenish the wallet as needed (also it could compare the addresses in the database with the amount spent)
set the credentials for the wallet access in a secure way


After bitcoin-cli -regtest -sendtoaddress "address" That address's balance is always 0 I'm not quite sure what I'm doing wrong here. I believe I have followed everything correctly but for some reason its still not working? I am using directions from here: https://bitcoin.org/en/developer-examples

bitcoin-cli -regtest generate 101 < This prints that long list of new satoshis

bitcoin-cli -regtest getbalance

50.00000000
Ensuring that the balance is 50

bitcoin-cli -regtest getnewaddress < Make sure I have a new address to send satoshis to

bitcoin-cli -regtest sendtoaddress mviKj9i2zQmoLVUGkLBMuDhwvAwDmfrAmZ 10.00
Attempting to send satoshis. This returns the transaction ID.

bitcoin-cli -regtest generate 1 < Should confirm it

bitcoin-cli -regtest getbalance mviKj9i2zQmoLVUGkLBMuDhwvAwDmfrAmZ

I am expecting this to return 10.00 however it returns 0.00000000

Any ideas on how to fix this?

If you go through the documentation, the getbalance command can take arguments for an account name, but not an address. I see that you are trying to get the balance for an address.

On blockchain, each account will be linked to non-zero number of addresses. Money sent to any of these addresses will be shown on the same account. So it doesn't make sense in showing the balance on an address. You command was interpreted as getting the balance on the account mviKj9i2zQmoLVUGkLBMuDhwvAwDmfrAmZ, which is non-existent. Hence, the result of 0.00000000.


Who are you solving algorithms for and why? I am sick to death of people responding to my question with logistics of "how to" mine data or just that you are solving "mathematical concepts" and "algorithms."  What I do understand is this - some "organization" seems to think it is worth A LOT of money to have the public data mine for them (i.e.: bit coin payments for solving data). My question is what is this data used for, who is using it, and why?  No one seems to know and anytime I've encountered a secret this well hidden, it usually is nefarious under the surface.

The algorithm of choice is two rounds of SHA256, which has completely arbitrary outputs and a massively unsearchable output space. To this end, there is no data mining or valuable calculation actually being done. Here's what's really happening:

Every so often, the rules of the Bitcoin protocol set a difficulty number. This number sets a sort of target for a value miners are looking for. Since the output of SHA256 is essentially random with respect to its input, miners are all just looking for some random value in a given field that makes SHA256(SHA256(x)) return a value within a specified range. Such a value is considered a "solution" to the mining problem, but really it's less like math and more like throwing darts while blindfolded until you hit the bullseye. The changing difficulty number ensures that block solutions will be found at regular intervals no matter how many people are mining.

This solution does not hold any valuable data or information of any kind, except that it proves that someone somewhere had to have done a lot of work to find a value that produced the desired output. This also means that for someone else to fake that data they would also have to do a lot of work.

Since each block of data references the block before it, these hashes - and the work it took to create them - also stack up, meaning that older data would require a TREMENDOUS amount of computational power to falsify, since you'd also have to falsify every block that came after it, faster than the entire network combined is solving new blocks. This is the entire underlying security mechanism of Bitcoin: Data in the Blockchain represents a consensus and this is the way a network of people with no other trust mechanism reach a consensus.

This is likely why you've had such a hard time finding an answer to your question: There isn't anyone you're solving algorithms for and the only "why" is "because it's hard work, and fraudsters would have to do more hard work than everyone else combined to lie to the network."

Finally, as to the "someone thinks this is worth a lot of money" - there are two sources of mining income. The first is transaction fees paid by those whose transactions are in the mined blocks, which seems pretty reasonable given that the miners' work is the only reason that data will be trustable. The second is the block reward.

One of the more difficult problems to solve when decentralizing a currency is deciding who gets the initial run of the stuff. In this case, it was decided that the miners who are doing valuable work to secure the network should receive that initial issuance, in the form of a "block reward." Every so often this reward is cut in half and eventually it rounds down to zero. At that point all 21 million bitcoins that will ever exist will have been mined and the only reward miners will continue to receive is the transaction fee.


using coinbase with uc_bitcoin drupal module I need a simple hack to change the Drupal uc_bitcoin modules code so it gets the exchange rate from Coinbase, it is designed to use MtGox. I want to avoid using the entire coinbase API because I just want the exchange rate, not the kitchen sink. There is a lot of documentation there.

I have found the code in the uc_bitcoin drupal module which gets the information from MtGox. It needs some simple changes so it gets this data from Coinbase. Since both are so different, and I'm not fluent with PHP I thought someone might be able to help me with this.

Here is the code which gets the exchange rate from MtGox:

function uc_bitcoin_exchange_rate($order) {

  static $rate;

  if(isset($rate)) {
    return $rate;
  }

  if ($order->currency == 'BTC') {
    // BTC 1:1
    return 1;
  }

  // Supported MtGox currencies, Dec 15 2012
  $mtGox_currencies = array(
    'USD',
    'EUR',
    'JPY',
    'CAD',
    'GBP',
    'CHF',
    'RUB',
    'AUD',
    'SEK',
    'DKK',
    'HKD',
    'PLN',
    'CNY',
    'SGD',
    'THB',
    'NZD',
    'NOK'
  );

  // @todo add cache
  if (in_array($order->currency, $mtGox_currencies)) {
    if ($response = drupal_http_request('https://data.mtgox.com/api/1/BTC' . $order->currency . '/ticker')) {
      if ($response->code == 200) {
        $data = json_decode($response->data);
        if(!empty($data->return->avg->value)) {
          $rate = $data->return->avg->value;
        }
      }
    }
  }

// @todo add cache
  if (in_array($order->currency, $mtGox_currencies)) {
    if ($response = drupal_http_request('https://data.mtgox.com/api/1/BTC' . $order->currency . '/ticker')) {
      if ($response->code == 200) {
        $data = json_decode($response->data);
        if(!empty($data->return->avg->value)) {
          $rate = $data->return->avg->value;
        }
      }
    }
  }

  if (!$rate || !is_numeric($rate)) {
    watchdog('uc_bitcoin', 'MtGox lookup - Unable to get current exchange rate', WATCHDOG_ERROR);
    $rate = FALSE; // just to be super sure.
  }

  return $rate;
}

I'm not terribly familiar with drupal, and I've never used the module you're talking about, but I'll take a shot at it:

function uc_bitcoin_exchange_rate($order) {
  static $data;
  $rate = FALSE;
  $currency = $order->currency;
  $currency_code = 'btc_to_' . strtolower($currency);

  if ($currency == 'BTC') {
    // BTC 1:1
    return 1;
  }
  if (!isset($data) {
    if ($response = drupal_http_request('https://api.coinbase.com/v1/currencies/exchange_rates')) {
      if ($response->code == 200) {
        $data = json_decode($response->data);
        $rate = $data[$currency_code];
      }
    }
  }

  if (!is_numeric($rate)) {
    watchdog('uc_bitcoin', 'CoinBase lookup - Unable to get current exchange rate', WATCHDOG_ERROR);
    $rate = FALSE; // just to be super sure.
  }

  return $rate;
}


Are the mining incentives of bitcoin compatible with the existence of a competing Proof-of-Work chain? Scenario A: A chain split occurs due to a bug or contentious rule change (i.e. the miner incentives aren't changed in any way).

Both coins initially start out with the same difficulty (and won't change for another 2016 blocks, in the worst case), but their market price will vary.

A rational economic miner will only mine the chain with the highest reward, which is the chain with the higher market price. Users of the lower value chain can offer high fees to compensate, but this is costly.

Scenario B: A hard fork chain split occurs where one chain has decreased difficulty and/or higher block rewards (not touching the 21 million limit, but pushing the release schedule forward).

Unless the new chain has a really low market value, miners are highly incentivized to mine it. It will be hard for the old chain to compete.

The question for both scenarios: How will the scenario play out? Can both chains coexist or will the less popular chain die from a negative reinforcement loop (lower value -> less blocks mined -> even lower value) and be forced to do a PoW hard fork?

And if both chains can't coexist, does that mean that any chain that tries to out-compete bitcoin for the same PoW is a threat to the network?

Both chain in your scenarios can coexist because the current value of a coin (and the current mining reward) isn't the only factor miners are taking into consideration when they have the choice to mine two different coins.

They also put their personal conviction into consideration when choosing what to mine. If they prefer the change brought in chain A, why would they mine chain B that doesn't have it ? (Mining chain B in case of a HF would be being against chain A in that case)

So yeah both chain A & B can coexist as long as the differences between them are big enough. If not their would be no incentive to choose to mine the chain with the least value.


Is there any good reason to buy Bitcoins? I've read the introduction to bitcoins. But the main question remains: what reasons could push me to buy bitcoins today?

For speculation, you would buy when the price is low in anticipation that the price will rise in the future.

There are some signs that the currency is seeing wider use and has greater potential in the future.  For instance:
 - http://blockchain.info/charts/n-transactions

Concluding that that growth means that a bitcoin will be worth $4 or $2 or $32 by any certain date is more or less speculation though.

As far as why you might want to buy bitcoins today?

How about to participate in an online lottery where the jackpot payout return is 99% of the total wagers.  Beats the heck out of doing a scratch-off at the gas station.  Tickets are about $1 each.
 - http://www.bitlotto.com

How about for the novelty.  Have you ever bought a quart of pure maple syrup direct from the farm?
 - https://bitcointalk.org/index.php?topic=55594.0
or Alpaca socks?
 - http://www.grasshillalpacas.com/alpacaproductsforbitcoinoffer.html
or a Blue Canary Night Light:
 - http://bluecanarynightlight.com

How about to prove your brilliance?  Bets of Bitcoin is a predictions market.
 - http://betsofbitco.in

Maybe you want to purchase something and would rather that purchase not show on your credit card bill.  Or not.

Or maybe you want to make a purchase from someone on Craigslist and don't know if you can trust that they'll ship your order.  There are escrow services (with dispute resolution) available using bitcoins (compare BTCrow's 1% to escrow.com's $25 minimum fee):
 - http://www.btcrow.com

Maybe you want to send a few bucks to someone in another country as an expression of appreciation.  Bitcoin transfers are nearly instant and know no borders.


What type of hedging might CoinLab be employing? In the announcement on GeekWire that CoinLab had received seed funding, there was a statement that I found interesting:

  CoinLab will pay game companies in government currency, not Bitcoin, and will use price hedging strategies to protect its own interests.

What type of hedging might they employ and why?  And from where?

Bitcoins are easy to hedge against delivery by pre-selling, provided your working capital calculations are properly sorted, and you understand timing constraints throughout the systems you're dealing with.

We will sometimes be delivering digital goods through an intermediate currency as well, and we will use existing financial markets to sort/hedge that leg.

Shorting on Bitcoinica is another possibility, although it doesn't remove the need to manage your working capital (or credit lines)


At which point do blocks get validated in the mining process? I'm trying to understand how mining works and I'm stuck on the part about validating blocks and adding them to the blockchain.

When a miner finds a solution to a block, he shares it with the network, where other miners validate his new block by checking if the hash of the block (using the found nonce) is smaller than the target, right?

At which point does the validation of the block happen and how many users do have to validate the block so it gets appended to the blockchain?

Does this happen before a miner creates a new block? So basically he'd take a new block in the network, validate it, if it's okay, he takes that one as his "previous block" reference?

A block is checked in two places: First, it's checked before a miner starts working on it, and second, it's checked by every other node before accepting the block as valid.


Example accepted getwork function input and output? I'm looking for example getwork input and output of a successful block hash to verify a getwork client I've implemented.

I'd also accept suggestions on better ways to verify this. I've looked at TestNet but this seems to be a slow process.


How are a private key and a seed phrase related? Is it a 1-to-1 relationship? If so, does that mean they are interchangeable? Can I then store just one of them and derive the other when needed?

It's the same relationship between the branches of a tree and the seed you put in the earth that grows into that tree.
We have a seed that can be used to derive child branches and child keys which makes the relationship is one directional (you can always derive the child key by having the seed but you can't compute the seed from the child key).
Take a look at the following picture from BIP32:


Bitcoin daemon Error: Invalid combination of -regtest and -testnet How to solve above title problem?

I first started with bitcoin as regtest.

Now I want to launch bitcoin as -testnet.

So I did like

root@q352-3023-vps:~/.bitcoin# bitcoind -testnet -daemon

but above error..

So this was because .conf file has line of regtest=1


How exactly does the network know if the miner has put forth a valid proof of work? If all that the miner needs to do is find a hash with a certain number of leading 0's of the block's header, couldn't they just find a random hash with the required number of 0's that isn't necessarily the hash of the block header? How would the nodes know?

How exactly do the nodes decide if the proof of work is valid? What protocol is used for this?

When a miner authors a new block, the block contains a block header. The block header is used to put the new block in relation to previous blocks and gives a summary of the transactions. In detail, the block header contains:

a version byte
the block hash of the previous block
the Merkle root that commits to all transactions in the block
a timestamp
a field corresponding to the current difficulty
a nonce that provides some randomness.

This block header has only 80 bytes of data. When these 80 bytes are put through SHA-256d once, they result in a hash which we use as the unique identifier of the block, the "block hash". The block hash is used to announce the block to peers and in the next block to commit to this one. This same "block hash" interpreted as a number has to meet the difficulty requirement ("have a certain number of leading zeros").

  What you are saying is that the nodes have to do the work to find the valid hash all over again.

Not quite! Finding a block header for which the hash meets the difficulty requires a multitude of tries. Since it is impossible to predict which block header will succeed except by hashing and checking, the fact that a valid block has been found proves that a large number of tries have been expended (about 4,92×10²² in average currently). We call this concept proof-of-work. However, the validation of the work only requires to put the provided block header once through a hash function and then to compare the resulting hash with the difficulty which is trivial to do!
In fact, this is the first of a number of validity checks that other network participants do when they receive a new block candidate.


Where do I get the public key to verify the Bitcoin.org PGP signed message? I've downloaded the Bitcoin client from https://bitcoin.org/en/download

I also downloaded the PGP signed file that shows the SHA256 file signatures:
https://bitcoin.org/bin/bitcoin-core-0.12.1/SHA256SUMS.asc

How do I verify this PGP signed file? When I use the command "gpg --verify SHA256SUMS.asc", I get the message

gpg: Signature made Fri Apr 15 02:37:20 2016 EDT using RSA key ID 36C2E964
gpg: Can't check signature: public key not found

Where do I get the public key?

If you check out https://bitcoin.org/en/download, you'll see some links below the download button: 'Bitcoin Core Release Signing Keys'


What if the brain wallet is just a memorable private key itself? A brain wallet usually applies a hash function on a passphrase to derive the private key. But what if the private key itself is memorable and we just use the private key as the brain wallet?

For example it is very easy to memorize this private key:

Private key: 5JustSomeVeryEasyToRememberBitcoinPrivateKeyWALEmag
Address: 1GtAW7vntpij1q8Mqi3FQw8R1gAd9rnRV4

A series of random words (not a sentence!) long enough to use as a secure key should be about 12 words long, which could be around 100 characters long (figuring they're fairly long, 7-8 average, with a space in between). This gives you 2^128 combinations that you might have to try to crack your password, which might take about 1 billion billion years.

A private key, in base 58 format, is 51 characters long. Your idea of using a 51-character sentence as a private key would probably give about 51 bits of entropy (English is around 0.6 to 1.3 bits per character), which could be cracked in about 12.5 seconds.


Calculating the cost to send bitcoin? This is a follow-up post to this question.

I am using Electrum to send Bitcoin. From what I can gather, it doesn't seem like there is a way to know your "inputs" upfront. The inputs are the various addresses the different chunks of bitcoin are coming from... I think? So the inputs, as I understand, will depend on the source.

I am trying to figure out the best way to calculate the fee I can charge the client for the transaction. So my questions are:

Is there any way that I can assume 1 input for my calculations? Or find another way to get a more accurate fee calculation?
I can't have a fixed fee of, for example, 0.0005, because that will probably work fine for small amounts, but if someone sends a large amount, the fee could easily be more than this. Is there a way to know what the worst case cost could be for sending 0.01 BTC versus sending 20 000 BTC?
Is there a maximum or "worst-case" formula I could use to work out what the absolute highest a fee could be for a specific scenario?

From what I can gather, it doesn't seem like there is a way to know your "inputs" upfront. The inputs are the various addresses the different chunks of bitcoin are coming from... I think? So the inputs, as I understand, will depend on the source.

Your wallet's balance is comprised of the various 'unspent transaction outputs' (UTXOs) it controls. These UTXOs can be used as inputs for new transactions (which will create new UTXOs). Some software will allow you to manually manage your UTXOs ('coin control'), which means you can pick specific UTXOs to be used as inputs for a new transaction.

This page appears to have a walkthrough of the process when using electrum: https://bitcoinelectrum.com/how-to-spend-specific-utxos-in-electrum/ (disclaimer: I am not affiliated with that site and have not verified its legitimacy, but at a very quick glance it appears it may be helpful to you).

  Is there any way that I can assume 1 input for my calculations? Or find another way to get a more accurate fee calculation?

Assuming 1-input for all your transactions will probably not work well in real life. Any transactions you send that have multiple inputs will end up with fees that are lower than intended, which will likely result in long confirmation times (or, a transaction that never confirms).

The most accurate method is to simply first determine the size of the transaction you are sending (vbytes), as well as the fee-rate you would like to send it with (sats/vbyte), and then multiply the two numbers to determine the total fee (sats).

  I can't have a fixed fee of, for example, 0.0005, because that will probably work fine for small amounts, but if someone sends a large amount, the fee could easily be more than this.

This is a misunderstanding of how fees work, it does not matter what the value being sent is, only the number of bytes for the transaction.

But otherwise, in general a fixed fee is not a good solution at all.

  Is there a way to know what the worst case cost could be for sending 0.01 BTC versus sending 20,000 BTC? Is there a maximum or "worst-case" formula I could use to work out what the absolute highest a fee could be for a specific scenario?

You can set the fee-rate as high as you'd like. 'Worst case' would be sending 100% of the transaction value to miner fees.


Better Capacity with More Nodes In regards to the scaling debate, transactions per second etc. I’m curious, and I don’t often see this mentioned. But why not add more nodes to the network to alleviate some of the load?

I’m pretty certain there’s a good reasons why not, but would actually like to know?

The number of nodes in the P2P network is unrelated to scalability. Due to the entire validating network operating in lock step, they all do identical work independent of their peers no matter how many of them exist in the system. One node, a thousand nodes, a million nodes all operate at the same effective speed (and the limits of the network are the same). Adding more peers actually worsens the load somewhat, as you increase the total bandwidth necessary to get the transactional data to everybody in the network quickly.


Safest way of long term holding I am considering holding Bitcoin for the long term. I have learned a few basics about the blockchain and BTC mechanisms, but still unable to find a complete guide on how to safely store bitcoin.

How to generate a private key safely? Online tools are obviously undesirable as they might keep a back door on all keys generated. Similar reason for any library or packages even they operate offline (I cannot check if these keys generated are in fact following some predetermined sequence).
I can use a random number generator on a offline PC. But I am not a real 'hacker' and have concerns on whether any programming language can produce truly random numbers that cannot be reproduced (or say predicted) on another PC.
Currently, I can only think of throwing dice in my room for key generating but that cannot scale.

I do not want to use any 3rd party software as wallet. Suppose I just store my private key on a piece of paper and later transfer coins into it using exchanges. Would that be a valid transaction and allows me later to spend these coins?  Is there anything else I need to store together with the private key (like the hashed transaction number in transaction_input in the blockchain?)  I really want to avoid 3rd party software because it might be obsolete in the future, get wiped out, and cannot be backed up on a single paper.

Any advice?

Paper wallets used to be the safest way. But as of late there are many rumors that some of them actually do not generate random keys but can steal your coins (even when generated offline). So sites like bitcoinpaperwallet are a nono.
If you want it for free, you can find many key generators on github. You'll need some programming skills to check them. And before comitting to one test that the keys are generated correctly. Even I have made one in Java at https://github.com/Johanpmeert/GeneratePrivateBitcoinKey
It uses a Intel DRNG to generate 32 random bytes. Or you can bypass this by entering the random bytes yourself or by taking any picture and taking the SHA256 hash. That'll be random enough.
The safest way is buying a ledger or Trezor direct from the manufacturers website.
If you have a paper wallet, that's all you need. Private and bitcoin address on the paper. No need to store anything but that. You can verify the amount on it by entering the bitcoin address on any blockchain explorer. If you have a QR code that is even easier, there's many apps that scan that and give you the balance.


Can anyone explain why this website has missing data? I was trying to use the api that is located at:

https://api-r.bitcoinchain.com/v1/address/13gWtMQJdg3H6XBpFjMELcHLJc1HHp79vD

However, for every address I look up, they seem to be missing some transactions and subsequently have incorrect balances for each address.

bitcoinchain.com is currently under maintenance, Please consider changing the website until they're back.


What are some uses of a signed crytocurrency message in a product or service or some other useful use of this feature? A signed message is a way to prove a user owns an address. But what are some useful products or services that have been built around this feature with signing a bitcoin / altcoin message with their private key?

This isn't necessarily a product or service, but Gigabyte distribution (Stellar Lumens distribution was done similarly) was done by distributing the currency to those who owned Bitcoin, based on the amount they owned. Ownership of a Bitcoin address was proven by either sending a micropayment, or signing a message using the address.


Are BIP39 mnemonics generated with a French list compatible with software that expects English words? BIP39 specifies different word lists in different languages. But I wonder if the word list generated by a software that gives me French words (e.g. Copay on iOS) can be used to re-create the same wallet using another software that expects English words.

I looked at the section From mnemonic to seed of the BIP39 specification.  Given that the mnemonic sentence itself is fed through the PBKDF2 function, rather than first looking up the indices of the words in the dictionary, I guess that the answer is no, and a French list can't be easily converted into an English list. Is this correct?

Doesn't this drastically reduce the interoperability of wallets using different word lists?  Specifically, how can I ensure that the word list I have for a wallet can be used in another software than the one it was generated with?

Given that the mnemonic sentence itself is fed through the PBKDF2 function, rather than first looking up the indices of the words in the dictionary, I guess that the answer is no, and a French list can't be easily converted into an English list. Is this correct?

That is correct. You can not convert a mnemonic generated using one wordlist to another since the mnemonic decodes to different byte arrays. For example the third English word is 3 bytes (able) while the third French word is 8 bytes (abdiquer). And consequently the seed (that you use in BIP32 functions) is going to be different.

  Doesn't this drastically reduce the interoperability of wallets using different word lists?

Usually when wallets implement BIP39 they implement all of it including all the wordlists that are linked in the protocol improvement. So they can remain compatible

  Specifically, how can I ensure that the word list I have for a wallet can be used in another software than the one it was generated with?

You have to check those wallets individually to see what they have done, either by checking their source code on GitHub or their website, or asking the community about for help. Lack of compatibility doesn't stop there.
Usually there is a page explaining it clearly. For instance Electrum uses an entirely different scheme although it still supports BIP39, or LND and wallets based on it use unique scheme called aezeed


Differents explorers arent synchronized I have this testnet address: yehZoVH57FwDFC7vBRGK5ptuYHG9DfL2cf

I had used this faucet twice:
http://test.faucet.masternode.io/

When I access this explorer:
https://test.insight.dash.siampm.com/address/yehZoVH57FwDFC7vBRGK5ptuYHG9DfL2cf

My balance here is 77.5262, but

When I access this explorer:
https://chain.so/address/DASHTEST/yehZoVH57FwDFC7vBRGK5ptuYHG9DfL2cf

It dont show to me any transactions, and not, mainly, a positive balance such as the first explorer.

Whats happening on here ?

I'm a beginner in this world, so excuse me!

The explorers are not synced with each other; they display different blocks. It seems like Dash's testnet has been reset multiple times so chain.so is using one version of the testnet which dash.siampm.com is using a different version of the testnet. This means that they are using different blockchains. Thus your transactions will only appear correctly on the one that is using the testnet chain that you are using.


Ubuntu Linux, Unable to set bitcoin datadir to a folder in different drive I am trying to run a bitcoin node. I want to set the datadir to a folder located on drive other than on which I have installed ubuntu.
Folder I want to set as datadir:
/media/spider/Utils/bitcoin

with permissions
drwxrwxrwx 1 spider spider 448 اپریل   2 17:25 bitcoin

But when i try to run bitcoin-core i get this error
$  bitcoin bitcoin-core.daemon --datadir=/media/spider/Utils/bitcoin
Error: Failed saving settings file:
- Error: Unable to open settings file /media/spider/Utils/bitcoin/settings.json.tmp for writing

Applications in a Snap run in a container with limited access to the host system, you can install bitcoin-core with full filesystem access via the Luke-Jr repository:
sudo add-apt-repository ppa:luke-jr/bitcoincore
sudo apt-get update
sudo apt-get install bitcoin

or download the release from here:https://bitcoincore.org/bin/bitcoin-core-0.21.0/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz
unpack and run bitcoind executable inside the bin folder.


Logic thread between output folders and input transactions I'm studying the bitcoin protocol and I don't have very clear things, for example the logical thread that exists between an output transaction and a subsequent input transaction, where that output is direct.

I realized that the input transaction contains the reference to the output transaction through the Outpoint type, but now how could the input transaction related to the output transaction be identified?

an example

Bob sells a coffee to Alice and Alice pays in bitcoins, then bob spends his input transaction coming from the alice output transaction, Now I want to find and the two Rawtransactions where the alice transaction information and the bob information are contained for connect the two RawTransactions.
I believe that I haven't understood any important steps to do this

Sorry for my terrible English but I'm learning

Let us illustrate this using the example given in Mastering Bitcoin.

Joe sent 0.1 BTC to Alice in the transaction having txid = 7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18. Below are the outputs of that transaction:

vout": [
    {
        "value": 0.10000000,
        "n": 0,
        "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "reqSigs": 1,
            "type": "pubkeyhash",
            "addresses": [
                "1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK"
            ]
    }
]

When Alice spends these earnt bitcoins to Bob Cafe, she references this transaction in the input. Note that the input includes the txid of the transaction through which she earnt her bitcoins and the n=0 which shows output number of that transactions that was directed to the address she controls.

"vin": [
        {
            "txid": "7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18",
            "vout": 0,
            "scriptSig": {
                "asm": "3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e3813[ALL] 0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf",
                "hex": "483045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301410484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf"
            },
            "sequence": 4294967295
        }
    ],

Full nodes maintain a UTXO set through which they can easily cross-verify this data to ensure, the txid and n referenced by Alice has not been spent previously. If Alice wanted to spend more than 0.1 BTC to Bob Cafe, she would have had to reference multiple transactions as the txid and n she referenced only has access to 0.1 BTC.


Accessing bitcoind from python module hits error I am experimenting with the blockchain a bit, specifically trying to use the python-OP_RETURN module to put a few bytes into the blockchain op_return field.  To use this module I blv I need a running bitcoin core instance so I installed bitcoind using a downloaded .tar.gz (and not thru the ppa which raised some system issues iirc). Anyway, I have the bitcoind daemon running and by writing a bitcoin.conf file it seems I can avoid devoting 200+GB to this by using the prune paramter. I also set the following in bitcoin.conf:
rpcuser=myuser
rpcpassword=mypassword
testnet=0
rpcport=8332
rpcallowip=127.0.0.1
rpcallowip=1.2.3.4
server=1

and now wanted to try putting some bytes into the blockchain :
jeremy@instance-1:~$ python3 python-OP_RETURN/store-OP_RETURN.py 'This example stores 47 bytes in the blockchain.'
testnet False  [**this is debug info I printed]
url http://127.0.0.1:8332/ req {'id': '1620597001.3218298-441058', 'method': 'getinfo', 'params': ()}  [**this is also debug info I printed]
Traceback (most recent call last):
  File "python-OP_RETURN/store-OP_RETURN.py", line 47, in <module>
    result=OP_RETURN_store(data, testnet)
  File "/home/jeremy/python-OP_RETURN/OP_RETURN.py", line 116, in OP_RETURN_store
    if not OP_RETURN_bitcoin_check(testnet):
  File "/home/jeremy/python-OP_RETURN/OP_RETURN.py", line 410, in OP_RETURN_bitcoin_check
    info=OP_RETURN_bitcoin_cmd('getinfo', testnet)
  File "/home/jeremy/python-OP_RETURN/OP_RETURN.py", line 477, in OP_RETURN_bitcoin_cmd
    raw_result=urlopen(url, json.dumps(request).encode('utf-8'), OP_RETURN_NET_TIMEOUT).read()
  File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 563, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 1034, in http_error_401
    url, req, headers)
  File "/usr/lib/python3.7/urllib/request.py", line 987, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python3.7/urllib/request.py", line 997, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

So my question is how I would avoid the 404 , and/or why its happening.
The url and request from line 477 are
http://127.0.0.1:8332/
and
{'id': '1620597001.3218298-441058', 'method': 'getinfo', 'params': ()} respectively. Should I use telnet maybe to check if the host:port is responding?


Can i send bitcoin from non-segwit address to segwit address? can i transfer bitcoins from my exchange(Koinex) which has address starting from 1xx...
to a ledger nano s segwit address starting with 3x.... ?

Although coinbase is not my exchange i am talking about, I have heard like coinbase is currently not supporting segwit , what does that exactly mean ?

PS : I have raised a ticket for same to ask my exchange support , is there anything else that i should be aware of in this scenario to transfer my coins from exchange to ledger wallet ?

TIA

Yes, you can.

The transaction will just not be a SegWit transaction, and not receive its benefits (including lower fees for a given confirmation speed).


Difficulty Adjustment Compairson Thinking about different difficulty adjustments for protecting new coins against attacks from big miners. 2017 when BCH forked from BTC, BCH added the EDA (emergency difficulty adjustment) and updated later to DAA ( difficulty adjustment algorythm ). Another approach of protecting the blockchain is DigiShield, the difficulty adjustment that is used by Dogecoin.
What is the difference between DigiShiel and the DAA of BCH ?
Wich difficulty adjustment is better and why ?

Just because someone has made something and given it a name doesn't mean that it isn't utter garbage.  Don't trust any review or analysis from anyone that can't give you clear and well reasoned list of criteria that it is necessary and sufficient for a difficulty update algorithm to achieve.

Some of the fad options that altcoins blindly copy don't even achieve the basic property of achieving the target block interval when hashrate is constant.

Instead they seem to obsess about falling back to the nominal rate when hashrate suddenly spikes, ignoring that slow blocks are a safe failure mode and completely failing to consider the security side effects of their decision. We've seen at least a few hyped difficulty update changes lead to actual attacks, not just theoretical weaknesses.

I have no doubt that its possible to make something that is pareto-superior to bitcoin's non-overlapping rectangular window, but I am equally sure that essentially all the other things you see hyped fail to do so. This is unsurprising because instead of starting with a meta-analysis to understand what properties are useful, they all seem to have been created by changing things and analyzing only one or two properties (or not even analyzing things at all).

Keep in mind the primary purpose of most technical changes in most altcoins is to create marketing bulletpoints that can be used to convince unsophisticated speculators to pay for the altcoin.  This marketing requires a lot of hype-- far in-excess of whatever hyper a theoretical 'perfect' difficulty update would deserve-- but not a lot of substance.


my unconfirmed transactions hold for over 1 day I have following 2 unconfirmed bitcoin incoming transaction for one day, can you please advise how to speed up?
1Eg8thYVMBTpXg78FQo2sXhxeFdZWB9DjN
1D3grbjFXZWUp1wCApLTHQ9GAxsyyAawkU

Your question will be closed as duplicate which may or may not help you, if you really did those transactions associated with addresses mentioned in the question. Try doing the following in future:

Use RBF (Replace by Fee)
Use fee rate more than others if transaction is urgent. Check multiple websites: https://mempool.space https://btc.bitaps.com https://mempool.observer


When BTC is traded at a Bitstamp, Mt Gox (or similar) what is the algorithm for matching Buys to Sells? How do partial fills occur? I'm trying to understand how a partial fill would / should happen at an exchange and how that would occur

For example, if the BTC rate was $10/BTC and

Someone wanted to buy 100 BTC at $10

The only sellers were

One seller wants to sell 50 coins for $10 USD
One seller wants to sell 50 coins for $9.90 USD

Question

Would the final transaction not be completed because not enough matching shares were available?  (fair benefit)
Would the purchaser be charged $10 * 50 + $9.90 * 50 = $995  (purchaser saves $5)
Would the purchaser be charged $1,000 and the price was increased from $9.90 to $10 (seller gains unexpected $5)
Would the exchange purchase the shares at $9.90 and quickly resell them for $10  (exchange benefit)
If #4 occurs, should the exchange still charge a fee on top of profits already made?

What is expected in this scenario?

To put this in better context, I'm comparing #4 to SEC Rule 605 to encourage open reporting and trade equality.  Namely requiring market centers (Mt Gox) to disclose the extent to which they provide executions at prices better than the public quotes to investors using limit orders.

(2) is the correct answer, the exchange will match the buy order with the lowest sell orders. This is the case with mtgox. Other exchanges should do the same, however it is up to them, hard to give a general answer here, need to look at each one case by case

(4) is specifically NOT true in case of mtgox because they do not act as counter party to any transaction. Not sure about any other exchange, because they all have their own policies.


How to receive transaction in bitcoinj wallet I am a real noob with bitcoin and bitcoin. I have a lot of questions and I don't know where to start. Let me try.

I have a bitcoin-qt client and I downloaded the chain (took me one day) and now I am playing with bitcoinj.

Can I use the block chain downloaded with bitcoin-qt with bitcoinj ? If yes how ?

I created a wallet with bitcoinj client and I get the adress inside it and send money from my bitcoin-qt client to this address.

Do I need to download the block chain to receive this btc ?

There is this code:

// We want to know when the balance changes.
wallet.addEventListener(new AbstractWalletEventListener() {
    public void onCoinsReceived(Wallet w, Transaction tx, BigInteger prevBalance, BigInteger newBalance) {
        // Running on a peer thread.
    }
}

Do this code need the block chain ?

Thanks for your answers and the help.

Technically you don't need to have an updated blockchain to receive coins: just create an address and anyone will be able to send to that address. Until the blockchain is updated, you won't see those incoming coins, so you won't be able to spend them, but you will as soon as the update finishes.


The best way to keep my private keys safe? Best ways means the most reliable and robust, and meanwhile easy to access ways?

The best way currently, that is still easy to access are hardware wallets. The two most famous retailers are:

Trezor:
https://buytrezor.com/

Ledger:
https://www.ledgerwallet.com/

A hardware wallet is dedicated hardware with a defined interface that makes it impossible to extract the private key from the hardware. The interface does however allow signing of transactions. This means that the hardware wallet can safely be plugged into hardware infected with malware.


How do I backup my wallet with bitcoin-cli over RPC? hendry@knuckles ~ $ bitcoin-cli backupwallet /home/hendry/backup.dat
error code: -1
error message:
boost::filesystem::status: Permission denied: "/home/hendry/backup.dat"

Reddit couldn't help me https://www.reddit.com/r/BitcoinBeginners/comments/aftb91/am_i_running_bitcoin_core/

This is no permission problem.

hendry@knuckles ~ $ touch backup.dat
hendry@knuckles ~ $ ls backup.dat
backup.dat
hendry@knuckles ~ $ rm backup.dat

I suspect the bitcoind -server which runs in isolation as "nobody" is trying to access my home directory, which is a bit of a concern. My user's .bitcoin directory looks fine:

hendry@knuckles ~ $ find .bitcoin/
.bitcoin/
.bitcoin/mempool.dat
.bitcoin/wallets
.bitcoin/wallets/wallet.dat
.bitcoin/wallets/db.log
.bitcoin/wallets/.walletlock
.bitcoin/.lock
.bitcoin/chainstate
.bitcoin/chainstate/000003.log
.bitcoin/chainstate/CURRENT
.bitcoin/chainstate/MANIFEST-000002
.bitcoin/chainstate/LOCK
.bitcoin/fee_estimates.dat
.bitcoin/banlist.dat
.bitcoin/blocks
.bitcoin/blocks/index
.bitcoin/blocks/index/000003.log
.bitcoin/blocks/index/CURRENT
.bitcoin/blocks/index/000004.log
.bitcoin/blocks/index/MANIFEST-000002
.bitcoin/blocks/index/LOCK
.bitcoin/blocks/index/000005.ldb
.bitcoin/blocks/rev00000.dat
.bitcoin/blocks/blk00000.dat
.bitcoin/peers.dat
.bitcoin/bitcoin.conf
.bitcoin/debug.log

The process writing the file is bitcoind, not bitcoin-cli, which is simply issuing RPC commands to the server.bitcoind needs to be able to write to the destination, which can’t be another users home folders unless you explicitly give it permission.


Why does Mt gox BTC price discounted with other exchanges? When ever the BTC prices are crashing, MT Gox prices are discounted. What is the logic behind it?

MtGox has stopped allowing people to withdraw bitcoins off of the site. What this means is that in an attempt to get money off the site everybody sells their bitcoins to begin wire transfers. When you have a bunch of people selling and no one buying, the price drops.

Mtgox's prices often get discounted because they are isolated from the rest of the bitcoin market, as no one is able to transfer funds from the rest of the market onto MtGox, and vice versa.


Looking for code generate bitcoin address from passphase in C++ i'm try to write a program which generate bitcoin address from given hash sha256 of passphase as private key or given hex private key. I've found a library for this but it required Boost package in visual studio which took nearly 6GB,totally unnessary for a program like this. Is there any available library to convert hex private key straight into address? No need to make wif private key, though

You need:

1) libsecp256k1 to calculate the public key from a private key

2) Hash the result with Sha2/256 + RipeMD160

3) Add version byte and 4-byte checksum

4) Encode it using Base58. My minimal code would work.

So, it's not really simple


Is the mtgoxlive depth chart information accurate? Mt. Gox publishes live data which is available at mtgoxlive.com.  The chart includes the current market price as well as a depth chart of existing bid and ask prices, which I assume is compiled from the order book of each account with the exchange.  However, orders are allowed to be placed on Mt. Gox without having available funds in ones account to actually make a trade.  If the depth chart reflects these unfunded orders, they would make the chart steeper than it should be.  Of course, the depth chart may also not reflect trades which people have the funds and intention to make but haven't yet placed in the order book.  In sum, does the mtgoxlive depth chart reflect unfunded orders, and in any event, how useful, accurate, or predictive is it?

Unfunded orders obviously don't show up in the orderbook. I assume that mtgoxlive is based on the same data provided by the API so it is probably accurate.

If you really want to know, just compare the market depth from mtgoxlive with the ones shown at bitcoincharts and clarkmoody.