How many unit test should be run after building a node? After building Bitcoin ABC and running make check, I get this:

# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

Is that correct?

There is one unit test binary which contains several hundred tests within it. make check just runs the binary, and if none of the tests within it fail, then make check passes. Because there is only one binary, make check sees this as being only one unit test, but in reality, all 200+ tests are just packaged into the same binary.


Bitcoinj wallet can't receive coins in Testnet3 I have a problem with bitcoinj.

I have created a wallet and than trying to send coins to it in Testnet3 using this faucet:
https://coinfaucet.eu/en/btc-testnet/

Coins sended, transaction confirmed, but when I trying to get balance - it's always zero (available = available spendable = extimated = estimated spandable = 0).

Here is how I creating a Wallet:

NetworkParameters params = TestNet3Params.get();
Wallet wallet = new Wallet(params);
BlockChain chain = new BlockChain(params, wallet, new MemoryBlockStore(params));
PeerGroup peerGroup = new PeerGroup(params, chain);
peerGroup.addWallet(wallet);
peerGroup.startAsync();
File file = new File("testwallet");
wallet.saveToFile(file);

Address:

wallet.currentReceiveAddress().toString()

Balance:

wallet.getBalance()
wallet.getBalance(Wallet.BalanceType.AVAILABLE_SPENDABLE)
wallet.getBalance(Wallet.BalanceType.AVAILABLE)
wallet.getBalance(Wallet.BalanceType.ESTIMATED_SPENDABLE)
wallet.getBalance(Wallet.BalanceType.ESTIMATED)

And it's always zero.

What I'm doing wrong? Why I can't receive coins?

Use WalletAppKit this class is Utility class that wraps the boilerplate needed to set up a new SPV bitcoinj app. Instantiate it with a directory and file prefix, optionally configure a few things, then use startAsync and optionally awaitRunning.

i created the wallet and send the coins using your the faucet you have mentioned and its works fine and receiving coin, here is my code...

public class Main {
    static NetworkParameters params = NetworkParameters.testNet3();
    static String path = System.getProperty("user.home") + "/Desktop";
    private static File walletFile = new File(path);
    private final static String APP_NAME = "MyWallet";
    private static WalletAppKit kit;

    public static void main(String...args)
    {
        kit = new WalletAppKit(params, walletFile, APP_NAME)
        {
            @Override
            protected Wallet createWallet() {
                Wallet wallet = new Wallet(params);
                return wallet;
            }
            @Override
            protected void onSetupCompleted() {
                super.onSetupCompleted();
                System.out.println(kit.wallet().currentReceiveAddress());
                System.out.println(kit.wallet().getTotalReceived().toFriendlyString());
                txHistory();
            }
        };
        System.out.println("start syncing...");
        kit.startAsync();
        kit.awaitRunning();
    }

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

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


Did Satoshi transfer several bitcoin domains before disappearing? Wikipedia Satoshi's page says that:

