What do the red and green blocks mean in a price chart? What do the red and green blocks mean in this price chart?

Source: Tradingview

red block - price was going down
green block - price was going up


Unconfirmed transaction simple advice I am new to bitcoin and made a beginner mistake. I sent bitcoin from Mycelium wallet to coinbase wallet. Mycelium offered some rely small fees without warning, they only warned that if you pick 0 it might not happen. I picked a small fee as I considered that I am not in hurry. Now the Mycellium says transaction its confirmed and coinbase says its pending. If I understand Blockcypher correctly it says my BTC is received but no send. Is there anything I can do but hope that someone mines the rest of the block? If yes can you please tell me what in a simple way? amount is like 0.08... BTC so its relatively high for a student...

I wouldn't worry to much yet. These days Bitcoin transactions take their time to be confirmed on both sides. A transaction that would have previously been confirmed successfully in one hour, can these days take a day or more.
With the small fee you offered for the transaction you didn't exactly help in speeding up the process.


What causes the wallet functions to be disabled? I have run bitcoind as a server on one host. On a second host, I have configured bitcoin-cli to interact with bitcoind.  However, all wallet commands are now disabled with this new configuration.  When I run simple commands such as:

bitcoin-cli listaccounts

or

bitcoin-cli getaccountaddress "new_account"

I get:

error: {"code":-32601,"message":"Method not found (disabled)"}

When I call any other bitcoin-cli method that does not involve wallets, I get a normal response.

What is happening?  What causes the wallet functionality to be disabled?

The configuration file reads as follows:

server=1
rpcuser=jared
rpcpassword=1234
rpcport=8332
rpcallowip=192.168.0.0/16
gen=0
prune=600

In Bitcoin Core 0.11 pruning is experimental, and incompatible with the wallet.

So turning on the prune= option automatically disables the wallet function.

In 0.12 the wallet will work with pruning (though you obviously won't be able to rescan past the pruning cutoff).


What are layer 2 protocols? People often talk about building a protocol “on top of” the bitcoin blockchain. Those same people often call this building a layer 2 protocol.

To be clear, “on top of” is clearly metaphorical language here (this is a visuospatial metaphor for what is a technical abstraction). Can someone explain what is actually happening when someone says that? Feel free to use the example of a well known application.

This layer 2 wording is an analogy/comparison to the network TCP/IP stack. Basically the TCP/IP stack allowed for networking machines as the foundational layer (or the layer 1 infrastructure). And on top of this infrastructure came the protocols, which are commonly used today (http, mail, ...). When comparing to the bitcoin world, the idea is that bitcoin as per today is the "payment infrastructure", and on top of it there will be protocols for lightning (micro transactions), schnorr sigs, smart contracts, ... So the underlying bitcoin network has proven to be reliable, and serves as a utility for future setups on top.

There is also a certain euphoria when people talk like this, hoping the future will reduce/avoid today's limitations with these "layer 2" protocols. Exciting times ahead!


How to BIP38 existing private keys offline How do I go about encrypting some existing private keys using BIP38 in an offline manner?  I have looked at bitaddress.org and that site only lets you BIP38 keys which the bitaddress.org site itself created.

I basically want to generate my own bitcoin private keys using bitcoin-core, and then BIP38 encrypt them in an offline manner so I can have a copy of my private keys in paper form just as an extra backup to my existing digital encrypted backups.

The Bitcoin-Explorer (bx) v3.0 implementation described below has had FULL BIP 38 functionality for over a year, and has extended BIP 38 to numerous altcoins.

See 5) Extended AES256Encrypt and AES256Decrypt BIP 38 CLI Example Set, and use -v 0 for Bitcoin instead of -v 76 for Dash. See the 4th column of BIP44 Altcoin Version Mapping Table for version mappings for various coins.

Use wif-to-ec to convert your WIF-encoded keys to hexadecimal.  Use ec-to-wif to go the opposite direction as needed.

The full round robin example below is for Bitcoin, not Dash, but contrast:

% bx wif-to-ec L5b1xYjJCxfPsr9b4896DwMqoGb3TyNrwUvfGacm2RQoUoKGqjny
f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269

% bx ec-to-ek -v 0 "Hello it is me" f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269
6PYK35faHFxireTJyhtjm9weuBFMuc2uF7fBKmHzDvakT6TRek9RwfyX9a

% bx ek-to-ec "Hello it is me" 6PYK35faHFxireTJyhtjm9weuBFMuc2uF7fBKmHzDvakT6TRek9RwfyX9a
f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269

% bx ec-to-wif -v 128 f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269
L5b1xYjJCxfPsr9b4896DwMqoGb3TyNrwUvfGacm2RQoUoKGqjny

The ec-to-wif command needs to use integer values for the 3rd column of BIP44 Altcoin Version Mapping Table corresponding to the crypto-coin being used. If version integers are dropped, bx assumes the operations are for Bitcoin.

Be forewarned that BIP 38 isn't standardized for altcoins with Bitcoin heritage yet. Many wallet tools claiming to provide BIP 38 functionality use the prefix 6P for altcoins. The prefix 6P should be different for altcoins to minimize confusion.  This sample mapping shows -v 0 maps to a 6P prefix for Bitcoin, while -v 76 maps to a 7f prefix for Dash, (76 base 10 == 4c base 16).


What can be done in order to improve privacy in bitcoin transactions? Privacy should be default and  not an optional property - even when using stealth addresses or confidential transactions, your bitcoin balance and transactions in the wallet are transparent to anyone. All of these are awful characteristics for a currency.

We all live in post  Snowden era of full spectrum surveillance, and ridiculous anti-cash propaganda. Cash is government’s  legal tender and is protected by law.  But the implacable war against cash payments waged by big government and banks worldwide is gaining new momentum. The excuse or reason given by our rulers for suppressing cash is to keep society safe from terrorists, tax evaders, money launderers, and other villains, real or fictional. But their main and real intention is to limit or even prohibit cash, in order   to force the public at large to make payments through their financial system in order to enforce their unstable fractional-reserve banks and, more importantly, to expand the ability of governments to monitor on and keep track of their citizens’ private financial transactions.

Fungibility is an essential property of money that makes every unit of this currency interchangeable. One can pay the service or a product with a coin or a paper note, and the receiver does not  care where it came from, as long as this banknote or coin isn’t counterfeited, he will accept it and exchange products or services for that banknote. This is how physical cash works. Creating Bitcoin fungibility is not a trivial task, as far as I understand. There is high probability that anyone who interacts with you knows exact amount of bitcoins  in your wallet.  Tor can not keep private your wallet linkage to other wallets.
Real question is -- How  we can enforce fungibility on a transparent blockchain where every transaction is visible?

Pieter Wuille posted an answer earlier today that covers some of what is already being explored in the pipeline for additional privacy.

  ... but improvements are continuously being worked on (search for things like MAST, TumbleBit, Layer-2 payments, Taproot, signature aggregation, scriptless scripts, confidential transactions, ...)

In addition, further ideas like change obfuscation have recently been seen on the [bitcoin-dev] mailing list.

There will no doubt be even further suggestions in time.


What happens to my bitcoins if lose my wallet file e.g. I suffer data loss and my computer is unrecoverable? You run bitcoin as a service on your local computer.  What happens if this computer is compromised?  A corrupt/failed hard drive or theft leads to the machine being lost and unrecoverable, and my bitcoin details (addresses etc) are gone.  Do my bitcoins disappear into the ether?

i.e. What happens to my bitcoins if my wallet file is compromised/lost?

If a wallet file is truly lost with zero ability to recover it, then the coins it contained are lost forever.  Think of it as cash left in a burning house.

Be sure to periodically backup your wallet.dat file.  It is best to also encrypt those backups lest they be compromised giving someone else access to your wallet.


Transfer coins to a paper wallet created before the fork So I have a paper wallet with BTC (and I assume BCH) that I created before the hard fork. I have recently purchased some BTC and would like to transfer them to my paper wallet. Would this cause any problem or should I create a new BTC paper wallet?

Considering that you are transferring the new purchased BTC to the same paper wallet as you stored the earlier BTC, there won't be a problem at all.

Example:

You had 10 BTC before the fork in paper wallet with address 'abcd'

After fork you have 10 BTC in 'abcd' wallet in BTC Chain

And 10 BCC in 'abcd' wallet in BCC Chain

Now you buy 5 BTC after the fork and transfer it to 'abcd' wallet

So, now your final balance will be:

BTC: 15

BCC: 10

You can use these two balances separately depending on the chain you select.


Running BitCoin Wallet On USB I'm trying to run a BitCoin wallet on a USB Drive. I've got that working, but I'm trying to make the block chain get downloaded and stored inside of the USB drive as well. This is the only thing I've been able to come up with and I've had no success.

H:\Bitcoin\bitcoin-qt.exe" -datadir=H:\Bitcoin\appdata

I get the error "Filename is incorrect". I know there is a portable BitCoin program, but I'm also wanting this to work for other coins such as LiteCoin, and I know there aren't portable versions for those.

Perhaps it's just an issue with the code block, but I only see one double quote. I assume that the other is before the entire code block, and is used to pass the program name.

The only other possible issues I can think of are to

make sure the directory specified in the datadir argument exists and is writable
make sure that the USB drive is mounted on H:\ on any other computers you use. Maybe it would be smarter to use a relative path instead.

Regarding portable Litecoin etc.
Any program is portable, as long as all of its dependencies can be met in a portable environment. Therefore, if you copy the entire C:\Program Files\Litecoin folder, you should, in theory, have a portable program, provided you copy your data directory also, or don't mind re-downloading the blockchain and don't mind losing all your Litecoins.


Is buying BTC on localbitcoins.com safe? Hi I'm looking into getting some bitcoins, and was wondering if buying locally from someone on localbitcoins.com would be safe.

Has anyone had any experience with that?

It's a reputable website, but it's really up to the person you are buying from.

Do your research, choose a person with good reputation, make sure you understand how the escrow system works, and under no circumstances release escrow early.


What makes HD wallets resistant to brute force attacks? To be more specific, let's consider wallets that use 12 words as a seed.

Total bit width is 132, with 4 bits used as a checksum, so the actual seed size is 128 bits. I know 2^128 allows for LOTS of combinations.

I don't have a formal background in security, but here's what makes me think, as an amateur, that my bitcoins are not secure.

the attacker is not bruteforcing a specific password/seed - there is no username associated with the seed - all the attacker needs is a seed that is being used by someone who hasn't spent all of his bitcoins
with the bitcoin network and HD wallets becoming more popular, there would be more seeds that lead to non-empty addresses. Consider that if the BTC/fiat exchange rate goes through the roof with widespread adoption, even if bruting takes a lot of compute power, the rewards for successful bruting go up

Where did I go wrong with my thinking?

You don't have access to all of a HD wallet's private keys and their corresponding addresses immediately and can't check them for funds immediately.

When generating the 128 bit seeds and then generating the first few addresses of those HD wallets, you will encounter duplicates. Even if we ignore this and assume every private key and every corresponding address to be unique (which makes the math easier so more people can understand it), it's an unfeasible endeavor.

