How to securly move bitcoins from a wallet.dat file to a paper wallet? I have an old wallet.dat file with a few Bitcoins. It is stored in an isolated computer that is not connected to the internet.

I would like to get rid of the wallet.dat file, and move all the Bitcoins in it to a few separate paper wallets (created using bitaddress.org).

The naive approach would be installing Bitcoin-QT, and make the transaction. Unfortunately, this is insecure - hackers could potentially steal my Bitcoins while I am online.

The secure way should probably be something like:

Import the private key from wallet.dat using some command-line tool, on the offline computer.
Sign a transaction on the offline computer.
Copy the signed transaction (sans any private key!) to an online computer using a flash drive.
Publish the transaction from the online computer.

I've inspected a few tools, including Electrum and Armory, but I seek for your advice regarding the simplicity and safety of these tools.

Any advice how to sign a transaction offline and publish it offline, to salvage the bitcoins from my wallet.dat file?

You have correctly answered your own question in the list following "The secure way should probably be something like [...]". You could skip step one by using the command-line API to the bitcoind client you presumably already have installed and used to generate the wallet.dat in the first place, but this is very tedious as you may have to manually list all the inputs to include in the transaction in a createrawtransaction API call, and then echo the output back into a signrawtransaction API call, before getting the signed transaction for step 3. If you want to investigate this route, check the API Calls List.


Can I clear the mempool from this transaction? I accidentally sent a payment from my blockchain.info address to my Bitcoin Core address with a really small fee (5 satoshi/byte). The transaction is still currently unconfirmed, for 4 days now.

I heard Bitcoin Core has mempool.dat, but I'm unsure if this tactic works only if you sent the TX from Bitcoin Core.

If I delete my mempool.dat, will that send the bitcoin I sent back to me on blockchain.info? I'm sending my bitcoin to my Bitcoin Core address that has the mempool.dat. Let me know. Thanks!

It doesn’t work that way. Your transaction resides in mempools of other nodes of bitcoin network. Mining nodes take the transactions to the block from their own local copies of mempool. Deleting this file on your node will not help you.

You can however send the same transaction but with higher fee: Is it possible to add a miner's fee after you send your bitcoins?


Accepting micropayment donations via Lightning Network - what is the most efficient / recommended architecture? The difficulty that I am experiencing at the moment - how to accept Lightning Network micropayments donations supporting (shameless plug): https://genesis.re/wiki#Plan_B

Zap / Joule:

I send on-chain BTC to lightning enabled wallet
I open a channel
I do not have inbound capacity to receive lightning payments, need to spend first

(two on-chain transactions and spending money first feels like too much)

Blue Wallet / Bitlum:

they say these are custodial wallets
I do not understand how do they work
is my account balance a cell in a database?

(feel free to educate me - comment section -  in the inner workings of custodial wallets)

Bitrefill

This seems reasonable, created by a reputable organization:

https://www.bitrefill.com/thor-lightning-network-channels

  If someone's looking to receive bitcoin, as tips or other earnings, this is a quick and easy tool to get started.

Maybe there is something better available?

Maybe there is a better way?

EDIT / UPDATE

Exchange sats on Lightning Network into BTC on-chain so to have inbound capacity?

https://lightningconductor.net/invoice

  Use this form to extract credit from your Lightning Channel and turn into BTC. Enter the Bitcoin address you want the funds sent to and amount you want to extract.

https://zigzag.io (temporarily out of supply)

I was able to signup and accept Lightning payment in 2 minutes: https://www.opennode.co/

  OpenNode is the easiest way to accept bitcoin.

It was easy. Looking no further. And they offer API: https://developers.opennode.co/

I admit I've spent a little bit too much analyzing which VPS and what hardware requirements. The process of configuring everything from scratch is daunting, wish there was a 1-click install: https://github.com/lightningnetwork/lnd/issues/3159

Something similar to: https://medium.com/lightning-power-users/windows-macos-lightning-network-284bd5034340 (unfairly easy, no excuses not to run a full node)


Is it technically feasible to "shun" particular bitcoin wallets? Bitcoin is supposed to be an apolitical currency, but the United States reportedly gained some leverage by amassing over 27,000 bitcoins — and counting. (People seem to be jumping at the possibility of turning bitcoin into the ultimate unmoderated facebook clone and the "content" there is what you'd expect.)

OTOH, this poses a practical problem for the community, because attempting to redeem this amount would probably destroy the currency's market value.

Now, in the marvellous world of atomic hat-based TF2 trading there is a de-facto authority called SteamRep. In short, what they call a scammer is a scammer. Their items become scammed. Trade for scammed items and you become a scammer. This label shuns you from virtually all trading websites, which will be happy to take for themselves whatever items or currency of yours they hold.

I am not advocating for this. I do not have bitcoins. I don't like bitcoins. I also don't like aiding criminals in their trading and money laundering. That's just my opinion and it's worth its weight in electrons.

I do wonder, though, if it would be technically feasible for the bitcoin community to protect itself from a possible sudden devaluation of the currency by marking a bitcoin wallet, and all the individual fractions of bitcoins in there, as "bad, no, worthless, will not accept, will not process transactions" in an attempt to artificially limit their worth.

Not really, if you start doing that then chain forks and a whole load of nasty things follow. There's no real way of blacklisting a "wallet", as by design there's no way of determining exactly the extent of the keys under control by a specific party, so for the sake of this discussion we will assume we have one blacklisted "address".

Even if nodes reject transactions from specific addresses, miners can still include them in blocks without them even having to be broadcast. If some nodes decide to arbitrarily invalidate blocks with transactions they don't like, you've then got a forked network. Massive double spends occur on both forks by intentional and unintentional parties, and the network collapses in the sea of mistrust.

Currently, some mining nodes (like mine) specifically refuse to include transactions in blocks that come from known betting site addresses, like SatoshiDice. I however don't reject blocks that contain the transactions, or I'd be very quickly become isolated from the network.

You'll never get all the miners to agree with any form of blacklisting, so no, it can't technically happen.


Is it possible to view unconfirmed transactions with the bitcoin client? This site shows you unconfirmed bitcoin transactions:
https://blockchain.info/unconfirmed-transactions

As I understand it, these unconfirmed transactions are received and rebroadcast by every bitcoin client. Given that they are on my computer, how would I go about extracting this information (i.e. a list of all unconfirmed bitcoin transactions) from the bitcoin client?

The RPC interface includes the getrawmempool command which returns transactions in your memory pool. Transactions stay in your memory pool until they're confirmed, so this is effetively a list your known unconfirmed transacions.

Since getrawmempool returns only a list of transaction ids, you'll have to getrawtransaction <txid> for each transaction id in your memory pool. Remember you can get JSON-formmated output via getrawtransaction <txid> 1.


Installed MacOSX over HDD containing wallet I formatted and re installed MacOSX on the HDD that contained my wallet.dat. I have no backup of it.

Any ideas how I could possibly recover this file and my Bitcoins?

I have no experience and I think you would be mightily lucky if you succeed in recovering your wallet file, but I'd advise you to stop using that HDD (to avoid too much writes) and try googling for the problem and trying all the proposed solutions.


Is ASIC miner worth my money? I started to mine BTC recently with my single 7970, and I'm getting 590MH speed on it. Using some BTC profit calculators that I've found on the internet tell me I could earn ~$300-400 worth of BTC annually. Since I have only one PC that I use for work and gaming I can't have it mining all the time, so I'm considering getting an ASIC. I've been looking for information this whole morning and I haven't found a definitive answer on which ASIC I should buy, or should I buy one at all.

I've read some threads that say that the arms race for mining equipment has gone too far to actually be profitable and trading BTC is a better choice, is this true?

Currently I'm looking at BFL products, namely the 5 GH model since it's really affordable at $270, but reading about the mining difficulty rising contantly I get the feeling that this device will become obsolete pretty soon (right?). The next product that I'm considering is the 50GH model priced at ~$2500, which seems to pay itself back and net a nice profit, at least according to the online calculators.

So here's my bombardment of questions: Should I even consider getting the 5GH device? Does a $2500 ASIC REALLY give me a ROI and profit if I order it today (they seem to be in stock)? Can I still use my GPU occasionally to mine alt-coins to trade the for some BTC? Is it a good ivestment to buy BTC, say $50 each month, will it add up in the end?

Any advice is much appreciated :)

In my opinion trading BTC has a higher potential of profit when compared to mining because of the sheer difficulty.

If you do decide to go for an ASIC.
I would recommend Coin Terra GoldStrike1 2TH/s ASIC miners.They are expensive at 6,000 USD.But their Break Even time on January Batch is 4 Days.If they deliver through this is the only miner I feel could have the potential of profit.
I would not recommend BFL as they seem to be taking an insanely long time to ship their products and there are other severe allegations made against them by their users.

Alternatively, You could go for Litecoin Mining and convert to Bitcoin later


How Bitcoin nodes validate a new wallet I have a cuple of questions about how wallet creation works. If I create a Bitcoin wallet offline, is there any way of like validate the new wallet, I mean, what if this wallet already exist? I know the posibilities are incredibly low.
And, if I create an address offline, how Bitcoin nodes would accept my address as valid (or this isn't needed?) I mean, in which moment, Bitcoin nodes accept my offline-created address.
I have create a script that creates bitcoin wallets, and I create one offline, then I search for that address on https://www.blockchain.com/explorer and it shows my current address, so my question is how this address appear in this web?

How Bitcoin nodes validate a new wallet

They don't
Bitcoin nodes validate blocks and they validate the transactions within those blocks
Other nodes don't have access to your wallet and can't validate it or anything in it.

I mean, what if this wallet already exist?

No one knows or cares if the private-key initially generated by your wallet already exists. Nodes don't check for this type of "collision".
If someone else's wallet has the same private key, either of you could spend each-other's money as well as your own.

if I create an address offline, how Bitcoin nodes would accept my address as valid (or this isn't needed?)

Any address is accepted so long as it looks like an address. A well-formed address has an acceptable length, initial bytes and checksum.

I mean, in which moment, Bitcoin nodes accept my offline-created address.

each node accepts it at different moments. In whatever moment they happen to come across the address and see that it is a well-formed address.

how this address appear in this web?

A correctly generated well-formed address that has never been used and consequently never appeared in the blockchain is nevertheless a valid address. I expect most blockchain explorers would simply display it and show that there are no transactions associated with it.

In summary, no one keeps track of wallets, private-keys and addresses that have been created and never used. All of these are just as valid as a wallet, private-key or address that gets used a thousand times a day every day of the year.
There's a vast ocean of numbers,  they are all valid. Some have been used, some not yet, almost all  will never be used.

See also

Can Large Bitcoin Collider break into the wallet which is created by new version of Electrum?


Are my bitcoins safe? As I understand, the safest way to keep your bitcoins is to have them in cold storage.

After reading a few articles I just wanted to make sure the technique I will use will allow me to pull my bitcoins out of storage whenever I want:

1) Boot up a computer using a linux live cd that is not connected to the internet
2) Transfer a copy of armory over using a USB stick
3) Generate a new wallet and 1 address. Encrypt it, and keep a paper backup of it.