  Nakamoto continued to collaborate with other developers on the bitcoin software until mid-2010. Around this time, he handed over control of the source code repository and network alert key to Gavin Andresen, transferred several related domains to various prominent members of the bitcoin community, and stopped his involvement in the project.

Is the domain transfer information correct? Does anyone know which ones?

Source: https://en.wikipedia.org/wiki/Satoshi_Nakamoto

I believe it was just bitcoin.org and bitcointalk.org.

He's the 3rd user on bitcointalk.org. It was transfer to theymos.

Edit: Correction, bitcointalk.org was not a domain transfer according to Pieter Wuille.


Manage multiple users wallets for web wallet service This already summaries the issue I'm currently trying to figure out to calculate the transaction fee to prevent negative balance.

(testnet) I tried using createrawtransaction answered.
When I tried to send all balance to an address, the txid was created successfully using createrawtransaction but when I ran the fundrawtranaction on that txid it showed

error code: -4
error message:
Insufficient funds

The goal is to calculate transaction fee before hand to check either sufficient balance is available of an account using sendfrom

To manage multiple users to isolate users' balances as this.

EDIT1:

If using estimatesmartfee it is showing the fee:

bitcoin-cli -testnet estimatesmartfee 6
{
  "feerate": 0.00501921,
  "blocks": 6
}

When calling sendfrom for total balance transfer:

bitcoin-cli -testnet sendfrom <account> <address> <amount>
error code: -4
error message:
Error: This transaction requires a transaction fee of at least 0.00067257

Is there a way to get 0.00067257 the fee part before send the transaction amount and set it so that account balance won't go negative for multi accounts wallet.

Edit 2:

I found out that accounts are deprecated.

And multi wallet creation/load/unload on runtime is underway to 0.17.0

So what would be the best approach to handle multiple users bitcoins in isolation on a full node to prevent negative balance.

You can do estimatesmartfee 6 to calculate suggested BTC/kB fee aiming confirmation in six blocks. Then you can do fundrawtransaction <tx> "{feeRate: 0.000something}" to add inputs with the specified fee. This way, you'll have more control over the fees.


Is Ripple centralized or decentralized? Are people still fighting about this or have they come to a consensus? Also, as of today (Sep 2015), what is the main advantage of Ripple over Bitcoin?

According to Ripple: Ripple for Financial Institutions
Financial institutions, network operators and regulators play critical roles scaling and providing stability to payment systems. Ripple enhances the existing payment stack, offering real-time settlement infrastructure at the foundation."

https://ripple.com/integrate/

Given that financial institutions, network operators and especially "regulators" are part of this equation then in this instance of "Financial Institutions" when considering the totality of human involvement it perhaps could not be considered decentralized, which in the context described makes it centralized.

Ripple also states "Jurisdiction or network specific rules, governance, standards, and other critical functions are intended to be provided by existing systems and operators."

With respect to your second question Ripple is a system for exchanging the Internet of Value (many different assets digital and physical) in which they also offer their own XRP digital "currency", whereas Bitcoin is simply another digital currency.


How to withdraw from an offline / paper wallet into Bitcoin-Qt on Mac? I understand how to create and deposit into an offline wallet, but how do I retrieve the BitCoins back onto a local Bitcoin-Qt wallet on a Mac?

Goto: Help > Debug Window > Console

In the input box, type:

importprivkey [YOUR_PRIVATE_KEY_HERE]

Example:

importprivkey 5J5njVrrim5SX9LF56GPx571iViS7LGqpH5TH49ncfaaWFtzMjY


How to move in and out of wallets cheaply and fast? So... Trezor has ridiculously high fee for "normal" speed of transferring money. If I select cheapest transfer version, it takes more than 2 days.

Is there a way to transfer money between a crypto-wallet (such as Trezor Wallet) and an exchange (such as GDAX) quickly AND cheaply?

Otherwise this safe storage seems like a big limiting step in quick-response trading.

There is no way currently to transfer bitcoins quickly and cheaply between wallets. You need to pay the fee necessary to get your transaction on the blockchain in the timeframe you're comfortable with.

In the near future, the Lightning Network (LN) will allow you to do this. Once you have a LN channel open, you can send to anyone (including an exchange) instantly for a very low fee. Exchanges like gdax won't be needed for crypto-to-crypto exchanges as soon as atomic swaps become available on more coins. Once that happens, you won't need a 3rd party to exchange cryptocurrencies (tho you'll still need them for dealing with fiat).

For more info on the Lightning Network, see the "So you wanna understand the lightning network" section here: https://governology.wordpress.com/2017/07/21/so-you-wanna-understand-bitcoin-part-2/


What does verifying a fake transaction mean? Dear China: please ban bitcoin mining.
Four large Chinese mining pools control almost 60% of bitcoin supply and could in theory collude to verify a fake transaction: Goldman

https://twitter.com/zerohedge/status/1396165860792934407
Which mining pools control 60% of bitcoin supply?
Which theory is mentioned in the tweet?

The tweet seems very confused. Most likely, they meant "60% of the hashrate" rather than supply. It's not clear from the tweet what they mean with "verify a fake transaction". Charitably, one might interpret that they could execute a Finney attack, or execute a doublespend attack by reorganizing the chaintip in a form of majority attack. As written, it rather does sound as if the author of the tweet thought that miners could include invalid data in their blocks and the network would go along with it, which would imply that the tweet's author did not understand that all full nodes on the network independently verify blocks and reject invalid data.


Bitcoin full database is not equal on each node Is it true that a full bitcoin database is not equal on each node?

I mean database (files) in blocks dir, which create official bitcoin client locally.

What is that bitcoin database?

No, they are not identical. There are various reasons for this:

Different nodes may see blocks in a different order. Whenever a fork occurs, by definition some nodes on the network will have seen one block first, and others saw the other first. If they all saw the same blocks first, there wouldn't be any fork. As Bitcoin Core stores blocks in append-only block files, the order on disk reflects the order in which those blocks were seen in the network. Branches in forks that are reorganized out are kept on disk.
Different nodes may not even see all blocks another block sees. If there is a fork between block A and B, and A eventually is built upon further, the nodes that saw A first, and are not connected to any peers that saw B first, will likely never see B at all. This is true in particular for newly synchronized nodes, which typically don't hear about historical forks, and only downloaded the branch that won.
Different versions of Bitcoin Core manage the block files differently. Earlier versions would leave partially written blocks in the files when a crash occurred while writing a new block. Newer versions will reuse that space.

However, despite all this, the active branch of the blockchain (which is the most-work chain that is valid according to the consensus rules) will converge over time across different nodes. This does not happen instantly (as forks may need resolving, which can take minutes or even hours), and does not imply that the files on disk are identical for the reasons above.


Ardor Conversational Wallet Any idea what it would take to build a conversational wallet for basic interactions with Ardor accounts through a chat bot and what the potential risks are?

Will also appreciate any possible code repo dealing with this.

Thanks.

CryptAIVR

The main challenge is how to secure user passphrases.
In the past we had a slack bot implemented in C# https://github.com/libertyswede/NxtTipbot you can use it as reference implementation.


Tax implications in Canada of buying and selling Bitcoins? What taxes should be paid in Canada on Bitcoin transactions? Has anyone gotten official advice on this?

Is it relevant whether the Bitcoins were mined, received as payment for services, bought and then sold for a profit, or freely donated?

Is it relevant whether the Bitcoins are exchanged for CAD or exchanged directly for goods?

Is it relevant where geographically the buyer and seller are?

Taxing authorities consider currencies or goods received in trade to be taxable income. Bitcoin would fall in the same category as foreign currency or barter, and would be taxable.

In Canada, barter is sometimes exempt from taxation:

"According to the Revenue Canada document T-490 (Barter Transactions): if the person(s) bartering is an employee, and not a business owner, they may exchange non-business-related services or goods "occasionally" without being subject to taxation. However, if the goods are business-related, or the exchange is "a regular habit" it falls under the category of taxable income, regardless of his employee status." source

Here's the Revenue Canada bulletin on barter and taxation:

http://www.cra-arc.gc.ca/E/pub/tp/it490/it490-e.txt


Transaction remains not confirmed On Multibit, one of my transaction to Bitstamp is not confirmed since 5 days (Status icon displays a white square). Apparently the 0.0001 fee was paid. I don’t know where is the money neither what to do.

By the looks of things the transaction never made it to the network from your client. Find the "reset blockchain" button in Multibit and wait for it to recover. You won't lose any funds (the ones you "sent" never left) and then you can give it another shot.


running regtest network, bitcoin.conf incorrectly configured? This is what happens after I run this command bitcoind --regtest --printtoconsole, my guess is that it's something to do with bitcoin.conf

My bitcoin.conf file looks like this:

server=1
rpcuser=root
rpcpassword=password
rpcconnect=127.0.0.1
rpcport=8332

If you need more context, these are my other questions: trouble with bitcoin cli regtest and interacting with bitcoin over docker

just do this...

To use bitcoind and bitcoin-cli, you will need to add a RPC password to your bitcoin.conf file. Both programs will read from the same file if both run on the same system as the same user, so any long random password will work:

  rpcpassword=change_this_to_a_long_random_password

in the future I'll be sure to RTFM


Transaction still listed as 'pending' after 12 hours I'm using Electrum 2.5.4 on Tails 2.2.1

Sent the following transaction over 12 hours ago with 0.0005 BTC/kB transaction fee.

There's a warning message saying the transaction has a none standard input - which after googling doesn't seem to have a concensus on what to do about this

What gives? Any help much appreciated

https://blockchain.info/tx/22e6190880cb2433fb99f27e7daf1a763c5e86d64fadb40b708be8295283a052

The higher the number of unconfirmed transactions (in the mempool) the longer will take to confirm your transaction unless you give a higher fee.

I recommend watching current mempool where you can see the number of unconfirmed transactions and it gives you an idea how "clogged up" is the Bitcoin network.

Unconfirmed transaction will either confirm or expire (not sure but I think it takes 3 days to expire).


Which code part in bitcoin-core project generates new bitcoin addresses? i am trying to find out which c++ code in https://github.com/bitcoin/bitcoin

is responsible for generating bitcoin address and private key.

See CWallet::GenerateNewKey in src/wallet.cpp.  It calls either DeriveNewChildKey or MakeNewKey depending on whether HD wallets are in use.


Why do we refer to previous transactions in each transaction? Isn't it enough to just have the Input Address, Output Address, Amount and Signature for each transaction?

We don't refer to previous transactions, but rather to specific outputs of previous transactions. When transactions sign over money to a recipient, they create a uniquely identifiable "Unspent Transaction Output" or UTXO. Transaction inputs in turn spend these "UTXO" to fuel transactions. Since addresses can be reused, addresses alone are insufficient to precisely identify the bitcoins that are being spent.

If you only had "Input Address, Output Address, Amount and Signature for each transaction". This would be trivially broken:
Let's say Alice keeps all her funds in address A1, and pays Bob 0.1BTC in rent to address B1.
Bob pays Mallet to fix Alice's heater from B1, using the funds that he received from Alice.
When Alice pays Bob next month again from address A1 to address B1, Mallet can replay Bob's transaction to himself in order to get paid again.


Bitcoin-Qt wallet passphrase help I do not remember being asked for a passphrase when I installed Bitocoin-Qt (0.8.2 - Beta) (though it was a couple months ago, I could be mistaken) and now am being asked for a passphrase.  I have no idea what it is.  Can this passphrase be reset?  If it cannot, are there restrictions on what can be used for the passphrase (i.e. only letters and numbers) ?

No, it cannot be reset. Yes, I believe it can only include letters and numbers.


What exactly is "privatekeys.pw"? Today, I stumbled upon this bizarre website: https://privatekeys.pw/

Bitcoin Private Keys Directory

The FAQ makes no sense at all and doesn't explain what it is about whatsoever.
What could they be referring to? Private keys? Are they listing compromised private keys to Bitcoin wallets? Why do that in public? And if so, of course whoever runs that site must've already nabbed any coins from the wallet anyway? So what possible use is that information to the world?
As so often is the case, I have to ask: "What am I missing here?"

The site is a joke, or at best a confusing attempt to educate.
It literally lists all private keys, from low to high, as private keys are just numbers. There are of course way more than can be reasonably computed and stored, so the pages are just generated on the fly. If you ask for private keys starting at number N, it on the fly computes the public keys corresponding to private keys N through N+43, and looks up their balance on public block explorers.
But it doesn't let you search by public key, so it is useless for cracking things. Real private keys are randomly generated, and just scrolling through a near-infinite list of pages to look for a given public keys won't give you anything.


Balance doesn't show up after import in multibit I'm trying to import a private key that I exported from Blockchain, I import it, the right public key is created, but no transactions show up or balance?
I've imported a bunch of private keys. and this is the first time I've run into something like this.
Could it be the date? The key is exported in the right Bitcoin-QT format. What could it be?
How can I enable 0 confirmation spending? I want to use it between addresses that I use so I don't need to worry about double spending; I really don't want to alter the source code and all that.

What version of Multibit and on what platform ie OS?

There were issues with importing Blockchain wallets (a Reddit or BCT thread detailed lost BTC from a supposed lost imported Blockchain private key) so I believe recent Multibit versions have had Blockchain wallet imports disabled.

A couple threads to check:

http://www.reddit.com/r/Bitcoin/comments/1rop3t/bitcoins_showing_up_on_blockchain_but_not_in/
http://www.reddit.com/r/Bitcoin/comments/26fymy/multibit_has_removed_imports_from_blockchaininfo/

There's nothing stopping you from using Blockchain's export unencrypted keys in either base58 or Bitcoin-QT formats and pasting the private keys for import (PRIVKEY will either be 5H,5J,5K or K,L)


What is the early history of the BTC exchange rate? Trading on Mt. Gox, which is now the largest Bitcoin exchange, started in July 2010 at an exchange rate of $0.05 USD. This comment suggests that on May 2010, bitcoins were traded at bitcoinmarket.com for roughly $0.004 USD.

What other exchanges existed this early in Bitcoin's life? What is the earliest/lowest recorded exchange rate?

According to https://en.bitcoin.it/wiki/History:

  2009
  October 5 Exchange rates published by New Liberty Standard. $1 = 1,309.03 BTC (and theymos thought NLS was overcharging[3])

It cites http://newlibertystandard.wetpaint.com/page/2009+Exchange+Rate
and
https://en.bitcoin.it/wiki/History#cite_note-2

That first citation seems to have a decent list of pre-May 2010 exchange rates.


Why was the MIT license chosen for Bitcoin? Given that an open, transparent, distributed p2p network is a central element of Bitcoin project it seems unusual that it is licensed under the MIT license which allows proprietary closed source derivitives.

http://en.wikipedia.org/wiki/MIT_License

Does anyone know if there was a stated or expressed reason for not chosing a free software license?

Has there been any discussion to license future versions of the Bitcoin client under licenses which have "copy left" and "patent retaliation" provisions such as GPL?

Satoshi:

  If the only library is closed source, then there's a project to make
  an open source one.

  If the only library is GPL, then there's a project to make a non-GPL
  one.

  If the best library is MIT, Boost, new-BSD or public domain, then we
  can stop re-writing it.

  I don't question that GPL is a good license for operating systems,
  especially since non-GPL code is allowed to interface with the OS.
  For smaller projects, I think the fear of a closed-source takeover is
  overdone.


Many daemon and wallet Can you please tell me if I launch a few actively working daemons bitcoin and point them to different -wallet, but the same -datadir will I have problems?

Yes, you will have problems. You cannot have multiple instances of Bitcoin Core (bitcoind) using the same datadir. That is not allowed and the software will prevent you from doing so. If you want to use multiwallet though bitcoind, wait for 0.15 to be released (it contains multiwallet support for RPCs, although experimentally) or compile it yourself.


Are there standardized ways of generating wallets from passphrases? Brainwallet is a well-known tool that lets you generate an address from a passphrase. I think Brainwallet just performs a single SHA256 hash on the passphrase to get the 256-bit private key of the address.

Is there a BIP-standard formulated for this calculation?

Now that HD wallets are making there way to become mainstream, I think it is useful to have a standard to generate an HD wallet from a passphrase. Electrum and CarbonWallet seem to already have implemented HD wallet generation from passphrase and they are using 100,000 rounds of SHA256, which sounds already a much safer process than a single round.

The original BIP0032 that defines HD wallets doesn't define a way to generate them from passphrases (and it shouldn't), so maybe it is a good idea to make a separate BIP for this purpose if it does not already exists.

I want to be able to switch between wallet apps just taking my master key with me. Or for HD wallets, f.e. use a different wallet for watching (using the public root key) than for signing.

Yes, BIP39 is one such way.

Electrum has a different, mutually incompatible way.


Bitcoin-qt transaction not initiated by the wallet owner I was just mining for some Dogecoins with Eobot and parallel I had BGFminer set on solo mining + 4 pools from eclipse.

The issue is that the moment the Eobot kicked in (it started on mining Dogecoins as they just started on increasing) I saw a notice of Bitcoin transaction, asap I opened the client to see it i found the following:

The best part is that I did not post my sending address anywhere nor iniciated this transaction (And seems I have this wallet since a week and this is the entire  amount that was stored there) so is it possible that i got some Trojan on my PC that somehow managed to process this transaction or similar.

Any suggestions?

Your hypothesis of a Trojan seems likely, unfortunately. Just be glad you didn't have more coins in that wallet.

You'll probably want to wipe and reinstall the computer in question.


NBitcoin how can I get notify when I receive coins? I something like onCoinReceived in bitcoinj
Example with bitcoinj

NBitcoin is only a library. In order to get notified upon receipt of funds you would need to be running a bitcoin implementation such as bitcoin-core and use it's JSON-RPC, or ZMQ or it's built-in features like walletnotify.
https://github.com/NicolasDorier/NBitcoin.Docs/blob/master/README.md
How do I use walletnotify?


What is the NAT traversal technique used by bitcoin https://bitcointalk.org/index.php?topic=30947.msg23736281#msg23736281 says that

incoming port can be opened or
UPnP enabled.

Is this incoming port opened on the NAT device so that all incoming messages coming to that port are relayed to my host?

EDIT: More resources about the topic https://bitcoin.org/en/full-node#enabling-connections and https://bitcoin.org/en/full-node#network-configuration

The second resource says: "If Bitcoin Core can’t automatically configure your router to open port 8333, you will need to manually configure your router."

Is this automatic opening mentioned actually UPnP way?

And manually configuring the router actually bullet 1 mentioned above?

Is this automatic opening mentioned actually UPnP way?

Yes. UPnP is disabled by default in Bitcoin Core due to some vulnerabilities in UPnP. You can enable it by going to Settings > Options > Network and checking Map port using UPnP