There currently are about 4.67*10^7 UTXOs. The best-case scenario for stealing at least some money is that every UTXO is held by a different private key in a different address. Instead of thinking about how our chances of success are worse than that, let's just assume it to be true.

HD wallets only use their seeds after 10^5 rounds of sha256. We neglect the additional effort of creating a private private key, creating a public key from that, creating an address from that, praying to the Flying Spaghetti Monster that the user actually used the very first address in their HD wallet and the funds in that first address are still unspent, and doing the actual lookup. Because those are harder to determine the cost for and as it will soon turn out, it's infeasible even if we literally have zero cost for that.

Given the numbers above and our very generous assumptions, we have to calculate 2^128÷(4.67*10^7)*10^5 = 7.28656032*10^35 sha256 hashes to get access to 1 UTXO.

The current hash rate of the entire Bitcoin network is about 3*10^18 hashes per second. Of course, in reality we can't just use miners because those 10^5 hashes we need to calculate per seed aren't independent of each other. In fact, they all (but the very first) depend on the one before them. That's the worst possible scenario for calculating a lot of hashes.

But even if we assume that we have access to all of the world's Bitcoin miners, magical new means of running purely sequential calculations in parallel (which is impossible, of course), and get all of the electricity those miners for free because our uncle just happens to barely use his nuclear power plant, recently, anyways, we still need to wait 7.28656032*10^35 / (3*10^18) = 2.42885344*10^17 seconds per UTXO to be able to steal it.

Luckily for us, that's only 7'701'843'734 years which is hardly more than half the age of the universe. I think we got that 1 UTXO. Then, again, our assumptions were pretty generous. It might take us a little longer to get hold of that 1 UTXO. Most of the big UTXOs probably aren't even stored in HD wallets but in cold storage instead, so we have even less hope to get hold of them, but whatever.


BIP91 Activation Period I understand that BIP91 needs 269/336 signaled blocks.
My question is is it a rolling window of any 336 blocks or are there activation periods of 336 blocks that start and end at predetermined block numbers?

It looks like it is actually periods of 336 blocks instead of a rolling window. It is like what BIP 9 specifies, but uses 336 blocks as the window and 269 blocks as the threshold. The windows begin when a block's height is a multiple of 336.


What's with this address 1111111111111111111114oLvT2? It was the burn address with the most BTC received in 2017 according to
http://bitcoinwhoswho.com/blog/2017/12/30/8-97-bitcoins-burned-in-2017/. It's Hash160 is 0000000000000000000000000000000000000000. In Sept 2015 it served as a 40 BTC proof-of-burn address for Blockstore.

So, why did it receive 14,270 inputs of BTC dust in 2017 totaling 8.70069482? Why does "unable to decode output address" accompany this address on every transaction on Blockchain.info? https://blockchain.info/address/1111111111111111111114oLvT2

In this transaction it appears similar to a change address:
https://blockchain.info/address/16HBq938GwQkpWKWFkAomt4KpQeWUqXsZR

what is 111...1114oLvT2?

See also here, it explains in detail on the logic behind „proof of burn“, including op_return.

  why 14,270 BTC?

We cannot know. Pure speculation would be, that people write scripts, to do a proof of burn. Or also, they could provide a P2SH tx, where the hash of a text is provided. Think of it as „I can proof, that I had a data, that I published as a ahah into the bitcoin blockchain“ (proof of existence). Also one could think of a recurring payout from a faucet or mining contract. We don‘t know.

  why unable to decode?

answered by Nate


I forgot which software I created my wallet with. How can I recover from a 12 word seed phrase? I purchased bitcoin through a bitcoin ATM, and I opened a new wallet on the spot.

On getting home my phone was mysteriously wiped, how can I find the wallet I created? I happened to write down the 12-word phrase.

I happened to write down the 12-word phrase.

You are in a very good situation. Much better than many new bitcoin owners who ask questions here. It is very likely that your bitcoin is safe and needs no urgent action.

  how can I find the wallet I created?

You don't need to, wallets are not important so long as you have the 12-word seed-phrase. Wallets don't contain your bitcoin, they are just a way of using the private-key (derived from the seed-phrase) which gives you control over your bitcoin.

Wallets are completely disposable. Just keep backups of your seed-phrase (or the private key itself) and guard them very closely.

The key things to do are

Don't panic, there is no urgency here.
Don't rush into things, you have time to work out the options that suit you best.
Don't let anyone else see your 12-word seed-phrase
Spend some time to understand

the different types of wallet available
the basics of

how wallets work,
what a private-key is,
what an address is,
the difference between a private-key and a seed-phrase.

choose a wallet that suits your needs, chytrik's answer contains a list.
I note that CoPay runs on Android and supports 12-word seed-phrases
but there are many choices available, take your time to choose one.

  How can I recover from a 12 word seed phrase?

Chytrik's answer give you some good advice. The exact steps depend on which wallet you decide is best for you.

If you want to hang on to your Bitcoin for five years, you need do nothing other than lock away in a very safe place your 12-word seed-phrase.

I understand you'll feel compelled to check the amount of bitcoin you control though, that involves at least using a wallet to derive the private key from the pass-phrase and to derive the receiving address from the private key. The wallet will do all this automatically when you import the seed-phrase into it. Once you have an address you can check the unspent bitcoin value associated with that address by using any of several blockchain explorer websites.

Useful references here

How can I safely store and trade Bitcoin and other crypto currencies?
Where can I find more resources that explain Bitcoin simply?
What are the advantages of running a full node in comparison with a lightweight client?


Can someone explain those free 0.00000001 BTCs? I've just noticed an odd transaction to my wallet address. 1LnNQDKV6DiMnZ2rZ9yXpcnnTh7my1WusP seems to be giving me a free 0.00000001 BTC.

Investigating further shows that I'm not the only one receiving the free 0.00000001 BTC. Take a look at the blockchain transaction.

What is happening? Is this guy using blockchain's public note as an advertisement spam?

You are right. This is a kind of advertisement which targets bitcoin users to spend bitcoin in a particular service. Something like an booklet which people in store are giving you when you have used their service.

But keep in mind that blockchain public note is not a function of bitcoin itself (by this I mean that you can not add it though bitcoin client). This is a service offered by blockchain.info and they just add this by attaching a field to their database. You can read more about it by reading their FAQ in the section public note.


What additional benefits can QR codes bring to Bitcoin applications beyond payment requests? Anyone who has recently used one of the Bitcoin wallets on a mobile device (and some desktop  clients) will have seen a Bitcoin QR code. Clearly, QR codes allow for a succinct method for transferring complex information in a reliable and error-resistant manner.

Naturally, the most obvious use of a QR code is for encoding a payment request URI. However, are there any other benefits that QR codes can bring to Bitcoin beyond this?

I'm thinking in terms of marketing, exotic transaction types that sort of thing.

In terms of marketing, here is a very nice QR code that could be used for spreading the word about Bitcoin. It contains a link to bitcoin.org. See this thread on bitcointalk.org for more information. It was created by phelix at bitcoinx.com.


Why are Electrum 2.x mnemonic sentences thirteen words long? The 2.x version of Electrum uses mnemonic sentences that are 13 words long. However, 1.x versions use a sentence only 12 words long.

I realize that 2.x changed the derivation of key pairs significantly, but I'm not clear why a sentence of 12 words wouldn't work just as well as one of 13 words.

Why is an extra word now used?

The seed phrases in 2.0 are longer because 8 extra bits are required in order to store the seed version number. (default entropy is 128 bits)

Note that the number of words in the seed phrase depends on the size of the wordlist used in the generation. Currently, the English wordlist used in Electrum has 2048 words, which results in 13 words per seed phrase. This wordlist can be extended in the future, for example 2581 words would give you 12 words per seed.


How would one mix NXT coins? How would a user mix their NXT coins so they cannot be linked to previous accounts that sent it to the user? One way I thought up of was to deposit your NXT coins into an exchange and take it back out into another account. This is assuming that exchange has alot of transactions to blur the transactions.

The coin shuffling feature is on the product roadmap but I don't know when it will make to the mainnet:
https://bitbucket.org/JeanLucPicard/nxt/issue/135/coin-shuffling-monetary-system


i have good pc can i mine on it, if i don't have to pay for electricity? i have gtx 970 g1 gpu and intel i7 4790k cpu. i dont have to pay for my electricity costs. i used to play games but now i don't play them any-more. i was hopping someone will tell me if i can make a profit and how much i can make in a week by bitcion mining.
i dont have a clue how to mine if i will profit from mining can someone list in steps the things i need to start mining.

Main reason i got idea for mining is because i don't have to pay for electric costs. any advice will be helpfull

No, you can't. The days of GPU mining Bitcoins are long past.


GUIMiner stuck at 99% Done for over 1 hour I have just started up my client GUIMiner for the first time.  It was downloading the block chain without any issue and got up to 99% where it has been stuck for the past 1 to 1.5 hours.

Is this normal behavior?

Network issues were preventing this from completing.


Is it possible to make a transaction with no transaction fee? Is it possible to make a transaction with no transaction fee? Is it possible to pay more fee to prioritize your transaction?

Is it possible to make a transaction with no transaction fee?

As Raghav Sood noted in a comment, transactions with no transaction fee are not transmitted by standard Bitcoin nodes - so your zero-fee transaction normally won't reach a miner. In theory you could make some special arrangement with a miner but it's hard to see why they would want to do that.

  Is it possible to pay more fee to prioritize your transaction?

Choosing a higher initial fee tends to result in quicker confirmation. If your wallet supports Replace By Fee (RBF) you can use that subsequently to improve the likelihood of a quicker confirmation.


How is the reward that you got after calculating the right hash added in the blockchain? I have a question. If for each transaction, the hash is calculated and so the pool who calculates it gets the bitcoins as reward, now getting reward means bitcoins gets added to your wallet, but this also becomes 1 transaction so doesn't it require that transaction to be included as well? And if yes, then doesn't the process become recursive?

When you are mining, you always compute hashes of blocks assuming that you will be the one to find the block. So you already include this special transaction, known as a coinbase transaction (not to be confused with a transaction made using the service Coinbase - here coinbase just means coin generation), in the block you're hashing. If you're right, then great, you've found a block and included a transaction that sends 25 BTC + transaction fees to yourself. If you're wrong, and someone else finds the block first, there's no harm in that. Just give up on the current block and start working on the next one.

For a more technical side, when you compute a hash you're really hashing the block header. It includes a bunch of things, one of which is the hashMerkleRoot, a hash of the transactions in the block.


Does every full node verify every transaction TWO separate times? I am building my Bitcoin expertise, and want to verify my understanding on a specific point: at what point(s) do all full nodes verifies a new transaction?

Here is my understanding in a nutshell, please confirm or correct:

[1] Upon receiving each new transaction, every full node fully verifies it before adding the transaction to the its own mempool

[2] Upon receiving each new block, every full node fully verifies each transaction in the block before accepting the block