I can now send all bitcoin 'savings' to the 1 address that the wallet has, and even if the computer that made the wallet is destroyed I can still recover the wallet from anywhere (even if I didn't copy the wallet file anywhere) because I have a paper backup?

As I understand it this should work?

That seems right except there are some gotchas if you try to spend from your paper wallet.  The "change" will go to you another address and the paper backup address will be empty.  This should not be an issue with Armory though because it has deterministic addresses.  Be sure to follow the instructions carefully.


Are Hardware Wallets (i.e, Ledger Nano X) Safer than Software-Based Cold Storage Wallets? I'm looking into purchasing Ledger Nano X as a cold storage hardware solution.
What benefits does Nano X (or other hardware wallets) provide over software based cold storage solutions? Why not install a wallet such as Electrum on a device that is not connected to the internet and use it as a cold storage?
I looked at reviews of the Nano X and see people mention that it's sleek, sturdy, has improved display, Bluetooth connectivity and a "killer feel in the hand". All of this is nice but a cheap laptop with software that supports cold storage will have most of these features, and many others that Nano X is missing.
What kind of benefits does Nano X offer when it comes to the most important functionality - securing + storing your Bitcoin in cold storage?
I did see this answer which points to the fact that with hardware wallets the private key is embedded in the device itself and is therefore less prone to malware attacks.

What this means is that if your computer is compromised with malware,
with a software wallet, that malware can steal your private keys. With
a hardware wallet, because the private keys cannot be retrieved from
the hardware wallet and because the keys are stored on the hardware
wallet, the malware cannot steal your private keys. In this way, your
funds will be safe.

However, doesn't this mean that:
1) If the hardware device is lost or stolen (don't forget it's "sleek and small") it would impossible to retrieve the wallet as the PK is only be stored on the device itself? (If it can be stored anywhere else you are no longer resistant to malware attacks)
2) Can't a malicious program siphon funds from the hardware wallet while the device is connected to a computer without ever stealing the PK? Similarly, since every hardware wallet runs some OS, why can't it be infected when it connects to a computer? Perhaps the PK can't be stolen but the funds can.
3) If a laptop is always in offline mode (not connected to the internet) won't this prevent it from being infected in the first place?
4) Also it seems that a device that is specifically designed to store cryptocurrency is the perfect candidate to be tampered with during manufacturing and/or delivery. After all, it's pretty clear what the device is going to be used for (unlike regular laptops which have other use cases)
Thanks

If the hardware device is lost or stolen (don't forget it's "sleek and small") it would impossible to retrieve the wallet as the PK is only be stored on the device itself? (If it can be stored anywhere else you are no longer resistant to malware attacks)

All current hardware wallets use BIP 39 mnemonics. This is a sequence of 12 or 24 words which you can memorize and/or write down on paper which can be used to re-generate all of the private keys in your wallet. This is allows for your private keys to be stored elsewhere while not exposing them to any malware.

Can't a malicious program siphon funds from the hardware wallet while the device is connected to a computer without ever stealing the PK? Similarly, since every hardware wallet runs some OS, why can't it be infected when it connects to a computer? Perhaps the PK can't be stolen but the funds can.

No. The hardware wallet has buttons and screens so that it can show the user what it is going to sign, and allow the user to accept or reject the transaction before signing. Hardware wallets are not just dumb storage devices, they have mini operating systems and will do their own checks of the transaction and ask for user input before private keys are retrieved and used for signing.
The mini OS that they run is not like an OS on your computer. They are highly specific to the device and, in general, can't be infected by malware on your computer. Hardware wallets have a limited communication protocol with the computer. While there could be a vulnerability in the firmware that does allow it to run malware, the attack surface is very small and far more easily auditable than the software that runs on a laptop.

If a laptop is always in offline mode (not connected to the internet) won't this prevent it from being infected in the first place?

Airgapped devices can still get malware through USB drives and other devices you plug into. Famously, the Stuxnet virus successfully jumped an airgap in this way. Furthermore a laptop could be accidentally connected to a network. You cannot assume there won't be any human error.

Also it seems that a device that is specifically designed to store cryptocurrency is the perfect candidate to be tampered with during manufacturing and/or delivery. After all, it's pretty clear what the device is going to be used for (unlike regular laptops which have other use cases)

That is possible, and different hardware wallet manufacturers address this in different ways. Trezors are shipped in boxes that have tamper evident seals. Coldcards are shipped in sealed, tamper evident bags. The Coldcard, Ledger Nano S and X can be visually inspected to see if any of the hardware is not what it should be. Coldcard and Ledger have high quality images of the device's circuit boards online and you can look at your devices circuit board and compare them to the pictures.
Additionally, most hardware wallets have open source firmware so you can compile the firmware yourself and run that on your device instead of trusting the firmware that it shipped with.
Of course there is still the element of trust. You still have to trust the hardware wallet manufacturer and their factories. But it is reduced with these methods.


Mining without pool where does the bitcoin/reward go if successful? I was wondering 2 things:

How to set up cgminer to mine without a pool?

If if I am successful solving the block how do I claim it / send to my Bitcoin wallet?

I don't have a huge 'rig'. I know you need high hashrate… just starting out and want to know. I can't find this answer anywhere else sorry to ask.

Read the cgminer documentation about "solo mining".  You'll need to install and set up bitcoind and sync the entire block chain, so see its documentation as well.

As far as payouts, note the --btc-address command line option to cgminer; that specifies the address to which the reward will be sent.


MultiSig Learning On TestNet I'm trying to figure out multisigs and have just created a 2 of 3 multisig as follows:

createmultisig 2 '["public_key_1","public_key_2","public_key_3"]'

This returns 2 values

Value 1: Address

Value 2: redeemScript

Now, if I want to fund this multisig, where do I send the funds?  I typed in Value 1 into blockr.io, and it said that is an invalid key.  So how do I get the public key for that multisig?

I am trying to learn the hard way, using bitcoin-core.

So basically, for the next step in my learning, I want to send that multisig some funds using the testnet, but I don't know where to get the public key for that multisig.

A "multisig address" is actually a Pay to script hash (P2SH) address. Unlike normal bitcoin addresses that start with 1, P2SH addresses start with 3 (on the main network, 2 on the testnet). How this works is explained by the P2SH BIP16 wiki page. Essentially, you pay coins to a special address that is a hash of the redeem script. To claim the transaction, one must provide a redeem script that hashes to the correct address, and also provide conditions that make the redeem script evaluate to True.

In your example, paying the multisig is  really easy: Just copy-paste whatever value you got in the address field into your wallet and pay it just like you would a regular transaction.

Claiming the funds in a multisig is a little tricky. First, you must know the redeem script. Hopefully, you saved it, and you also gave it to the other key owners so they could verify the P2SH address is fair (their key is in it). If you lost the redeem script, reenter the createmultisig command with the same parameters and the same public keys in the same order. You're guaranteed to get the same redeem script and the same address.

Then you need to generate and sign the transaction, which is pretty difficult with the core client. You're going to find it simpler if you use a ready-made program.

Essentially, your transaction that paid your multisig address had an output that looked like this:

<hash> OP_EQUAL

and the transaction that spends from the multisig will sign that input with the signature script:

OP_FALSE <Signature1> <Signature2> <redeemScript>

where the redeemScript is what you got when generating the address, serialized and pushed onto the stack. The redeemScript must hash to the value specified by the output. Note that <Signature1> <Signature3> and <Signature2> <Signature3> would also validate, but not any other order. You also can't have more signatures than required: if it's a 2-of-3 multisig, you need exactly 2 signatures, not at least 2, so <Signature1> <Signature2> <Signature3> won't work.


How does the hash of a coinbase transaction differ for the same miner? Based on the format of a coinbase transaction described here: What is the format of the coinbase transaction?, I don't see how the all the coinbase transactions for a given miner do not all have the same hash assuming the miner was just using a single pubkey and the block rewards were the same. If they all have the same hash then when you spend one of them, you effectively use them all because that transaction hash has now been used as an input. Clearly that wouldn't make sense, so how are they ensured to be unique transaction hashes?

The script of the input to a coinbase transaction can hold up to 100 bytes of arbitrary data. After BIP 34, the block height must be the first thing in that script. Since each block has a different height, this rule ensures that each coinbase transaction is unique as the block heights will always be different.

Furthermore, since miners can put whatever arbitrary data they want in that input script, they frequently use that as an extra nonce. Instead of reselecting transactions when all of the nonces are exhausted, miners will increment a value known as the extranonce which is put in the input script.

Also, before BIP 34 activated, there were in fact cases of identical coinbase transactions in different blocks. Only the outputs from the most recent of these identical coinbase transactions are spendable. Spending outputs from these transactions does not spend all of the outputs, only the ones from the most recent one. This means that the outputs from the earlier coinbases are unspendable and those coins are provably lost forever.