  And manually configuring the router actually bullet 1 mentioned above?

Yes.


Should I continue using this Bitcoin Doubler? I saw an advertisement of CryptoX2 recently, and tested out the website. They promise to double deposits within 24 hours. The first time I used it, they paid me fully, and the second time worked too, but I have heard a lot of stories about similar sites being scams, so I am wondering if this is one of them, or if not, how the site works? Does it wait until the amount I deposit gets higher before not returning any money?

It is definitely a scam. They typically pay people who paid in before with the payments of the people who pay in later. This is unsustainable and it will collapse leaving those who paid in later without any money. Furthermore, most of them will simply take your money and leave. This is a scam and so is everything that promises absurd rewards. This includes doublers, HYIPs, ponzi schemes, etc. You pay in at your own risk and if you lose money, then that is all your fault and there is nothing you or anyone else can do to get your money back.


How to pay bitcoin via webmoney? I have some Bitcoin on my Webmoney Bitcoin purse (called " WMX "), so I want to pay for some service, for example to my "namecheap.com" account, how should i do it? after checkout it redirects me to bitpay.com then I think I should copy the address they provide and what I do next?

First you should go to site you want to buy something then go to the menu where you can deposit bitcoin, it redirected me to some bitpay.com page with a qr code, so I copied the address besides the qrcode, and went to webmoney's WMX purse and pressed spend (or send bitcoin) and it successfully been sent, but bitpay didn't recognized the payment so after few days I got the transaction from webmoney and blockchain (supposedly the site they use for bitcoin transferring) and sent it to the purchase site support and asked them for help after few days they added it to my account.


How does Satoshi Dice's 'zero confirmations' transaction system work technically? The popular bitcoin betting game Satoshi Dice sends back payments very fast, they don't wait for confirmations. The user sends money to Satoshi Dice and gets back winnings a couple of seconds later. Here's a quote from their site:

  The SatoshiDice Bitcoin game operates with zero confirmations [...] This is safe because it always builds the answering transaction with the output of your bet transaction. This means a blockchain that does not contain your bet cannot contain the site's answer.

I think I understand the theory behind this: Satoshi Dice always sends back coins from your own bet. So if your bet doesn't get confirmed then your winnings also won't get confirmed.

What I don't understand is how I could technically create these kind of transactions. Using bitcoind, how could one build these transactions?

Thanks for your suggestions.

A transaction claims some outputs from previous transactions and then creates new outputs whose summed value is equal to (or less than, in the case of fees) the sum of the claimed outputs values.

For a transaction to be valid it must be the only one that claims the outputs (no double spend) and the transaction that created the claimed outputs must be valid. Satoshi Dice can immediately send back a transaction containing the winnings because the transaction claims the output of the incoming transaction, chaining the two transactions together.

The result is that either both transactions are valid, in which case the player gets his winnings, or the first transaction is not valid, immediately invalidating the second one, and Satoshi Dice is not tricked into sending coins back without receiving the wager.


Successfully compile bitcoin without errors, but get 'Abort trap: 6' when I run /.bitcoind on Mac OSX I compile bitcoin successfully without errors, but get 'Abort trap: 6' when I run /.bitcoind

/bitcoin/src > ./bitcoind
Abort trap: 6

Building with master branch lastest commit: https://github.com/bitcoin/bitcoin/commit/99bc0b428b03b571afbc311b7f18fd3a707ac5af

I solve it by updating OSX and XCode to latest version, but still get 1 fail when running 'make check'(see issue: https://github.com/bitcoin/bitcoin/issues/11731#issuecomment-345811656).


Will 8 decimal places really be feasible in the future? I had a thought..

Given that block mining rewards halve every 4 years and eventually disappear, miners' incentives to continue mining will be transaction fees. The standard "priority" transaction fee (as far as the Android wallet is concerned) is 0.0001 BTC.

I know that as of now some transactions are mined for free, but to my understanding, transactions that are mined for free have to be at least 0.01 BTC.

My thought is that in the future, transaction fees are likely to rise to a higher rate (let's say 0.001 BTC) and will be required for every transaction. If you don't have at least 0.001 BTC, you basically won't be able to send any BTC to another address, which would seem to render the remaining 5 decimal places useless.

Is there something I'm missing?

You need to consider two separate effects:

Mining starts being funded with tx fees rather than inflation. This will result in higher fees, until tx fees per block are similar to current inflation (maybe 1-2 orders of magnitude less).
The value of every bitcoin increases. The real tx fee per transaction remains more or less the same. The nominal fee decreases. The number of txs per block increases, resulting in an equivalent nominal total fee per block. The real total fee per block will increase, to fund greater security for the bigger network.

The 2nd effect is expected to be bigger in magnitude, and to happen sooner, than the first. So overall, we should see a decrease in the nominal fee per tx, allowing us to use small fractions of a bitcoin (which will then have significant value, in real terms).


Can the Bitcoin network be used for cracking? I'm assuming that the Bitcoin economy is rapidly building a computing cluster capable of unprecedented amount of hash searching.

Would it be possible for an attacker to leverage this to crack other systems?

E.g. could an attacker input password hashes into transactions and then deduce useful information from the output of miners with regards to hose hashes?

(I'm not asking about the security of Bitcoin as such, so I don't think it's a duplicate of [1] or [2])

[1] Could mining calculations be used to crack private key?

[2] How long would it take a large computer to crack a private key?

Short answer: no.

Long answer:

Blocks are exactly 80 bytes long. When have you ever seen an 80 character password?
Blocks start with a bunch of null bytes in the version field. Again, when have you seen that in a password?
Each miner is mining a different block. You don't know the merkle root of what they're mining because that contains a hash of a secret address.
Bitcoin uses SHA256(SHA256(x)) as a hash function, which is not very common in password hashing.
Miners won't publish their results unless they solve a block. They only solve a block if it starts with 12 zeros (at time of writing). The odds of your hash starting with 12 zeros is 0.000000000000003034%.


How to check if a program is mining crypto in the background I noticed a program I recently downloaded cause my CPU usage increase by 30 percent and 80% GPU usage increment in idle state. It is not a GPU intensive program at all. I am worried about it using my computer to mine crypto. Is there a way to check this or find more direct evidences? Thanks!

You can try to check suspicious network traffic. Install wireshark and inspect all network traffic.


activate Electrum command line interface (mac) I installed Electrum on my Mac from python source. The GUI works fine, but I can't use the CLI. Thus, I get :

dyn907-208:Electrum-2.6.4 name$ electrum help
-bash: electrum: command not found

both when I type this command (for intance) in a regular bash, or under the "console" tab of the GUY.

What did I miss?

rgds

It might be in a subdirectory, so run:
find . -name electrum

Or if it is in ., it might not have execute permissions:
chmod +x electrum

Or it might be named something else:
find . -perm -100

Or you might not have . in your PATH: ./electrum help


running bitcoin-cli -testnet getblockchaininfo Hello when I run this command (bitcoin-cli -testnet getblockchaininfo) I get this:

{
  "chain": "test",
  "blocks": 0,
  "headers": 0,
  "bestblockhash": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
  "difficulty": 1,
  "mediantime": 1296688602,
  "verificationprogress": 4.453828060385498e-08,
  "initialblockdownload": true,
  "chainwork": "0000000000000000000000000000000000000000000000000000000100010001",
  "size_on_disk": 293,
  "pruned": false,
  "softforks": [
    {
      "id": "bip34",
      "version": 2,
      "reject": {
        "status": false
      }
    },
    {
      "id": "bip66",
      "version": 3,
      "reject": {
        "status": false
      }
    },
    {
      "id": "bip65",
      "version": 4,
      "reject": {
        "status": false
      }
    }
  ],
  "bip9_softforks": {
    "csv": {
      "status": "defined",
      "startTime": 1456790400,
      "timeout": 1493596800,
      "since": 0
    },
    "segwit": {
      "status": "defined",
      "startTime": 1462060800,
      "timeout": 1493596800,
      "since": 0
    }
  },
  "warnings": ""
}

can you explain what does each line mean and why headers :0 ?

Thank you

You can get information about each value on the RPC documentation on bitcoincore.org or by running bitcoin-cli help getblockchaininfo. I paste it below:

{
  "chain": "xxxx",              (string) current network name as defined in BIP70 (main, test, regtest)
  "blocks": xxxxxx,             (numeric) the current number of blocks processed in the server
  "headers": xxxxxx,            (numeric) the current number of headers we have validated
  "bestblockhash": "...",       (string) the hash of the currently best block
  "difficulty": xxxxxx,         (numeric) the current difficulty
  "mediantime": xxxxxx,         (numeric) median time for the current best block
  "verificationprogress": xxxx, (numeric) estimate of verification progress [0..1]
  "initialblockdownload": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode.
  "chainwork": "xxxx"           (string) total amount of work in active chain, in hexadecimal
  "size_on_disk": xxxxxx,       (numeric) the estimated size of the block and undo files on disk
  "pruned": xx,                 (boolean) if the blocks are subject to pruning
  "pruneheight": xxxxxx,        (numeric) lowest-height complete block stored (only present if pruning is enabled)
  "automatic_pruning": xx,      (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
  "prune_target_size": xxxxxx,  (numeric) the target size used by pruning (only present if automatic pruning is enabled)
  "softforks": [                (array) status of softforks in progress
     {
        "id": "xxxx",           (string) name of softfork
        "version": xx,          (numeric) block version
        "reject": {             (object) progress toward rejecting pre-softfork blocks
           "status": xx,        (boolean) true if threshold reached
        },
     }, ...
  ],
  "bip9_softforks": {           (object) status of BIP9 softforks in progress
     "xxxx" : {                 (string) name of the softfork
        "status": "xxxx",       (string) one of "defined", "started", "locked_in", "active", "failed"
        "bit": xx,              (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
        "startTime": xx,        (numeric) the minimum median time past of a block at which the bit gains its meaning
        "timeout": xx,          (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
        "since": xx,            (numeric) height of the first block to which the status applies
        "statistics": {         (object) numeric statistics about BIP9 signalling for a softfork (only for "started" status)
           "period": xx,        (numeric) the length in blocks of the BIP9 signalling period
           "threshold": xx,     (numeric) the number of blocks with the version bit set required to activate the feature
           "elapsed": xx,       (numeric) the number of blocks elapsed since the beginning of the current period
           "count": xx,         (numeric) the number of blocks with the version bit set in the current period
           "possible": xx       (boolean) returns false if there are not enough blocks left in this period to pass activation threshold
        }
     }
  }
  "warnings" : "...",           (string) any network and blockchain warnings.
}

The headers field means the number of block headers your node has validated, without validating whether the transactions inside that block are valid. Validating the header includes validating the difficulty, timestamp and blockhash fields and can be done without downloading the whole block. The headers must be equal or higher than the blocks field which indicates how many blocks have been fully validated.


What happens to the bitcoin network when the miners all stop in the future? What happens to the bitcoin network when the miners all stop, years in the future after all the bitcoins have been mined?  How will the network continue to function?  Won't bitcoins then be useless?  What would be the incentive for an individual to continue using computational power to service all the transactions?  Isn't this like a ticking time bomb or is there something I'm not getting?

Bitcoin becomes very insecure if miners stop mining. Think of how easy a 51% attack would be to pull off.

However, I disagree with your assumption that miners will stop. And certainly that if Bitcoin dies it would be because miners stop. I would instead think that miners would only stop if something else already killed Bitcoin. Bitcoin is designed to always give miners an incentive to keep mining and secure the network. If miners don't have an incentive to mine, then Bitcoin has already failed.

Many mining pools don't pay out income from transaction fees and the whole thing is often glossed over. But mining income is newly minted coins PLUS fees from the transactions you include in the blocks you generate.

Have a look at the tx fee statistics at http://blockchain.info/no/charts/transaction-fees

As I write this at the end of march 2013, it looks like tx fees were about 4 BTC per day a year ago and are now about 50 BTC. At the same time the newly minted coins in each block has dropped from 50 BTC to 25 BTC.

With 6 blocks per hour this means one year ago we mined 7200 BTC in new coins and 4 BTC in fees per day. Now we mine daily 3600 BTC in new coins and 50 BTC in tx fees. So tx fees went from being 0.00056% of the income a year back to the 1.39% of mining income they are today.

I'm sure you can see where this is going. No, mining does not stop when the minting of new coins stops.


Reserve the connection for local wallets I run a Bitcoin daemon on my LAN server that is connected to the Internet, and would like to use one or more Bitcoin wallets on local workstations that would connect only to my daemon. This initially works (connect=IP in wallet's bitcoin.conf), but when the daemon reaches the maxconnections, local wallets can't connect until the daemon is restarted so all the existing connections are closed.

Is there a way to permit local clients to connect to the daemon regardless of maxconnections parameter, or to somehow reserve few "slots" to particular local IP addresses?

Thanks!

Bitcoin Core allows you to bind a separate listening socket with specific white listing properties. It has enhanced transaction relaying for use as a gateway and an immunity to banning for bad behavior.

  -whitebind=<addr>
       Bind to given address and whitelist peers connecting to it. Use
       [host]:port notation for IPv6

This command can be used in conjunction with whiteconnections to reserve some of the maxconnections limit for connections to the whitelist socket. maxconnections=128 and whiteconnections=4 will use 8 for outgoing connections, allow a maximum of 116 incoming connections, and reserve 4 additional connections for incoming clients on the whitelisted port.

In this case you would bind the whitelist socket to an internal port, and then point LAN nodes to it. This is also useful for attaching axillary programs like P2Pool or the Bitcoin Relay Network.


How do payment processing companies work? What is the rationale for existence of payment companies like BitPay? If I want to start accepting Bitcoin at my store I can simply set up my own Bitcoin wallet for free and then a simple script which counts Bitcoin price after checkout depending on current exchange rate. So what is the extra value these guys bring to the system?

Currently still, most companies want to receive in fiat currency. Most of these merchant payment companies function as a man-in-the-middle, so that you don't have to be concerned about anything Bitcoin-related.

They provide functionality with which your customers can purchase goods using Bitcoin and you will receive all payments in your fiat currency of choice (as long as it's supported by the merchant service).

Like with PayPal, when a users wants to pay with Bitcoin in your site, they will get forwarded to a page from, f.e., BitPay. The user will pay in Bitcoins to BitPay and be forwarded back to your site while you will be notified that the users did indeed pay. Meanwhile, BitPay adds the payment amount to your merchant account, in fiat currency, using the exchange rate of that moment.

Given the high volatility of the Bitcoin exchange rate, this is the best solution for most merchants for now. It's easy and safe.


What would the expected block mining time be if 30% of the total network hashrate disappeared suddenly? Ignoring the economic reasons as to why this may or may not happen.  If for some reason the network hashrate suddenly dropped by 30% immediately after a difficulty adjustment and remained at that level until the next difficulty adjustment, how long would each block be expected to take to mine until the next difficulty adjustment.

You're trying to do 100% of the work with 70% of the workforce.
The expected block interval is to the target interval of 10 minutes as the total work is to the workforce:

Texp = 10 minutes  × (100% ÷ 70%) = 14.3 minutes

The difficulty reset would get extended by the same factor:

Dreset = 14 days × 100 ÷ 70  = 20 days

The expected block interval would be about 14.3 minutes for twenty days.


Which Bitcoin-powered gambling sites are "provably fair"? Through the spread of Bitcoin for the purposes of online gambling, the concept of "provably fair" games came more into the limelight. Which of the Bitcoin-powered gambling websites are provably fair?

For clarity's sake, a provably fair game is a game that uses cryptographic algorithms to ensure their players that the game host or other players did not temper with the outcome of the game after it has begun.

BitLotto was likely the first blockchain-based "provably fair".  It uses the transaction ID as the "ticket", and the results of a large government-run lottery to determine the winning numbers.

http://www.BitLotto.com

SatoshiDICE became a blockbuster (pun intended) method for online gambling.  It uses the transaction ID to determine the "lucky number" (between 0 and 65,535).  The secret used for determining that lucky number is revealed after the end of the day.

http://www.SatoshiDICE.com

bitZino gets credit for coining the term "provably fair", and first launched an online blackjack game then followed it up first with video poker and then roulette as well.  The game allows the user to change the client seed used for each play.

http://www.bitZino.com

BitJack21 was possibly the first.  The game gives the ability for the player to change the seed used for each hand.

http://bitjack21.com/

BitDice.com, SatoshiRoulette.com and others claim to be provably fair, I believe.  But I haven't gone through the verification steps myself to confirm.

BitLotto and SatoshiDICE wagers can be verified by anyone at any time after the results are published in BitLotto's instance, and after each day's secret is published for SatsoshiDICE's instance.  Proving that bitZino always computed the results correctly requires logging of the hash, the client seed, and also the way the hand was played -- so it is much more effort to verify unless there is automation but no automated solutions for verifying all wagers on bitZino have been made available.

Here's an article on what provably fair means:

http://www.forbes.com/sites/jonmatonis/2012/08/31/bitzino-and-the-dawn-of-provably-fair-casino-gaming

Here is one explaining how it works:

http://bitcoinreviewer.com/provably-fair/

[*********

Additional sites in which claim to be provably fair but I've not gone to verify:

http://www.satoshibet.com
http://www.BitMillions.com  (Apparently uses as a seed a Twitter sequence?)
http://www.KingCo.in
http://www.BitcoinVideoCasino.com
http://www.Playt.in
http://www.bitino.com
http://www.pinballcoin.com
http://www.blockchainroulette.com
http://www.diceoncrack.com   (Uses transaction hash just like SatoshiDICE, so should be easily to verify)

*********]


What are the differences between the various MTPs in Bitcoin? I think there are 3 different MTPs (median time past) in Bitcoin (though this may be incorrect). David Harding said on IRC that there was a MTP in Bitcoin v0.1 (Satoshi's first release). There is also MTP as used in BIP 9 and then there is MTP as defined in BIP 113.
If indeed there are 3 different MTPs in Bitcoin, why? What was the motivation?

There is only a single concept of Median Time Past (MTP) in Bitcoin, the median time of a block and the 10 blocks preceding it on the same block chain.  MTP has always been used in Bitcoin as part of the rules nodes use to determine whether a block has a valid nTime field in its header.  Those rules are:

The nTime of a block must be greater than the MTP of its parent block.  E.g., if the MTP of a block is 1618782748 (the actual MTP of the most recent block as I write this), then the nTime of the next block must be 1618782748 + 1.

The nTime of a block in UTC must not be more than two hours in the future according to the UTC clock on the computer of the local node.

These two rules allow the Bitcoin Protocol, which has no direct way to determine the time, to bound the range of allowed times.  That's important, because the times provided in block headers are used to calculate difficulty adjustments that try to keep average block production at roughly one block every ten minutes.  This use of MTP has existed since Bitcoin 0.1.  (Those rules alone haven proven to be good enough so far, but at least one additional rule is needed to prevent miners from significantly manipulating difficulty; see the time warp attack for details about the problem and the proposed Consensus Cleanup soft fork for a solution.)
MTP has the useful property that it is monotonically increasing---it only goes up, never down (assuming no block chain reorgs).  BIP9 takes advantage of this property to avoid having to deal with cases where time moves backwards.
MTP also has the useful property that it's out of the control of a miner creating a single block (they can, at most, choose between two possible options whose precise values were set by previous miners).  BIP113 takes advantage of this property to eliminate an incentive problem related to timelocked transactions where miners would always be encouraged to mine blocks almost two hours in the future.  That wouldn't be a major problem, but it was nice to allow miners to continue reporting accurate times for their blocks according to their own clocks.
In summary, Bitcoin doesn't have three different MTPs---it has one monotonic clock that is used in three different contexts.


Are all trades stored in block chain? Are all trades stored in block chain?

Are all trades, like mtgox exchange, gambling, etc. stored in block chain? Or, few trades could have been skipped / ignored?

Consider this case, 'a' transfers 10btc to 'b', and then 'b' transfers 10btc to 'c'. Is it possible to store this as single trade, as 'a' transfers 10btc to 'c'?

Is it possible for an exchange to include fake bid/ask orders for it's own benefit?

Is it really possible to differentiate between two transfers, where in one transfer is between single user accounts and another one is between two users?

Within an exchange's ledger system, value may be moved between accounts without creating actual transactions in the public Bitcoin ledger, the blockchain. Exchanges that use this method keep all of their reserves in one set of accounts and simply debit and credit user accounts as necessary. Only when a Bitcoin transaction is necessary to move value from one account to another outside of the system will a Bitcoin transaction be created and broadcast.

In other systems, an exchange or other entity may actually create a new Bitcoin transaction for every trade. This method is more inline with the ideals of Bitcoin, but costs more because of the transaction fees necessary to expedite/facilitate processing.


How do Bitcoin nodes know where to send new transactions and blocks to? I am researching Bitcoin; what I can't find much information on though is how the P2P network itself operates. For example, BitTorrent uses a DHT protocol that allows for node discovery and calculating distances between nodes etc.

So if a Bitcoin client wants to do a transaction, how does it know which IP address to connect to in order to announce it?

And how does the node that the transaction gets sent to know which other nodes it needs to connect to, and so on?

Bitcoin is a so-called gossip network. They announce any new object to all of their peers (just the hash of the data). If the peer doesn't know the object yet, it asks for the full object. So it's certainly not a DHT or any smart organisation of data: every (full) node (eventually) learns about every block and transaction. They have to, there is no other way of validating history otherwise.

As for how the client discovers peers, see How do Bitcoin clients find each other?


What happens if a TX was a double spend? What happens if the 'High' risk option (one confirmation) was chosen and then the TX turns out to be a double spend in the end? Would the value deposited be revoked? Would the user be notified somehow?

The appearance of a double-spend on the network throws the status of the earlier payment into doubt.  The doubt is only resolved when one of the payments is confirmed.  As always, the more confirmations, the more certainty that the payment will be permanent.

The recipient of the payment that was double-spent is NOT notified very quickly.  The bitcoin network itself tries not to propagate double-spends.  Therefore, the earliest that recipient reliably learns of the problem is when the double-spend is actually confirmed in a block.

Even then, most wallets are not very vocal about notification.  This is an area where bitcoin could improve.  A bitcoin core improvement request initiated by Gavin Andresen does exist.


rpi3 bitcoin full node missing wallet commands I built a bitcoin full node from 0.15.0.1 that is missing the wallet commands:

pi@raspberrypi:~ $ bitcoin-cli help getwalletinfo

help: unknown command: getwalletinfo

It synced the blockchain fine. I used the instructions here: http://www.raspberrypifullnode.com/

Any suggestions of what might have caused this omission?

The instructions you're linking to include the line

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --disable-wallet

The --disable-wallet in that line (surprise!) disables the wallet functionality, making the node purely act as a P2P participant.

If you want a wallet, you need to configure enabling the wallet support.


Attacking Bitcoin with a supercomputer The difficulty in Bitcoin is recalculated every 14 days. What if immediately after this difficulty adjustment someone targets Bitcoin nodes with a supercomputer and start creating new blocks?

Such attack can create some many bitcoin to complete the series to the 21 million bitcoins before the 14 days pass by. Then the difficulty will be recalculated and it is going to result sky high, because of so many blocks were generated in the previous cycle.

But after that the super computer is disconnected, and the Bitcoin network (all nodes that were mining prior the attack) will have no power to create another block. The network will stall. The interest in mining Bitcoin will disappear and nobody would be able to withdraw anything, since you would need a supercomputer to create the next block, or wait for hundreds of years for the next block to come.

Is there any error in my reasoning? Is this scenario possible?

"TL;DR: Bitcoin mining is virtually immune to someone attacking it with a supercomputer, because the mining market is already flooded with supercomputers custom tailored to the job at the hardware level."
(via Cort Ammon in comments)

First of all, the difficulty reset happens after 2016 blocks. That's only after about 14 days if the hashrate is stable. When there is a steep increase in mining power the difficulty will therefore adjust much more quickly. The difficulty change is limited to a factor of four, so e.g. if the hashrate increased by a factor ten (at the start of a difficulty period), the difficulty would increase by a factor four after 1.4 days, and then again by a factor of 2.5 after 5.6 days, so that it would have adjusted a factor of 10 after only one week. Since the adjustment is an exponential function, the network can similarly adjust to even bigger jumps. You are correct however, that if the hashpower left at that point, the network could get stuck.

Luckily, supercomputers are not effective at producing Bitcoin blocks. For Bitcoin blocks, the only operation that needs to be churned endlessly is a double SHA-256 hash. And that's exactly what Bitcoin ASIC miner hardware does, their chips have the necessary algorithm implemented in hardware and are therefore exclusively designed to calculate Bitcoin blocks. This is what makes even a single contemporary ASIC faster than thousands of computers.

The window for supercomputers to take over Bitcoin mining closed some time in 2012 or 2013. Today, the Bitcoin network produces about 10 exahashes/s. To my knowledge, the most cost effective miners come at about $100 per TH/s which translates to a magnitude of one billion USD invested in Bitcoin mining hardware alone.


Which exchanges are Tor-friendly? Mt. Gox's sign-up page states:

  Please be advised that accessing your account via the Tor network
  and/or public proxies may result in a temporary suspension of your
  account, and having to submit AML documents.

Are there other exchanges which do not have such a restriction (e.g. for transfers and account balances below $1K USD for instance?)

BitInstant seems like a nice Tor-friendly option (they even accept deposits in cash): https://www.bitinstant.com/


Do I really have to place my wallet file in the data directory? I run bitcoin-core QT and I downloaded the full ledger data to an external HD so I can move between machines. My wallet.dat file is secured someplace else.
I start-up the QT client giving the external hard disk as the data root.
So after I put my real wallet.dat file in the data directory (and restart the client with -rescan):
Do I really have to keep it in the directory where the ledger data is saved? Is that safe?

If you want your wallet database (file) to be in a different directory than your data directory, you can use the -wallet=<path> startup option to specify a custom path to your wallet.
Quoting the manpage:

-wallet=< path >
Specify wallet database path. Can be specified multiple times to
load multiple wallets. Path is interpreted relative to  <wallet‐
dir>  if  it is not absolute, and will be created if it does not
exist (as a directory  containing  a  wallet.dat  file  and  log
files).  For backwards compatibility this will also accept names
of existing data files in .)


special block version or is my data corrupt? I've recently written my own blockchain parser. It works well (yay!) up to a certain block and then fails because the data read is pure nonsense.

I've tracked down the error away from my code to the data on the disc and I get the same result if I parse the file only using a sheet of paper and a hex editor. Even after deleting the file and executing  bitcoind -reindex  I still get the same erroneous results.

My question is if anybody can reproduce this or if my data is still corrupted somehow. Maybe I just need to delete all files and let bitcoind create them again?

My findings:

blk00622.dat causes the trouble
Problem still exists after deleting blk00622.dat and running bitcoind -reindex (according to diff the new file equals the old one)
The last ok block is block #428949 (at file address 0x7B748DF).
I have no problem parsing it with my hex editor, I get the same results as shown here: https://blockchain.info/de/block-index/1144703
The erroneous block begins at file address 0x7C68AB3
It starts with  F9 BE B4 D9 41 0F 0F 00 F9 BE B4 D9*

F9 BE B4 D9 is the block's magic number and 41 0F 0F 00 is the block size. The strange thing here is that the following version number again equals the magic number (which makes me thing that maybe my data is still corrupt). The remaining data of the block makes no sense,
for example the time field points to 03/04/1948 ..

Edit: Please see the comments below for an URL to the file (I am not allowed to put more than 2 links in here unfortunately).

Thanks!

*see https://en.bitcoin.it/wiki/Block

That block file is corrupted. You will have to delete blk00622.dat and any higher numbered blk*.dat file and rev00622.dat and any higher numbered rev*.dat file. Then you will need to reindex. This should fix the issue as the corrupted blocks will be redownloaded.


What is the "Untrustworthy" tag on bitcointalk? I just saw some people that were once labeled "Scammers" are now labeled "Untrustworthy" instead. Does anyone retain scammer tags, or was this a rename? Where was this discussed/announced?

People still have scammer tags.

"Untrustworthy" is technically different than the scammer tag - the latter is a forum position, which appears in a certain place and has a specific icon. In Matthew's case it is just a custom title, usually reserved for VIP donators who can write there whatever they want.

I suppose Matthew's tag was commuted as part of his rehabilitation process.


Difference between Public Bitcoin Address and Hash 160 Address? I know the difference Public Key and the Public Bitcoin Address (hashed version) and why.  But I dont understand why there is a Public Bitcoin Address and Hash 160 Address?

I assume the Hash 160 Address is just another hash of the Public Bitcoin Address?

Can you tell me what exactly the Hash 160 Address is and more important, why it is needed?

Thanks!

What you refer to as 'Hash 160 Address' and which appear in this example under the field 'Hash 160' (e.g. the hex number a6c70c4a88205065c1d33b17c156137fa8c736c1) is a 20 bytes hash of the public key (specifically, it is the ripemd160 hash of the sha256 hash of the public key). These 20 bytes are essentially the same thing as what you call the 'Public Bitcoin address' (e.g. 1GCqcweZTwwe1w2RMWwwQMKSFgQzgFZQUb in our example). This bitcoin address is a 25 bytes number (usually displayed in Base58) which is linked to the hash 160 as follows:

address = [Version Byte (1)][Hash 160 (20)][Checksum (4)]

The version byte is simply 0x00 for the main bitcoin network and the 4 checksum bytes are simply the first 4 bytes of the double sha256 hash of the 21 bytes [Version Byte][Hash 160]

I attach a java snippet to illustrate some of the computations:

import org.bitcoinj.core.Address;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.Base58;
import org.bitcoinj.core.Sha256Hash;
import org.bitcoinj.params.MainNetParams;

class Test {
  public static void main(String[] args)
  {
    String  str = "1GCqcweZTwwe1w2RMWwwQMKSFgQzgFZQUb";

    NetworkParameters main = MainNetParams.get();

    // The string address is just a number expressed in base 58
    // Let us parse this string and see the bytes of the underlying number
    // 0:
    // -90:-57:12:74:-120:32:80:101:-63:-45:59:23:-63:86:19:127:-88:-57:54:-63:
    // -86:-114:24:124:
    byte[] full = Base58.decode(str);
    for(int i = 0; i < full.length; ++i){
      System.out.print(full[i]+ ":");
    }

    // Let us compute the hash 160 of the address
    //-90:-57:12:74:-120:32:80:101:-63:-45:59:23:-63:86:19:127:-88:-57:54:-63:
    // These are the same 20 bytes as before
    Address addr = Address.fromBase58(main, str);
    System.out.print("\n");
    byte[] hash = addr.getHash160();
    for(int i = 0; i < hash.length; ++i){
      System.out.print(hash[i]+ ":");
    }

    // Let us see the first 21 bytes of the address
    // 0:-90:-57:12:74:-120:32:80:101:-63:-45:59:23:-63:86:19:127:-88:-57:54:-63:
    byte[] decode = Base58.decodeChecked(str);
    System.out.print("\n");
    for(int i = 0; i < decode.length; ++i){
      System.out.print(decode[i]+ ":");
    }

    // Let us compute the double sha256 hash of the first 21 bytes of the address
    // and display the first 4 bytes: -86:-114:24:124:
    // These first 4 bytes are exactly the last 4 bytes of the address above
    byte[] check = Sha256Hash.hashTwice(decode);
    System.out.print("\n");
    for(int i = 0; i < 4; ++i){
      System.out.print(check[i]+ ":");
    }
  }
}


HOw to convert BItcoin to cash or bank transfer I am in India and 1 of My US customers wants to pay me in Bitcoin.. so my questions is:

can i take Bitcoin? If Yes then what is the procedure of that?
Client is asking for the Account in which he can transfer it. Where and how to open that account?
How can i convert the Bitcoin in INR (Cash or bank transfer)

Please help.

Yes, you can easily receive a payment in BTC following these steps:

1) Download a Bitcoin wallet. A Bitcoin wallet is a software which you can use to store, send and receive bitcoins. There are many different types of Bitcoin wallets but I recommend using one of these:

https://electrum.org/#home
https://greenaddress.it
https://bitcoin.org/en/choose-your-wallet

Install procedure is quite easy. You can find plenty of information on the internet about this or you can email me at cluster2k@protonmail.com, I'm happy to give you some hints to get started with Bitcoin

2) When you have installed a wallet you will see that the wallet has a "receive" tab where many Bitcoin Addresses (in this form: 1Ht7brsfdt8qG1QkBnku1MWwoPRWNwQfgL) are shown. You can choose one of those addesses and that becomes "your account" where you can receive Bitcoin transactions (as in example the payment you want to receive from your client). Just copy paste one of those receiving BTC address from your wallet to your client and he will know that he has to send BTC to that "account" you just gave him to execute the payment towards you.

3) You can exchange BTC to FIAT currencies, including INR, on so called cryptocurrencies exchanges. I have made a list here, and there are many India Based exchanges which can turn to be useful to what you are looking for. Check the list here : https://bitcointalk.org/index.php?topic=3140406.0

I hope this helped.
Enjoy the revolution of Bitcoin tech ;)


can sender send 2 amounts to single recipient in single transaction? I am working on web-app that needs to send money to customer's addresses.

i am trying find out if is it possible to ,
Bitcoin sender to send 2 or more amounts to single address in single transaction ?

e.g.

Transaction 1->
               sender1 -> (20 satoshis)-> receiver 1
                       -> (40 satoshis)-> receiver 1

Is this possible ?

i know i can add both amounts and do single transaction. but i would like to know can this be doable ?

Yes. This sort of transaction is doable in bitcoin.

A point which I would like ot highlight is that transaction fees in bitcoin are proportional to the transaction size in bytes(and not the amount being sent). So, splitting the amount into 2 outputs will cost you more than combining the outputs.


How to sync litecoin blockchain (+ bootstrap) from the terminal? I've installed Litecoin from the main page, so now I have few executable files, like litecoin-cli, litecoind, litecion-qt, ...

I know, that the easiest way to sync blockchain is to run ./litecoin-qt and it will start the syncing automaticly. More than that, I've downloaded bootstrap.dat, so know the stuff will get synced much faster.

But how can I do it, without QT GUI, only using the terminal?

litecoind will sync the blockchain the same way as litecoin-qt, and you can interact with it via RPC calls or with litecoin-cli, both from terminal. Also, bootstrap is not recommended generally for newer bitcoin codebases.


What would happen to my bitcoins? I have a Bitcoin wallet for android and I would like to know what happens if I back up the wallet and restore it in other phone. Will I be able to use the bitcoins in both devices?
Thanks in advance

Yes you will be able to access the same coins with both devices. You can think about it like if you make a copy of a key to your home, and give it to someone; both people will be able to open the same door.


Determinant of confirmation time There seems to be a lots of variations in confirmation time.

https://blockchain.info/charts/avg-confirmation-time

I would like to understand factors that affects the confirmation time.

Confirmation time is effected by two things: the time to find a block, and the transaction fee paid by a transaction.

Since a confirmation means that a transaction has been included in a block, one factor in the time for a transaction to confirm is the amount of time it takes to find a block. This is, on average, 10 minutes. However the time between blocks is not always 10 minutes, it can vary quite a lot, typically from a few seconds to 2 hours. This means that if miners just happen to be really unlucky for a certain block, then the confirmation time for a transaction could be very long.

The other limiting factor is the transaction fee. For a transaction to be confirmed, a miner must select it for inclusion in their block. The selection is based by transaction fee (specifically the fee rate). Transactions that pay a higher fee rate will be selected first. If there happens to be a lot of unconfirmed transactions, transactions with lower fee rates will take longer to confirm as they have to wait for the transactions that pay higher fee rates to be confirmed first. This will also effect confirmation times.


Cant spend input with non-standart redeemscript (OP_CSV) I'm playing with OP_CHECKSEQUENCEVERIFY.

Here is my transaction that I'm trying to spend:

  https://tchain.btc.com/e79d469698915aa6724288ae3a4141a31706d081f39fb7fd0b956a73a9044b22

which has the folowing redeem script:

2 OP_CHECKSEQUENCEVERIFY f45d94733d430261962932e0c847075195916a04 OP_CHECKSIG

But got an error when I  broadcast it (after two block confirmations left):

mandatory-script-verify-flag-failed (Non-canonical DER signature) (code 16)

I have no issues to spend transaction if I:

Just specify 2 CHECKLOCKTIMEVERIFY (can spend anyone)
With standart transaction HASH160 f45d94733d430261962932e0c847075195916a04 OP_EQUAL

but none with combination of them.
Here is a signed transaction:

0200000001224b04a9736a950bfdb79ff381d00617a341413aae884272a65a919896469de7000000006b4830450221008801d7f0e402724b090133ec01a817e993675a44a871f1a3afc0dba730e24ea4022044097be610bece524e90a743fa9d060cd194079105e6f6d150265a1164e722c3012103e8546cfe53ca9014f6a352bc2e5c1f7cec1f5b344c73d4db3ed3b8f075d5c9ef020000000120a107000000000017a914f45d94733d430261962932e0c847075195916a048700000000

Can someone explain me what I'm doing wrong?

P.S. With the folowing redeem script (OP_DROP added)

  https://tchain.btc.com/022d42355ac90e63f2667208112cf22471397dd2812645b5571da2d212596932

2 OP_CHECKSEQUENCEVERIFY OP_DROP f45d94733d430261962932e0c847075195916a04 OP_CHECKSIG

I got another error

(Script evaluated without error but finished with a false/empty top stack element) (code 16)

[UPDATED]:

  https://tchain.btc.com/46894d9dd5e20147826523b1a3ac8e8c5c64603338430d04bd6f5846af2bb9b4

3 OP_CHECKSEQUENCEVERIFY OP_DROP OP_HASH160 f45d94733d430261962932e0c847075195916a04 OP_EQUAL

Then trying to broadcast this tx:

0200000001b4b92baf46586fbd040d43383360645c8c8eaca3b12365824701e2d59d4d8946000000006a47304402205649f715d2553cc4a66dd36a61b3c1b187d19f585bd40427d795c600373a45ab02203325ef44a3aae191ed3f2a90efe382d7992712c03f249f8dd61d8a30997806dc012103e8546cfe53ca9014f6a352bc2e5c1f7cec1f5b344c73d4db3ed3b8f075d5c9ef0300000001e00f97000000000017a914f45d94733d430261962932e0c847075195916a048700000000

I got

error code: -26
error message:
mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code 16)

Here is a privatekey

cUB1iazKDHngknjpTHUfKtH9zNRvHn1aBMPJbK2s913zUegjkeNn

Can someone spend it?

You must provide a scriptSig that, when executed with scriptPubKey results in a true (or any nonzero item) on the stack (and passes all verification ops).
The scriptPubKey you need to satisfy (with a scriptSig) is:
2 OP_CHECKSEQUENCEVERIFY f45d94733d430261962932e0c847075195916a04 OP_CHECKSIG

(note this is not the redeemScript)
There main problem is:
OP_CHECKSIG is looking for a public key, but you have provided a script hash: f45d94733d430261962932e0c847075195916a04. This will never be satisfied so this transaction output is not spendable.
If you want to use the same redeemScript as before, you probably want the following scriptPubKey:
2 OP_CHECKSEQUENCEVERIFY OP_DROP HASH160 f45d94733d430261962932e0c847075195916a04 OP_EQUAL
Note the OP_DROP because the OP_CHECKSEQUENCEVERIFY leaves the 2 on the stack.
In order to spend this, you must provide any signatures and the redeemScript whose hash equals f45d94733d430261962932e0c847075195916a04.
Update:
The redeemScript is still wrong. Instead of 03e8546cfe53ca9014f6a352bc2e5c1f7cec1f5b344c73d4db3ed3b8f075d5c9ef, try 0014e17bbad678e82f8188099a351170c3e0efd4011b. This is the P2WPKH script you used previously in https://tchain.btc.com/46894d9dd5e20147826523b1a3ac8e8c5c64603338430d04bd6f5846af2bb9b4. Also note this is a segwit script so it will look for the signature and pubkey in the witness data: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wpkh


What is the best BTC miner for intel HD 4000 card? Right now I am using GUIminer(and some guides said not to use it), it gets ~80Mhash/s but this miner is laggy, sometimes disconnects without a reason, and it is slow... So I would like to use cgminer, but it doesn't find Intel hd card...

so how do I use cgminer with Intel HD 4000 integrated card, so it could mine? Or what miner would you suggest?

NOTE: this is a question by a guy who is working with BTC for like 1h lol AND I don't want to receive answers who say this is stupid or ineffective.. or it's Impossible.

The question is HOW would You do this with the restrictions of an integrated video card? lets say for theoretical learning purposes, NOT TO MAKE MONEY! I just wanna see if I can make it work.

Or maybe I should use BFGMiner if he would work better(or at all) with Intel integrated HD 4000 card?
thanks:)

Theoretically, you should be using cgminer to mine a GPU coin with your GPU :). Maybe not the answer you're looking for, but you're going to get bored real quick when your miner returns 2 cents for the week.

I recommend mining Litecoin with your GPU. Convert to bitcoin on BTC-e.com if thats your favorite. Its practically the same challenge/experience that you're working at, but you'll at least see some progress. Good luck!


How can we look at the hidden message in the first block? This is the first block, how can I see the message?

  'The Times 03/Jan/2009 Chancellor on brink of second bailout for banks'

Click on the sole transaction in that block (4a5e1e4b...) and click Show scripts & coinbase.


How do exchanges and atms introduce bitcoin As far as I know, Bitcoin is "mined", introduced into the system as part of the protocol, a reward to the miners for verifying everyone's transactions and keeping the network up.

But how do exchanges and ATMs introduce Bitcoin into the system?

Say I bought $10 worth of Bitcoin from an ATM. ATM takes my cash, I get $10 worth of Bitcoin assigned to the address I provided. Where did that $10 worth of Bitcoin come from? Surely it wasn't "mined on the spot". Is there a protocol for such transactions? Does the ATM/Exchange have "spare Bitcoins" that they just assign to the buyer? If so, how did they obtain those coins in the first place? They must have traded it with something too.

Miners need to pay for costs, namely electricity and hardware. One such way to pay for these is to sell the Bitcoin they mine for regular money.

Such transactions will often pass through exchanges. Exchanges and ATMs are simply order books. They accept Bitcoin and fiat money, and match buyers and sellers. If you want to sell 1 BTC at $1000, the order will only go through if there is a buyer willing to pay $1000 for 1 BTC.

Exchange will rarely hold large positions themselves. Instead, all the funds on an exchange usually belong to buyers and sellers, which can be miners, or people who have previously bought Bitcoins.

ATMs and other such systems will often just be a more user friendly mask to an exchange. An ATM operator might deposit $100,000 into an exchange account. Then, when someone puts $100 into an ATM, the ATM operator will execute a buy order of $100 on the exchange (out of their 100k balance). If the order is successful, the ATM will send the BTC out to the user's address, usually from a "hot wallet", which contains some prepurchased BTC that is readily accessible (also commonly known as the "float").

The ATM operator will then perform some balancing of their own, which may involve moving the BTC purchased on the exchange to their hot wallet, and moving the $100 physically deposited into the ATM into a bank account, and then transferring to the exchange he/she uses to maintain liquidity.

At the end of the day, if you follow transaction inputs back long enough, you will eventually end up at a coinbase input, which is the block mining reward that created some BTC. This till then pass through an assortment of exchanges, personal wallets, and p2p trades until it finally ends up with you.


Decide Currency before buying mining hardware? As different Crypto-Currencies have different underlying Algorithms (e.g. SHA256, Scrypt, CryptoNight, etc : Source). Does this mean that if I am looking to buy cryptocurrency mining hardware, I need to decide the hardware after I decide which currency I am looking to mine? For example, a GPU setup may be good for Ethereum but for LiteCoin, I need some ASIC hardware?

Yes, it is true that different coins can require entirely different mining hardware. Some coins use sha, scrypt or some other algorithm; others use a different protocol altogether; and some are privately mined and can only be purchased.

If you want to participate in mining, you need to settle on a coin first. One consideration is whether the hardware for that coin can easily be turned toward a different coin. A lot of coins use sha or scrypt, so you'll have a lot of choices if you choose one of those.

After that comes the difficult and highly speculative part: the profit analysis. Good luck and happy mining.


how do i know which key has mined bitcoin? I mined some coin in 2019 - 2020 via Bitcoin Core which i know very little about.  I have used dumpwallet to get all the keys but there are hundreds ! how do i know which keys might contain the mined coin ?  Any hep would be great as ive been trying to sort this for over 12 months.
Thanks

You have to load the keys into software which can scan the blockchain and search for transactions that belong to them. The simplest way to do this is to just start Bitcoin Core and let it sync. During the syncing process, Bitcoin Core will also be scanning the blockchain for any transactions that belong to any wallets that are loaded, so once it is synced, you will see any transactions (and thus Bitcoin) that belong to you.


Does a low profit margin on mining reduce the integrity of the blocks stored in the transaction history? As the mining Bitcoin payout decreases from 50 to zero, what incentive is there for miners to continue operating?

Is there a need for miners to continue to operate when the payout decreases to zero?

I thought part of the purpose of mining is to validate the Public key with the General Ledger that is replicated in P2P fashion between nodes.  If the miners go away, will GL validation stop?

All that is needed is a number of miners sufficient so that a consensus of bad actors gains control to disrupt the blockchain doesn't happen.

Transaction fees are a tiny fraction of the level of the block reward subsidy ( still not exceeding 1% ) but as bitcoin is more widely used, the fees will eventually make up for the lowered subsidy.  That's what is expected, and so far that appears to be what is actually happening:

http://blockchain.info/charts/transaction-fees?timespan=180days&daysAverageString=7


Antminer S7 Dual Power Supply I am planning on powering up Antminer S7 with dual power supply per usermanual (https://shop.bitmain.com/files/download/Antminer%20S7%20user%20guide.pdf) page 4.  It does not say minimum power requirement for PSU1 and PSU2.

Two boards with 950Watt and 1 Board with 850 Watt.

I plan on using regular power mode without over clocking.  So can it be safe to assume I only need 450 Watt per board and 950 Watt for two board will be just enough?  Will it work?

Since we only need 450 Watts per board and 950 Watts PSU1 and 850 Watt PSU2 worked. Make sure you turn on PSU2 After PSU1 as the S7 manual says.


Electrum-personal-server isn't seeing any historical transactions; using a Trezor I followed the instructions in the Electrum Personal Server guide. I know that the transactions are there because I checked wallet.trezor.io. But none are showing up in Electrum. I have run --rescan. I have bitcoind running in the background as a full node.

The instructions are here: https://github.com/chris-belcher/electrum-personal-server

It's the wallet type. There are three address types: legacy, p2sh-segwit and segwit. Choose the right one or your transaction history will be empty.


What stops people attacking my new coin? Say I just made a new altcoin.
I mined it for a few days at some reasanoble difficulty - 2000 for example.
I got to the 10 000th block and I am happy with my premine and network.

Then, an attacker downloads my client and without connecting to the network, starts mining with some huge hashing power.
So for 24 hours, he is at block 12 000th with difficulty of 5000.

Then, he connects to my network.
Wouldn't that make all my nodes sync with his network?
This way I would lose my premine, wouldn't I?

Is that the case?
Can I prevent the attack?

Firstly, if he downloads the client wouldn't he have to sync with the existing block and be up to date.
From what I'm able to understand your concern is time warping (it should be but it kinda got solved in july 2010 for bitcoin if your coin is a fork of the bitcoin source). But to simply answer your question his solved blocks would have to get approved and even if they do they will get added to the network and synced to the current ledger. Therefore, only the blocks 10000 to 12000 would be solved by him and no it won't make it sync to his nodes.


wallet will not sync it has been a week and I still do not have my money in the wallet. It took out my account I have video proof that this has been going on for a week I have restarted the computer multiple times and have yet to receive any money into my account. I do not even have a wallet number.

You are using wallet-software that requires you to download the whole Bitcoin ledger before it can read your balance. The Bitcoin ledger (the blockchain) is currently about 210 gigabtyes, so you would need a very fast internet connection to download it in just six days. If you don't have 210 gigabytes of spare storage, your laptop's disk will fill up before it gets to the part of the blockchain with your transaction and you'll not be able to see it.

You may therefore want to consider importing your address into some other wallet-software that's able to read a remote copy of this enormous ledger. Such wallets are very popular, but ultra security-conscious people do like to have their own copies of the blockchain, and only you can decide how much security you need.

In the meantime, any blockexplorer web site will tell you whether or not your coins have been sent to your address. If they're at your address, you have nothing to worry about other than the minor inconvenience of either waiting for the blockchain to download or importing your address into some other wallet-software before you can spend your coins.

It will make more sense if you remind yourself that bitcoins are not stored in wallets. Wallets are just tools for drawing up & signing transactions (and they also let you view your balance). The coins themselves exist only on the blockchain.

EDIT
Putting together the information in your two comments, it sounds like you've already transferred your coins to an address controlled by you (check your address on a blockexplorer web site). If so, your predicament is like having a faulty debit card (i.e. the money's in your account but you can't see it). I suggest you study how to export the private key for the address that you used. Once you've exported it, you can import it into a lightweight wallet that doesn't insist on downloading the whole blockchain. Personally I would use Electrum, but other lightweight wallet software is available. Electrum has a create new wallet wizard, with an option to “Import Bitcoin addresses or private keys”, where you should be able to paste your exported private key.

Private keys are valuable to you and to anyone who hacks into your computer, so you want to proceed carefully. Consider disconnecting your computer from the internet during the export/import process. You don't need the internet for key management chores.


Armory Closing after Building Databases completes I am having trouble with opening Armory today, after the 'building databases' portion completes, armory automatically closes itself. When I reopen it, it says Bitcoin-QT must be killed. So I kill that and Armory closes again after the databases and scans.

I don't understand why this is happening and I am seeking possible solutions.

From the Armory Support Page:

While Armory is still in Beta, there are still some subtle bugs that cause Armory to misbehave on systems. Armory developers are always working to fix these problems, but it usually requires a bug report submitted from Armory, or you can open a support ticket so we're aware of the problem and can try to fix it. One thing you can try, is to go into the start menu and find the entry for “Armory Bitcoin Client”. Click on the option that says “Armory (offline)”. This will load Armory without most of the operations that cause loading problems. Once that is open, you can go to “Help”–>”Revert All Settings”. This is effectively a “factory reset” of Armory to the state it was in before the first time you used it.


XAPO's flow from wallet to vault - a different wallet address used for the transfer I have a XAPO account and I moved a bitcoin from Bittrex from XAPO. Now, XAPO has provided me with a wallet address a1.

Now when I have moved my bitcoin from my bitcoin wallet to vault and checked the transaction in the blockchain.info, I was kind of surprised that from address was different from original deposit address a1.

Also, looking into blockchain.info, I was surprised to find that my deposit address a1 was used to send bitcoin to other addresses as well which I have never initiated. So, it looks like XAPO has provided the same deposit address a1 to other users as well, which is not good. In that case, I have to be dependent on their internal ledger to claim my funds, no?

Will the withdrawal process be same as well, meaning when I withdraw from Vault to wallet, the from address will be different from what I see now as my vault address, b1? And when I finally move my fund out from wallet to let's say Bittrex, that txn will also show a different from address?

In addition to that, if XAPO regularly moves the fund around, won't it cost them a lot of fees?

Now when I have moved my bitcoin from my bitcoin wallet to vault and checked the transaction in the blockchain.info, I was kind of surprised that from address was different from original deposit address a1.
Also, looking into blockchain.info, I was surprised to find that my deposit address a1 was used to send bitcoin to other addresses as well which I have never initiated. So, it looks like XAPO has provided the same deposit address a1 to other users as well, which is not good.

Instead of thinking as the addresses being "my addresses", think of them as Xapo's or the exchange's addresses. You are not depositing into your wallet, you are depositing into Xapo's or the exchange's wallet and the addresses they give you belong to their wallet. When they receive your transaction, they just update an internal database for your account's address. The money that you deposited becomes the service's money and they promise to give you back the same amount when you ask for it. This is similar to how banks work

In that case, I have to be dependent on their internal ledger to claim my funds, no?

Yes. This is the same for basically all exchanges and all online wallet services (with a few exceptions). They are custodial, you give them money and they promise to give you back the same amount when you ask for it. In the meantime, they can do whatever they want with the coins. This model is generally easier to implement and less costly as the service can move around coins to reduce cost later.
Furthermore, instead of then having to keep everyone's coins in hot wallets (wallets that are connected to the internet), they can move most coins to cold wallets (wallets that are not connected to the internet) and keep some in hot wallets for people who wish to withdraw. Actually assigning and "spending from" addresses for each user results in perpetual hot wallets which is not secure.

Will the withdrawal process be same as well, meaning when I withdraw from Vault to wallet, the from address will be different from what I see now as my vault address, b1? And when I finally move my fund out from wallet to let's say Bittrex, that txn will also show a different from address?

Yes. The transaction will "send from" addresses that belong to other people as is convenient for the service.

In addition to that, if XAPO regularly moves the fund around, won't it cost them a lot of fees?

Xapo probably isn't actually move the coins around internally, but rather the coins that you deposited went into their hot wallet and someone requested a withdrawal so those same coins were sent to that person.


Send coins with Electrum from encrypted wallet created with Bitcoin Core I am totally new to bitcoin. I have google'd this a lot now. I created a wallet with Bitcoin Core GUI and encrypted it (settings -> encrypt wallet...). Then I took a receiving address from the wallet (file -> receiving addresses...) and sent some bitcoins to that address from an exchange (bitstamp). I confirmed with https://blockchain.info/ that the bitcoins have arrived to that address.

Now I want to spend the coins. I can't use Bitcoin Core because I don't have the resources to download the entire blockchain, so I want to use Electrum for sending coins.

How do I import an encrypted wallet.dat created with Bitcoin Core to Electrum and send coins? If I try to open the wallet.dat with Electrum then I get Error cannote read wallet file

Every wallet can create it's own way of storing data. There's no protocol in bitcoin,that defines the way, how a wallet is structured. In your case it might be best to extract the private key, and load it into Electrum, like here:

http://docs.electrum.org/en/latest/faq.html#can-i-import-private-keys-from-other-bitcoin-clients


Delete Bitcoin Qt Mac: System folder inflated in size, although "Application Support/Bitcoin/" and app deleted I downloaded Bitcoin Qt and the entire blockchain, now I'd like to delete it.

I followed instructions from various search results, which all instructed to delete the app and to delete all data (where the "data", the blockchain, is supposed to take up so much space) in ~/Library/Preferences/, ~/Library/Application Support/ and ~/Library/Caches/. This was the most comprehensive guide: https://uninstallmacapp.com/bitcoin-0-9-removal.html.

In ~/Library/Preferences/ & ~/Library/Caches/, I couldn't find any related data. In ~/Library/Application Support/, there was a "Bitcoin" folder (which was like 7gb in size according to right click->"Get Info"), which I moved to Trash (was emptied subsequently).

I'm sure that I chose only default options in the installation of Bitcoin Qt - no non-default directories were chosen.

Before Bitcoin Qt, under "Storage management", "System" took up like 30-50 gb. Now, it takes up 155 gb. The way I understand it, "Library" is basically my system directory. The "Library" directory, via "get info", shows a total size of 60 gb. However, in "Storage management" System is shown to occupy 155gb. I'm not sure how this makes sense. I have enabled to see all hidden files, so I'm also sure that I'm not overlooking something too obvious.

Rebooting my mac also doesn't help.

Do you have any clue where the blockchain from Bitcoin Qt could sit, so I can delete it and free up the space?

I use a MacBook Pro Early 2015, macOS High Sierra, Version 10.13.6

If you had enabled pruning, then a 7 GB Bitcoin folder makes sense.

Otherwise, you probably chose a different data directory in which case you will need to remember where it is. Try searching your computer for a file named debug.log or blk00001.dat.


Accept payments on someone else's behalf without being able to spend them TL;DR I wish to store some sort of key in my application for each vendor account that allows for my application to generate a receiving address for clients to make payments to.

I am writing some invoice software in Java that I would like to allow to use bitcoin. Basically what I want to have happen is a vendor can save some sort of key to their account details (sorta like the PayPal id and secret key) and any clients paying to that vendor via bitcoin will be given the url to pay to. I don't want this to be a middle man software in the sense that I will never have any bitcoins on my server, I won't accept payments, it only serves to give a payment address of the vendor to a client.

I am under the understanding that this would be possible using the receiving address, however it is not good to use one address for every payment so that is out of the question. I don't want a vendor to have to add a new address after every payment because that isn't at all user friendly.

So I'm wondering if there's some way I can generate addresses for the vendor on my server without holding their wallet. I have been looking at bitcoinj and it seems like there may be some way to do it, but I am quite new to bitcoin. Is that even a possibility? Is this a reasonable expectation for my application to have? If not, do I have any other options?

This is entirely possible with an optional additon to Bitcoin called BIP32. Unfortunately, BIP32 is not implemented by the standard client, but there are other clients that do implement it.

Ask your customer to download the latest version of Electrum, then have them give you their extended public key.

(As I said above, there are multiple clients that can do this, I'm just most familiar with Electrum.)
Include this code in your BitcoinJ application:

String serialized_xpub = "xpub.....";
unsigned int address_num = 4;
NetworkParameters params = MainNetParams.get();
DeterministicKey root_xpub = DeterministicKey.deserializeB58(null, serialized_xpub, params);

// Derive m/0/<n>, Electrum's BIP32 path
DeterministicKey receiving = HDKeyDerivation.deriveChildKey(root_xpub, new ChildNumber(0, false));
DeterministicKey new_address_key = HDKeyDerivation.deriveChildKey(receiving, new ChildNumber(address_num, false));
String new_address = new_address_key.toAddress().toString();

You will generate the same address as long as you use the same xpub and address_num. Make sure that you don't skip five or more addresses, though. If you do end up doing this, then your customer can generate addresses until they see the new payments.

Also, note that you don't have the private key for this address. If your customer loses their wallet, those coins are gone.
Put that address on the invoice.
The money will show up in their wallet.

Best of luck with your application!


I found 10 different wallet.dat files on my computer. How can I tell which has money in it? Bitcoin-core-qt In cygwin I did "find / -name wallet*.dat" and found 10 wallet*.dat files on my Windows box.
Some have 2005 dates, some are newer.
Q: How can I determine which one has the money in it?

You will need to have a fully synced bitcoin core on your computer and then load these files one by one. You may need to re-synchronize each time if you use pruning so I suggest to not do that.


tiny-secp256k1 and ECDSA signing determinism I noticed in bitcoin when using the tiny-secp256k1 library to sign the signature for a signature hash of an input, the signature is always the same.
However in other ECDSA secp256k1 libraries (im using one by nordic semi conductors) the signature is always different.

Am I misunderstanding something? is there a difference in the signature algorithms?
I read something about randomly and deterministically calculating the k value, should it matter if it is random or not?
 or is there possibly extra encoding done after the signature hash is signed in bitcoin secp256k1?

Thanks!
Chris

The secp256k1 library uses RFC6979 to generate deterministic nonce values (k). It essentially takes the hash of both the private key and the message being signed in order to get k. This means that signing the same message with the same private key multiple times will always result in the same signature.

Other libraries may not do this. ECDSA only requires that k be a random integer (or rather that k is indistinguishable from random). So some libraries will simply generate a random k and use that. RFC 6979 is another way to generate a k that is indistinguishable from random, assuming that the hash function used is a pseudorandom function (meaning it's output is indistinguishable from random). The hash function used by secp25k1 is HMAC-SHA256 which is considered to be secure.


I have bitcoins in Poloniex. How do I get them to CANADIAN dollars? Coin base doesn't allow transfer to a CANADA account and Kraken's authentication is down.
it looks like I can get money out of Quadrigacx?? but how do I transfer my bitcoins from Poloniex to Quadrigacx
am I totally off and there is another way? I'm ready to cash out and would like my bitcoin in cash!

Thank you!!

it looks like I can get money out of Quadrigacx?? but how do I transfer my bitcoins from Poloniex to Quadrigacx

You will need to register and verify your account with Quadrigacx. Next obtain a deposit address for your Quadrigacx account, and initiate a withdrawl from Poloniex to the Quadrigacx address. After some time, your Quadrigacx account will be credited with the bitcoin.

  am I totally off and there is another way? I'm ready to cash out and would like my bitcoin in cash!

You could find someone to sell them to in person. There are some websites that facilitate this, such as Local Bitcoins.