If the above understanding is correct, then every full node verifies each new transaction TWO TIMES: once when the shiny-new transaction is unconfirmed, and again a few minutes later when the transaction is included in a block.

I recognize the above is somewhat of an abstraction ... is it an ACCURATE abstraction?

Thanks in advance.

It is an accurate abstraction.

However, the most computationally expensive part of transaction verification is ECDSA signature verification. And the results of verification are cached and reused when they're done a second time. We don't cache the rest of transaction verification as it is subject to many parameters (new softfork rules can have been activated, height, locktime, ...), and it's relatively cheap anyway. We do however cache transaction verification failures.


What does the segwit upgrade path look like? I've been wondering what the upgrade path for the ecosystem would look like to increase the number of segregated witness transactions. What should wallets do and what should exchanges do and in what order? When do you change to displaying bech32 addresses as a merchant? When do you start being able to send bitcoin to bech32 addresses? It seems like a chicken and egg problem but presume that's because I don't adequately understand the upgrade path.

Wallets and merchants should first upgrade to support receiving and spending from segwit outputs. The software should be capable of recognizing segwit outputs that belong to its wallet and be able to spend from them.

Then wallets and merchants should then upgrade to giving out P2SH nested segwit addresses as those do not require users to have upgraded to new wallet versions. Wallets and merchants should also provide an option to give out bech32 addresses if the user wants to use those but also warns them that not all wallets will be able to send to those addresses.

Over time, as more wallets support bech32, wallets and merchants should transition to give out bech32 addresses by default. The timeframe of when to do this is unknown as it is hard to know when all wallets support bech32.


Is Bitcoin Classic binary-compatible with Bitcoin Core? I have three full-nodes running Core 0.12.0 that I'm considering moving over to Classic.

Am I right in thinking that Classic is binary-compatible with an existing blockchain download?

Would I be able to just uninstall bitcoind from the Core PPA and install it again using the Classic PPA?

Since Bitcoin Classic is a fork of Bitcoin Core, this should indeed be possible. The problem though is that, should Bitcoin Classic switch to larger blocks and Bitcoin Core stick with small blocks then it will not be possible to switch back without Bitcoin Core downloading the whole chain again. But in that case we are quite in trouble anyway :-)


What is the algorithm to create a Bitcoin mining calculator? I want to know how I can calculate the profit of bitcoin mining in bitcoins. I am interested in the formula that is used by calculators. For example lets say I have 700mh/s hashrate, current difficulty is 908350862,437. The calculator says I will mine 0.00038755 BTC per day. What algorithm is used to calculate these figures?

I want to give an extended answer as I found the pre-existing here or elsewhere in need of a bit more clarification, specifically for newcomers.

Formula

In order to calculate the approximated total bitcoin earnings value per month from a mining operation (not taking into consideration mining costs [electricity, hardware maintenance etc...]) the following formula can be used:

H = Hashrate (hashes / second)
D = Difficulty (Reference for values below)
B = Reward per Block (Reference for value below)
N = Number of days per month (default = 30)
S = Number of seconds per day (S = 60 * 60 * 24 = 86400)

Example

H = 21,990,232,555,520 h/s (~= 20TH/s)
D = 47,427,554,950.648
B = 25
N = 30
S = 86400

The total number of bitcoins earned per month as per the defined variables above will be ~6.995. Dismiss N from the numerator and you'll get the daily value.

Python

A quick python statement as an example implementation (you can type this directly in the terminal)

$ python -c "print (30*21990232555520*25*86400)/(47427554950.648*2**32)"
$ 6.99542703277

Some References:

Difficulty (Current Value | Wiki)

Reward per Block (Current and Future values)


Are public keys and their corresponding hash values both added to a BitcoinJ Bloom filter? The paper, On the Privacy Provisions of Bloom Filters in Lightweight
Bitcoin Clients has this to say about Bloom filters in SPV:

  ...Indeed, in current implementations of SPV clients [BitcoinJ], both
  the addresses and their public keys are inserted in the outsourced
  Bloom filter. As such, if the adversary knows both the address and
  its public key, then she can trivially test whether an address is a
  true positive of the filter by checking whether both the address and
  its public key are inserted within the filter. If not, then it is highly
  likely that the address is a false positive of the filter. We believe that
  the inclusion of both the address and its public key in the Bloom filter
  is a severe flaw in the current SPV client implementations—and
  can be easily countered; we thus do not exploit this flaw in our analysis.
  In fact, more than 99% of all Bitcoin transactions consist of
  payments to Bitcoin addresses (or the public key hash); moreover,
  only 4587 out of 33 million total addresses in the system received
  transactions destined for both their public keys and their public key
  hashes. This means that for the vast majority of Bitcoin clients,
  there is no need to include both the public keys and their hashes
  (i.e., the Bitcoin addresses) in the Bloom filters; inserting one or
  the other would suffice (in more than 99% of the cases). [my emphasis]

The idea behind this attack was re-iterated in Privacy in BitcoinJ:

  The vulnerability is that if a pubkey is truly in the filter then querying both pubkey and pubkeyhash must return true. Because the pubkeyhash is just another almost uniformly random string, the probability of a false positive for the attacker is fp' = fp^2 = 0.0000000021555. I obtained around 56 million pubkeys from the blockchain (mid-January), which theoretically results in 56 million * fp' = 1.29 expected false positives when scanning the blockchain.

In other words, a simple attack is enough to pick out all of the public keys from a BitcoinJ Bloom filter.

Does the current release of BitcoinJ add both a public key and its hash value to its Bloom filters? If not, which release stopped it from occuring?

Also, why were both public keys and hashes added in the first place?

Does the current release of BitcoinJ add both a public key and its hash value to its Bloom filters? If not, which release stopped it from occuring?

Yes. The following code implements it:

/** Inserts the given key and equivalent hashed form (for the address). */
public synchronized void insert(ECKey key) {
    insert(key.getPubKey());
    insert(key.getPubKeyHash());
}

(Source.)

  Also, why were both public keys and hashes added in the first place?

I'm not the guy who wrote this (Mike Hearn). That said, I would guess that it's difficult to tell whether deposits to an address will be in P2PKH or P2PK form. Pay to Public Key is really uncommon, but it is legal. Given the choice between having some of his customer's money go missing for mysterious reasons, or reducing their privacy, he chose the latter.

Now, if you're asking why filterload doesn't just take the HASH160 of a key before comparing it to the bloom filter so that a thin client can look for both the hash and the key at the same time, I don't know. That seems like it would fix the problem mentioned in that paper for a pretty reasonable amount of CPU time. I would blame the author of BIP37, but that was written by the same guy.


Is Electrum's SPV (thin-client) implementation not P2P (as opposed to Multibit's)? As far as I know, when I use Electrum I'm just choosing servers to trust that hold the blockchain.

But in this recently published article I read this about Multibit:

  It uses a slightly weaker trust model than Bitcoin-Qt. In SPV mode, with clients like Multibit and Hive, it still scans the blockchain, and what it assumes is whatever blockchain has the majority of miners on it [is correct]. Instead of verifying the entire contents, it just trusts that the majority of miners are honest. It's still peer to peer.

Does this mean that Multibit's SPV implementation is more "P2P" than Electrum? Does it connect to peers (other thin-client users) instead of servers?

MultiBit connects to (typically) four bitcoinds at random at start up. It then picks the best peer (using ping times, advertised blockchain height and the version of the peer to decide) and uses that as the download peer to get the block headers from.

It is thus using one peer to catch up the blockchain from where it previously knew about.

It listens to all four connections to hear about all the new broadcast transactions and uses this to work out a 'transaction confidence'. If four peers tell it a transaction exists, it has more confidence that the transaction is real.

When it sends a transaction, it sends it via the single download peer and then listens on the other peers to hear that transaction 'echo' back from the network. Once it has heard the transaction it just sent come back via other peer(s) it can be confident that the transaction is 'out in the Bitcoin network'.


Traditional VC investment vs. bitcoin IPO There are few Bitcoin "stock exchanges" trading mainly BTC mining company pass-through shares, like

https://btct.co/
https://bitfunder.com/

We are planning to get investment for our Bitcoin-related business. Instead of traditional Silicon Valley-style venture capital investment, we are investigating the opportunity of doing "Bitcoin IPO" and liquidate some of the company shares through pass-through exchanges.

We are looking for 0,7M - 1,5M USD investment. This money would be spent to expand and internationalize our business and enable Bitcoin interaction for more people in across the world. We really need to convert the investment to fiat currency in some point, as for marketing efforts (Google ads, etc.) are paid in fiat currency.

Now I am looking for advice on what would be pros and cons of both options: VC investment vs. Bitcoin crowdfunding. We are pretty sure that doing a Bitcoin IPO first would close the door for VC investment, as our stock and IPR would get tainted with nameless Bitcoin investors of whose shares could not be bought back easily (am I correct?). However, we are also keen on doing a Bitcoin IPO because that way we could have more control over the company (not giving away voting rights) and steer the company to the direction more beneficial to the Bitcoin ecosystem instead of a 4-5 years exit plan.

I am mainly looking advice on:

Valuation in both scenarios. We believe we could get higher valuation through a Bitcoin IPO.
How much goodwill Bitcoin fans and current Bitcoin millionaires have to build the ecosystem
Credibility: a VC investment would give us more real-world credibility
Bitcoin is hot in old-fashioned VC industry right now. We have been contacted by several world-class VCs by themselves to discuss with us.
The legal implications: what is the relationship between pass-through shares and real shares? Should we move to live underground after a Bitcoin IPO to avoid possible later legal mess?
Should we found the company in some tax haven where laws are more relaxed (e.g. Seychelles)
It seems that the Bitcoin stock exchange industry is little shady, and it's hard to trust pseudonyms. Is it still too early to go there, as it might be that stock exchanges will be crashing within a year, like fiat money exchanges have, and we end up with a complete mess and lost information on shareholders, dividends and ownership?

This is ultimately a question where you may have to choose between liquidity and control.  Traditional VC investments are a lot more liquid, in other words, they likely have a lot more money to offer, than any bitcoin stock market.  At the current exchange rate, the amount you'd like to raise is equivalent to roughly 15,000 bitcoins (on the 1.5 million end of the the range, anyway).

Localbitcoins - you're a popular enough exchange that you may very well be able to raise that much in a bitcoin IPO.

I imagine it'd be a lot easier with a traditional VC to make that kind of money though, and that would be in fiat already for the marketing efforts that you're planning.  But the catch is that the money the VC provides will likely have strings attached, they'll want some control of your business in return for that kind of money, or as you said, the 4 - 5 year exit plan.

The other issue that you have to consider here is this: what are you looking for in return for this money?  Are you just thinking of the money going towards shares of stock, as in a bitcoin exchange?  Or do you want business advice for your business as well?  A bitcoin exchange can definitely provide liquidity, how much, I don't know.  But if you want business advice, then you are likely better off with a traditional VC since they will be able to provide that for you.