Bitcoin Charts API Data So I'm trying to learn how to work with an api, and how to get bitcoin historical price data.  Ideally, I'd like all of it, and the nice gui that they have on the site for displaying the charts (but I don't suppose I can get the gui?).

Alternatively, I'd like to be able to just see the last 2000 trades, up to an end date, as it seems to say I can here, using http://api.bitcoincharts.com/v1/trades.csv?symbol=SYMBOL[&end=UNIXTIME].  This works fine for UNIXTIME up to a couple days ago, but not further back.  Is it possible to retrieve older data?  Or are there better ways to go about this?

There's a start and an end that can be quoted, and only one is required although both can be used.

If you want US$ per BTC data from a 24th April until now until now, use:

http://bitcoincharts.com/t/trades.csv?symbol=mtgoxUSD&start=1366784293

If you want all US$ per BTC data until now, use:

http://bitcoincharts.com/t/trades.csv?symbol=mtgoxUSD&start=1279424500

If you want all US$ per BTC data until 24th April 2013,:

http://bitcoincharts.com/t/trades.csv?symbol=mtgoxUSD&start=1279424500&end=1366784293


Where is the New button in the Receiving Addresses windows of bitcoin core 0.17.0? I'm not imaging this right - the New button in Receiving Addresses of bitcore core has just disappeared in 0.17.0?

Press "request payment" to get an address.

The button on the address book was redundant and was removed by PR12721.


There was a transaction spendable only by someone who provided the double hash of the genesis block. How was that transaction created? I can't find it anywhere, but I remember reading about a transaction that was spendable only by someone who provided the double hash of the genesis block. Was it simply that the private key of an address was seeded with the genesis block hash and coins were sent to that address as an output?

Is there a transaction type that allows you to specify that providing a pre-image of a hash is the only requirement of redeeming coins?

This transaction is described quite well on the wiki.

https://en.bitcoin.it/wiki/Script#Transaction_puzzle


bitcoin-cli getinfo error code: -28 OSX Sierra

it seems all the other command bitcoin-cli working on my Mac,
except,

bitcoin-cli getinfo only always returns an error.

  $ bitcoin-cli getinfo
  error code: -28
  error message:
  Rewinding blocks...

Why does it happen?

Wait a few minutes and the error will be gone.

The source code defines error 28 as

  Client still warming up


Can I run a full bitcoin node on a Raspberry Pi? If so, what would be the best way to get started?

Yes. I have one with an external usb hard drive if you want to store full blockchain or without it if you run a pruned node.


What is the difference between Dogecoin and Bitcoin at the network level? With all the Dogecoin hype, mainstream media has been comparing Doge with established cryptos like Bitcoin.
I'm trying to understand the difference at the technical level:

It comes up that Bitcoin network has better security. Is that due to the hashrate? If more miners start switching to Doge, wouldn't that solve the problem?

Doge's codebase is also almost same as Bitcoin.

Ignoring the coin supply factor, where Doge can continue creating 5 billion coins per year, is there any other reason that the Bitcoin network is superior? Does it boil down to simply which network gets more adoption?

TL;DR: small code differences, but many larger ecosystem differences
IIRC, Dogecoin is a fork of Luckycoin, which in turn was forked from Litecoin, which was forked from Tenebrix, which was forked from Bitcoin. As far as I can tell, the main differences to Bitcoin are:

scrypt hashing algorithm
1 minute block interval
accelerated reward schedule:
Full supply emission in less than 2 years via random rewards, then later changed to have a constant tail emission of 10,000 Doge per block.

Dogecoin is merge-mined with Litecoin, so it shares the protection of the hashrate of the incumbent Scrypt-coin and is therefore not trivially majority-attackable as some other minority-hashrate forks. Since Litecoin/Dogecoin use a different hashing algorithm (Scrypt) than Bitcoin (SHA256d), mining hardware does not transfer, it is only compatible with one or the other.
Presumably, people citing security concerns are alluding to Dogecoin Core being about 15,000 commits behind Bitcoin Core, with its master release citing inclusion of "changes from Bitcoin Core 0.14.3" (which was released in Sep 2018). I surmise that this means that a plethora of security fixes and performance improvements have not yet been backported to Dogecoin. The Dogecoin network has only about 220 public nodes at chain-tip. Allegedly, the software is struggling to synchronize the 3.7M block headers.
Dogecoin did also not backport segwit, which means that it still suffers from third-party transaction malleability, the quadratic hashing problem, and cannot support a Lightning Network. Since the upcoming Taproot soft fork builds on segwit, the resulting new features including Schnorr signatures, public key and signature aggregation, scriptless scripts, Merklized Alternative Script Tree (MAST), and Discreet Log Contracts (DLC) are also unlikely to become available.
So, Bitcoin and Dogecoin are practically the same, except that Dogecoin has no infrastructure, no ecosystem, a plethora of security and performance issues, maybe one developer, next to no code review, and none of the new shiny features. However, it is a great meme and a funny parody on all altcoins, so it will always have a special place in our hearts.


How much binary data (bytes) could I put in a transaction and how? I know that some people had put text, pdf and images in the blockchain.

I wonder which are the limits in order to have a minimum "bytes/btc" value in regarding the blockchain as a permanent database.

How much bytes could I put in a transaction and how many bitcoins I need to use (e.g. in fees) ?

And how this is possible, e.g. using satoshi client?

There's 3 related issues to your question where confusion may be arising.

The Blockchain can be used to hash PDFs or JPGs as a means of proof of existence - this is not the same as attaching the document itself
As seen here, it is (was?) possible to take hex code for a PDF/JPEG and use the resulting hex string as a public address. Splitting the file into ?? byte chunks then using these addresses as outputs in a Bitcoin transaction allows for things like photos of Nelson Mandela
Coinbase (source of mined coins) allows 100 bytes of arbitrary text in the block which was utilised in the Genesis Block, where encoded in hex (0x5468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73) was the phrase: 'The Times 03/Jan/2009 Chancellor on brink of second bailout for banks'.

Find more interesting stuff encoded in the Blockchain at BitcoinStrings.com


Correlation between Ripple and Bitcoin Is there a correlation between the value of Ripple (XRP) and Bitcoin (BTC)?

Bitcoin and Ripple's past 90 days prices somewhat correlated

Using price charts of the last 90 days in XRP/USD and BTC/USD, the daily prices of Ripple and Bitcoin appear to be somewhat correlated: Their correlation coefficient comes out as 0.741.

Correlations in Coingecko's Top Ten

I've proceeded to check the past 90 days correlations of the top ten cryptocurrencies as listed on Coingecko.com:

In the past ninety days:

Litecoin and Bitshares had a correlation of 0.93, as had Litecoin and NXT.
Bitcoin appears to be most correlated with Ripple and Litecoin, both 0.74.
Bitcoin appears to be least correlated with Stellar, at -0.19
The least correlation appears to be between Dogecoin and Monero at -0.05.

Procedure

All data was taken from Coingecko's last 90 days pricecharts on 2015-06-08. Therafter, I plugged them into LibreOffice, and ran Correl(A;B) on each pair.


How to store/export coins from bitcoind to papper wallet 'cold storage' I have bitcoind 0.9.1 installed on my VPS debian server. I would like to store my coins via "cold storage", on paper wallets.

I read some articles over internet, but i don't know which one is usable/achievable in this case.

Could someone tell me some ideas how can i achieving cold storage via bitcoind.

You can create a paper wallet (from a link from here for example) and then send the bitcoin to the address associated to that wallet. Then it is in the so-called cold storage. The paper does not need to know there are bitcoins on it, you just want to have the private key (which is printed on it) associated to the address you have sent you BTC to, whenever you want to access the BTC again

The idea is that you have a private key on the paper wallet, which is the ONLY (so dont loose it ;) ) option to access that specific wallet. Whatever ends up in that wallet is yours, whenever you send it (so before or after printing, but you have to create the address/key before sending of course)


Is it possible to create a disposable address identical to mine? So today I lost money on a transaction. This guy I was dealing with asked for my bitcoin address. I of course copy and pasted my bitcoin address and sent it to him. He sent me a screenshot of me preparing to send me my funds, i confirmed the amount but wasn't able to confirm the address because I expected him to copy and paste what I copy and pasted. I wondered why the funds didnt arrive yet, I double checked the address only to see that the address he sent the btc to was identical to mine, except for 1 letter (instead of a p there was a q)

Now my question, is it possible to create an address similar to mine, but change 1 letter/number?

You have been scammed.

The address with one symbol changed is invalid and all bitcoin cliends reject sending bitcoins to it. So, your partner lies. Tell him to give you a link for his transaction on block-explorer site like blockchain.info

  Now my question, is it possible to create an address similar to mine, but change 1 letter/number?

No. It is not possible.


Was a timejacking attack ever performed? The timejacking attack appears to be a pretty straightforward attack to pull off successfully. I was wondering, whether it was ever performed and documented somewhere, or was it just theoretically described?

For those of you who are wondering what TimeJacking is, please consider the following:

In order for computers and machines, separated by vast distances, to work in tandem, they usually have to be synchronized. If the time and date aren't isn't synchronized, this can lead to issues relating to security, usability, and overall response time. According to NTP.org:

http://www.ntp.org/ntpfaq/NTP-s-def.htm

"If you have communicating programs running on different computers, time still should even advance if you switch from one computer to another. Obviously if one system is ahead of the others, the others are behind that particular one. From the perspective of an external observer, switching between these systems would cause time to jump forward and back, a non-desirable effect. As a consequence, isolated networks may run their own wrong time, but as soon as you connect to the Internet, effects will be visible .... Even on a single computer some applications have trouble when the time jumps backwards. For example, database systems using transactions and crash recovery like to know the time of the last good state."

This also applies to online security certificates (in browser). If the time and date is wrong, strange things may happen (invalid certificate error).

While this appears to apply only to the Network Time Protocol, I assure you otherwise - networked systems need to stay synced in order to function. BlockChain and other cryptocurrency handlers have this exact issue because they are handling electronic transactions over vast distances, across time-zones.

Oh wait - in case you don't know what a bitcoin node is:

http://www.coindesk.com/bitcoin-nodes-need/

Now that we know how the system crack can occur, let's delve into the process (good source, BTW - ThePiachu):

(Presented by culubas: Timejacking and BitCoin - Blogspot)

"Each node internally maintains a counter that represents the network time. This is based on the median time of a node's peers which is sent in the version message when peers connect. The network time counter reverts to the system time however if the median time differs by more than 70 minutes from the system time. A very reasonable way to estimate the median network time.

An attacker could potentially slow down or speed up a node's network time counter by connecting as multiple peers and reporting inaccurate time-stamps. (A relatively small number of Tor clients could send enough messages to take over the node's median time.)"

As usual, time is used for security and validation on these monetary hardware servers and nodes. If the time is off, bad things can happen. For more info on how an actual cracking attempt could occur, read the section labeled "Creating a 'Poison Pill' Block" of culubas blogpost cited above.

In short, an attempted hack would create a perceived time gap between the mining machines and node targeted, by lagging part of the system until one of three things occur: either an unaffected node or the target itself creates a block, clocks are reset, or operators intervene. As such, valid blocks could be dropped, and money could be lost or stolen. Please read the original article for more info.