Decode blocks received and Store in another file for analyzing I am working on a bitcoin research project. I want to decode receiving blocks from the block chain and store decoded data in a separate file for analyzing purposes.

For this purpose I digs the bitcoin c++ code and find the exact place, which use to write the blocks into blkXXX.dat file.

Could you please suggest a solution for this matter.

Thank you

#include <QTimer>
#include <QFile>

#include "BlockChain.h"

BlockChain::BlockChain ( const int start, QObject* parent ) : QFile ( parent ), blkFile ( start + 1 )
{
  QTimer::singleShot ( 0, this, SLOT ( start ( ) ) );
}
//--------------------------------------------------------------
void BlockChain::start ( )
{
  setFileName ( blkFileName ( blkFile++ ) );
  if ( !open ( QIODevice::ReadOnly ) )
  {
    _trace ( QString ( "cant open [%1]" ).arg ( fileName ( ) ) );
    getParent ( ).block ( QByteArray ( ) ); // finish signal
    deleteLater ( );
  }
  else
  {
    _trace ( QString ( "processing [%1]" ).arg ( fileName ( ) ) );
    QTimer::singleShot ( 0, this, SLOT ( next ( ) ) );
  }
}
//--------------------------------------------------------------
void BlockChain::next ( )
{
  bool lock ( true );
  if ( pos ( ) < size ( ) )
  {
    quint32 magic;
    quint32 size ( read ( (char*)&magic, 4 ) );
    xassert ( ( ( magic == MAGIC_ID ) || !magic ) && ( size == 4 ) );
    if ( magic )
    {
      read ( (char*)&size, 4 );
      xassert ( size > HEADER_SIZE && size <= MAX_BLOCK_SIZE );
      getParent ( ).block ( read ( size ) ); // process data
      QTimer::singleShot ( 0, this, SLOT ( next ( ) ) );
      return;
    }
    else
      lock = false;
  }
  close ( );
  getParent ( ).doneFile ( lock, blkFile - 1 );
  QTimer::singleShot ( 0, this, SLOT ( start ( ) ) );
}
//--------------------------------------------------------------
const QString BlockChain::blkFileName ( const int i )
{
  return
    ( i < 10 ) ? QString ( DATA_ROOT "\\blk0000%1.dat" ).arg ( i ) :
    ( i < 100 ) ? QString ( DATA_ROOT "\\blk000%1.dat" ).arg ( i ) :
    QString ( DATA_ROOT "\\blk00%1.dat" ).arg ( i );
}


What does this phishing website compromise? Earlier this day, I have received an email saying that there is a buyer for my localbitcoins advertisement:

However, the https://localbitcoins.com/ads/37726/103702 link shown actually links me to:

  http://mandrillapp.com/track/click.php?u=30106122&id=8f52703cd0ec4b2b81e069630069dbdc&url=http%3A%2F%2Fllocalbitcoins.com%2Faccounts%2Flogin&url_id=ad428ed9d64304239644387c1388db2f686a98ca

I've accidentally clicked it and it brings me to a phishing website which looks identical to localbitcoins. The phishing website is hosted on http://llocalbitcoins.com (whois record). Notice that there are two "L"s in the domain name.

Wwhat does the hidden link do? Now that I've clicked the link, what can happen to me?

I've changed my password since then. But what else can I do to protect myself?

LocalBitcoins provides two-factor authentication which protects you against all kinds of phishing attacks. Even if the attacker gains access to your password by phishing link or malware (e.g. infected Windows machine), they cannot access your one time codes needed to login and do transactions.

LocalBitcoins recommends you to enable two-factor authentication on your Wallet page (if you have bitcoins) and every time in your user profile navigation bar unless it is enabled.

There are two different methods for two-factor authentication

Mobile app (Google Authenticator) - works on iPhone, Android and other smart phones
Paper codes (you print a set of one time codes)

Both options can be enabled from the link shown in the screenshot above, or from this direct link. For both options, you need to also make sure you have a proper backup as in the case you lose access to your mobile phone with two-factor authentication app you cannot no longer login to LocalBitcoins.

To receive the email in the question the user probably has published email in an advertisement, LocalBitcoins forums or given it to a malicious trader. LocalBitcoins recommends you do not do communications or trade deals off-site outside LocalBitcoins messaging system.

In the case you have already given your password to a phishing site

Change your LocalBitcoins password immediately
Enable two-factor authentication as instructed above


What is the difference between key aggregation and signature aggregation? What is the difference between key aggregation (e.g. MuSig) and signature aggregation?
Many people (including myself) have in the past used these terms interchangeably. Why is it important to be careful to use the correct term in its correct setting?

As Pieter Wuille states here key aggregation is completed at address creation time not at signing time or post signing time.

Of course, key aggregation has an impact on the signing algorithm, and that's probably one of the main reasons why it's useful to do it before CISA: the work needed to support MuSig signing in wallet will take a while, but it's pretty similar to CISA signing.
Why is key aggregation better? Because it means the original keys never end up on chain. With signature aggregation you still have on-chain keys, but with 1 signature....Key aggregation means the consensus rules can be completely oblivious of even the concept of aggregation.
Downside: key aggregation cannot be used cross input, as you can't predict which UTXOs will be spent together.

Meanwhile signature aggregation is completed at signing time or post signing time, not at address creation time. To implement it it would possibly need a specific opcode that observes multiple keys.

Signature aggregation implies a verification algorithm that receives a list of (message,pubkey) pairs and a signature.

You could see key aggregation as a special case of signature aggregation as the aggregated signature is also a valid "single key" signature for the aggregated key. But conceptually there is a huge difference in how they would be implemented.

Why is it important to be careful to use the correct term in its correct setting?

The proposed Taproot soft fork does not enable signature aggregation at all (cross input or otherwise), it facilitates key aggregation schemes e.g. MuSig. As Pieter says, the consensus rules of Taproot and Schnorr don't have any awareness of aggregation. Hence if you say Taproot enables signature aggregation this is incorrect and will confuse. In addition, when moving onto the discussion of what soft fork(s) could potentially follow Taproot, enabling signature aggregation will be a candidate feature that is seriously considered as the block space savings could be significant. (Note witness data is already discounted post SegWit). Key aggregation allows you to aggregate keys within one input but cross input signature aggregation could potentially allow you to aggregate signatures across inputs.
Aggregating signatures not only across inputs but across transactions could potentially mean only one signature goes onchain for the entire block. However, this is not possible with discrete logarithm based cryptography (see Pieter's comment below). It needs non-interactive aggregation as you can't require transaction authors to cooperate. This aggregation needs to be done by miners.


Bitcoin Client - How do I find the destination address of an incoming transaction? I'm mining Bitcoins and have multiple incoming addresses in my bitcoin-qt wallet.

When I get a payout for mining in the "Transactions" tab it shows the amount of BTC I received and the type is set to "Mined".

Now I see a lot of transactions, but I have no clue for which incoming wallet address these payments were originally made for.

How can I figure out the destination address in the wallet for incoming transactions? And if I can't; why?


How to obtain your nodeID (QR code) in eclair-mobile? I want someone to open a direct (no hops between us) channel to me in lightning (she will be the funder, I'll be the fundee). How can I get the QR code of my node in my eclair wallet to show to the funder? I don't find the UI/setting for it.

Click the three dots in the top right corner, tap "Network Info".

Your NodeId is visible on this screen

Now, go to the URL ip.tyk.nu to find your IP address.

Now, in a Linux prompt (or WSL), install the PyPI qrcode package. On Ubuntu, it is available in the python3-qrcode package.

Now, execute this command (substitute the values you just learnt):

echo -n "<nodeID>@<IPaddress>:9735" | qr

The QR code is now visible in your terminal. If you want a real image, you can use zbarimg from the package zbar-tools.


Organization to keep track of wrongfully obtained bitcoins I am curious whether there are any organizations that are actively trying to monitor bitcoins from illegal sources.
I understand that 'when done properly' you can make bitcoins practically untraceable, but I have just witnessed a rather amateuristic attack where people were suggested to transfer funds to
3EaRJ5p172iLYJKH8YYnPYFw9pKgxYg1sj and I wonder if anyone is trying to do something about these cases.
Just one partial solution I could think of would be to alert exchanges or vendors when the bitcoins are traced to them, so they can hold the funds untill the situation has been cleared up.
I am not asking whether my proposed solution makes sense, but I do ask  if there is any organization/solution that structurally tries to make life difficult for bitcoin criminals

So far I have seen a lot of answers explaining you cannot catch all criminals, but I would be surprised if we cannot even catch some.
I also found a reference to nomoreransom.org but ultimately that just referred me to the local authorities, which makes me doubt there is a structured approach behind this.

There are companies such as Chainalysis (no affiliation) and Elliptic (also no affiliation) that attempt to perform such analysis and group addresses into clusters based on the entity (exchange, scam, unknown, mining pool, gambling, payment services, etc.) that is believed to control them.

They offer their analysis to exchanges, governments, merchants, etc. for a price, as any other business.


Blockchain and ISO/OSI I've heard blockchain is built on top of the ISO/OSI stack. Does it means blockchain belongs to the layer 7 (Application layer) of the Osi architecture?

Bitcoin uses TCP which would put it at layer 7 of that description, but there's nothing particular that requires it. The transport layer for data is orthogonal to the system, it could alternatively use raw frames, carrier pigeons, or have the packets inked onto the heads of slaves. Systems exist which allow for data to be transfered through a TV satellite relay for example, which skips the networking layers entirely.


Good documentation on starting bitcoind and bitcoin-cli after building them on Ubuntu Bionic I have been following Antonopoulos book but it seems to be outdated.

I am having elementary problems. Which command to run when, after I build bitcoind and bitcoin-cli. How am I to get blockchain to start downloading?

Start with the infamous bitcoin.conf which doesn't exist and nobody knows exactly how it should come into existence.

  :~/.bitcoin$ bitcoind -datadir=/mnt/d/blockchain -txindex=1 -daemon
  Bitcoin server starting

Ok, I assume it is now doing something, like downloading blocks.

But:

~/bitcoin$ bitcoin-cli -datadir=/mnt/d/blockchain -getinfo
{
  "version": 170100,
  "protocolversion": 70015,
  "walletversion": null,
  "balance": null,
  "blocks": 0,
  "timeoffset": 0,
  "connections": 0,
  "proxy": "",
  "difficulty": 1,
  "testnet": false,
  "keypoololdest": null,
  "keypoolsize": null,
  "paytxfee": null,
  "relayfee": 0.00001000,
  "warnings": ""
}

implies that nothing is going on. Nothing is being downloaded.

Start with the infamous bitcoin.conf which doesn't exist and nobody knows exactly how it should come into existence.

Well, I know.

It should come into existence by you creating it with a text editor in your datadir directory, if you wish to do so.  It's completely optional.  If there are command line options you want to use every time without having to specify them (such as -txindex=1), you can put them into bitcoin.conf.  If you're happy continuing to give them on the command line, then there is no need for bitcoin.conf to exist at all.

And now you know too.

As for your other issue, if you use getblockchaininfo instead of getinfo, you'll get more detailed information.  Current versions of Bitcoin Core try to download block headers before getting the blocks themselves.  You'll see a headers field in getblockchaininfo which perhaps will be increasing.

Otherwise, any and all diagnostic information would be in a file called debug.log in your datadir directory.  Look at that file.  If it isn't self-explanatory, then you can post the last several lines of it in a question here, or to your other favorite Bitcoin support forum.


Bitcoin-cli 0.19.1 Wallet not Sending from Addresses with Closest Amount? I have a weird issue that I thought was fixed a few years back with Bitcoin wallet to reduce fees. I guess not, or I am missing something...
My wallet received a transaction for the amount of 0.54530200 BTC, yet when I went and sent 0.51986042 BTC out using bitcoin-cli sendtomany to 16 outputs, the wallet used 856 inputs to send the amount that was available and cleared with at least 400+ confirmations in the first address.
The above TX cost me 0.03600705 BTC to send when it should have cost me a fraction of the amount had it used the address that contained the closest amount to the amount it's sending out...
Bitcoint-cli version 0.19.1
Any ideas what I could be doing wrong or what I could be missing?

I am not sure why coin selection algorithm didn't work or if you manually added some inputs or could have manually added inputs to avoid this. However, you could have still avoided paying more fees.
The transaction had virtual size of 78213 VByte
You had used fee rate: 46 sat/vByte
Since this transaction involved lot of inputs and bigger size, you could have used a lower fee rate when mempool had less than 5 MB of transactions.
Assuming you had used 5 sat/vByte fee rate for this transaction, the total fees paid for the transaction would have been 0.0039 BTC which is 90% less than the fees you paid.
Looking at the mempool history, the transaction would have confirmed yesterday:

UTXO consolidation is normally done when mempool is clear or you have lots of time so that 1-5 sat/vByte can be used for such transactions.
Consolidation of 4 Million UTXOs at Xapo: https://bitcoinops.org/en/xapo-utxo-consolidation/


Change in hash rate fraction of mining pools There are pages that show how the cumulative hash rate of network changes over time however, I wasn't able to find any that shows how hash rate fraction of pools change over time. Is there a page that traces this metric?

You could try this page for the current share and keep a record?
Bitcoin Hashrate Distribution


How convert Bitcoin Privat Key Compression to public address? This script gets the public address from the uncompressed private key.
import ecdsa
import hashlib
import base58

private_key = input("privatekey: ") # e41b45e722251672c01a28e4fada590471fea09f90d13b143033ed3a1107ef49

# Convert hex private key to bytes
private_key = bytes.fromhex(private_key)

# Derivation of the private key
signing_key = ecdsa.SigningKey.from_string(
    private_key, curve=ecdsa.SECP256k1)
verifying_key = signing_key.get_verifying_key()

public_key = bytes.fromhex("04") + verifying_key.to_string()

# Hashes of public key
sha256_1 = hashlib.sha256(public_key)
ripemd160 = hashlib.new("ripemd160")
ripemd160.update(sha256_1.digest())

# Adding prefix to identify Network
hashed_public_key = bytes.fromhex("00") + ripemd160.digest()

# Checksum calculation
checksum_full = hashlib.sha256(
    hashlib.sha256(hashed_public_key).digest()).digest()
checksum = checksum_full[:4]

# Adding checksum to hashpubkey
bin_addr = hashed_public_key + checksum

# Encoding to address
address = str(base58.b58encode(bin_addr))
final_address = address[2:-1]  # change 2

print(final_address)

Format (private keys):
        uncompressed: 0x80 + [32-byte secret] + [4 bytes of Hash() of previous 33 bytes], base58 encoded
        compressed: 0x80 + [32-byte secret] + 0x01 + [4 bytes of Hash() previous 34 bytes], base58 encoded

    case 1:

    secret (hex): 1111111111111111111111111111111111111111111111111111111111111111
    uncompressed:
        secret (base58): 5HwoXVkHoRM8sL2KmNRS217n1g8mPPBomrY7yehCuXC1115WWsh
        pubkey (hex): 044f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa385b6b1b8ead809ca67454d9683fcf2ba03456d6fe2c4abe2b07f0fbdbb2f1c1
        address (base58): 1MsHWS1BnwMc3tLE8G35UXsS58fKipzB7a
    compressed:
        secret (base58): L4xkFv5sbttQcsgnTjzqJuQdNfHC5gk9zsK5HmaV822qu79zJA7L
        pubkey (hex): 034f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa
        address (base58): 1Q1pE5vPGEEMqRcVRMbtBK842Y6Pzo6nK9

I need to get this code to work with two formats, but I don't understand what needs to be fixed. If I insert a compression private key 682cf5791be8d4526aacf63bb7ab201f5cd1d732c1f634e5839379191b02295925 , I get an error:

ecdsa.keys.MalformedPointError: Invalid length of private key,
received 33, expected 32

I understand that the bottom part of this code can be used, but I am failing to lack knowledge.
def __private_to_compressed_public(private_key):
        private_hex = codecs.decode(private_key, 'hex')
        # Get ECDSA public key
        key = ecdsa.SigningKey.from_string(private_hex, curve=ecdsa.SECP256k1).verifying_key
        key_bytes = key.to_string()
        key_hex = codecs.encode(key_bytes, 'hex')
        # Get X from the key (first half)
        key_string = key_hex.decode('utf-8')
        half_len = len(key_hex) // 2
        key_half = key_hex[:half_len]
        # Add bitcoin byte: 0x02 if the last digit is even, 0x03 if the last digit is odd
        last_byte = int(key_string[-1], 16)
        bitcoin_byte = b'02' if last_byte % 2 == 0 else b'03'
        public_key = bitcoin_byte + key_half
        return public_key

I've done a lot of tests, but I can't figure out what's wrong. Tell me how to modify the code correctly.
Thank you in advance for your help.

If I get your code and use "e41b45e722251672c01a28e4fada590471fea09f90d13b143033ed3a1107ef49" as secret hex value AKA secret private key... then I get result: "12sF1DbBbPaoNYrs28Qm7waiCcAVoF93Nn" which is uncompressed public address.
Check my script, it is more extended, but with a copule of imports for an educational point of view, to show all the process. You will get compressed and uncompressed public keys from a given secret in hexadecimal value.
First, the script will get uncompressed private key and compressed private key in hex:
'04417A55413D948D79F5194F1F2CD670F078CB7F6D3A2F2B12E8CDF9A3268CAD3BAAA3251D2587D4E57ACBCE7991B72355EA33C44DBCF260D09B6C921879A61AA4'
'02417A55413D948D79F5194F1F2CD670F078CB7F6D3A2F2B12E8CDF9A3268CAD3B'

Then it will get both public uncompressed and compressed public keys.
The code:
#!/usr/bin/python3
from hashlib import sha256, new
import binascii

PCURVE = 2 ** 256 - 2 ** 32 - 2 ** 9 - 2 ** 8 - 2 ** 7 - 2 ** 6 - 2 ** 4 - 1  # The proven prime
N = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141  # Number of points in the field
ACURVE = 0
BCURVE = 7  # These two defines the elliptic curve. y^2 = x^3 + Acurve * x + Bcurve
Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240
Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424
GPOINT = (Gx, Gy)  # This is our generator point. Trillions of dif ones possible

def modinv(a: int, n: int = PCURVE):
    # MAXIMO COMUN DIVISOR: Extended Euclidean Algorithm/'division' in elliptic curves
    lm, hm = 1, 0
    resto = a % n
    high = n
    while resto > 1:
        ratio = high // resto
        nm = hm - lm * ratio
        new = high - resto * ratio
        lm, resto, hm, high = nm, new, lm, resto
    return lm % n

def ECadd(a, b):  # Not true addition, invented for EC. Could have been called anything.
    LamAdd = ((b[1] - a[1]) * modinv(b[0] - a[0], PCURVE)) % PCURVE
    x = (LamAdd * LamAdd - a[0] - b[0]) % PCURVE
    y = (LamAdd * (a[0] - x) - a[1]) % PCURVE
    return x, y

def ECdouble(a):  # This is called point doubling, also invented for EC.
    Lam = ((3 * a[0] * a[0] + ACURVE) * modinv((2 * a[1]), PCURVE)) % PCURVE
    x = (Lam * Lam - 2 * a[0]) % PCURVE
    y = (Lam * (a[0] - x) - a[1]) % PCURVE
    return x, y

def EccMultiply(gen_point: tuple, scalar_hex: int):  # Double & add. Not true multiplication
    if scalar_hex == 0 or scalar_hex >= N:
        raise Exception("Invalid Scalar/Private Key")
    ScalarBin = str(bin(scalar_hex))[2:]  # string binario sin el comienzo 0b
    Q = gen_point  # esto es una tupla de dos integer del punto de generacion de la curva
    for i in range(1, len(ScalarBin)):
        Q = ECdouble(Q)
        if ScalarBin[i] == "1":
            Q = ECadd(Q, gen_point)  #
    return Q

def private_to_hex_publics(hex_private_key: hex):
    public_key = EccMultiply(GPOINT, hex_private_key)
    public_uncompressed = f"04{hex(public_key[0])[2:].upper()}{hex(public_key[1])[2:].upper()}"

    if public_key[1] % 2 == 1:  # If the Y value for the Public Key is odd.
        public_compressed = ("03" + str(hex(public_key[0])[2:]).zfill(64).upper())
    else:  # Or else, if the Y value is even.
        public_compressed = ("02" + str(hex(public_key[0])[2:]).zfill(64).upper())
    return public_uncompressed, public_compressed

def hash_256_from_hex_string_like_bytes(hexstring: str):
    return sha256(bytes.fromhex(hexstring)).hexdigest()

def ripemd160_from_hex_string_like_bytes(hexstring: str):
    return new('ripemd160', bytes.fromhex(hexstring)).hexdigest()

def b58encode(hex_string, expected_length=None):
    v = binascii.unhexlify(hex_string)
    alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
    lev, number = 1, 0
    for char in reversed(v):
        number += lev * char
        lev = lev << 8  # 2^8
    string = ""
    while number:
        number, modulo = divmod(number, 58)
        string = alphabet[modulo] + string
    if not expected_length:
        return string
    elif len(string) != expected_length:
        raise Exception(f"b58encode: Expected length={expected_length} obtained length={len(string)}")
    else:
        return string

def sha256_get_checksum(hex_string_to_checksum):
    hasha1 = hash_256_from_hex_string_like_bytes(hex_string_to_checksum)
    # print("HashA1", hasha1)
    hasha2 = hash_256_from_hex_string_like_bytes(hasha1)
    # print("HashA2", hasha2)
    return hasha2[:8].upper()

def sha_ripe_digest(hex_string_to_checksum):
    hashc1 = hash_256_from_hex_string_like_bytes(hex_string_to_checksum)
    hashc2 = ripemd160_from_hex_string_like_bytes(hashc1)
    return hashc2.upper()

def wif_from_private(privkey: hex):
    # put 80 for bitcoin and concatenate with privkey
    prepend = "80"
    private_key_str = hex(privkey)[2:].zfill(64)
    prepended = (prepend + private_key_str).upper()
    compressed = (prepend + private_key_str + "01").upper()

    if len(prepended) != 66 or len(compressed) != 68:
        raise Exception("WIF conversion: Wrong prepended or compressed private key, length not 66")

    uncompressed_checksum = sha256_get_checksum(prepended)
    compressed_checksum = sha256_get_checksum(compressed)
    private_key_uncompressed_checksum = prepended + uncompressed_checksum
    private_key_compressed_checksum = compressed + compressed_checksum
    private_key_WIF_uncompressed_Base58 = b58encode(private_key_uncompressed_checksum, 51)
    private_key_WIF_compressed_Base58 = b58encode(private_key_compressed_checksum, 52)

    print("PREPENDED:\t\t\t\t", prepended)
    print("PRIV_UNCOMP+CHECKSUM:\t\t\t", private_key_uncompressed_checksum)
    print("Private_key_WIF_uncompressed_Base58:\t", private_key_WIF_uncompressed_Base58)
    print("PRIV_COMP+CHECKSUM:\t\t\t", private_key_compressed_checksum)
    print("Private_key_WIF_compressed_Base58:\t", private_key_WIF_compressed_Base58)
    return private_key_WIF_uncompressed_Base58, private_key_WIF_compressed_Base58

def hex_public_to_public_addresses(hex_publics):
    uncompressed = hex_publics[0]
    public_key_hashC_uncompressed = "00" + sha_ripe_digest(uncompressed)
    checksum = sha256_get_checksum(public_key_hashC_uncompressed)
    PublicKeyChecksumC = public_key_hashC_uncompressed + checksum
    public_address_uncompressed = "1" + b58encode(PublicKeyChecksumC, 33)
    print("Public address uncompressed:\t", public_address_uncompressed)

    compressed = hex_publics[1]
    PublicKeyVersionHashD = "00" + sha_ripe_digest(compressed)
    compressed_checksum = sha256_get_checksum(PublicKeyVersionHashD)
    PublicKeyChecksumC = PublicKeyVersionHashD + compressed_checksum
    public_address_compressed = "1" + b58encode(PublicKeyChecksumC, 33)
    print("Public address compressed:\t", public_address_compressed)
    return public_address_uncompressed, public_address_compressed

if __name__ == "__main__":
    privkey = 0xe41b45e722251672c01a28e4fada590471fea09f90d13b143033ed3a1107ef49
    print(f"PRIVATE KEY:\t {hex(privkey)[2:].zfill(64).upper()}")

    # Public hex test
    hex_publics = private_to_hex_publics(privkey)
    print(hex_publics)
    print()

    # WIF creation test
    wif = wif_from_private(privkey)
    print(wif)

    # Public keys
    public = hex_public_to_public_addresses(hex_publics)
    print(public)

The script is inspired by this site.
Finally you will obtain the two public keys, uncompressed and compressed:
'12sF1DbBbPaoNYrs28Qm7waiCcAVoF93Nn', '1BMKGYmgjrvmSDtvLZvKjyVMnbi6FLmcVi'

Hope this will help you.
Note: it will give you the WIF format too.
Full output:
PRIVATE KEY:     E41B45E722251672C01A28E4FADA590471FEA09F90D13B143033ED3A1107EF49
('04417A55413D948D79F5194F1F2CD670F078CB7F6D3A2F2B12E8CDF9A3268CAD3BAAA3251D2587D4E57ACBCE7991B72355EA33C44DBCF260D09B6C921879A61AA4', '02417A55413D948D79F5194F1F2CD670F078CB7F6D3A2F2B12E8CDF9A3268CAD3B')

PREPENDED:                               80E41B45E722251672C01A28E4FADA590471FEA09F90D13B143033ED3A1107EF49
PRIV_UNCOMP+CHECKSUM:                    80E41B45E722251672C01A28E4FADA590471FEA09F90D13B143033ED3A1107EF496CB6A884
Private_key_WIF_uncompressed_Base58:     5KYkFr9FMmBVcwjLbJinAw94b985tgyt4PL9Jhcjsk6J6ZRfxjM
PRIV_COMP+CHECKSUM:                      80E41B45E722251672C01A28E4FADA590471FEA09F90D13B143033ED3A1107EF4901070CD9AC
Private_key_WIF_compressed_Base58:       L4s7vXuQNe1KKeZsURDQNqxaqgrGb9U4MwZVf8GkEyCNTKyEk3iK
('5KYkFr9FMmBVcwjLbJinAw94b985tgyt4PL9Jhcjsk6J6ZRfxjM', 'L4s7vXuQNe1KKeZsURDQNqxaqgrGb9U4MwZVf8GkEyCNTKyEk3iK')
Public address uncompressed:     12sF1DbBbPaoNYrs28Qm7waiCcAVoF93Nn
Public address compressed:       1BMKGYmgjrvmSDtvLZvKjyVMnbi6FLmcVi

Editing original code by Jon Do request
import ecdsa
import hashlib
import base58

def bytes_to_hex_string(b: bytes):
    return ''.join('{:02x}'.format(x) for x in b).upper()

def get_prepend_if_even_or_odd_for_compressed(x_point):
    y = int(x_point[64:], 16)
    if y % 1 == 1:
        return "03"  # odd
    return "02"  # even

private_key = "e41b45e722251672c01a28e4fada590471fea09f90d13b143033ed3a1107ef49"

# Convert hex private key to bytes
private_key = bytes.fromhex(private_key)
print(f"Private key hex string: \t\t {bytes_to_hex_string(private_key)}")
print(f"Private key bytes: \t\t\t {private_key}")
# Derivation of the private key
signing_key = ecdsa.SigningKey.from_string(private_key, curve=ecdsa.SECP256k1)

verifying_key = signing_key.get_verifying_key()
print(f"Verifying key, x and y points (bytes):\t{verifying_key.to_string()}", type(verifying_key.to_string()))

x_point = bytes_to_hex_string(verifying_key.to_string())
print(f"Uncompressed private key (hex):\t\t 04{x_point.upper()}")

even_odd = get_prepend_if_even_or_odd_for_compressed(x_point)
print(f"Compressed private key in (hex):\t {even_odd}{x_point.upper()[:64]}")

# public_key = bytes.fromhex("04") + verifying_key.to_string()  # this is error, you're using uncompressed private key
public_key = bytes.fromhex(even_odd) + verifying_key.to_string()[:32]

# Hashes of public key
sha256_1 = hashlib.sha256(public_key)  # now public_key contains compressed private key
ripemd160 = hashlib.new("ripemd160")
ripemd160.update(sha256_1.digest())

# Adding prefix to identify Network
hashed_public_key = bytes.fromhex("00") + ripemd160.digest() # hashed_private_key is public key

# Checksum calculation
checksum_full = hashlib.sha256(
    hashlib.sha256(hashed_public_key).digest()).digest()
checksum = checksum_full[:4]

# Adding checksum to hashpubkey
bin_addr = hashed_public_key + checksum

# Encoding to address
address = str(base58.b58encode(bin_addr))
final_address = address[2:-1]  # change 2

print(f"Public compressed key (hex): \t\t {final_address}")

The new output is:
Private key hex string:                  E41B45E722251672C01A28E4FADA590471FEA09F90D13B143033ED3A1107EF49
Private key bytes:                       b'\xe4\x1bE\xe7"%\x16r\xc0\x1a(\xe4\xfa\xdaY\x04q\xfe\xa0\x9f\x90\xd1;\x1403\xed:\x11\x07\xefI'
Verifying key, x and y points (bytes):  b'AzUA=\x94\x8dy\xf5\x19O\x1f,\xd6p\xf0x\xcb\x7fm:/+\x12\xe8\xcd\xf9\xa3&\x8c\xad;\xaa\xa3%\x1d%\x87\xd4\xe5z\xcb\xcey\x91\xb7#U\xea3\xc4M\xbc\xf2`\xd0\x9bl\x92\x18y\xa6\x1a\xa4' <class 'bytes'>
Uncompressed private key (hex):          04417A55413D948D79F5194F1F2CD670F078CB7F6D3A2F2B12E8CDF9A3268CAD3BAAA3251D2587D4E57ACBCE7991B72355EA33C44DBCF260D09B6C921879A61AA4
Compressed private key in (hex):         02417A55413D948D79F5194F1F2CD670F078CB7F6D3A2F2B12E8CDF9A3268CAD3B
Public compressed key (hex):             1BMKGYmgjrvmSDtvLZvKjyVMnbi6FLmcVi


Less circuitous way to get network fee in raw transaction I have my code working correctly now to create and send a transaction with the correct network fee. Here is my pseudo-code using the json rpc:

Estimate network fee using estimatesmartfee "ECONOMICAL" based on a typical transaction size
Adjust payout amount based on fee estimate
createrawtransaction using estimated payout amount
signrawtransaction
read size of decoded raw transaction from step 2
Recalculate network fee using estimatesmartfee "ECONOMICAL" based on a actual transaction size from last step
Adjust payout amount based on actual network fee
createrawtransaction using actual payout amount
signrawtransaction
sendrawtransaction

Steps 6-9 repeats Steps 1-4.

Is there a way to do this without having to call everything twice?

If the inputs to the transaction are known to the Bitcoin Core wallet, then you can use the fundrawtransaction command to skip fee estimation and input selection. The process then becomes:

createrawtransaction with only the outputs you want (i.e. no change, only the recipients).
fundrawtransaction
signrawtransaction
sendrawtransaction

If you are not using Bitcoin Core's wallet, you can use effective values.

Presumably you know the amounts in the inputs before you actual create the transaction. So you can then calculate how large the inputs will be, calculate how much in fees that will cost based on the output of estimatesmartfee, and subtract that fee amount from the actual value of the input. This is your effective value.

When you create the outputs, you calculate the total size of the non-input data and calculate the fees for those data. Now you have how much total value your inputs must cover. You can then select coins that way.

So the process is:

estimatesmartfee
For each potential input, calculate the fee for that input and compute the effective value.
For each output (including change if you assume that there will be change) and for the extra fixed size transaction overhead, calculate the non-input fees.
Add the non-input fees to the amount you want to send, this is the amount that your inputs will need to cover the total cost.
Choose the inputs you want to spend based upon their effective values.
createrawtransaction, signrawtransaction, sendrawtransaction.

The size of inputs in vbytes are as follows:

P2PKH: 148 vbytes

P2WPKH: 37 vbytes

P2SH-P2WPKH: 60 vbytes

For P2SH and P2WSH inputs, it depends on the script that you are using. Most people though will be using P2PKH, P2WPKH, or P2SH-P2WPKH.


Who sets the fees for a transaction? Can I send a transaction with zero fees? And if I could, what would happen? Would miners ignore my request? Who sets the price of fees for transactions?

Can I send a transaction with zero fees?

You can create transaction with zero fee. You can try to broadcast it to your peers. But there is no chance that your peers will accept it and rebroadcast.

  And if I could, what would happen?

The same as for regular transaction with fees. Ignoring zero fee is not a consensus rule, but coded in most nodes.

  Would miners ignore my request?

Today yes

  Who sets the price of fees for transactions?

Market


How do I properly paytomany using electrum via script? I know that I can use the GUI to do this and I"m glad to do so...however how would I do this using a bash script?  This is on a Mac but I would just change it for any OS in question.

#!/bin/sh

PAYOUTS=cat ~/Desktop/weeklySummary.csv
WP= /Users/${USER}/.electrum/wallets
PASS= "my_wallet_password"
# echo $PAYOUTS

cd /
./Applications/Electrum.app/Contents/MacOS/Electrum paytomany && $PAYOUTS -w $WP -W PASS

# this is not ready yet!  I have to figure out
# whether or not change address, a fee, and a
# from address are requried to use this

I get thrown some errors for a few missing details.  Am I required to have my wallet password, from address, and change address (I presume the answer is yes)  but furthermore, what are the -h, -v, -P parameters mentioned here?

WOW....so this never got answered by anyone else....okay let's share the answer for you all as I eventually figured it out but had forgotten that I wrote this question:

electrum paytomany "[[\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05], [\"17Umi7fbYuKixnr8nRq16kMESWgJVc66s\", 0.05]]"

So each address to be paid must reside within its own array which is itself enclosed into a parent array of all those payout requests...the slashes are simply there to escape the quotes so they're included within the string.  I actually ended up doing something other than bash but utlimately this is the string you need to format in order to paytomany using electrum.  Still don't know what the -v nor the -h are for (op...nevermind they mean Help and Verbose)...-P for portable wallet (meaning it can be put onto something like a usb drive (a portable filesystem essentially)... Hope this can help some other fellow web traveller in the future ;)


Who pays the miner fees for the closing transaction of a payment channel? For single-funded channels, I understand the miner fee for the the transaction that is opening the channel is paid by the  actual party wanting to make a payment.

However it's unclear who will eventually pay for the fee for the transaction that is going to close the channel. Will it be split by the two parties? Will it always be the person who "wants to cash out" that pays it?

Currently Blockstream Store is receiving lots of small payments via LN through single-funded channels. Let's say Blockstream (just an example) needs the revenue and wants to cash out. To do this they ask all their channels nodes to "cooperatively close the channel".

If Blockstream has to pay the closing channel fee, what happens if the fee is actually larger than the amount they received through the channel itself?

This becomes even more tricky to understand when you're routing payments.

According to the BOLT 3 specification, the peer that funded the channel will incur the costs of closing fees. It also seems that these fees would be calculated before closing a payment channel. Both parties already have a transaction with a built in fee that can be used to close the channel that they can broadcast at anytime.

Reference: https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#closing-transaction


Multisig Setup - Pruned Bitcoin Core on Computer vs. Dedicated Hardware Are there security implications of running a pruned Bitcoin Core node on a personal computer vs. a full Bitcoin Core node on a dedicated hardware device (i.e. Raspberry Pie with Umbrel, myNode, nodl, and etc.)?

The intended use case for the Bitcoin Core node is integration with a multisig wallet such as Specter, Electrum, and etc.

This scenario presumes the personal computer is configured to run Bitcoin Core through Tor/VPN (That do not save/collect logs) as in the Specter desktop 1-click setup.

One non-security implication is the performance impact on the personal computer when running the pruned Bitcoin Core node.

Both a full Bitcoin and pruned node can be run from Bitcoin Core with the same level of security.
Pruned nodes have the following differences:

Does not keep the full blockchain on disk
Size limit is defined by the user
Will discard unnecessary block data as it synchronizes

As a user on the Bitcoin Talk forum explains, most "dedicated hardware" Bitcoin Nodes are software wrappers around Bitcoin Core which may be less secure than running Bitcoin Core directly.
See Multisig Setup - Pruned Bitcoin Core on Computer vs. Dedicated Hardware - bitcointalk.org


Sweeping Private Key With Electrum From Electrum's documentation, the following should sweep all private keys to a new address:

electrum listaddresses --funded | electrum getprivatekeys - | jq 'map(.[0])' | electrum sweep - [destination address]

Is there any way to enter a WIF key into the command line to specify it directly?  The address I'm wanting to sweep isn't in my Electrum.

For example, let's say this is the private key (never use this):  L3ei8Zdu3eVRxMifD8XFN14jofv25ME51AhTzJr999dazxrWZMrZ

And this is the address I want the coins swept to: 1KdcMcRXNTBYT5BnHcmFHuYvvdWGsPnnwb

Assume that neither the sending nor receiving address is in my Electrum wallet.

What would I need to enter in Electrum command-line?

The first two commands extract private keys from the electrum wallet. So you can simply pass on your private key (wif) and destination address to electrum sweep.

However, if your private key isn’t listed in electrum wallet, it may not know/hasn’t indexed which utxos this specific key can spend, which is necessary information for sweeping funds controlled by that private key. I am not sure if electrum indexes by all addresses(incl. those spendable by your private key), that will be critical to your ability to sweep.


Can Bitcoin be "shutdown" if energy consumption for mining is heavily regulated? Can Bitcoin be "shutdown" or heavily hampered if energy consumption for mining is heavily regulated? Can transactions still be processed if mining for new coins is hampered? I am thinking it would be easy to detect illegal mining just like they detect illegal drug-plant farms from the massive use of energy used to power the solar lights. Would BTC survive with only minor mining going on?

It is quite obvious that if BTC will start to consume more energy than USA than people might be, if nothing else, a bit concerned about the environmental effects.

If BTC won't survive, has Ethereum with the future proof-of-stake concept a better chance of surviving government clamp-down?

Those questions have been answered multiple times.

The difficulty depends on the mining power. If there is a regulation and 60% of the miners are away, the difficulty would decrease drasticly within 2 weeks and the other 40% would need less power to mines the blocks. So the mining would not be hampered for a long time.

  Would BTC survive with only minor mining going on?

yes. Only a few people could still mine. The bitcoin network does not really need big mining-pool companies for that.

And you third question is a primarily opinion-based.


transfer between different account I'm living in Turkey and I bought some bitcoins from here.
If, for example, I have a neighbour in America and he bought bitcoin from a different platform, can I transfer my bitcoins to him? And can he transfer it to me?

Yes, Bitcoins are the same no matter where you bought them, and you can transfer them anywhere you want.

(One thing to watch out for, though, is that Bitcoin Cash is a different currency from Bitcoin, and you can't directly transfer one to the other.)


How do you obtain bitcoins? This is a question many people ask when they're introduced to Bitcoin.

Bitcoin sounds interesting, but if I want to use this system I will need to get some coins, otherwise, there's no way I can spend them! How can I start?

Exchanges
You can use an online exchange such as BitStamp for US dollars, as well as many others for dollars, and other currencies.
See the wiki for a full list of ways to buy bitcoins.
Brokerage Services
Brokerage services allow you to buy or sell directly from them instead of relying on a third party to offer the trade with the exchange just taking a cut. One such service is Coinbase.
Local / In Person
You can use tools such as localbitcoins.com to find people near you who will trade cash for bitcoins. (Note, however, that localbitcoins strongly encourages you to use their service despite the fact bitcoin does not require using a 3rd party to do in person transactions)
IRC and Remote Trades
You can use bitcoin-otc's web of trust system to improve the likelihood of a successful long distance trade.  This could help you do trades with people you find on IRC channels or Bitcoin Forum.
Hardware Mining
Mining bitcoins is very technical, and not for many people.  Unless you already have the hardware and technical skill to set it up I would not recommend mining as a way to get bitcoins.
Accept Bitcoin
I believe by far the best way to get bitcoins is to provide goods and services for bitcoin.  This stimulates the bitcoin economy which in turn makes the bitcoins you receive more valuable.


I transferred BTC from my blockchain wallet to my trading wallet using my can to address and it never showed up! Help please! I tried to transfer money from my blockchain wallet to my trading wallet. I even scanned in the QR code so it wouldn't be wrong. My funds never showed up! The wallet it went to seems to have been created the day I did the transfer and since has had many transactions! What the heck happened! I am so confused. How could this have happed with scanning the QR code? It is almost as if the wallet address I sent it to is a receiving account for transfers? Is there such a thing? The other strange thing is I got no emails of any transfers? I have tried to trace the transactions but I don't really understand what I am doing and what it means. Someone said if I have the HASH then I can go in and possibly cancel it if it is unconfirmed. It shows spent now... this was on the 17th and I have sent many emails to blockchain with no response. Should I put the PKscript up or subscript? I can put the receiving wallet up here but I don't think that will do much good unless someone knows a way to find out who it is from that even though it should be MINE! Any help would be greatly appreciated.

If you transferred funds to the receiving address for your trading account, and the transaction is included/confirmed in a block on the blockchain, but not showing up in your trading account, then you need to contact your trading platform.
A few points to remember here:
1: Once a transaction has been included in a block, it CANNOT be cancelled, voided, or "called back." The only way you could get that bitcoin back is if you have the recipient send it back to you in a new transaction.
2: While most reputable exchanges use separate wallets for each client to deposit to & have servers monitoring for incoming transfers, there is always the possibility of a "glitch" or "server goof." As soon as any deposit to your exchange wallet has more that 3 confirmations on the blockchain, if the exchange hasn't updated your transaction, CONTACT THEM, it could be an honest mistake & if so, they'll be more than happy to correct it for you.
3: All responsibility for making sure your bitcoin transactions go to the right place rests on YOU. Since bitcoin is a decentralized platform, there's no central bank/government you can contact if you make a mistake. Therefore, you should always verify ALL of the information (destination address...read at least the first & last 5 digits, coin amount, and coin type [make sure you don't send BTC to a BCH or BSV wallet]) at least twice BEFORE you confirm sending a transaction.


Bitcoin Shop - question I am thinking about how are these all 'bitcoin shops' working.
Imagine i go to a web page called http://bitcoinshop.smth where all i see is:

Price of the Bitcoin
And all i can do is "Buy".

Of course the price of the BTC that they display is the lowest Ask price at the exchanges +X$ Fee they want to earn - makes sense.

Now the question is,
what is happening behind the scenes?

I can imagine two situations:

a) They have BTCs in their wallet, so when i hit BUY - i get their BTCs out of their wallet at the price of the Exchange + their fee.
But what if they bought them for 200$ and the price dropped to 100$ on the Exchanges? How do they manage that?