Now, as for the question at hand, I wasn't able to find any confirmed instances of TimeJacking so far. That could be due to a variety of reasons, but I personally think that no one has chosen to target the cryptocurrency yet. In that case, I can't wait to see what a new API update would look like - especially with some new security patches for P2p time-keeping and network certificates. Sadly, it could be just a matter of time.


Bitcoin RPC getbalance of address I sent coins to on regtest Here is my terminal session:

$ echo $address
mvt7M16caMH1xoJyfWU5orjArfq97jhZ7k
$ bitcoin-cli -regtest getbalance
5899.99990000
$ bitcoin-cli -regtest sendtoaddress $address 10.0
6ed7452f8f11fe25904867b57e127a6b65cb180c2013e667e3d399c4179ff1f0
$ bitcoin-cli -regtest setgenerate true 1
$ bitcoin-cli -regtest getbalance $address
0.00000000

Shouldn't the balance of this address be 10 now? I thought that by generating a block, I will have that transaction included, which will show up on the addresses balance?

getbalance returns the balance of an account, not an address.  https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

If there's no account by the name of mvt7M16caMH1xoJyfWU5orjArfq97jhZ7k, it will return 0.

Try using getreceivedbyaddress instead.


miners fees and exchange fees I read somewhere that as older a bitcoin become as higher exchange fees the buyer has to pay. Is that correct?  These exchange fees go to the miners only or to whom else?

thank you

No, the transaction fee is not increasing over time. According to the Bitcoin wiki, these are the rules under which the reference implementation decides weather or not to include transactions (and therefore how fast they are confirmed):

  27.000 bytes in the block are set aside for the highest-priority transactions, regardless of transaction fee. Transactions are added highest-priority-first to this section of the block.
  Then transactions that pay a fee of at least 0.0001 BTC/kb are added to the block, highest-fee transactions first, until the block is not more than 250,000 bytes big.
  The remaining transactions remain in the miner's "memory pool", and may be included in later blocks if their priority or fee is large enough.

The priority addressed in the bold part is calculated like this:

  priority = sum(input_value_in_base_units * input_age)/size_in_bytes

As you can see, the priority increases with the age of the coins. Thus, the "older a bitcoin gets"* the more likely it is that the transaction is included in a block, even if no fee is paid, in fact.

This behavior has the following advantage: That way you have the option to pay more fees to get your transaction confirmed faster, or less and even nothing if you can wait a day or two.

Regarding the second part of your question: Yes, when a miner generates a block he gets the transaction fee of each transaction in this block.

* to be exact: "the older the last transaction spending the coins is"

When buying bitcoins with fiat, exchange portals like MtGox or Bitstamp usually charge another fee (about 0.5% on both bitcoins and fiat), which does not go to a miner but to the exchange portal. It has nothing to do with Bitcoin fundamentally, so it's totally up to the exchange how to calculate this fee. However, I don't know of any exchange which considers the age of the bitcoins, and I can't see any reason why they should.


Are there any ways to sync mempool from another nodes faster? I still use bitcoin 0.13.2 for some reasons. Recent mempool size is very high so syncing mempool takes for a long time, over two days. Are there any ways to sync mempool faster? I have some bitcoind nodes. Some of them have already finished to sync full mempool. I hope I can copy mempool from my another nodes.

I had a similar issue where I restarted my bitcoin node for changing some parameters and it took half a day to catch upto to all uncomfirmed tx. Bitcoin 0.14 has a feature that stores current mempool to disk and loads it back on startup https://github.com/bitcoin/bitcoin/pull/8448. It should be possible to copy mempool.dat files to your other nodes that are behind.


Beginning the process of buying bitcoins I am interested in the process of buying bitcoins, but I have many questions. First and foremost, how do I begin this process? I am looking to make my bitcoin wallet as secure as possible, so how would I go about doing that? How would I incorporate the process of buying bitcoins with Tor?

If you want your wallet to be as safe as possible, you'll have to store it cold, i.e. create a Paper Wallet. There a several options with different safety levels:

Use an online generator, like Bitaddress and print the generated address/key
Use an offline computer with a ubuntu-live cd to generate address/key and print it

You can send bitcoins to this wallet, even though it's created offline, and never has seen the internet, or vice versa. For further reading about this, I recommend the first link, as there are some recommendations you should read first.

Buying bitcoins with Tor is a little more complicated. I never did it, and couldn't find anything about it. PrivateInternetAcces said Bitinstant was a good option, but the article is 2 years old, and bitinstant returns a white page. A local trade is a good option, find some people on LocalBitcoins


How can I recover a blockchain.info wallet without the wallet identifier or the mnemonic? My son made both of us each our own bitcoin wallet, and showed me how to use the faucets. With me being disabled and sometimes not being able to get out of bed because of pain; He thought it would give me something to do while he was at school all day.

So, I played with 3 or 4 of the faucets last week and at least 2 of them said they paid out Sat/Sun as long as you have at least 5500 Satoshi in their account, which I did.

So, I  wanted to see how much was in my wallet (and if the faucets actually paid out like they say they do) after the weekend. I went to Blockchain.info (where my son said he went to make/get the wallets) and tried to login. It has a place that asks for "Identifier" and in the box it says Identifier or Alias. Now I have he long Alphanumerical "number" which I am not sure whether that is an address or Identifier or what, but I tried putting that in the box and it says "Unknown Wallet identifier. Please check you entered it correctly" I know I entered it correctly bc I copied and pasted it the last time to make sure.

I know that on the other wallet (the one I an NOT using) my son remembered to write some sort of mnemonic device that is supposed to be for recovering the wallet if you lose the long string of letters and numbers? (I think) but not for this one. I do know the email address and password used to create the wallet, but it doesn't ask for either of those.

Also, I read through a few not so similar Questions and answers where they spoke of downloading the wallet, which I know for sure we DID NOT do. Is this something you have to do?

I can type the long alphanumerical number into the main page and see there has been 2 deposits totaling 0.00033813 BTC, so I know it's there. But, I don't know what I am doing wrong.

Please, someone tell me how to access my wallet and what I am doing wrong.

THANK YOU.

Quick primer:

The identifier is a dash separated lowercase bit of text, like a32d0de4-818b-4aa3-...

It's specific to blockchain.info - other wallets use different systems. It was probably emailed to you.
The mnemonic is a 17 word bit of text, like skill course bleed oversize attempting lazer endure...
A bitcoin address looks like 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W. A bitcoin address is not specific to blockchain.info. It's how you tell the faucet where to send the money. This is not what you use to log in.
All of this is different from your email address or password.

Troubleshooting steps:

You need to get either the mnemonic or the identifier. The identifier was probably emailed to you by blockchain.info, so check there. If you get the mnemonic, you can recover the identifier on the login screen with the 'Recover Wallet' button. I think it's also possible to get the identifier by contacting blockchain.info support, but you need additional information.

Once you have the identifier and the password, you can log in.

  Also, I read through a few not so similar Questions and answers where they spoke of downloading the wallet, which I know for sure we DID NOT do. Is this something you have to do?

It's something you need to do for some wallets. Not blockchain.info, though.


What are the different prefixes of Bitcoin addresses? Until today, I thought all addresses must start with 1.

Well, behold 3M8XGFBKwkf7miBzpkU3x2DoWwAVrD1mhk, which is a multi-sig escrow address created to hold the bounty for the development of CoinJoin. This is both the first address I observed that doesn't start with 1, and the first multi-sig address that I've seen in the wild.

Are there other possible prefixes? What characterizes the different prefixes? (E.g. are all addresses that start with a 3 multisig addresses? Are there multisig addresses that do not start with a 3?)

According to the glossary
the possible prefixes for bitcoin addresses are 1,3 or 5:

I'm quoting here:

  Address

  Bitcoin address is a Base58Check representation of a Hash160 of a
  public key with a version byte 0x00 which maps to a prefix "1".
  Typically represented as text (ex. 1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG)
  or as a QR code.

  A variant of an address is P2SH address: a hash of a spending script
  with a version byte 0x05 which maps to a prefix "3" (ex.
  3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8).

  Another variant of an address is not a hash, but a raw private key
  representation (e.g.
  5KQntKuhYWSRXNqp2yhdXzjekYAR7US3MT1715Mbv5CyUKV6hVe). It is rarely
  used, only for importing/exporting private keys or printing them on
  paper wallets.


View historic USD prices when transactions were made Currently when viewing blockchain.info transactions, all transaction values are quoted in today's price. But is there an option or service where you can see how much the value was at the time of the transaction? Example, Say I send Alice 1 BTC 2 years ago. At today's price it will look like I sent $4000, but 2 years ago it was sub $1000. Is there a blockexplorer that shows the historic price value?

I was also looking for similar solution and have come up with a manual one.

Note: you need to know the Bitcoin address of the sender and receiver, or transaction hash. let us suppose we know a bitcoin wallet address

  3BtSyeNf24tEXkEYKiMmDjM98W7Yqudh3w

and it belongs to person A, following steps can be executed to know about the transaction details

Step 1: Goto www.blockchain.info and enter the respective address into website's search bar.

Step 2: resulting page will show transaction details which are as follows

      a. Transactions performed = 2
      b. Total Received = 0.02608688 BTC
      c. Final balance = 0 BTC

[explanation: Respective Address had two Transactions, 1st. it received 0.02608688 and it spent complete amount because its remaining balance is 0 BTC. Each transactions is explained below.]

Step 3: Evaluating transactions

      a. **First Transaction** hash is
         0d704a15bd8d56812dff9d067c0510afb4185190d2816513dd8eca777b7ec72c
      b. This transaction was confirmed at 2017-10-09 16:08:56
      c. Using historic Bitcoin price reference at coindesk.com/price/,it
         was found that at that moment 1 BTC was equal to 4722 USD.
      d. Hence, first transaction shows that person A received 123 USD
         worth of bitcoin. (0.02609 BTC * 4722 USD = 123 USD)

      e. **Second Transaction** hash is
         fe5bd13f81d26166937efc472f8a30090e7f30e721517ad212bc06e48f8e1e96
      f. This transaction was confirmed at 2017-10-15 16:05:17
      g. Using historic Bitcoin price reference at coindesk.com/price/,it
         was found that at that moment 1 BTC was equal to 5700 USD.
      h. Hence, Second transaction shows that person A transfered
         accumulated BTC for 148 USD .
         (0.02609 BTC * 5700 USD = 148 USD).

Step 3: Net difference

      a. Person A gained 20% in 6 days (one perspective)
      b. Net worth of holding is zero because wallet holds 0 BTC