b) They are having market links to several exchanges and when i hit BUY they immediately place a BUY order on the exchange with the given price. Of course this is simplified as they should be looking into the order book and check the quantities and so on.. but nevertheless.

Still i see some issues: 1) They can't guarantee the order to be filled with the quantity i asked for, 2) They can't guarantee that at the time i hit BUY the price will be exactly as i wanted to buy. Well yes if the price goes down they get the money, but if the price goes up - well my BUY shouldn't be executed as i would have to pay more than i declared.
This reminds me the old-days @ electronic exchanges - there was a regulation for this that the price has to be guaranteed for the buyer, but that's a different story.

Does anybody know how is that managed?
And additional question, what if i come with a request to buy 10000 BTCs,
i wonder how is that managed..

Example Shop:
https://www.4coins.pl/en/

Their wording is a little funny but it sounds like they act as a middle man and cannot guarantee a price until they have facilitated a deal. I assume the conversion rate shown on the main page is only an estimate. In that case they don't have to worry about price volatility as they are putting that burden on you the buyer.

  §4 Terms and Conditions of Service

  The Service uses the services of online payment provider Dotpay S.A.,
  whose office is located at ul. Wielicka 72, 30-552 Cracow, Poland.

  Using the 4Coins.pl via online payment provider user transfer funds to
  the 4coins.pl’s account in PLN currency. The amount received by the
  Service is reduced by 1.9 % of its value as a commission charged by
  the online payment provider.

  Service under an order for the total service credited to the account
  searches offers on the market BTC – bitcoin and mediates on the
  principle of matching user with the available range of offers.

  Due to the nature of the market BTC website does not guarantee the
  execution of transactions on the presented course. Given course is
  presented only in the form of information.

  After the service, the user will be informed about the parameters of
  the transaction, and may order the withdraw of their units BTC –
  bitcoin.


If anyone with your seed phrase can generate your wallet private keys, what is the advantage of a hardware wallet? When you start using a cryptocurrency hardware wallet, you get to write down a seed phrase in some physical medium (paper, metal, etc.) so you can regain access to your funds if you lose the hardware wallet.

If anyone who gains access to this seed phrase can regenerate your private keys in another wallet and get access to your funds, why use a hardware wallet in the first place? Why not just keep the seed phrase well hidden, remove your data from any wallet app and use the seed phrase to regenerate your keys anytime you need to transfer funds? Is it only a matter of convenience and security when actually transferring the funds?

Well, in both cases, your seed words are ultimately the key to the wallet.

If you use a regular wallet, you open yourself up to a number of other attacks

Malware on the device that runs the software wallet
Keyloggers
People shoulder surfing
Backdoored wallet software

Moreover, larger OSes like Windows, Linux, and Mac OS have considerably larger attack vectors than a hardware wallet. Someone may gain access to your machine through some completely unrelated.

A hardware wallet not only minimizes the attack surface, it also makes use of secure elements (the good ones, anyways), which are specifically designed to prevent exfiltration of things like keys. Most computers do not have similar hardware.

Moreover, since the seed generation happens on the hardware wallet, the seed does not pass through a potentially compromised computer. Of course, one must trust that the hardware wallet is honest, which is why it is better to stick with reputable ones, such as Trezor and Ledger.