I hope i cleared some of the confusion.


What Bitcoin Securities / Stock exchanges are around? As a historical user of GLBSE I thought the concept was brilliant. Sadly that did not end well but many more have appeared.

https://btct.co/ appears to be the most popular.

Which other stock exchanges are available and what are their advantages & disadvantages?

*UNFORTUNATELY THIS IS ALL OUTDATED NOW, SORRY*

BTC Trading Corp. - https://btct.co

Pros: good notifications in email, good analysis of your positions

Cons: always in development, weird UI when new features are added, 24 hour withdrawal limits, but you can request larger amounts but it is delayed a few hours as the admin has to move the bitcoins from cold storage

BitFunder - https://bitfunder.com

Pros: looks more advanced than BTC Trading Corp

Cons: stock prices are typically lower there on cross-listed securities, no email notifications when anything happens, lame we-exchange thing

Havelock Investments - https://havelockinvestments.com

Pros/Cons: Best UI UX, Canada.

MPEx - http://mpex.co

Pros/Cons: Run by a multiple personality lunatic.

Cons: Admission/Listing fees, I forget. Nonexistent UI


Current hash rate required for one block Now, the height of the blockchain is 485531. How much hash power is ideally required to mine block number 500000.

And how much hash rate does a node require to publish a block successfully each hour?

Firstly, new blocks are published every 10 minutes on average, not every hour.

There is no 'required' amount of hash power to mine a block. It is all a game of luck, a race against the rest of the network. To mine a valid block roughly once per hour, you would be mining a sixth of the total blocks (~6 blocks mined per hour), so in theory you would need around a sixth of the total hashpower on the bitcoin network. You can see the current network hash rate here:
https://blockchain.info/charts/hash-rate

At the time of this post, that's roughly 1.4 exahashes per second (million terahashes per second).


what will be the best approach to accept Bitcoin payment instantly? How could I receive Bitcoin instant payment?

Bitcoin takes 10 minutes for a transaction. It is advised to wait for a 6-block confirmation for a safety. This takes a maximum time of 1 hour. So, instant payment is really difficult.

If for your business, you could try services like coinpayments.  They have different strategies which reduces users risk.


How to integrate bitcoin wallet I am a programmer and I am working on a website. I want to find out how to integrate a blockchain into my website. (Please note that the wallet address changes as soon as it receives a payment). I'm particular about how to resolve this issue.

You can install your own wallet and use it ie. with RPC

Probably you will need some payment processor. There are several, just google for them and their developers guides.

Many shop solutions like ie. magento have several extensions using different technology, you can look up how they do it and build based on their implementation.

Here is one of many guides: https://code.tutsplus.com/tutorials/adding-bitcoin-payment-processing-to-your-website--net-33098

Blockhain.info: https://blockchain.info/api
Bitpay: https://bitpay.com/developers
Bitpay gateway guide: https://bitpay.com/bitcoin-payment-gateway-api
Bitpay's API Documentation: https://bitpay.com/api


What will happen if a block is lost on a peer? In the Bitcoin network, each peer maintains a full copy of the ledger (blockchain). What will happen if a peer losts one of its blocks in the blockchain (e.g. another process on the peer accidentally wiped out the disk area that stores the block)? Will this peer be able to detect that this block is missing? If yes, how will the peer detect it and how is it going to repair?

It depends on the implementation. For Bitcoin Core, the node maintains a database which has the locations of all blocks on disk. If a block is deleted, then it will notice that the location of a block either does not exist or contains garbage or invalid data. If it does notice that a block is missing (or something is corrupted), it will attempt to rebuild the database using the blocks stored on disk and then download the missing blocks from its peers.

However, blocks can actually be deleted after they have been verified and the local database has updated so that the node knows the block it has just deleted was a valid block. This is called pruning, and with pruning, old, historical blocks can be deleted as they aren't used for anything in normal node operation (except helping new nodes sync).


Name of attack where you pay a high fee to block others Is there a name for an attack where someone with a lot of capital makes loads of transactions with a high fee, just to prevent other transactions from taking place?
This seems like a moderately cheap way of preventing 99% of all transactions. Is this a real vulnerability, and if so what is its name?

It's a flood attack. Or just specifically "transaction spamming".
It's rather theoretical vulnerability, blockspace market is open to everyone  and proceeding with this attack is a waste of money. It's not vulnerability in terms of being malicious and preventing parties from sending transactions with higher fees/ rbf.


how does bitcoin know which one is utxo? Let's say John gave 5 BTC to me. So, John took his unspent outputs and put it into inputs to create a transaction.  Let's say John already had a transaction which was holding exactly that amount of BTC.
Now, How can John not spend 5 BTC anymore ?  The output John used to give me 5BTC is still on Blockchain. So, does node go to that output transaction and mark it as spent ? how does it mark it as spent?

To answer the title, utxos are entirely consumed and refered in transactions inputs.

Now, How can John not spend 5 BTC anymore ?

As long as the transaction spending it is in the most PoW block chain, no.

The output John used to give me 5BTC is still on Blockchain. So, does node go to that output transaction and mark it as spent ?

If a valid transaction consumes it in a next block, it is marked as spent and not available anymore.

how does it mark it as spent?

By updating a database commonly refered to as "the utxo set" in which are recorded not-yet-spent UTXOs. See How is a Transaction Output Marked as Spent? .
You likely want to give a look to questions regarding coin referencing and consumption by transactions, for example:

How is the UTXOs of each partially-spent TxIn determined?
Why is there "Change" in Bitcoins?


How could I make my own API to query the blockchain I'm looking to access transaction history for some specific coins directly from the blockchain. The main reason is that most of current API are not free or don't provide information for the coins I want.
I'm interested in the Bitcoin block chain but in the BSC as well. And for both I'm having issues understanding if I need to run a node myself in order to retrieve transaction or if some "public" node allow people to query them for information.
On top of that, I can't find any information related to what would be the way to request information from the node, like using REST or something.
Same goes in the case I want to run the node myself, not much information on what the exposed interface would be etc...
Doesn't anyone already tried to build his own API on a chain ?

You could use www.tatum.io to do all of that. We provide blockchain infrastructure and a simple, unified REST API that supports over 20 blockchains. You can do everything with a free plan, and upgrade to a paid plan when you need more that 5 API requests per second.


What incentive is there for a miner to not cancel his own 'real' txs It is said that a Bitcoin miner attacker with enough CPU power to outrun the entire network is better off mining honest bitcoins - which is not correct since by creating a false block chain the attacker already wins the coinbase on the way, just like he would if he behave honestly.

Actually, an honest miner has all the incentive to defraud by adding to his block transactions that cancel his own 'real' transactions.

Or am I missing something?

EDIT- and maybe an answer

Let me give an example, lets say Alice owns a very big pool (big pools had known to create up to 6 blocks in a row), also Alice buys something from Bob for 1 bitcoins every 10 minutes.

Alice could try to do double spending of each of her payments (by passing the same bitcoins to herself) and use the second transactions in the block she is mining.

Note that this is all completely legit.

If the pool solves the proof-of-work, then her 'real' txs will be canceled - Bob can wait 10 minutes to see if the transaction gets confirmed or not, but it might not be enough in the case that there was a fork.

Conclusion:

A owner of a big pool can try to create doublespends but he will win his btc back only in rare occasions when:

there was a fork
Bob didn't check the fork, and didn't wait enough time (e.g. 1 hour) to see if the transaction was confirmed
The good that Alice bought is not associated with any physical address (so that Bob cannot find Alice and claim for his money).

It is a short term gain only, as bitcoin would very quickly lose its value as people realize that holding one's wealth in bitcoin has become a bad idea. Behaving honestly gets you income until such a time your hashing power decreases.


What does the frequency of my miner mean? What does the clock frequency of my miner mean. I can change it but how does it affect performance? For BFGMiner when I start my Gridseed I can press 'C' to change it.

I believe that is just a parameter to allow you to control the clock frequency (usually measured in MHz) of your miner. You can see a sample list of configurations for CGMiner here.

There is an inherent trade-off here. A higher frequency means a higher hash-rate but more energy consumption and wear-and-tear on your hardware. For example, this site shows a sample chart of different frequencies and hash rates for a particular piece of hardware. It's up to individual miners to figure out what the right trade-off between performance and energy consumption is for them.


Why do transaction/blockchain based gambling sites use such complicated methods for proving fairness? Doesn't the block hash or the transaction id provide enough entropy
(for example, by using block_hash % 37 to generate a random number between 0 and 36)?

Block Chain Roulette determines the lucky number as a function of the hash of newest block in the chain:

  Everytime a new block is created on the Bitcoin block chain, the roulette wheel is spun and a random number between 0 and 36 is generated... random hash = hmac_sha512(secret hash, block hash) ...
  the random decimal integer is then multiplied by 37 and divided by (72057594037927935 + 1), decimal places dropped, resulting in a number between 0 and 36. 14 hex charecters are used because this represents a maximum random number of 72057594037927935, a number which is divisable equally by 37 (Or at least very very close to being equally divisable, when working with such large numbers). This ensures each number between 0 and 36 has an equal probability of being chosen. Continue reading...

SatoshiDice determines win/lose by using a pre-determined secret as well:

  The lucky number used to determine the winner of games is simple. It is simply the first bytes of hmac_sha512(secert,txid:out_idx). That would be the secret string as the key and the transaction ID of your bet transaction as the data.

Can someone generate a transaction in such a way that its hash is known ahead of time?
Edit: It seems like the second part of the question has already been answered.

Obviously many gambling websites cheat. Most of them are not transparent.

An important thing is that most gambling websites that use a government-backed currency are subject to gambling laws in the country of that government.

Bitcoin isn't. Bitcoin is currently not subject to any gambling law and so it would be easier for gambling site owners to be unfair. For this reason, it can be very important for a Bitcoin business to be transparent if they want to gain traction in the masses.

Another reason, Bitcoin offers a unique way to prove fairness of such applications from within it's own workings. Why wouldn't you use it if you plan to offer a fair service after all??


How to return Tx to mem pool from orphan block This question is centered around the implementation of how transactions on an orphan block return to the mem pool.

In my understanding, once a block becomes orphan all it's transactions (that aren't on other non-orphan blocks) need to return to the mem pool.

Do we start from genesis block until we reach the last block of the active chain checking every transaction along the way, or is it there a more efficient algorithm that's based on some constraint/property that allows the algorithm to start from a more recent block?