Is there an easy explanation to understand the different types of pools I would like know if there is an easy explanation on all the different pool systems, their reward systems and how fast they pay without being referred to the Meni Rosenfeld paper

I've written a tutorial a while ago; I will be using some terminology in my answer and it would be best to acquaint yourself with it.

Prop (proportional) is one of the easiest to understand. All miners submit shares, and after the pool finds a block, the reward is divided proportionally among the miners based on how many shares they submitted that round.

PPS (pay per share) is also quite straightforward. Each time you submit a share, you get paid a fixed amount. As I mention in my tutorial, that amount is equal to the block reward divided by the expected number of shares that round. With PPS, the pool operator takes on a lot of risk (e.g if a block is not found in 500% the expected time, the owner is basically paying out a lot without any compensation in return), so typically they will charge a large pool fee (as a risk premium). For instance, BTC Guild charges 7.5% for PPS compared to 3% for PPLNS.

PPLNS (pay per last N shares) is similar to Prop but is designed to combat a major problem with it: pool-hoppers. Basically, since mining is a Poisson process, there's no such thing as partial credit. If a pool finds a block at 10%, it is worth just as much as a block found at 1000%, even though it took 100x less time to find it. So it is advantageous to mine only when the pool % done is low, and then switch to another pool that has a lower % done, because your expected payout per share is higher when the % done is lower. PPLNS solves this problem by making it by (roughly speaking) distributing the block reward not according to who submitted shares in that round, but who submitted submitted the last N shares (N is often twice the expected number of shares per round). I won't go into the full mathematical details here, since it's explained perfectly well by other people.


getnewaddress (RPC) on encrypted bitcoin wallet without wallet password? Say for example an encrypted wallet has 5000 addresses already pre-generated in the keypool.

Can getnewaddress be called via RPC command without knowing the actual wallet password?

I envisage a shopping cart script which calls getnewaddress to provide a customer with an address to spend to. The shopping cart would know the RPC password, but not the wallet password. The shopping cart never needs to spend funds.

If the shopping cart was hacked, can bitcoin be stolen?

Check out Hierarchical Deterministic Wallets (BIP32) and eventually this blog-post to get a better understanding of the implications it brings.

There are many wallets today that have BIP32 implemented. Bitcoin Core is NOT one of them and should probably not be used for the wallet feature.

In the scenario you described, your webserver will provide new public addresses, but will also know the private keys to them. Therefore, if your webserver were hacked, the bitcoins could be spend from those addresses.

With BIP32 you can separate the information to create public keys from the information needed to create the corresponding private keys.
The information to generate the corresponding private keys can be kept in Cold Storage.


What does "lock time" mean? I got a transaction that is still not confirmed for about one week, and I can see a field called "Lock Time" that says:

Lock Time Block: 419382
https://blockchain.info/en/tx/ea445ae61c2906d43f8f8d73cfef2caefe3d63ae504da31a6a829cc35527faf6

What does that mean and how long do I have to wait until my transaction gets confirmed?

A specified locktime indicates that the transaction is only valid after a given blockheight.
Since the locktime field indicated is 419382 and currently the latest blockheight as of 12th July 2016 1108 (AEST) is 420352 the transaction is now valid and can be included in a block by any miner that chooses to do so.


Can I prioritize my transaction in Bitcoin? How can I prioritize my transaction in Bitcoin? Does Bitcoin has any feature that can provide me fees required in case I want my transaction to be sent as high priority?

That is one of the purposes of transaction fees.

Since block space is finite, miners will select transactions with the best Feerate or fee/kB ratio. Of course, this is variable based on volume of transactions and the market rates.

See Fee Rates | Transaction fees


Why is mining described as validation of a block through proof of work when it is the validation that is critical not the proof of work? That is reward for proof of work provides incentives for miners to validate transactions; it does not validate them through proof of work.

You are correct in that the proof of work itself does not validate transactions, that is done separately, so that only valid transactions will be included in the block.

However, the block itself must contain a valid proof of work (the block hash). Without this proof of work, the block would not be valid (even if the transactions are valid). So it can be said that a block is made valid by its proof of work.

Edit: it is worth noting the distinction between the act of performing the proof of work hashes, and the object that is the proof of work (block hash). My answer references the object, not the act.


What are the pros and cons of P2P mining pools? I've heard P2P mining pools are the answer to the current threat of mining pools controlling 51% of Bitcoin's hashing power.  Is this true or not true?  Does anyone have a supporting or critical assessment of P2P mining pools? What are the trade offs? Thanks in advance.

P2Pool allows individual miners to band together and find blocks with the reward being shared directly with the miners who participated in finding the block.  If you didn't contribute a pool share during a round, you wouldn't receive a payment for a block found by the round.  The pool has a lower difficulty than the network but greater than an individual miner.  That is, your miner can be submitting shares to the pool but you won't get a pool share unless one of your shares has a difficulty greater than the pool difficulty.  When somebody submits a share with a difficulty greater than the network difficulty, a block is found and everybody who contributed at least one pool share gets part of the reward.

So the trade-off is a high variance since you only get paid if you were participating at the time a block is found and you contributed a pool share.  And finding a block itself is highly variable since it depends on the total hash power of the pool (luck also plays a large role).

Depending on your hash power, you could run your own p2pool or join a p2pool set up by somebody else.  The advantage of joining a common p2pool is it increases your chance to contribute a pool share and thus share in the block reward.


If an offline, never connected, Electrum wallet is lost, it can still be recovered? I'm just making sure I understand this correctly, since I'm new to Bitcoin.

Lets say there is an Electrum wallet created, but on a machine which was never connected to the internet. This machine is then destroyed/lost/stops working.

The wallet, along with any funds which were sent to it, can still be recovered, as long as one has kept the seed? So this means that the private key is derived from the seed (this is what the deterministic aspect refers to?).

Yes, the private key(s) can be derived from the seed. That's the point of deterministic wallets. The wallet that generated the seed does not need to be connected to the Internet in order for the seed to work.

The BIP32 wiki page explains the actual algorithm used to generate a very large number of private keys from a smallish seed.


Historical data of Kraken (bid-ask) How can I buy or download the data of Kraken bitcoin trades 2015-2016 in cvs format. I need it for my trading strategy (time stamp, volumes, bid, ask)
can someone help me or make for me?

I believe the best option for you would be to write a script which grabs the data from Kraken's API, and parses that into a CSV output that you want.

Using the API to download trade history is explained here:
https://support.kraken.com/hc/en-us/articles/218198197-How-to-pull-all-trade-data-using-the-Kraken-REST-API?mobile_site=true


Is there Windows based mining software that allows you to set precentage of GPU/CPU or set low priority Essentially the title is my question.

I have 3 Windows boxes that already run 24/7 for specific low CPU usage tasks.
Was hoping I could find mining software I could run on them that will not affect their functionality.

If not I might be able to "schedule" mining for off peak times?

Sorry if these are dumb questions but very new to all this.

Bitcoin CPU and GPU mining is not general considered to be worthwhile anymore because of high difficulty.

If you wish to proceed, you could try limiting the mining application to a single core in task manager for CPU mining.  Additionally Some miners have "aggression" or equivalent settings that may be able to limit the resources the process takes.


All else being equal which is better for the environment, Litecoin or Bitcoin? Does scrypt mining inherently confer any environmental benefit or energy efficiency for the same level of service provided?

No. It is exactly the same balancing mechanism: Electricity and acquisition cost vs revenue.
I would expect the total environmental impact to turn out similar for a given revenue value.

But then, maybe I'm missing something. I'm curious for other answers.


Installation of Bitcoin Core 0.18.0 on Ubuntu 18.04.2 error I used "sudo snap install bitcoin-core" and it appeared to install fine except I get the error: "Failed to launch 'Bitcoin Core' Desktop file didn't specify Exec
Field."  Did I do something wrong?  Maybe I am not finished with the install?

This is nearly a pristine installation of Ubuntu.  The only other thing I did was run updates and I installed Konsole prior to installing Bitcoin Core.  I ran the "sudo snap install..." command from Konsole.

Thanks to all.

From the command line, I typed '/snap/bin/bitcoin-core.qt' and now Bitcoin Core is synchronizing with the network. Problem solved.

I still don't know how to repair the shortcut but that is because I'm a Linux newbie.