Proto code for starting from the genesis block:

Blockchain blockchain = ...
function Dictionary<Key, Tx> deleteOrphanTx (Dictionary<Key, Tx> orphanTx) {
    foreach (Block currBlock : blockchain.getBlocks())
        foreach (Tx tx : currBlock.getTx())
            Key txKey = tx.getKey();
            if(orphanTx.contains(txKey)
                orphanTx.remove(txKey);
    return orphanTx;
}

Proto code for returning transactions from orphan block:

foreach ( tx: orphanBlock )
  if ( tx.isValidAfterReorg ( ) )
    mempool.insert ( tx );


Is it possible to add a miner's fee after you send your bitcoins? I accidentally sent a transaction without a miner's fee and I need it to clear as soon as possible. But, as far as I can tell it's going to take days if it goes through at all. Is there any way that I can pay a fee on top of what I've already sent?

Rebroadcasting a similar transaction with a fee attached will invalidate the one that's waiting. Basically you initiate a double-spend and the new one (with a fee) will get confirmed.  Once it's confirmed, the old transaction will be invalid and forgotten.

Your client probably does not allow double-spend attempts, but it's possible via blockchain.info. Warning: Don't create a raw transaction unless you really know what you are doing!

People are working on making fee changes easier for us mere mortals; one example is/was (seems to be defunct) ConfirmNext.


Unable to build Bitcoin on Mac Catalina I keep getting this error message after running 'make' or 'make check':
Making check in src
  CXXLD    bitcoind
Undefined symbols for architecture x86_64:
  "__ZN2Db6verifyEPKcS1_PSoj", referenced from:
      __ZN16BerkeleyDatabase6VerifyER13bilingual_str in libbitcoin_wallet.a(libbitcoin_wallet_a-bdb.o)
  "__ZN5boost10filesystem4path5imbueERKSt6locale", referenced from:
      __Z16SetupEnvironmentv in libbitcoin_util.a(libbitcoin_util_a-system.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [bitcoind] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

Any ideas on how to fix it?

Berkeley-db from brew which is clang compiled is GCC incompatible. Either Recompile berkeley-db4 with GCC:
HOMEBREW_CC=gcc-10 HOMEBREW_CXX=g++-10 brew reinstall --build-from-source berkeley-db4
or compile Core with clang
Discussion: https://github.com/bitcoin/bitcoin/issues/3228


Targetting a specific wallet when sending commands using RPC commands to bitcoind I'm very new to Bitcoin development, using its RPC API.

I created a wallet using

{
    "method": "createwallet",
    "params": {
        "wallet_name": "/wallets/walletA"
    }
}

Now I want to get info about this wallet. I try to use the getwalletinfo command.

But it seems you can't specify the wallet name/path when running this command? You have to "load" the wallet first (using loadwallet)?

This is the part I do not understand. Let's say I have created 10 wallets and I try to run a getwalletinfo command in a multithreaded environment... How can I make sure I target the right wallet? Do I really have to send a loadwallet request to specify the wallet I want to work on, before getting info about it?

What will occure if I want to get information about "walletA" so I run loadwallet walletA, but before I can run getwalletinfo to get its info, a loadwallet walletB request is made?

When more than one wallet is available, the wallet is selected by sending the RPC requests to <host:port>/wallet/<wallet_name>.

You might have to play around with the exact form, I suspect it might be <host:port>/wallet/wallets/walletA in your case, or <host:port>/wallets/walletA, or <host:port>/wallet/walletA.


Known cases of miners withholding blocks when used as randomness? There are some applications that use the blockhash as a source of randomness, often with a payout similar to a lottery. I've heard of attacks where it would be more profitable for a miner to withhold blocks and lose the block reward, but increase the chances of them winning the lottery payout. I've heard this has actually happened, but never seen details.

Are there any known instances of such a withholding? Are there numbers on what the payout would need to be relative to percentage of hash-power the miner controls?

You're probably better off going to some ethereum venue, as ethereum has been rife with broken schemes like this-- riggable "fair" lotteries and such.


What are some ways that the powerful elite can thwart cryptocurrencies? What are some ways that the powerful elite can thwart cryptocurrencies?

Cryptocurrencies appear to be not susceptible to most forms of power, regulation, or control. Due to their decentralized and anonymous nature, they are often touted as an antidote to government, Wall Street, etc manipulation through currency and money.

How accurate is this? What are some ways that an actor who has an interest in say the dominance of Wall Street or just any old reason for using their power to control otherwise free actors could do so through cryptocurrency economies?

Here are a few ways Bitcoin can be affected by the decisions of a wealthy investor:

Value manipulation: A wealthy investor can sell coins or purchase coins in such a rapid pace that the market sinks or rises to an unrecoverable level.  In real exchanges, the SEC protects investors from these hostile trades.  There is no SEC protection with Bitcoin.  Update: there apparently is now SEC prosecution for Bitcoin matters
Negative press / word of mouth: Part of the success of Bitcoin rests on it being freely exchanged for goods and services.  If Bitcoin becomes overly associated with the darker parts of the internet, then some businesses will become risk adverse and not want the additional scrutiny on their private ledgers (tax, audit, etc).  However if BTC is associated with "good" things then the inverse is likely to happen.
Protocol hacks: If an elite person discovered, or a team is funded to discover protocol issues with the Bitcoin network, and a flaw is found, that will undermine investor confidence in the system. (e.g. Malleable Transactions)
Laws on M1, M2, M3 transfers: Bitcoin is unique in that it can be purchased with USD and sold back to Bitcoin and back to USD.  This feature is different than other items such as a calling card, gift card, Amazon coins don't have this two way feature.  The less isolated a currency is, then the more likely it will have regulations apply to it.  Regulations are supposed to protect the merchant and consumer, and these regulations will likely be placed on all exchanges.  It has already started with the recent FinCEN announcement.
Manipulate or create a Internet outage, a massive sustained power outage, like the 2003 Northeast blackout, covering an area with a heavy miner concentration.
An over dependence on a single exchange, with no auditing or external oversight, could manipulate the currency value with a double set of books.

Any player in the Bitcoin system who also needs to use the value of Bitcoin in a local currency will likely have most regulations placed where the BTC ↔ currency conversion is done.  Identification "checkpoints" and other analysis will eventually be done on trades to identify the good guys from the bad.   Depending on which side you're on, this could be thwarting one's intentions.


Zeusminer not being recognized with BFGminer I'm trying to run bfgminer on a Raspberry Pi but the zeusminer is not being recognized. When I run the command:

sudo bfgminer-5.1.0/bfgminer -S zeusminer:all -d? -D

I get:

 [2015-05-31 19:47:42] setrlimit: Soft fd limit not being changed from 1024 (FD_SETSIZE=1024; hard limit=4096)
 [2015-05-31 19:47:42] Started bfgminer 5.1.0
 [2015-05-31 19:47:42] lowlevel_scan: Found usb device at usb:001:007 (path=(null), vid=1c4f, pid=0002, manuf=SIGMACHIP, prod=USB Keyboard, serial=(null))
 [2015-05-31 19:47:42] lowlevel_scan: Found usb device at usb:001:006 (path=(null), vid=0403, pid=6001, manuf=FTDI, prod=FT232R USB UART, serial=AH02YA6E)
 [2015-05-31 19:47:42] lowlevel_scan: Found usb device at usb:001:005 (path=(null), vid=0bda, pid=8176, manuf=Realtek, prod=802.11n WLAN Adapter, serial=00e04c000001)
 [2015-05-31 19:47:42] lowlevel_scan: Found usb device at usb:001:004 (path=(null), vid=1a40, pid=0201, manuf=(null), prod=USB 2.0 Hub [MTT], serial=(null))
 [2015-05-31 19:47:42] lowlevel_scan: Found usb device at usb:001:003 (path=(null), vid=0424, pid=ec00, manuf=(null), prod=(null), serial=(null))
 [2015-05-31 19:47:42] lowlevel_scan: Found usb device at usb:001:001 (path=(null*), vid=1d6b, pid=0002, manuf=Linux 3.18.11-v7+ dwc_otg_hcd, prod=DWC OTG Controller, serial=bcm2708_usb)
 [2015-05-31 19:47:42] lowlevel_scan: Found usb device at usb:001:002 (path=(null), vid=0424, pid=9514, manuf=(null), prod=(null), serial=(null))
 [2015-05-31 19:47:42] lowlevel_scan: Found ft232r device at usb:001:006 (path=(null), vid=0403, pid=6001, manuf=FTDI, prod=FT232R USB UART, serial=AH02YA6E)
 [2015-05-31 19:47:42] lowlevel_scan: Found vcom device at dev_t:00bc000000000000 (path=/dev/ttyUSB0, vid=0000, pid=0000, manuf=FTDI, prod=FT232R USB UART, serial=AH02YA6E)
 [2015-05-31 19:47:42] Devices detected:
 [2015-05-31 19:47:42] Timers: Using clock_gettime(CLOCK_MONOTONIC_RAW)
 0 devices listed

Here is my command to try and get bfgminer to run:

sudo bfgminer-5.1.0/bfgminer --scrypt -o <pool> -u <user>.<worker> -p <password> -S zeusminer:/dev/ttyUSB0

I have tried running the -S flag with zeusminer:all, zeusminer:auto, and zeusminer:/dev/ttyUSB0.

Anyway any help would be greatly appreciated.
Cheers

I'm running BFGminer 5.4.0 on a pi with two Zeusminers. Here is an example of my command that I run:

--scrypt -o stratum+tcp://pool:port -u username -p password -S zeusminer:/dev/ttyUSB0 --set zeusminer:clock=328 --set zeusminer:chips=6 -S zeusminer:/dev/ttyUSB1 --set zeusminer:clock=328 --set zeusminer:chips=6


How does 1ML measure the availability ranking of nodes? If there is an 1ML Node Rank ranking explanation anywhere ?
My node is online 99.9% but "Availability" dropped down from 700 to 4000 in last 3 months. :(
I guess this is somehow associated with the number of channels ?

Looks like the problem is found.
I didn`t forwarded 9735 port on router, as LND and my router support UPnP.
But looks like UPnP works not as intended, so sometimes host was accessible on 9735 port, and most of the time not :(.

Now I forwarded 9735 port to my Raspberry Node local address , so  Availability on 1ML not dropping down.


Do I need to backup a wallet every time I generate a new address? This question concerns the Armory client.

Since Armory has deterministic wallets, do I only need to back up a wallet one time (after creation), or do I need to back it up each time I create a new address with that wallet?

In other words, can all addresses, that a deterministic wallet creates, be recreated again if I lose these addresses, but still have a backup of the "genesis" wallet (I assume that, in this context, that is meant with a deterministic wallet, correct)?

When you generate new accounts inside a wallet you will only have to make a back-up once. The backup key gives armory the possibility to create a indefinite series of addresses for your wallet.

Please note that by default, Armory only generates 100 addresses. This means that when you use more than 100 and you lose your wallet, after you restore the back-up, the client will at first only see the first 100 addresses. You will have to specifically tell Armory to look for more addresses.

This does not count for addresses you imported in a wallet! If you import private keys to a wallet, you will have to back-up them separately! The easy back-up process only works for addresses generated by Armory.


What is the difference between Root Hash and Block Hash? I was reading about how Bitcoin works from Satoshi's original paper. I had a query while going through the 7th paragraph. What is the difference between Root Hash and Block Hash? Isn't the block hash same as the hash of the root of its Merkle Tree? I have studied Merkle tree and understand how it works.

First, all transactions are hashed along a Merkle tree. The root of that tree is the Merkle root.

Then the block header is created with 6 fields: version number, the hash of the previous block, the time, the difficulty, and the Merkle root computed in the previous step.

Then that block header (which contains the Merkle root) is hashed, resulting in the block hash.


What's the status of BitInstant's debit card? http://www.engadget.com/2012/08/20/bitinstant-founder-says-bitcoin-debit-card-to-launch-within-next/

It's been almost four months. Where can I find the latest public information about this?

This is still very much a project which is being worked on.  BitInstant hopes to bring you more info as everything progresses.  Thanks for your patience.


How do developers fix bugs when compiling takes so long? It takes so long to compile Bitcoin Core on my machine... I can't imagine trying to fix bugs like a missed semicolon and having to wait an hour for the compiler to finish before testing. Is this really what devs have to deal with? Or is there a way to just compile smaller units of the code and run it quickly over and over again until all the semi colons are fixed?

Initial compiling of bitcoin-core can take a couple of minutes. If you have a multicore processor, you can use make -j<cores+1> to speed up compiling (parallel compiling).

Once bitcoin-core is compiled, a single semicolon change does (mostly) not require to recompile everything. You only compile the affected files (.cpp) again and do do the linking.

On most machines, compiling a simple change requires mostly less then 10 seconds.


How can I use Bitcoin privately with the Electrum wallet and Tor? I do not want to run a full node like Bitcoin Core but still want privacy running an SPV node like Electrum wallet to use Bitcoin.

How can I setup to run Electrum privately with Tor?

Electrum v3.1.3 and earlier includes a setting to use Tor

When Tor is correctly setup on your system, it is possible to directly configure Electrum to connect via Tor for all connections, both to Electrum servers and, to third-party services.

Using these steps you can be anonymous in only five minutes.

Setting up Electrum and Tor

These instructions work on Fedora 27 and assume a default installation of Electrum v3.1.3 and Tor v0.3.1.10 or newer. Fedora is a modern operating system that will run on most standard modern hardware. The configuration is the same on Windows, but the instructions are different. There are some instructions for setting up Tor on Windows here.

Further instructions for other *nix based systems are available here. NOTE: You do not need to configure your Tor client as a relay or exit node for Tor to operate, so you can skip the step for 'Put the configuration file /etc/tor/torrc place:' in that guide. You will still need to use all of the following steps in this guide.

Setup Electrum

Install the Electrum package:

sudo dnf install electrum

Run Electrum. If you start Electrum with the -o offline switch the first time you run it your details don't leak out.

Choose Automatically Connect and click on Next.
Name your wallet if you like or accept the default and click on Next.
Select Standard Wallet and click on Next.
Select Create a new seed and click on Next.
Select Segwit and click on Next.
Securely, privately and accurately store your seed. This is your wallet backup. If it is lost all your BTC is gone permanently. Click on Next.
Type your seed in the box and click on Next to verify you have it correctly.
Set a good password that you will never forget. This must be secure to ensure your wallet cannot be stolen. Click on Next.
Your wallet is setup.

Setup Tor

Install the tor package:

sudo dnf install tor

Start the tor daemon and make sure it starts at boot:

sudo systemctl enable tor
sudo systemctl start tor

With Electrum setup and running:

Go to Tools -> Network
Click on the Proxy tab
Place a tick for Use Tor proxy at port 9050
Note that Electrum will momentarily disconnect and reconnect via Tor
Click on Close
Exit and restart Electrum normally (to go online)
Check that your password works and that you remember it before you use your wallet.
Look for the icon to turn turquoise indicating that you are online. You can click it to check status.

Done! Enjoy being anonymous!

Appendix 1 - Monitoring Tor

You can monitor (and further tweak/break) Tor using nyx.

There are several installation methods available. On Fedora 27:

sudo dnf install nyx

To start nyx simply type nyx in the console and it will connect to Tor if it is running. Requires control port 9051 to have been uncommented in /etc/tor/torrc.

Footnotes

There are more configuration options available, and additional ways you can support the Tor network. Please see the several pages available here for information.

*by default, Tor will participate in the Tor network.


Is there a proof of work system which takes significantly more memory to generate than it does to verify? Litecoin resists GPU speedup by using an scrypt-based hashing function that takes some amount of memory to generate and verify. The problem with this is that the r parameter needs to be set high enough that it is difficult to use a GPU, but low enough that low-memory clients (i.e. smartphones) can still efficiently verify blocks.

Is there a proof of work which takes significantly more memory to generate proof of work for a block than it does to verify that a block contains sufficient proof-of-work?

I've heard of two possible approaches: time-memory tradeoff with scrypt and a graph-theory hashing algorithm that takes lots of memory to find solutions.

I think a mining process that made use of stochastic sampling of a large data set would meet the requirements you have laid out. The blockchain even provides a great data set for this. For example, let's say each nonce requires you to randomly sample the blockchain to pick out a few bytes. Since you use many nonces while mining and couldn't predict which data you would need from the block chain, you would basically need to have the whole block chain (any publicly agreed upon data set, really) available while mining. The solution can then be verified with a small sample of that data set and some proof that the data is in the set. When using the blockchain example, you would probably need a chain of block headers and a merkle branch for the transaction data selected.

Another way to do this would be to use a large random merkle tree. Let's say someone created a merkle tree of 2^31 random 32 byte values. When taking into account that the merkle branches have to be stored as well, this is (1 + 2 + 2^2 + 2^3 + ... + 2^31) * 32 bytes, or (2^32-1)*32 ~= 137.4 GB of data in all. This data is very publicly available for anyone who really wanted to download it and verify the merkle root. The merkle root would be made known as the mining merkle root, and it is a well known and agreed upon constant. Mining involves sampling this random merkle tree and hashing, and with finding a successful solution, the merkle tree branch is provided, proving that the data that was sampled is actually in the publicly agreed upon merkle tree.

  In this scheme, it takes ~137.4 GB of memory to mine, but only ~1 kB of data to verify a solution against the publicly agreed upon mining merkle root.

And the numbers could obviously be tweaked here to allow people to mine without giving up 137.4 GB of their harddrive. A balance would have to be reached.

I actually like this way better, now that I think about it, because it doesn't have the side effect that mining can take longer as the block chain grows. You could probably even snapshot the bitcoin block chain and use that as a pubicly verifiable data set. But the block chain method essentially forces nodes to be full nodes as well, which is interesting, so it's a tradeoff.

Edit: With a quick search, I turned up this paper that solves essentially the same problem with a different stochastic sampling method involving the birthday paradox. Their solution is interesting because it involves building your own large data set each time. But this may not actually be a good thing, as it discourages re-building of blocks when new transactions come in.

http://www.hashcash.org/papers/momentum.pdf

A relevant bitcointalk discussion on the Momentum algorithm:

https://bitcointalk.org/index.php?topic=313479.0

I think it's funny how the 'momentum' aspect (not being able to update merkle after it is first created) is touted as the defining characteristic of the algorithm, even though it's actually a pretty significant downside, delaying confirmation of all transactions by 1 block. It may also exacerbate the problem where miners don't want to mine large blocks because they take long to propagate. i.e. It may be more profitable to continue mining with your tiny block even after you have heard about a new block on the network because the momentum you already have makes it easier. I think the fact that bitcoin's PoW algorithm does not have any momentum is actually a great feature, allowing for transactions to get confirmed quickly.

Using an unchanging data set, like in the solution I provided above, provides the desired asymmetric memory requirements in working/verifying work, while also avoiding the problem of momentum.


Can I use blockfilterindex in pruned mode? I run a node in pruned mode. I want to enable blockfilterindex. What I expected the node to do was:

start downloading blocks from the very beginning;
create the block filter as it goes through the blocks;
only keep the last N MB of blocks stored.

What really happened was:
$ bitcoind -blockfilterindex -prune=550
Error: Prune mode is incompatible with -txindex.

I understand that it is not possible to enable block filtering without downloading all blocks, but why does it require storing all the blocks?

The block filter index is build asynchronously from block downloading and validation. It is possible that the thread handing block storage and pruning could be enough ahead of the thread building the block filter index that it starts to delete blocks before the index thread processes them. This would be bad. So for the initial block filter index implementation, it was decided to simply disallow pruning when the block filter index is enabled. You can read some of the reasoning and discussion in the PR.
In theory it is possible to allow pruning with the block filter index. However it is more work to do this and at least for the initial implementation, the extra code wasn't worth it. PR authors often do this to keep the PR small enough to be reviewed. This functionality could be added in the future as it is part of the more general problem of how we should handle pruning with the wallet and with the txindex.


How to get balance for a label I have lots of addresses organized under a label.
Is there a command to show the total remaining amount available under a label ? (Or address)
I am building a payment gateway and I need get the total remaining amount of an address thats why I cannot use listreceivedbylabel.
I am also not able to rely on some block explorers API.

Use getreceivedbylabel. It takes label and minconf as arguments. label is the label, and minconf is the minimum number of confirmations for a transaction to be considered for inclusion in this value. The default is 1 confirmation.


In Electrum, is it possible to restore a wallet from seed, from command line? Technically, it should be always possible to restore an Electrum wallet from the seeds.  I know it can be done via GUI, from the New/Restore wizard.

Let's say if we are to put this wallet a machine where GUI is not available, or too cumbersome to set up.  In such case, I wonder if it is possible to restore a wallet from the seeds.

Question:

Is it possible to restore a wallet from seeds at command line?

Yes, you can do

electrum restore <seed>

You can check what commands are available by doing

electrum -h

and specific help for a command by doing

electrum <cmd> -h


What is the point of Feathercoin The amount of bitcoin-like crypto currencies overwhelms me.

Just few minutes ago I came across FeatherCoin

The problem is that the information on the official site is scarce and the only thing I was able to understand is that the difference from litecoin is the block reward and the total amount of coins.

What is the point of this?

Most Bitcoin lookalikes are not really worth looking at. The two that are more or less accepted are Litecoin and Namecoin, of which the latter is not intended as a currency. Another more or less popular cryptocurrency that is not based on Bitcoin is Ripple.

I know that there are many more Bitcoin-based currencies. Most of them are not adopted and are thus insignificant. The value of such currencies is made by the willingness of people to exchange them for value, like objects or other money. As long as no one uses these alternative currencies, they are of no meaning at all.

And frankly, wouldn't it be better to first try to make one cryptocurrency succeed instead of spawning hundreds of others before the world knows what a cryptocurrency is?...


Unconfirmed Transaction? Money does not show in wallat I have tried researching this, and still cannot find an optimal solution/explanation.

My Wallet ID: 16B64JvCNBDHsEXeuE6Ao4g1tZDb9zyyQ8
ID of the wallet I sent the money to (also mine) 1JeFKHt65R8pQjXhChZGsUGpHizYDPLeXZ
Transaction:ID: 98057df05a8df30beb338aac8183df82dc44a1300d141aac04b388be8005818c

The payment is still unconfirmed? It has been a full day now, and this is really needed.

Can anyone point me in the right direction, or a clue on the time frame this will take to be confirmed?

Any help is appreciated, thank you.

Unfortunately ou have set a fee that is way too low.   This tends to happen if you are using an older version of whatever wallet your are using.  The newest version of a wallet do not allow you to set a fee that will get you into trouble.  I will try to enter your transaction into the ViaBTC accelerator, that usually will do the trick.   I suggest that you upgrade to the latest version, and make sure that your fee is of a reasonable amount.  Here is a site that shows you what the current wait time are for confirmation based on fee amount.   https://bitcoinfees.21.co/


Help me work out a transaction fee I am having difficulty working out how to work out a transaction fee.  I've read the theory, but don't understand how to get the values to put the theory to practice.

Can someone please help me work this out step by step?  If I want to send 0.05XBT from: mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1 to mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g.  How do I work out the transaction fee?

If your answer could use these public keys so I can try them out based on the instructions in your answer, I would really appreciate that.

Using bitcoin-qt's command line, I have the following details:

  listunspent [ { "txid" :
  "9df9c897af413505c02f158a7421b39000b40248a3bb826831ff458aee84f8ca",
  "vout" : 1, "address" : "mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1",
  "account" : "From http://faucet.xeno-genesis.com/", "scriptPubKey" :
  "76a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac", "amount" :
  1.19994817, "confirmations" : 364 } ]

Then I could use this:

  createrawtransaction
  '[{"txid":"d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262","vout":1}]'
  '{"mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g":0.05,"mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1":1.14974817
  }'

But this "assumes" a 0.0002XBT fee.

I can then sign the transaction like so:

  signrawtransaction
  '010000000162526ad26a3ebad9b305522f760c2ecd065840fa287913a988f88ef9aa60bed30100000000ffffffff02404b4c00000000001976a914bc5e62709adc296640dfed6871f0ebff5a7d11c588ac6160da06000000001976a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac00000000'
  '[{"txid" :
  "d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262","vout"
  : 1,"scriptPubKey" :
  "76a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac"}]' '["private key
  here"]'

Which gives me this:

  010000000162526ad26a3ebad9b305522f760c2ecd065840fa287913a988f88ef9aa60bed3010000006b483045022100f447788e6b40a1f8bd22b084c8507a7710bd5c8cb33b08082c308a7a0edc86d402204024287053715bc096e56744e45683bb63b32ebe56a2f2070fd318216512641d012103ca4eab4b394090c9f4c10b6a9c2674dfc14c7dee55b6d3eb72c4263fc325c37effffffff02404b4c00000000001976a914bc5e62709adc296640dfed6871f0ebff5a7d11c588ac6160da06000000001976a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac00000000

Which is 452 bytes.

Apparently I am supposted count the number of inputs and outputs too?  I understand that the fee can get more complex based on the age of the transaction and if I send a very small amount.  But just for example purposes, How would I work out the transaction fee using the 2 public keys above if I wanted to send 0.05XBT? so I can subtract the fee from the change when using the createrawtransaction command in bitcoin-qt?

I can calculate the priority of the transaction (527 confirmations currently, ~452 bytes):

119994817 * 527 / 452 = 139,905,461

Since this is over the minimum of 57,600,000 and meets the other rules for free transactions: namely, that the transaction is under 1000 bytes and has no outputs under 0.01 BTC, this transaction can be free. You do not need to include a transaction fee: make the sum of the outputs equal the input amount exactly.

If your transaction didn't meet the requirements for a free transaction, or if you don't wish it to be treated as a free transaction (which have some limits in transmitting, etc. that might slow down their inclusion in a block), you would need to include 0.0001 BTC transaction fee per thousand bytes (e.g. up to 1000 bytes is 0.0001, 1001-2000 bytes is 0.0002, etc.)

(this is assuming the testnet has the same rules for transaction fees as Bitcoin's mainnet)


Can I change the bitcoin block-data directory from /home/user/.bitcoin/blocks to something else? I have two users on my Linux system, daemonuser, which runs bitcoind and abeuser, which runs Abe.

Whenever I start Abe, I am told:

  Skipping datadir /home/daemonuser/.bitcoin/blocks: [Errno 13]
  Permission denied: '/home/daemonuser/.bitcoin/blocks/blk0001.dat'

Even after adding abeuser as a readable user on the /home/daemonuser/.bitcoin/blocks/ directory.

Would it be easier to keep bitcoin's blockdata in a public folder and read it from there for Abe's purposes?

Did you make the files in the .bitcoin/blocks/ directory readable for Abe? You can test this by logging in as Abe (sudo su abeuser should suffice) and typing strings ~daemonuser/.bitcoin/blocks/any.file.


Did blockchain.com stold my Bitcoins? Some 5 years ago I stored some Bitcoins on Blockchain.info, I remembered a few days that I still had a tiny amount left which would be worth something today, around 0.20 BTC in total which makes around $9,500+ with the currents Bitcoin value.
I decided to check my wallet which I did not log in for years. For my surprise the wallet address did not exist, and I was redirected to blockchain.com instead of .info
The login had an input to use the wallet ID, which I did. It then emailed me for authentication which I confirmed, it then asked for my second factor authentication which I entered but for my surprise it then asked me for a second password (besides my normal one). I had a second password stored, but that was only used while spending bitcoins, it was a spending password. I entered that, and it said incorrect, then again, and again and again. I tried multiple times with errors, this was already strange since they never asked this before on login, finally for some reason the page was blank and in a surprise, I was finally logged into my account.
But bigger was my surprise when by BTC balance was 0. Instead, I had around $147 something in the account and my balance is now showing as Bitcoin Cash. Bitcoin Cash did not even exist back in 2017, I never received any email from them about any conversion ever, or I would have moved by balance out. In fact, I don't remember receiving any email from them in years about anything.
I contacted their support, 2 days later no reply. No explanation.
Did they just steal my bitcoins, or I'm missing something here? I found another person here on Stack Exchange that asked the same thing. Is blockchain.com a legit company or are they fraudsters stealing people's Bitcoins?

you should check in history/activity when your btc was sold.
Btc forked to bch and bchscv so your btc became all 3.
if you had 0.2btc then you also have 0.2 bch (at current price that is about the amount you mention)
If you dont recall selling the BTC it is also possible to see what IP address was accessing your account.


Why are there more than two transaction outputs in a coinbase transaction? In a coinbase transaction there are always more than two transaction outputs.
The first transaction output contains the reward. The second contains the witness reserved value.
But why are there other transaction outputs OP_RETURN with 0 Satoshis? Are they necessary?

A coinbase transaction can have as many outputs as the miner who created it wants. You may see that there are not just one output for the reward, sometimes there are multiple outputs so that the coinbase transaction pays to multiple miners. Additionally, there may be other 0 value OP_RETURN outputs if the miner so chooses. Typically this is because the miner wants to include some additional data for another protocol that they are using.
Additional outputs are not required by Bitcoin's consensus protocol. In fact, Bitcoin does not require any particular outputs. A miner could forfeit all of the generated coins by creating an output with less than the correct amount. A miner can include other OP_RETURN outputs just because they feel like it. Even the BIP 141 OP_RETURN is only required if the block contains any segwit transactions, so if it does not, it doesn't need to be included.
The most common reason for other outputs that go to addresses and have positive value is for mining pools which directly pay their miners from the coinbase reward. Most mining pools do not do this, but some do. There are also peer-to-peer mining pools such as p2pool which directly pay the participating miners from the coinbase transaction.
For additional OP_RETURN outputs, the miner is typically participating in another consensus protocol that require commitments in the block. These are not required for Bitcoin, but rather for something else. There are two common protocols that miners participate in: p2pool, and merged mining. P2pool uses an additional OP_RETURN output to commit to some p2pool data that is stored elsewhere. Merged mining uses the Bitcoin blockchain to help protect an altcoin's blockchain by including a commitment from the altcoin in a Bitcoin block. This is typically done by including a hash in an OP_RETURN output.


BIP-0016 p2sh keys and altcoins It appears that bitcoin addresses using p2sh keys have a different prefix to that of normal bitcoin addresses. Do other altcoins such as litecoin, peercoin, dogecoin etc include this functionality?

Upon looking at the source of a number of altcoins I have found that p2sh keys are built into all the ones I checked.

For P2SH, the first address byte will be:

  bitcoin: '05'
  litecoin: '05'
  peercoin: '75'
  dogecoin: '16'
  beavercoin: '05'
  freicoin: '05'
  protoshares: '05'
  megacoin: '05'
  primecoin: '53'
  auroracoin: '05'

The tricky bit about this is that you can't nessesarily tell what network a P2SH address belongs to like you can with normal addresses.

The reason I wanted to know is so I could collate the version numbers for my project:

http://github.com/ryanralph/altcoin-address