text:
Specified data directory does not exist - but it does...
anyone ever had a similar issue where the directory exists but bitcoin-cli isn't recognizing it? Perhaps this is related to me setting the folder up as a symlink to my external HDD?
Thank you!
aaronson
-Mac-mini:~ $ bitcoin-cli -regtest generate 1
Error reading configuration file: specified data directory "/Users/---/Library/Application\ Support/Bitcoin" does not exist.
-Mac-mini:~ $ cd /Users/---/Library/Application\ Support/Bitcoin
-Mac-mini:Bitcoin $ ls
banlist.dat bitcoind.pid    chainstate  db.log      peers.dat
bitcoin.conf    blocks      database    debug.log   wallet.dat

Do not use backslash and space symbols in folder name

@aaronson If that was the solution, can either of you turn it into an answer so it can be marked accepted?

Do not use backslash and space symbols in folder name

I just encountered this issue, too, and removing spaces (escaped or otherwise) appears to have solved the issue.
Like the OP, I was using a path containing Application\ Support.
$HOME/Library/Application\ Support/Bitcoin is the MacOS default, though, so hopefully most people won't need to set that explicitly.

Curiously, though, datadir seems to be autogenerated in my bitcoin.conf file every time I run bitcoind.
That leads to issues on future runs whenever I'm using the default path, which contains Application Support


text:
Can I spend my bitcoin without knowing how to get into my bitcoin wallet?
Any advice would be greatly appreciated.
I bought bitcoin about 2 years ago. Put it in coinbase wallet. I have the lost my ability to log in and cannot remember my old phone# to reopen the wallet. I DO have my "share code #" for the bitcoin and I DO have the "Long"#.
Am I out of luck to get access to my bitcoin or is there another way to spend it or transfer it because I have the 2 different codes?
Can I spend my bitcoin without knowing how to get into my bitcoin wallet?
Please give me feedback THANKS!

Technically the Bitcoin can only be spent if you have the private key for the address. The private key is stored in a wallet. If you do not have access to that wallet then you will not be able to spend the money.
Try to contact the customer service of CoinBase to see what you can do with the information you have, also tell them if you have made any backups or wrote down any initial parameters (do not give away the exact parameters as it might be used to recover your wallet, just the fact that you have it or not).
Update:
In the comment below you mentioned they told you to never tell anyone the "Long"# you received, this is good, it is very likely to be a private key (about 51 random lowercase and uppercase letters and numbers) or some kind of "seed" (English words).
In case of the former you need to download a client and try to import that key. If you have the disk space (133 GB) I suggest using the official Bitcoin Core client, then after the initial synchronization finishes load your private key in the debug window follownig the How do I import a private key into Bitcoin-Qt? question. (Note: you are really likely to need to skip step 5 as your wallet is not encrypted.)
For the latter (if the "Long"# is a "seed") you need to use the same website/software you used when generated it but I really cannot help you out more than directing you to the customer service.

I think the question is whether it is possible to recover the private key using the information that OP has.  It will depend on what those numbers mean in the context of Coinbase.

@NateEldredge: Thanks, I updated the answer.

I DO HAVE 2 KEYS. (One is a "share code" - a shorter #) and (I have a long # - i was told to never give that out)  - Maybe the long code is the private key. Can I spend them with the long # or do I have to be able to get into the wallet?

(@JLBryan: comment is too short for a response, updated the answer.)

Thank you so much Gábor - I'll give it a try and let you know how it worked out.

GABOR HERA, THANK YOU SO MUCH!!!!! IT WORKED. I was able to retrieve my 4500 bitcoins!  - Just kidding - only 1  : ) but $2500 is $2500. Thanks again.

I am happy you got it back :) Could you please mark this answer as correct then? Thanks!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
About wallet architecture of cryptocurrency exchanges
It is my understanding that exchanges have one "omnibus settlement wallet" or multiple wallets assigned to individual users and exchanges have control over these wallets.
Of course, if any exchange opts for the omnibus settlement wallet, it usually assigns addresses to users so that they can transfer funds in and out their "wallets", the ultimate ownership of which of course belongs to the exchange.
Are these two designs the most commonly used wallet architectures for exchanges? It would be grateful if somebody could advise me on this wallet architecture issue, preferably about what the best practice for the architecture is these days.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
What if the bitcoin blockchain grows to the point it cannot be decentralized anymore?
I read the bitcoin white paper and am in the process of readin ethereum's. The second paper reads at one point : "Currently, this is viable for some desktop computers and not phones, and later on in the future only businesses and hobbyists will be able to participate."
Doesn't this mean that some day the remaining blockchain nodes will only be controlled by the very few ones that have the money and infrastructure required, as the smaller nodes won't be able to stay on the long run ?
Doesn't this mean that as time goes, the blockchain becomes less decentralized and more centralized ?
If so, another consequence would be the decreasing security of the blockchain : the remaning powerful nodes would gain the ability to fake transactions, right ?

How Bitcoin will scale into the future is a topic of much debate.  I will try to steer clear of too much opinion, and just give you the basic factors at play.
First, understand that there are different types of nodes on the Bitcoin network.  There are nodes that mine, there are nodes that keep full copies of the blockchain, and there are thin client nodes that only store the information required to maintain a single wallet.
The thin clients are what make up the vast majority of network participants, since this is what a normal user of the Bitcoin network will be running.  Since they don't store the blockchain, they don't care how much it grows.  The other two types of nodes are the ones where we are concerned with centralization.  They are what really represent the infrastructure of the system.
First, there are "full nodes", which keep full copies of the blockchain on hand.  These nodes provide requesting clients with historical blocks and transactions stored in their databases.  They also relay current transactions and blocks to other nodes, and verify the validity before passing the data on to other peers.  This provides the "plumbing" of the network and a first line of defense against malicious network participants.  It should be stated that there is no direct financial incentive for running a full node, yet it does require you to store the full blockchain (although some pruning is okay).
Second, there are mining nodes.  As the network has evolved from the specs laid out in the original whitepaper, mining nodes have become hyper-specialized.  Where at first, all full nodes had the option of mining, nowadays nearly all mining is done by mining pools.  These pools run their own networks of participants, and those participants only deal with hashing blocks they receive from the hub of the mining pool.  The nodes actually doing the mining are not running full nodes, but are relying on the mining hub to run full nodes and participate in the Bitcoin network.  Although the miners, themselves, can be very decentralized, there is already a certain degree of centralization of mining pool operators.  However, this is not due to the size of the blockchain, which is a negligible cost to a mining pool.
So, as the blockchain grows, it makes it less and less feasible to run a full node, yet this is not a problem for mining nodes and pools.  Full nodes are not paid for their service, so it becomes harder to justify running one if the data storage becomes expensive.  Luckily, data storage costs trend downward at a geometric pace, while the blockchain grows linearly (currently ~1MB/10min).  This means it is still feasible to run a full node for the foreseeable future.
I should also note that although there isn't a direct financial incentive for running a full node, there are several indirect incentives.  Running a full node allows a network participant to operate in a trustless manner.  This is important to many people for a variety of reasons.  For example, any online wallet or exchange company would typically need to run their own full nodes so that they don't have to rely on others for their core business.  There are many other reasons to run a full node as well, which will help to counteract centralization.

Time will tell then! I understand why there is a debate now. Thank you for this very thorough and clear overview of the subject. I couldn't hope for a clearer answer!


text:
Someone said they would send me bitcoin, they sent me a exe file, called bitcoin.exe, and it is not running
They said they saved bitcoin in that exe file. How do I access this bitcoin? They also created other bitcoin exe files with different names. Thank you

This sounds like a scam, or at least, an attempt to compromise your computer with malware.
Sending someone a Bitcoin transaction does NOT involve sending someone an executable file. It involves using the bitcoin network to send a bitcoin transaction that moves some amount of bitcoin to addresses owned by the transaction's participants.
You can generate receiving addresses, or send transactions of your own by utilizing bitcoin wallet software. You should download this software only after learning about how to use it, and finding a reputable place to download it from. In pretty much every case, you should not download and run a .exe file sent to you by an unknown person. If you have already done so, you should consider your computer compromised, and never use it as a bitcoin wallet otherwise, you will need to find a clean device for that purpose.
For more information on getting started with Bitcoin, see: I am new to Bitcoin, how can I get started?

In increasing order of scepticism:

most charitably, maybe they sent you a nice exe that unzips to make a bitcoin client, and includes a bitcoin keyring('wallet') with some keys giving you access to bitcoin on the chain. I wouldn't even know how to do this, but it seems possible. I doubt your 'someone' has the necessary skills.
less charitably, they just saw a bitcoin.exe on their computer and figured that would be enough to send you, with the intention of sending you bitcoin after you had the client running (you need to generate the receiving address first).
it's malware. In this case, you're irrevocable compromised already. Where you go from there is up to you. I would reformat the whole system, but my system already has bitcoins and other sensitive info. Yours might not - just remember the malware will always be there, so in future any bitcoins you get might disappear.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How blocks are created and broadcast?
Followings are some of my understandings about how bitcoin blockchain works, and want to confirm. Appreciate your comments and thoughts.
In the blockchain, every peer receives both transactions and blocks. A peer will store the transactions they received into a local buffer, keep them ordered, and organize them into blocks. Then, if this peer successfully solves the mathematical puzzle, it will broadcast the block it has. Otherwise, if this peer receives a block, it will update the existing transactions in its buffer according to the transactions in that newly received block. Please correct me if I am wrong.
If the above process is correct, does a peer broadcast only 1 block each time when it solves the mathematical puzzle, or it can broadcast multiple blocks? If a peer can only broadcast 1 block, what if the peer has created multiple blocks since last time it has received or broadcast any block?

It would first have to broadcast the first block. The way it works, the hash of the first block (including the nonce that is needed to solve the puzzle) would included in the second block. So the miner can't create the next block without first solving the puzzle for the first block because that's the only way to get that nonce.
So you can't work on two blocks and broadcast them simultaneously. The blockchain defeats that (that nonce which you can't tell till you have actually solved the block). You can work on two blocks to find the next block faster (although I doubt it's really reasonable since you have two split your hashing power between the workloads).
Now it's possible to broadcast the first block and find the next one  or two in quick succession. This happens. Finding the hash is brute force. It's a game of probability, which is basically just a fancy word for chance.

In the blockchain, every peer receives both transactions and blocks.

Yes, nodes receive transactions and blocks from peers on request.

A peer will store the transactions they received into a local buffer, keep them ordered, and organize them into blocks.

Yes. A node stores unconfirmed transactions in the memory pool.

Then, if this peer successfully solves the mathematical puzzle, it will broadcast the block it has.

Yes. A node that finds a nonce yielding a block with a hash value within the target range will send it to connected peers, and they will relay the block further.

Otherwise, if this peer receives a block, it will update the existing transactions in its buffer according to the transactions in that newly received block.

Yes. If a block with sufficient proof-of-work is received, it will be accepted and a new round of hashing will begin to extend the new block.

If the above process is correct, does a peer broadcast only 1 block each time when it solves the mathematical puzzle, or it can broadcast multiple blocks?

A node will publish any number of blocks that extend the tip of the active chain. For example, if a node gets lucky and finds a block immediately after the last one, it will publish two blocks - a parent and a child.

If a peer can only broadcast 1 block, what if the peer has created multiple blocks since last time it has received or broadcast any block?

A node can publish any block at any time. Whether or not peers accept the block is a different question around which the topic of "consensus" revolves.

Importantly it is generating a random solution to an insolvable "problem" that creates the non-deterministic authorization for a single node to publish a block that is acceptable to the rest of the network (ie. the lottery). "Mining" is a misnomer.
Some methods of attempting to exploit this have been discussed, but most prove impractical or inefficient. Some of these methods require winning nodes to hold back the winning block in an attempt to publish a valid fork of the blockchain unknowingly to the rest of the network. So what you describe is possible, theoretically.
https://bitcoin.org/en/glossary/51-percent-attack
https://btc-hijack.ethz.ch/
https://www.reddit.com/r/Bitcoin/comments/7uzm6o/game_theory_and_network_attacks_how_to_destroy/

If a 'miner' wants to solve two blocks then this has to be done one after the other.  Indeed, solving a block implies that you find the hash-vale for that block that fulfils the condition of being smaller than a certain threshold (or, equivalently that the hash starts with a pre-specified number of zeroes). This is the 'proof of work'.
But, every solved block contains not only the transactions and a nonce, but it also contains the hash of the previous block in the chain.  So if a minder wants to solve two consecutive blocks it must first solve the first block, put the ('valid') hash of that block in the next block (this can not be done before solving the first block because else you do not know this) and then solve this next block (that includes the valid hash of the previous block).

So the miner can only start solving the second block after it solved
  the first one.

Of course a miner could decide to do so and try to find to consecutive blocks and then broadcast them (in the right order, because else they are invalid) to the network, but if in the meantime another miner solves a block, then these two blocks arrive 'too late' and will not be appended at the end of the blockchain.
The risk of arriving 'too late'' is significant because - by the above-  that particular minor has to solve two blocks before any other minor solves one block.

A miner can only create a new valid block by solving the 'puzzle' (Proof of work) for that particular block. To broadcast more than one at once, it would have to have found a valid hash for both blocks, otherwise one of them would be invalid. The difficulty of the puzzle is chosen so that a block will roughly be found once every 10 minutes in the entire network.
I believe the 'buffer' you are talking about is the mempool. This holds all transactions that a node has seen which haven't been mined into a block (they are the unconfirmed transactions). Once a node receives a valid block from a miner, those transactions are no longer kept in the mempool.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How to transfer BTC between paper wallet and an exchange?
I am new to the paper wallet, and have a few questions about how to use it. Concretely， I am following the instructions here (https://walletgenerator.net/) to generate a paper wallet for BTC, but I am wondering 1. How can I transfer BTC back and forth between my paper wallet and the GDAX exchange, and 2. Is there any fee to do such transfer? Thanks!

Paper wallets are often a very secure way of storing bitcoins for the long-term but not for two-way transactions.
You can easily transfer bitcoins into your paper wallet from GDAX by going to WITHDRAW FUNDS and putting in the public address part of the paper wallet.
Sending bitcoins to GDAX from a paper wallet is more complicated.
You will need to import your private key into a real client.
Once you imported the private key into your client wallet it will allow you to spend your bitcoin and send it to the address provided on GDAX.
Current fees for bitcoin transaction can be found on miningfees.com

Exodus also allows gives you the added option to convert to other crypto-currencies.  It works like a currency exchange, using Shapeshift.
Just be mindful that not all desktop wallet clients are created equal.  You'd probably be fine using Exodus but often, you sacrifice security for convenience.  Make sure you are using a decent antivirus program for your PC and that ought to be sufficient.  But I would not keep very large balances on a desktop wallet for an extended period of time.

Assuming you have already created a paperwallet using the Bitaddress software download, located on Github (pointbiz), you will need to find out if GDAX has a wallet service for its customers.
This wallet would be a wallet you created on GDAX using the exchange's wallet service. Not all exchanges offer a wallet service. I know CEXio doesn't. you will need this address to send bitcoin FROM your paper wallet TO the exchange wallet. So how do you use the private key on a paper wallet, to send funds to the exchange wallet?
Firstly, in order to release funds from your paper wallet, you are going to need to use a thin client (desktop "hot" wallet client) for bitcoin, like Electrum, or Exodus, to name a few. Exodus is the most user-friendly desktop wallet for beginners.
Learn how your chosen desktop wallet works and generates key pairs because you are going to need to either SWEEP you paper wallet's private key in to the desktop wallet or you will need to IMPORT your paper wallet's private key into the desktop wallet. The decision to do one vs the other depends upon how the desktop manages private keys.
To summarize; go to https://www.exodus.io/releases/
download it, it's free! Follow instructions carefully and make sure you are comfortable using the software before importing/sweeping your paper wallet's private keys into Exodus. Once you have done that step you can use exodus to send bitcoin to your exchange address.


text:
Why Satoshi Nakamoto does not want to show up?
The Bitcoin was originally created by Satoshi Nakamoto, and is now becoming a very popular thing. However, I am wondering why the creator of the Bitcoin chose to use a pseudo name as Satoshi Nakamoto, instead of using the real name to make himself or herself famous?

Since this is a question that only Satoshi can answer himself, I don't think this is will find a reliably answer here. As far as I know, Satoshi neither announced his departure nor gave a reason.

Satoshi is a SPOF so he hide himself.


text:
How a transaction proves its ownership of the its source, which can be one or multiple unspent output?
I read the following from the book << Mastering Bitcoin >>

"As you may notice, the transaction contains an empty scriptSig because we haven’t signed it yet. Without a signature, this transaction is meaningless, we haven’t yet proven that we own the address from which the unspent output is sourced."

I am wondering how a signature can prove that this transaction owns the address from which the unspent output is sourced?

Assume you understand how public-key cryptography works. In short, one can verify the ownership of an address by checking the signature. A valid signature can only be generated by the private key owner.
The detail of signature verification in Bitcoin is described here
Without digging into the details, OP_xxx are stack operations. For example, OP_DUP is to duplicate top of the stack. Basically it

first hashes the public key by operation OP_HASH160 and check if the result is identical to pubKeyHash by operation OP_EQUALVERIFY
then verifies sig and pubKey by operation OP_CHECKSIG

You can read more about OP_CHECKSIG here

Please elaborate on what the links explain in the answer as well. As it stands, this answer is not helpful if the links stop working.

The ownership is proven for each input by providing a valid signature in the scriptSig field. If one of the signatures is missing, the whole transaction is invalid.
The scriptPubKey for each output in the example you provided is locked to a Bitcoin address. A Bitcoin address is, in a nutshell, a hash of a public key. So, in order to provide a valid signature, the secret key belonging to the same key pair of the public key referred in each input is required.


text:
Why Segwit makes blockchain faster?
In Bitcoin blockchain, Segwit takes the script, which containers the signature and sender's public key, out of each transaction and stores them into an extended block. However, why having an extended block can make the blockchain faster? Since I think each miner now has to process the original block plus the extended block, thus the amount of data each miner needs to be processed has not been changed. Please advise!

First of all, your understanding of segwit is incorrect. There is not extended block, the witness data is still part of the transaction.
Segwit also does not "make the blockchain faster". What part of it does is it redefines the maximum block size metric to be something called block weight. Witness data is weighted differently from non-witness data, which means that a block containing witness data will have more spare weight units to contain more transactions. This means that Bitcoin's transaction capacity will increase, as will the size of blocks.

It may be worth pointing out that while it doesn't make anything faster, it very intentionally does not make the worst case validation time much worse (i.e. the worst case per transaction is faster with than without).

If Segwit does not "make to blockchain faster", what is the benefit of Segwit? In other words, what 's the benefit of increasing Bitcoin's transaction capacity?

It means that more transactions can fit in a block, which means that more transactions can be confirmed at once. This does not make anything faster; it makes Bitcoin able to confirm more transactions simultaneously.

I see, but why can't we say that confirming more transactions at once essentially makes the Bitcoin blockchain faster?@AndrewChow

Because the blockchain a) has no speed and b) nothing is getting faster.


text:
Programming Languages used
Is there a reference that can give me information on the programming languages used in Blockchain development?
For example, Bitcoin is C++, Ethereum makes use of C++, Golang and Python, whilst its smart contracts are based usually on Solidity, Serpent and LLL.
What about other (more enterprise based) implementations? Ripple, Hyperledger, Quorum, Multichain, Monax.

I think you are confusing some things here. A blockchain like Bitcoin, Ethereum, Ripple, or Hyperledger is a protocol in first place. And a protocol is agnostic to programming languages used.
What you are relating to are reference implementations of the protocol. The Bitcoin protocol has the famous Bitcoin implementation (later Bitcoin Core) initially written by Satoshi Nakamoto in C++. But there are so much more clients available in so much more programming languages.
Ethereum, for instance, has three reference implementations, the Eth client in C++, the Geth client in Go-Lang, and the PyEthApp in Python. And there are even more implementations in Rust, Ruby, etc. available.
I could go on with the other blockchains you mentioned, but you get the idea. A protocol can be implemented in any suitable language if desired. If you want an exotic example, have a look at Lisk which tries to build the full blockchain stack in pure JavaScript.

An interesting case is R3 Corda, which is written in a not-so mainstream language Kotlin (recently added to the Android development kit). Some use functional languages like Scala and Haskell.

and Aeternity uses ERLANG to code their crypto currency. A language designed by Ericson for telecom applications.

Thank you for the clarification, I was indeed confusing some things, but this is also the information I want. So by all means go on. If I understood correctly, implementations are built on top of the protocol and can be programmed in various languages. Am I right?

Yes, that's what I tried to say with that answer.


text:
How to delete a specific wallet in bitcoind
I accidentally created a new wallet with
$ bitcoin-cli -testnet createwallet help
{
  "name": "help",
  "warning": ""
}

Now I would like to delete it without deleting the others I already have, means without deleting the whole wallet.dat. How can I do this?

Each wallet has its own wallet.dat file as well as some other files. You can delete a wallet by deleting those files.
First go to the wallets directory. This will either be a folder named wallets inside of the data directory, or the data directory itself (there will not be a folder named wallets in that case). Inside the wallets directory will be folders each named with a wallet's name.
To delete a wallet, delete the folder in the wallets directory with the name of the wallet you want to delete (in this case, help). Note that you must delete the entire directory, leaving the directory there or any of the files it contains will result in errors.

Thanks. So I assume there is no rpc to achieve this with bitcoin-cli. Any special reason this rpc doesn't exist?

There is no RPC because we generally do not make it easy for users to delete private keys. This can lead to a loss of funds, so any methods of removing private keys requires doing extra work.

even after removing the wallet directory along with its contents, bitcoin-cli listwallets still shows it though :(

@papiro listwallets will list wallets that are loaded in memory. You need to have first unloaded the wallet using unloadwallet, then you can delete it. Additionally, you should remove it from your bitcoin.conf file if you have specified it there as otherwise the wallet may be recreated the next time you start Bitcoin Core.


text:
Multiple pool options in Antminer S9 Settings
I have purchased and got running Antminer S9. While setting it up I notices that I can specify three pool connections

I was unable to find the purpose for this.
Are those backup options just in case one or two pool connections are down or should I could actually mine for three pools at the same time?

The AntMiner S9 manual is available at https://shop.bitmain.com/files/download/AntMiner%20S9%20Installation%20Guide.pdf
The manual says:

The AntMiner S9 can be set up with three mining pools, with decreasing
  priority from the first pool (pool 1) to the third pool (pool 3).
The pools with low priority will only be used if all higher priority
  pools are offline.

On older S-series models there used to be a "Pool Balance" setting on the pool screen, below the "pool 1", "pool 2", "pool 3" in your screenshot. From the manual for the old S3:

AntMiner can set up three mine pools, the priority decreases from
  first pool (pool 1) to third pool (pool 3). There are three Pool
  Balance option:
Failover: Automatic backup when Miner faults;
  ‘Failover’ is by default. The low priority pool will start to work,
  only when the high priority pool encounter fault.
Balance: Change
  multipool strategy from failover to even share balance.
Load Balance:
  Change multipool strategy from failover to quota based balance.

I do not know why this feature was removed in later models.


text:
Graph Interpretation on Slush Pool
I understand that a dar red line on Slush pool hash rate means a block has been discovered by the pool.

What does the blue line mean around 5AM?

These are called Namecoin blocks and you can see your reward for all those blocks by checking out your reward section. You'll see a toggle above the rewards table on the right to switch between Bitcoin and Namecoin blocks. These blocks have a much lower value than normal Bitcoin blocks and so your reward is very small. The number of confirmations needed for these blocks is also very small compared to normal blocks. They are a by-product of Bitcoin mining and the pool uses a service to automatically exchange them for Bitcoins.


text:
US Power Supply for Antminer s9
I have ordered Antminer S9. After doing some research I discovered that APW3+-12-1600 PSU 1600W is a recommended power supply however it requires 200+ voltage which is not available to me.
I live in the US and the standard wall socket output voltage is 110V.
Could you recommend a power supply that  would work well with S9 in the US without impeding its designed performance?
A recommendation or a reference to a working guide would be highly appreciated.

I disagree with the close vote, as the asker specifically tells us what the problem is he wants to solve and what he tried before. The product recommendation questions we don't want are: "What is the best X today?" The ones along the lines of "I need any solution to solve problem P, XYZ didn't work" are okay.— Recommendations in answer MUST solve asker's problem and explain how they arrive at recommendation.

This a valid question that I am looking for an answer to. Agree with Murch.

I am going to answer my own question and hopefully it will come in handy for someone else.
While I understand that it might be a bit of an overkill pricewise but this solution works for me and has been working for 6 month now.
I power each of mine Antminer S9 with EVGA SuperNOVA 1600 T2 80+ TITANIUM
This is how it looks at home https://www.youtube.com/watch?v=d3c2FBScdjk and at a data center: https://www.youtube.com/watch?v=EfgCPPlDYPw

I live in North America as well and just wanted to let you know that even though 110V is the most common wall socket voltage you've actually already got 220V coming in to your house.  There are 2 110V lines 180° out of phase from the other ... yadda yadda, some technical mumbo-jumbo...
Long story short, as long as you live in a building where you have access to the breaker box you should be able to add in a 220V circuit to power your miners, you may already have a couple in there for an electric range or drier, etc.
If electrical work is not your forte you should be able to get an electrician in to get you set up fairly easily, the hardest part is deciding where you want to access the power from and then routing the wiring there.
Hope that helps!
-J

thanks James, as it turns out I was unable to run a miner in my apartment at all: 1: heat and noise are not acceptable for a residential setting 2: I do not have an available electric rail that is capable of supporting this power consumption. I am already running microwave and AC on separate rails. I ended up renting a space in a data center. But I was more concerned with a model of a power supply I could get to power an S9 (which turns out to be EVGA 1600)

Doesn't answer the question.

I was running AntminerS9 on 120 volt without any problem but it will consume almost 12 Amps. Normal home supply is only 100Amps so in order to save amps I had to change it to 220 volt by installing new circuit breaker. With 220 volt it will consume only 6Amps (approx)

Power = Current x Voltage --> 6 Amps @ 220V = 1320 W , 12 Amps @ 120V = 1440 W --> so yes, the efficiency of the AC to DC  power supply converter apparently is working at a better operational point but to get 220V you are probably running through a voltage transformer (120->220) which considering an Ideal No loss Transformer, on the lower voltage side coil will still be consuming 1320 W / 120V --> 11 Amps.

In North America, virtually every home has two 120 volt phases that can be combined into a 240 volt supply with no power loss.

In North America, the two halves (each 120 V nominal) are NOT out of phase.  They are simple the top and bottom halves of a center-tapped transformer sitting outside on a pole or in a big green box on the ground.  Go outside and look at it.  The power company gives you one wire (plus a ground) to their transformer and two (plus a ground) leaving it going to your house.  The coil on the half of the transformer facing you is tapped to ground ("earth" in non-American English) in the center with nominally 240V across the whole transformer, and 120V on each wire. This has nothing to do with phase. The other side of the transformer (facing the line) has at least 7000V (or as much as 45,000V), and is tapped on one end - with the other end going to a SINGLE WIRE for a single phase from the power line.  If you see three wires plus a fourth one below, you are looking at three phases, but unless you are in an industrial setting (Lathes, BIG welders, mills, data centers, etc.) only one wire comes into your home or apartment building.  If there are three phases going into a building, you will see three transformers on the pole or poles.  Look at it and see - all the outside wires are exposed and you can photo them with your phone from the ground and zoom in to trace the wires.
Once inside, the breaker box, or panel or sub-panel will have a main breaker (kills all the other ones).  The number of Amps rated on that main will be the 80% of the max loadable Amps at 240V (nominal) and the total Wattage is that number times 240V.  In other words, if you follow this so far, you can fully load TWICE that many amps at 110/120V - assuming constant load and even distribution across smaller breakers.  Note also that every breaker (by code/law) has 20% leeway between the label and the actual trip amperage, (again, don't trust me, pull one out and look at the label on it) so if you have 200Amp sub panel for your house or condo, you might be able to get 440Amps of 120V equipment loaded before things start to smoke.  Keep in mind, mfg tolerances, age, loose screws or push connections, etc. AND, while you are reading the 20%, etc on the side of that breaker, you will note that it will have been made in Mexico at a location in a state that does not enforce a minimum wage or allow effective union negotiations - so figure that into the tolerances.  In other words, if you push it anywhere close to the maximums, you should not sleep where you mine, and you should have good fire insurance - especially the liability portion.
25 years building data centers.


text:
Setting up Bitcoin Miner in a data center
I have been running Antminer S9 in my apartment. It is too noisy, to hot, and it ruins the ambiance of my home. So I did some research and found a data center that can host my miner.
At home I access Antminer through my private IP through my router. However, in the data center I will have to get a public IP. I will have a strong password for the Antminer but I am still worried for having my ASIC publicly exposed to the world (DoS attacks etc).
I talked to a person in the data center, setting up VPN will further erode my profit margins. It is already expensive.
My questions to the community are:

Is it dangerous to set up a remote Antminer in a data center with a public IP?
What is a typical network set up when I want to host my equipment remotely?

Which data center did you find? Since no one has helped you, what did you find out about remote access? You know you can just have a PC server on the lan at the data center and remote into the pc using vpn and windows remote desktop (or whatever), right?

Yes. I definitely wouldn't take the chance. Minimum is a possibility of a DoS attack. I'm not familiar with the Antminer firmware and how that's setup, but you could possibly get hacked in your WebUI. Then they could point your miner at their pool.
Yes, a firewall with VPN capabilities and a switch are your typical data center networking setups. You don't really need to set it up that way. You could use a simple home router and turn the WiFi off. Then attach your Antminers to the router. If the router has VPN capabilities, then use that. Otherwise you can setup a computer in the data center to with TeamViewer or LogMeIn. Then you can remotely access your devices through that.

any router you would recommend for this set up. I periodically have problems with almost any router at home that requires a reboot once in a while. For this application I must try to minimize the necessity of human envelopment since the equipment is remote and datacenter tech support costs $$$

I haven't actually tried this setup yet (hopefully will soon), so I don't know for sure. I do know that I have a Netgear R6220 at home and I love it. Hardly any problems and it has VPN capabilities that I have used a little bit. Might be overkill though since you don't need any of the wireless functionality.

authors: نورالدين علي حسين المطهر


text:
How to select minimum difficulty when mining with Slush Pool
I am mining on a single Antminer S9 with Slush Pool.
There is a setting called "minimum difficulty":

When I read their manual, item #8 states
The pool automatically assigns difficulty that corresponds to the hash rate of your miner.
My scoring hash rate and hash rate are consistent with what the manufacturer of my mine advertises: 13.5 TH/s

and my default difficult is set too be 128.
However when I proceed reading their manual further I find that minimum difficulty should be set at 1024 for 1TH/s and then increases linearly with the hashrate.
According too the table my difficulty should be 13 times 1024 which is 13312. This is way higher than the pool determined 128.
What should I set the minimum difficulty be?
I tried to understand what minimum difficulty is but I was unable too find a clear and simple explanation what this number represents.

From the research I have done to understand the minimum difficulty it boils down to a balance between server/client bandwidth limitations and time to put at risk.
The pool which you connect to distributes work for miners to solve. The more difficult each "package" of work sent to you, the longer you will take to find a solution and reply back to the pool with this solution, named share.
As explained in this Post you will on average be rewarded the same solving problems of 10k difficulty at 10 seconds per share, as solving problems of 1k difficulty at 1 second per share.
On the Antminer s9 Miner Status Tab the stats I believe, it may not be correct, I have deciphered are the following:

Summary:

Elapsed - Time passed since online
Utility - Number of Accepted shares per minute
WU (Worker Utility) - Total Difficulty Submitted (Accepted + Rejected) per minute

Pools:

Accepted - Number of Shares Accepted by the pool
DiffA# - Total difficulty of accepted shares
DiffR# - Total difficulty of rejected shares
Rejected - Number of submited Shares rejected by pool

either good hashes of bad work or bad hashes of good work

Discarded - Discarded Work that has not been worked on. According to a developer of cgminer, meaningless.
Stale - Number Shares that were sent after a block was already solved.
LSDiff - Last Accepted Share Difficulty
LSTime - Time since Last Accepted Share

You can now check to see which difficulty the pool has automatically assigned to you in the Miner Status Page.
So back to the initial question / response of the "optimum" difficulty is a balance of how many packages back and forth the network connection between the server and client is comfortable with handling and time to put at risk.

If the difficulty is very low, the network and server will be flooded with shares of solutions you have found and may reject some as it can not handle so many packets per second.

So some work you have done in solving problems has gone to waste as these solutions have been rejected.
you are spending some time waiting for recieving new work from the server and also spending time sending the solutions to the server that could have been used for finding solutions.

If the difficulty is very high, you may be working on solving a problem which no longer needs solving and so you will get no credit for the work. As far as I understand, these submited shares would be marked as Stale or Perhaps Rejected.

Currently a new bitcoin block is found every 10 minutes or so, sometimes under a minute sometimes more than 15 minutes. So, if you set the difficulty to a value which allows you to generate 1 share per minute --> Utility = 1.0 then when blocks get found under 1 minute, you have lost that minute because the pool will generate new work with the latest new block to mine and the work you were working on that you couldn't complete in time would be useless. But if the next block were found in 1 minute and 2 seconds, you would have only lost 2 seconds theoretically cause you would have probably managed to submit a share.
So, ultimately you don't want to overload the pool but you want to make sure that you risk as few shares as possible.
Your Risk would be approximately = "1 / ( Average Accepted Shares per minute * Average Minutes per Block )"
From my experience hashing at 13.5 TH/s at a difficulty of 13.3K will produce approximately 1 share every 4.5 seconds or so --> Utility = 13.5 --> "WU = 13.5*13312 = 179712" , Risk of approx 0.74%
To optimize your difficulty you should look to maximize the WU : Worker Utility Value. Theoretical Max WU you can achieve is approximately 1 per 71.6 MH/s, so a 13.5 TH/s machine can not achieve a better than a WU of 197706.
I currently have a system configured at 10k Difficulty with a Utility of 18.0 obtaining a Worker Utility of 190k, mining at KanoPool. I have aimed for 18 shares per minute as that is what is recommended by the pool.
Just though I may contribute my research on the subject incase it helps :)
Disclaimer: This response are just compiled bits from forum replies, github code and other bits here and there I have found and my own understanding of how it apparently works. This is not necessarily 100% correct information.
Some of sources:
- CGMiner Github Repo
- BFGMiner Github Repository
- BFGminer Forum talk

That's just the minimum that the pool will assign that worker, not the difficulty that it's actually working on. You can find that in your miner status page, under "DiffA#" which shows the difficulty of the last accepted share.
Generally you should not need to change the minimum. It's there in case the pool is having trouble determining what difficulty to use.

According to my research, LSDiff - Last Accepted Share Difficulty, ..  DiffA# - Accumulated Work difficulty solved and accepted.


text:
How does mnemonic recover a single private key?
As I understand the algorithm of mnemonic (BIP39) can generate billions of private keys from your 14-24 words.
Whats the mechanism that some wallets/clients use to recover a single private key, my private key?

Typically, they just pick the first one that the mnemonic generates.


text:
How blockchain.info calculate the value transacted
Having this address: https://blockchain.info/address/19tqZYnP9youKtbene2FZiZtZyJYaLeBDw
The last transaction says that this address received 0.0236 BTC
But even knowing the value in and the value out I am not able to calculate that value:
https://blockchain.info/tx/831c976cb54f27e5a496db749fc9e865c8e077006225d1dfaf61d998fe5a3186
In:
---
15Rhv2dsEjFaHzMhPsjGmFxgqCRhCmggjj (0.04583825 BTC - Output)
13LwYeB93Bmo2aWqGyK1ybtF9JiupPFVey (0.029625 BTC - Output)
1BxdV34eTe1YJBJpScGx6jRRVDQBeRf5qj (0.00696224 BTC - Output)

Out:
----
1BTvKHzbfm3RjPMxDZSsG2YYuaEHgfdJNP - (Spent) 0.00045884 BTC
1NCLWFw6F2nJ2pgBWy96K37rbx7VSLZs66 - (Unspent) 0.00239111 BTC
1D7BNbWBPuL22TW6WuoSq5sRrbPAxeJw8g - (Spent) 0.0156 BTC
19tqZYnP9youKtbene2FZiZtZyJYaLeBDw - (Unspent) 0.0236 BTC
1wLbaePtYhh2t5Cgd5NF59LX6Pooe1yLH - (Spent) 0.00920259 BTC
3HXAkXTYvtLzYuudDfNZBMSoueUtvdwXAz - (Unspent) 0.03036754 BTC

What I tried is sum all the In's and then substract the Out that has been spent and the fees.
What I am doing wrong? How I can calculate 0.0236 BTC

You do not have to calculate the in/out values to see how many bitcoins have been "sent" to an address.
You see, outputs from a transaction can be "locked" to a specific address. However, the address page on blockchain.info shows all the transactions that have resulted in an output being locked to that address.
In the most recent transaction on that page, you can see that one of the outputs has been locked to that specific address:
Out:
----
1BTvKHzbfm3RjPMxDZSsG2YYuaEHgfdJNP - (Spent) 0.00045884 BTC
1NCLWFw6F2nJ2pgBWy96K37rbx7VSLZs66 - (Unspent) 0.00239111 BTC
1D7BNbWBPuL22TW6WuoSq5sRrbPAxeJw8g - (Spent) 0.0156 BTC
19tqZYnP9youKtbene2FZiZtZyJYaLeBDw - (Unspent) 0.0236 BTC <- this one
1wLbaePtYhh2t5Cgd5NF59LX6Pooe1yLH - (Spent) 0.00920259 BTC
3HXAkXTYvtLzYuudDfNZBMSoueUtvdwXAz - (Unspent) 0.03036754 BTC

So that's where they are showing that 0.0236 has been received by 19tqZYnP9youKtbene2FZiZtZyJYaLeBDw.
I suppose showing entire transactions on an address page can be a little confusing, when it's only the outputs that are locked to an address (not entire transactions).
Here is an alternative way of viewing the balance of an address in a blockchain explorer: http://learnmeabitcoin.com/browser/address/19tqZYnP9youKtbene2FZiZtZyJYaLeBDw


text:
what is a miner's main source of income
the name miner might come from the fact that it earns profits from block rewards; but a miner also earns profits from transaction fees, and it can choose which transactions to include into a block or not; usually, a miner also offers wallets as an integrated customer service; all of these remind me of a typical stock broker rather than someone working in a mining field;
i am wondering, which types of revenues, block rewards, tx fees or other paid services, provide the most income for a miner during these days;

This seems very difficult to answer and very variable over time as fees and mining profitability vary sorry

Any service a miner offers which is not related to or benefited by their being a miner should be ignored, because this is external and unrelated to mining: anyone can run such a service, and likewise a miner could choose to; or not.
There are some services that a miner could run that are miner-specific, but note that since such services are economic transactions which generally occur in private (ie between the miner and the customer), it is difficult to say how much revenue they may bring in. As an example, a miner could offer a service to mine transactions that are not broadcast to the network before they are included in a block. It would be difficult, if not impossible, to prove that any transaction in a block was such included via such a paid service, unless you were the miner or the customer.
So anyways, the thing we can be most sure about, is the block reward and the transaction fees. This is because that information is necessarily public: the first transaction in each block is called the coinbase transaction, and it includes all of that information.
So you can find this information for yourself, just by looking at the reward and transaction fees included in each block through history.
The block reward is halved every 210,000 blocks, currently it is 12.5 BTC. The transaction fees vary depending on how much users are paying to have their transactions included in new blocks (generally, more transactions means high fees), but right now (and for a good portion of bitcoin's history) transaction fees are a small part of the total mining reward.
As an example of a busy time on the network: in block 500,439 the transaction fees (~13.01 BTC) exceeded the block reward (12.5 BTC), and many blocks in that range have very high fees as well. To my knowledge that block is the only time the block reward has been less than the transaction fees, but maybe somebody else here knows better (I'm excluding blocks with 'erroneous' transactions which included unnecessarily large amounts of BTC as their transaction fee, at least).


text:
Is there an active testnet for Bitcoin Cash?
To learn more about Bitcoin Cash, I would like to try some things on the testnet.  I installed bitcoin-abc, made a copy of an existing datadir from a Bitcoin Core testnet install, and ran bitcoin-abc -testnet -reindex.  It got as far as:
2017-08-08 15:54:14 UpdateTip: new best=00000000f17c850672894b9a75b63a1e72830bbd5f4c8889b5c1a80e7faef138 height=1155875 version=0x20000000 log2_work=69.338231 tx=14689192 date='2017-08-01 13:58:35' progress=0.993792 cache=154.7MiB(460629tx)
2017-08-08 15:54:14 ERROR: AcceptBlock: bad-txn-replay, non playable transaction (code 16) (block 00000000000005063e35114c186ffd196272310fbe8265012ba0151eef092430)
2017-08-08 15:54:14 Misbehaving: 80.100.203.151:18333 peer=1 (0 -> 10) reason: bad-txn-replay
2017-08-08 15:54:14 ERROR: ProcessNewBlock: AcceptBlock FAILED

I presume this is where the fork happened.  However, the client does not seem to be receiving any further blocks beyond this point.  It seems that many peers are being rejected as "misbehaving", presumably because they are really BTC nodes on the other branch of the fork.  (Though there are a lot of receive version message entries in the log that are not followed by Misbehaving.)
Are active transactions and mining taking place on the Bitcoin Cash testnet?  If so, how can I connect to nodes that know about it?  If not, why not?

Yes, there is.  After many hours I eventually received blocks up to the present time.
There is a working DNS seed at testnet-seed-abc.bitcoinforks.org (hardcoded in the Bitcoin ABC source) which lists active Bitcoin Cash testnet nodes, many of which actually work.  Bitcoin ABC doesn't seem to prefer this seed - it tries lots of others that only have Bitcoin Core testnet nodes - but you can do manually do dig testnet-seed-abc.bitcoinforks.org and then addnode the resulting IP addresses.

// , Does the testnet have a block explorer?

@NathanBasanese: https://www.blocktrail.com/tBCC

Bitcoin Cash Testnet Block explorer - https://www.chain.so/


text:
curl returns empty output when json-rpc
I am not able to get JSON-RPC response via curl. It seems like is not accepting requests.
My bitcoin.conf
rpcuser=USER
rpcpassword=PASS
server=1
rpcport=9332

Running daemon
$ bitcoind -conf=~/.bitcoin/bitcoin.conf -daemon
Bitcoin server starting

Checking cli
$ bitcoin-cli -conf=~/.bitcoin/bitcoin.conf getinfo
{
  "version": 140200,
  "protocolversion": 70015,
  "walletversion": 130000,
  "balance": 0.00000000,
  "blocks": 439348,
  "timeoffset": 0,
  "connections": 8,
  "proxy": "",
  "difficulty": 254620187304.0614,
  "testnet": false,
  "keypoololdest": 1500029964,
  "keypoolsize": 100,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "errors": ""
}

Testing curl
$ curl http://localhost:3333
curl: (7) Failed to connect to localhost port 3333: Connection refused

Of course, the port is wrong:
$ curl http://localhost:9332
JSONRPC server handles only POST requests

Making a post
$ curl http://localhost:8332 -H 'content-type:text/plain;' --data-binary ''

The output is always empty, doesn't matter if I add data or user,password. Is always empty:
$ curl http://localhost:9332 -H 'content-type:text/plain;' --data-binary ''
$ curl http://localhost:9332 -H 'content-type:text/plain;' --data-binary ''
$ curl http://USER:PASS@localhost:9332 -H 'content-type:text/plain;' --data-binary ''
$ curl http://USER:PASS@localhost:9332 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getinfo","params":[]}'
$ curl --user USER:PASS http://localhost:9332 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getinfo","params":[]}'

Any ideas why is this happening? Don't know what else to try.

Can you add the verbose option and tell us what is says?
-v / --verbose

If you're on Amazon AWS try this:
setsebool -P httpd_can_network_connect 1

I had the same problem and it took me hours to figure out that the server was blocking connections. I thought it wasn't the problem because my AWS security group allowed it. But apparently the server was blocking it directly.

For anyone trying to connect locally to a wallet:
I managed to get mine working locally by changing rpcallowip and rpcconnect from 127.0.0.1 to my actual local I.P. address (e.g. 192.168.0.2), seems that by using default localhost or 127.0.0.1 does not always work.

add this to bitcoin.conf
rpcallowip=0.0.0.0/0

allow all ip

This is incredibly insecure. You should only allow the IPs you will be connecting from.

this allowed me to test locally after hours of trying specific ips.  Will not use for production though.


text:
How to generate a Litecoin testnet addresses (Segwit also) (Derivation path, bip32)
I'm creating a wallet that generates address for litecoin mainnet in two ways.
One is using bitcoinjs-lib. This library has an object with all the data need it to create private keys and address:
import Bitcoin from 'bitcoinjs-lib'

console.log(Bitcoin.networks.litecoin)
{
    messagePrefix: '\x18Bitcoin Signed Message:\n',
    bip32: {
        public: 71979618,
        private: 71978536
    },
    pubKeyHash: 111,
    scriptHash: 196,
    wif: 239
}

This ok for the mainnet, but I am not able to find on internet the same version of this for testnet.
The other way is using derivation paths. But again, I only could find the mainnet version of this.
mainnet: `m/44'/2'/0'/0/${index}`
mainnet_segwit: `m/49'/2'/0'/0/${index}`

Any idea where I can find it?

const ltcnet = {
    messagePrefix: '\x19Litecoin Signed Message:\n',
    bip32: {
      public: 0x043587cf,
      private: 0x04358394
    },
    pubKeyHash: 0x6f,
    scriptHash: 0xc4, //  for segwit (start with 2)
    wif: 0xef
  }

use it like this:
var key = bitcoin.HDNode.fromSeedHex(seed, ltcnet)

Do you also know what is the derivation path is (bip32)?

@EnZo Most coins don't have a separate testnet derivation path, they just change the prefix

I think you should also consider scriptHash: 0x3a to get the testnet p2sh addresses that start with Q.


text:
Lightning LND - Send Payment Both Ways Within Same Channel
Me and my friend are testing Raspibolt running LND 0.6 Beta. We noticed the following problem/limitation:

When I opened a channel with him, I could send him payments (via invoice) without any problems (direct connection). But when he tried to pay me (via invoice), the transaction tried to go through other nodes rather than going directly to my node. Then we closed the channel and tried the other way around. He opened a channel with my node and I could receive payments from him but I couldn't send him any payments directly. Transaction one again tried to go through other nodes.

Why is this happening?

Do you have an error message or log entry to share so that we don't have to do blind guessing?

No not blind guessing. I am using queryroutes command to check what is happening.

The Problem here is the channel reserve. If you fund a channel all the bitcoin are on your side. At this point you can only pay. However let us assume you make a really small payment (below 1% of the channel capacity) your channel partner can't pay you back on that channel. After establishment lightning channels are required to keep at least 1% of the capacity on their side. If it was less it would incentivice the person owning no or only little liquidity to breach to protocol an publish and old channel state. Since the punishment would do basically no other harm then having a channel closed.
I suspect this is what happened between your two nodes. Try to balance the channel a little bit more by sending over 10% of your funds and sending back 5%. if that does work then we found the problem.

A lightning network channel has a certain transactional capacity, determined by the channel participants at the time of creation. While it is possible for both parties to add funds to a channel during the creation of said channel, the current implementation generally has just one participant commit funds to the channel. So generally, a channel will start with all of the capacity on one end of the channel, and no capacity on the other end (since just one participant funds it).
To illustrate this, imagine you open a channel with 1BTC capacity to your friend. The initial channel state is: [you:1BTC, friend:0BTC]
So if your friend wants to pay you, they will need the capacity to do so. Maybe they open a channel of their own to do this, or you send some transaction that pushed BTC to their end of the channel, or maybe in the future the channel will just be dual-funded in the first place.
Whatever the case, just because you are a participant of a channel, that alone doesn’t mean you can send/receive lightning payments. Rather, you need to be a participant of a channel, and have the appropriate channel capacity available to your node. This works both ways: you can’t get paid if all of your channels are 100% pushed to your end, and you can’t send payments if all of your channels are 100% pushed to your friend’s node(s).

Also I should add that maybe you only paid a small amount to the other node so that miore than 99% of the channel capacity was still on your side. In that case the other node can't send to you due to the 1% channel reserve for the penalty mechanism. Also it would be ingesting to know what happens if the other node specified the direct route through your channel.

These are the details for the channel. This channel was connected with my node and my friend can send me sats. In fact total_satoshis_received is equivalent to 100. The problem occurs when I try to send him 50 sats. The remote_balance and local_balance are not empty:

"capacity": "20000",
"local_balance": "100",
"remote_balance": "19717",
"commit_fee": "283",
"commit_weight": "552",
"fee_per_kw": "254",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "100",
"num_updates": "2",
        "csv_delay": 144,
        "private": false,
        "initiator": false,
        "chan_status_flags": "ChanStatusDefault"

@user091ok perhaps @Rene’a comment is the real issue- try pushing more balance to your node (maybe 1000 sats?) and then see if you can send it back.

Will post it as a separate answer later today and also edit the information from user091ok's comment into the question. So that we can have a clear question and answer (:

We balanced the channel by sending him more sats and now transactions could go both ways directly.


text:
Watch only Bitcoin address in Sparrow
The task seems easy, yet it’s very hard to complete. I want to watch a Bitcoin address in Sparrow. It’s a multisig address starting with 3*. Here’s what I’ve tried so far:
New Wallet
Policy Type: Single Signature
Script Type: Nested Segwit or Legacy (neither works)
Master Fingerprint: 00000000
Derivation: m/49’/0’/0’
xpub: Bitcoin address starting with 3.. (e.g., 33WVxauW21vZEXn2r7gxAbENLRnwtVeWou)
The “Apply” button never becomes active. Something seems to be wrong.

A Bitcoin address and an xpub are different things.

Thanks for the quick answer, Murch. I’m aware of this and thought watch-only might still be possible (like Electrum does, for example). I assume it’s not achievable this way or even possible.

My guess would be that when you put the P2SH address into the xpub field, Sparrow doesn’t make the "Apply" button active, because a P2SH address is not an xpub. Perhaps you could try to go back to the original wallet that you are trying to watch and look for a way to export the xpub instead of the address.

This seems to be the only way. According to Sparrow Devs watch only with just the address is not possible.


text:
Understanding private keys, public keys, adresses and transactions
I need some claryfication about the things, here it goes:
1. For what I've read, for generate a bitcoin address is following this flow:(General speaking) Private Key (SK) -> Public Key (PK) -> Address (A). Some say that SK -> PK == A. Which one is correct?
2. Now, in a transaction when X to Y of "n" bitcoins happens this: X signs (digitally) the transaction "t" with its SK and this the part that I don't get it. How "Y" does to open and verify that the transaction was send from X? or besides that X signs the transaction he encrypts? the transaction again with the PK/A of Y for Y can open it? There's something that I missing?
Note that my native language it's not english and it's hard for me to understand this complex topic.
Thanks in advance

Private Key (SK) -> Public Key (PK) -> Address (A). Some say that SK -> PK == A. Which one is correct?

The first one. An address is not a public key. It is some encoding (Base 58 Check encoding or Bech32, depending on the address type) of the RIPEMD160 hash of the SHA256 hash of the public key. The address comes from the public key, but it is not the public key itself. A public key can have multiple addresses.

Now, in a transaction when X to Y of "n" bitcoins happens this: X signs (digitally) the transaction "t" with its SK and this the part that I don't get it. How "Y" does to open and verify that the transaction was send from X? or besides that X signs the transaction he encrypts? the transaction again with the PK/A of Y for Y can open it? There's something that I missing?

Signing is not the same thing as encrypting. Transactions are not encrypted, no data in a transaction is secret. It can all be read by everyone.
A digital signature can be verified by knowing the message that was signed and the public key corresponding to the private key that signed the message. In the case of Bitcoin, the message is defined by the consensus rules (it is the hash of certain parts of the transaction), and the public key is provided in the transaction itself. Those three things (the public key, signature, and message) can then be used to verify that the signature is valid.

First part clear, if that's the case some sites are showing wrong info. Despite that, the second part it's not clear still. So, generally a transaction is composed of 3 parts: Proof of X ownership of the "n" bitcoins to transfer called inputs, then the amount "n" to transfer, and finally the address of Y called output. But this 3 things is a transaction itself (right?) so, this transaction or message is digitally sign using a type of ECDSA this sign is composed of SK of A and the transaction and this is broadcasted to the network for further validation right?

So, the validation uses the ECDSA validation part of the algorithm right? o How that works?

A transaction is largely composed of two parts: a list of inputs, and a list of outputs. Each input provides a proof that that input is allowed to spend the output they reference. Each output provides the value of that output, and the conditions required to be allowed to spend that output.

A typical output has a condition that it can only be spent if the inputs provides the public key that hashes to the hash provided in the output, and a valid signature for that public key that signs the spending transaction. Both that pubkey and the signature then go into the corresponding input in the spending transaction. When that spending transaction is validated, the validator will check that the signature is valid for that pubkey and transaction (among other things). They check the signature validity using ECDSA's validation algorithm.


text:
Is there any full node software for bitcoin with serious wallet functionality?
I'm looking for a bitcoin software with a full-featured wallet functionality and running a full node, but I cannot find any.
Bitcoin Core does run a full node and the network capabilities are great, but the wallet functionality is very limited, it does not support BIP39 mnemonic (so there is no easy way to store the private key on paper for security), the addresses are stored on disk without encryption (it does encrypt private keys, but only that). So any backup have all this data.
On the other hand, electrum wallet seems to support everything, but it connects to electrum nodes only (it does not connect to the bitcoin network) and it send public address there to query for transactions.
Is there any alternative I'm missing? I thing that any sofware that make the wallet side of the equation while connecting to the full node I'm already running should work, but could not find any thin client wallet for bitcoin.

re: "but the wallet functionality is very limited, it does not support BIP39 mnemonic" -- I wouldn't call the Bitcoin-core wallet limited at all! It doesn't support BIP 39, so I understand your frustration there, but otherwise it has extremely broad transactional capability. I don't know of a wallet with more fine-grained control.

You can connect your Electrum wallet to your own Electrum server to preserve privacy. There are different Electrum server implementations:

Electrum Personal Server

Electrum Personal Server aims to make using Electrum bitcoin wallet more secure and more private. It makes it easy to connect your Electrum wallet to your own full node.

ElectrumX - Reimplementation of electrum-server

A reimplementation of Electrum-Server for a future with bigger blocks.

electrs - Electrum Server in Rust

The motivation behind this project is to enable a user to run his own Electrum server, with required hardware resources not much beyond those of a full node.

This seems like what I'm looking for, but it seems to require adding an extra layer of complexity. So not only a wallet layer (electrum), also an electrum-server layer and finally the P2P network layer (bitcoin-core). Anyway it is the better option by now.

You may be interested in the work being done on HWI (hardware wallet interface). See also: using HWI with bitcoin-core.
This software is still in development, so use at your own risk, but it may help accomplish the goal of being able to use bitcoin-core as a full node to validate transactions related to your wallet, while having an efficient backup method, and without needing to keep your private keys on an internet-exposed machine.

It is really interesting, but I don't have a hardware wallet (yet).

You might be interested in bcoin. It’s a full node implementation written for nodejs. Purse.io uses it for its backend and we do over $1,000,000/month in bitcoin transactions.
The bcoin wallet is bip44 based and scales very well to hundreds of thousands of accounts and addresses. It can be run as a plug-in or on a separate server. We have a robust multi signature application that supports hardware signing on devices like Ledger and Trezor.
https://GitHub.com/bcoin-org/bcoin
We’re on slack if you have any more questions about it. Docs and guides: https://bcoin.io


text:
Script - Is it possible to build an addresss that allows retrieve a certain amount per address?
Is it possible to define a multi signature address that allows spending only certain percentage to each signature?
For example, three different people with different public-private keys build an pay to script address with a script that allows spending only 34% of the total amount.
So instead of requiring multiple signatures to spend the amount, it define limits on each signature.

I think you could accomplish a similar result using a LN-style setup: create a multisig output and pass some partially-signed transactions around between the multisig participants, paying to with new outputs in the desired amounts.

Each output can only be spent atomically. Either the entire amount or not at all.
The scripts are not evaluated for any “amount”. The script machine evaluates to true or false.
Of course, it is possible to spend this multisig output to multiple other outputs, each with a separate amount and output script (spending destination).

In that case, would it be possible to specify the amount that is sent to each address? Let's say, for specify that anyone the address is only expendable to those three addresses and should send 33% to each.


text:
Is there any tool to visualize the bitcoin transaction graphs?
I want to visualize the bitcoin transaction graph linked to addresses that could potentially link my addresses and to better chose which coins I would use for which payment to prevent loosing privacy. Is there any tool that could help me build that graph and visualize the clusters that could be formed?

Check out KYCP.org. They have good visual and written explanations of heuristics used by chain analysis companies, such as common-input, round numbers and change outputs, and address reuse.
OXT.me is also a good website. I think they're related in some way, but provide slightly different visualizations and heuristics.

"I think they're related in some way" => Yep, same authors :)


text:
Importing master keys on bitcoin core
I want to use a mnemonic phrase and BIP 39 to store the keys, and use bitcoin-core, I understand that master private keys cannot be imported at least directly and that mnemonic phrase is not supported.
Also, I know that there is the idea of re-think the wallet format of bitcoin core to use descriptors, that support key derivation using BIP32.
My idea was to use importmulti to generate a basic usable wallet with some addresses generated from the master account key.
Using https://iancoleman.io/bip39/ , I've generated a seed and mnemonic:
rebel image use energy write boil throw okay claw
umbrella advice together clarify water actress

From there I can get the account extended private key (44'/1'/0'):
tprv8fvSBE7NPnC8FJfBwcptSmmgxhQZhsAbbzRWaLo9d9ystozdV7BFUbRHqvYgL18fnV3WfM4GZb2cLKbLq5H8qZqC9XDnq8Mep3RWXfRsZ7o
From there I can build some descriptors to build usable wallet:
External
deriveaddresses "combo(tprv8fvSBE7NPnC8FJfBwcptSmmgxhQZhsAbbzRWaLo9d9ystozdV7BFUbRHqvYgL18fnV3WfM4GZb2cLKbLq5H8qZqC9XDnq8Mep3RWXfRsZ7o/0h/*)#quvrmfad" 0
# => ["myeHNHuNnbk1aG4WcJNkWw6foM2G64AXGF", "myeHNHuNnbk1aG4WcJNkWw6foM2G64AXGF", "tb1qcm233e9h79ntuv4c5mhsvmfhe2umvm0hsgafsf", "2N56BvNBqmkTh1Jic4GbpXSYpbtTNHUdQFw"]

Internal
deriveaddresses "wpkh(tprv8fvSBE7NPnC8FJfBwcptSmmgxhQZhsAbbzRWaLo9d9ystozdV7BFUbRHqvYgL18fnV3WfM4GZb2cLKbLq5H8qZqC9XDnq8Mep3RWXfRsZ7o/1h/*)#6gdaynzv" 0
# => ["tb1q5vgxy6ntsugpdde9ryhst66cz8z4c8ztp4k7qv"]

To generate the wallet, I've created an empty wallet (as I don't want to depend on backups, just the mnemonic I generated earlier), and import some addresses with importmulti:
createwallet "mnemonic-test" false true
importmulti '[{"desc": "combo(tprv8fvSBE7NPnC8FJfBwcptSmmgxhQZhsAbbzRWaLo9d9ystozdV7BFUbRHqvYgL18fnV3WfM4GZb2cLKbLq5H8qZqC9XDnq8Mep3RWXfRsZ7o/0h/*)#quvrmfad", "range": 10, "timestamp": "now"}, {"desc": "wpkh(tprv8fvSBE7NPnC8FJfBwcptSmmgxhQZhsAbbzRWaLo9d9ystozdV7BFUbRHqvYgL18fnV3WfM4GZb2cLKbLq5H8qZqC9XDnq8Mep3RWXfRsZ7o/1h/*)#6gdaynzv", "range": 10, "internal": true, "timestamp": "now"}]' '{"rescan": false}'

It seems to work, all the generated addresses are generated, there is no HD seed enabled (so the addresses are always derived from the mnemonic seed).
The problems I found is that, those addresses, are never used by bitcoin-wallet, when trying to receive bitcoin it says it cannot generate an address (does not try to use one of the already generated addresses) and when spending it says it does not have any internal address available.
Do you know how to enable those coins?

You cannot import private keys to the keypool. This is currently not allowed because it is generally regarded as unsafe, at least with the way that the wallet works today. There is ongoing work to change this in the future.
You could do a split wallet setup where you have a watch only wallet with the pubkeys imported into the keypool and use that for address generation and transaction creation. Then you have a wallet with just the private keys imported and you use that for signing. But that's not what you want.
If you aren't tied to using a BIP 39 seed, you could generate a 256 bit seed and use sethdseed to set the HD seed of a wallet. That would do what you want, but BIP 39 uses 512 bit seeds and not 256, so it won't work there.

Imported addresses are never automatically used when you do getnewaddress. When you import them, you need to set keypool: "true" for each imported object for that to work.

The problem is that keypool: true is only allowed when wallet private keys are disabled. but I want to use them, so I don't know how to do that.

Oh right. You can't then. The reason that keypool is not allowed for wallets with private keys is that we don't want users to use keys that have been exposed. Imported private keys are considered to be exposed. Importing private keys to the keypool also means that you may be reusing addresses, and we want to avoid that as well.

Could I generate a mnemonic, use it to generate the 512 bit seed, split that seed in two and use the first one on bitcoin core? If I ever lost access to bitcoin core backups, I can use the same procedure to get the same seed, is that correct? does it makes sense?

You could do that, but the seed would be useless in any other software.


text:
Urgently need advise for unconfirmed transaction
I have a transaction as below which had not confirmed for more than 2 days. May I know what is the problem or what I can I do to speed it up?
https://www.blockchain.com/btc/tx/d69c2c14897a516917932f0ed0c2e04ed0380c63709d103d66541e6c77e34406

Hi all, thanks for the advise. I am using exchange wallet sending to other wallet. How to resolve this problem? As the receiver claim that blockchain show it is not receive. He is using blockchain wallet. Thanks in advance.

Hey @Krivola, when you have a follow-up question usually it is best to create a new topic and link to the previous question for context. However this one is simple, either you or the recipient should get in touch with blockchain.info's support and get them to clean up their database. The transaction went through.

Murch is correct.  Your transaction is confirmed.
~$ bitcoin-cli getrawtransaction d69c2c14897a516917932f0ed0c2e04ed0380c63709d103d66541e6c77e34406 1
{
  "txid": "d69c2c14897a516917932f0ed0c2e04ed0380c63709d103d66541e6c77e34406",
  "hash": "82e425eade7ece29c23bf61dbc3f49326c1017fec541befc5232622a33233aa0",
  "version": 1,
  "size": 799,
  "vsize": 419,
  "weight": 1675,
  "locktime": 0,
  "vin": [

............
............

"blockhash": "000000000000000000214f39cdb95eb84f68c33decbd8628cecdad04da0e852a",
  "confirmations": 525,
  "time": 1540810054,
  "blocktime": 1540810054
}

Blockchain.info is simply wrong. While it shows the transaction being unconfirmed, the transaction is actually confirmed:

See Smartbit.com.au: https://www.smartbit.com.au/tx/d69c2c14897a516917932f0ed0c2e04ed0380c63709d103d66541e6c77e34406

The good news is that your money cannot be lost. Eventually it will either reach its destination or revert to the sender.


text:
Transaction is not Picked
I am new to block chain technology. I am struggling to understand below concepts:

What if my transaction is not picked by the miners and what is the criteria for miners to pick? How can I rely on blockchain to settle/do fund transfer if it is not getting picked?
Are block chains closed distributed networks? I mean, does each company runs its own blockchain. Do I need to register multiple blockchains and pay fees.
To do fund transfer via blockchain,do I need to publish my account balance in public ledger?If yes then where is confidentiality...

What if my transaction is not picked by the miners and what is the criteria for miners to pick? How can I rely on blockchain to settle/do fund transfer if it is not getting picked?

You are at the mercy of miners to pick your transaction if you do not try to mine it yourself (which currently would require a substantial investment). Typically, miners will maximize the fee rate (satoshis/kB) for the block they are mining. This means you need to make sure you have a competitive fee based on the size of your tx in bytes.

Are block chains closed distributed networks? I mean, does each company runs its own blockchain. Do I need to register multiple blockchains and pay fees.

Blockchains were created to avoid the need for centralized servers or control. It is a way to establish consensus on a distributed network which is open to the public, which is how Bitcoin was designed. Closed blockchains do exist, however, in various forms such as completely centralized or as federated networks.

To do fund transfer via blockchain,do I need to publish my account balance in public ledger?If yes then where is confidentiality...

Every transaction is available for anyone to validate, this is important in order to prevent double spending. The information that is public only includes your public key, transaction value, and signature(s). If nobody knows you own the public key or address associated with a transaction, then you can remain anonymous, but transactions can be traced back to previously used addresses. There are various methods to maintain privacy such as using different addresses for each transaction. Coinjoin is another example, which allows you, for example, to pool your transaction outputs with others in a single transaction to obfuscate which funds were sent where.


text:
identical coinbase transactions
this sounds like an old topic but i have not found a satisfying answer yet; in history there lived two blocks with identical coinbase transactions:

https://www.blockchain.com/btc/block-index/106662
https://www.blockchain.com/btc/block-index/106692
https://www.blockchain.com/btc/block-index/106572
https://www.blockchain.com/btc/block-index/106730

but if you check the receiver address (1, 2)you would find they both get rewarded only once not twice; even though the same transaction was being used repeatedly, the two blocks have different nonces, which proved two shares of work in mining; then, which rule regards this as invalid and why is it designed like that?

Related: https://bitcoin.stackexchange.com/q/5903/5406, https://bitcoin.stackexchange.com/q/11999/5406, https://bitcoin.stackexchange.com/q/26910/5406, https://bitcoin.stackexchange.com/q/30764/5406, https://bitcoin.stackexchange.com/q/57435/5406

Duplicate txids were made invalid with BIP30 in 2012. The code was updated here: https://github.com/bitcoin/bitcoin/commit/ab91bf39b7c11e9c86bb2043c24f0f377f1cf514 to apply the new rule "to all blocks except the two historic blocks at heights 91842 and 91880 on the main chain that had to be grandfathered in." (These are the blocks you linked above).
The reason why they received the reward only once is because a given txid can only be spent once (no double spending is allowed). If one of the utxo is spent, then both get marked as spent since they have the same txid and vout index, so only one is listed as received. It also depends on the block explorer and how it handles the duplicate txids.

Theoretically speaking, prior to BIP30 could two blocks have the same coinbase TXid as an empty block within the same median timestamp and solve with the exact same nonce/PoW hash? (Assuming no difficulty change)

The chances are zero, but see https://bitcoin.stackexchange.com/a/38385/60443.

If someone wants to spend transaction d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599, how much bitcoin can they spend? 100 or 50?


text:
How can one confirm that reported transactions on the exchange actually occur and are not due to wash-trading?
For instance, if I'm subscribed to binance's websocket trade stream.. and it is reporting trades..  how can one be assured that the trades are actually occuring and not just the exchange trading with itself or generating false data to pump up their volume numbers?


text:
Bitcoin script execution unsuccessful
I'm working my way through "Mastering Bitcoin".
The author made a transaction:
0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2

https://www.blockchain.com/btc/tx/0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2
I tried to execute the transaction script (with the Unlock script in vout) in a Bitcoin Script online simulator:
https://siminchen.github.io/bitcoinIDE/build/editor.html
putting the current ScriptSig:
ScriptSig: PUSHDATA(72)[3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301] PUSHDATA(65)[0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf]

with the output script:
DUP HASH160 PUSHDATA(20)[7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8] EQUALVERIFY CHECKSIG

according the blockchain explorer.
I got "execution unsuccessful" even though i didn't figure out what's the problem.
Apparently the op_EQUALVERIFY got failed.

The online script check program that you are using to evaluate the script has numerous issues. First, there is a known issue of the software calculating the OP_HASH160 incorrectly. For example, the HASH160 of the public key that you have entered (the one starting with 04...) is 7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 while the program is calculating it as 6DF13DE1F1D824380834E0D42E49E5E451A647CF. This results in a failed validation when the OP_EQUALVERIFY opcode runs.
The error derives from mishandling the hashing strings as ASCII instead of binary. By this I mean that the program is hashing the public key as a string rather than treating the public key as a hexadecimal number and hashing the bytes. Below is a python code of how the hashing should actually be done.
import hashlib

def hash160(payload_in_hex):
    payload_in_bytes = bytes.fromhex(payload_in_hex) # note this step
    payload_sha256 = hashlib.sha256(payload_in_bytes).digest()
    payload_sha256_ripemd160 = hashlib.new('ripemd160', payload_sha256).hexdigest()
    return payload_sha256_ripemd160

pub_key = '0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf'
hash160(pub_key)
>>> '7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8'

Secondly, the signature verification against a public key without knowing what message was signed is simply incorrect. This is resulting in the program accepting any signature for any given public key. For example just try the below script and it will show you that execution was successful.
aecd 0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf OP_CHECKSIG


text:
blockchain account has watch onl on i
blockchain have been zero help. I need to know how I can get a private key to release my funds
I transferred funds from the exchange blockchain lost it. I had to find it myself I transferred it to imported wallets and had a watch only tag on it. I need these funds, but need a private key how do I get one

How exactly did you create the address to which you transferred the funds?

imported the wallet

I  found the wallet in an unspent account and imported it

I am not sure that I understood the question well. Would that be correct:
I transfered from some exchange my funds to an address, which I imported as watch address on blockchain.info. Now I see funds but I can not spend it, what should I do?
If that questions is the same what is asked and user reports that blockchain.info has not helped at all, then I would assume that blockchain.info is not the owner of the address that was imported. Here is what you could do:

To which address did you send your funds? If it is address that you somehow created with some application like bitcoin core, multibit, .... , then their application/user data folder must be still present on your pc (even if you uninstalled it). If that is the case and a wallet address you sent funds too is in ie. bitcoin core, you can export your private key if you write in the console dumpprivkey YourBtcAddress
If you imported exchange's wallet address, then funds would be still visible on exchange. In that case exchange would still have your coins and could help you
If this address has never belonged to you, then you do not have the private key and you can not do anything beside to contact the owner of the address.
Bruteforce is not really a option, but in theory it is possible. However, this is a point that you actually should forget.

I hope it helps. I see here only 3 possibilities, address belongs to you (you can retrieve your funds), address belongs to exchange (you still could get your funds) and that it belongs to somebody you do not know and you have no private key (in that case you can not do anything to get your funds back), maybe you could ask on internet who is the owner but I doubt any repl will come.

If you just imported the address and not its private key, then you cannot spend the Bitcoin. Each address has only 1 private key, and that private key is designed to be basically impossible to find unless you were the one who generated it. Since you do not have the private key for your watch-only address, you cannot spend the Bitcoin. Unfortunately the Bitcoin is lost and there is nothing that you can do about it.


text:
Creating Mining Competition on regtest
As we know ,  Bitcoin core-Regtest is used to set up our own blockchain starting from Genesis Block. I have created Two nodes on my localhost running on different ports (I am using Windows 8.1). They are connected to each other. Now I want to increase the difficulty level and create mining competition between two nodes.
I can manually use generate Number_of_blocks to mine that many Number_of_blocks on any node and It also includes my recent transactions which are not yet included in the blockchain while mining.
But how can have such an arrangement in which I will increase difficulty and start mining on both the nodes, and whoever comes first will broadcast the block and win the race.??
Any reference or step by step explanation would be much appreciated

Previous versions of bitcoin core included a miner, and you could use the RPC call setgenerate to activate it. However, this functionallity was removed on Bitcoin Core v0.13.0. In any case, this does does not seem to work on regtest (I have tried it with v0.11.1 and it returns a message saying to use generate instead).
Whenever I need to "simulate" nodes competing to mine in a regtest network, I define their mining power and randomly select which one of them is going to mine taking into account their defined mining power. Then, I send a generate 1 RPC call to the miner that has been selected.

Yes but how would I define mining power of a node in the software bitcoin core? And how would send generate 1 RPC call to selected miner?

@DOLLYPATWA you answered your own question, you would use the rpc interface and send a generate 1 block call to it.


text:
To create a blockchain using MySQL database
I want to create local blockchain for my application. New blocks should be created while giving reference to previous block. But I am not getting exactly how will I do it in MySQL? I got some idea from http://blog.theodorejb.me/sql-linked-lists/
. Now I want to retrieve top block every time I create a new block. But Is it possible in MySQL to retrieve Newly inserted row's primary key? Or Is is possible to implement stack(with reference) in MySQL ? So that I can retrieve top block.

I believe you are over complicating your life.
Having a BlockChain (a Linked Ledger) in SQL can be prototyped in the following manner

Create a table, such as:
CREATE TABLE IF NOT EXISTS
MyBlockChain (
    LedgerID int(10) NOT NULL auto_increment,
    block varchar(255),
    datetimestamp datetime,
    guid varchar(255),   --Have a Default GUID Generated
    PRIMARY KEY( `LedgerID` )
);

Having an AutoGenerated Sequence Number (as a primary key) - This creates the sequence in your ledger.
Assign Proper Security to only allow INSERTS to happen over a Public API.
Only the GUID is used to access a Record (block) via ReadOnly permissions.
When users can only INSERT Data (No DELETE or UPDATE) you, in essence, created a Ledger.
And since the Sequence Number will be used to determine ordering of actions.

The biggest challenge to distributing the MySQL database over multiple instances an having an API interface and ensuring ReadOnly and Insert Only security.
That by default is a simple implementation of a BlockChain

In order for this to be more blockchain-like, I believe you'd have to make guid the primary key instead of LedgerID, and then make a prev_guid the link to the previous block (row in this case). Of course, you'd have to uniquely generate each guid to keep database integrity.

Meanwhile, for a faster table speed, you could move block to the end of the table and then even switch it from varchar(255) to text, mediumtext, or longtext.

Permit no inserts unless no other block (row in this case) shares the same prev_guid, and your guid is unique.


text:
To get the master private key of HD wallet
How can I get the master private key of HD wallet bitcoin core satoshi client 0.14.2? Any command for that  on bitcoin core console? Currently I am on Testnet3.

go to help-> debug window -> console
Enter:
walletpassphrase "your walletpassphrase here" 60, to unlock the wallet if its encrypted.
dumpwallet  "filename", will crate a plain text file in same directory where your wallet .dat file is form which you can get your xprv.
walletlock, to lock your wallet
Don't forger to erase the file after you get the info. Also if u change your wallet password the xpri will change.

Just one correction. dumpwallet "filepath+filename" and after that It will not automatically create text file but You can go to that file -> properties and then change the extension and open it with notepad. Thanks again

authors: Раб Здравого Смысла


text:
Bitcoin core Testnet version 4
I am Curious about bitcoin testnet.
Since there is a massive change in bicoin mainnet i.e. https://bitcoin.org/en/alert/2017-07-12-potential-split
Will Testnet4 be there and Testnet3 completely wipe out?
I just want to perform mining on Testnet. As some people are mining with ASIC even on the testnet and increased the difficulty. If so happens then it would be great to have 0 difficulty again.

I am Curious about bitcoin testnet. Since there is a massive change in bicoin mainnet i.e. https://bitcoin.org/en/alert/2017-07-12-potential-split

The change on mainnet does not effect testnet at all. The mainnet change is to activate segwit. However testnet has had segwit for the past year and a couple months.

Will Testnet4 be there and Testnet3 completely wipe out?

No.

I just want to perform mining on Testnet. As some people are mining with ASIC even on the testnet and increased the difficulty. If so happens then it would be great to have 0 difficulty again.

There is no such thing as 0 difficulty. The minimum difficulty is 1. Testnet3 has provisions to ensure that it is always mineable by someone. If a block is not found within 20 minutes, the difficulty will drop to 1.


text:
To run bitcoin core testnet on Ubuntu 16.04
How can I run Bitcoin core testnet version on ubuntu 16.04 platform ? I am getting so many reference about how to run bitcoin core mainnet but it will take around 20 days to synchronize with the network as per my bandwidth and also will take my half of the HDD. So I opt for Testnet. Can someone explain me how to insatll bitcoin core testnet on Ubuntu 16.04? I would be grateful. Step by step explanation or reference would be much appreciated.

Are you running bitcoind from the command line?

After having installed Bitcoin core on your machine, run the following command to start synchronising the testnet blockchain
bitcoind -testnet -daemon
The synchronisation starts as a daemon and runs in the background, you can issue the following the command to see the progress
tailf ~/.bitcoin/testnet3/debug.log
To access the command line apis , just add the -testnet parameter
bitcoin-cli -testnet getinfo
Update: The RPC getinfo is deprecated, use getblockchaininfo for it to work with the latest version
bitcoin-cli -testnet getblockchaininfo

getinfo is now deprecated. Use getblockchaininfo instead:
bitcoin-cli -testnet getblockchaininfo

I don't have 50 reputation to comment. Otherwise, I would've added this as a comment.

Upvoted, now you have 51 :)


text:
OpenSSL generate Bitcoin address
I am building a script to generate secp256k1 using OpenSSL in MacOS.
Seems to work fine.
My question: is this SECURE enough?
#!/bin/bash

if [ $# -eq 0 ]; then
  echo "Missing name, for example generate_key.sh bob"
  exit 1
fi

FILE_NAME=$1
PRIVATE_KEY=${FILE_NAME}_private.pem
PUBLIC_KEY=${FILE_NAME}_public.pem
BITCOIN_PRIVATE_KEY=bitcoin_${FILE_NAME}_private.key
BITCOIN_PUBLIC_KEY=bitcoin_${FILE_NAME}_public.key

echo "Generating private key"
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out $PRIVATE_KEY

echo "Generating public key"
openssl ec -in $PRIVATE_KEY -pubout -out $PUBLIC_KEY

echo "Generating BitCoin private key"
openssl ec -in $PRIVATE_KEY -outform DER|tail -c +8|head -c 32|xxd -p -c 32 > $BITCOIN_PRIVATE_KEY

echo "Generating BitCoin public key"
openssl ec -in $PRIVATE_KEY -pubout -outform DER|tail -c 65|xxd -p -c 65 > $BITCOIN_PUBLIC_KEY

echo "Files created!"

Could you may explain what's the background of converting the private/public keys to Bitcoin private/public keys?

OpenSSL's RNG is considered secure, so there should be no problem with this method. I don't think you need to use -rand /dev/urandom since OpenSSL already uses /dev/urandom for seeding the RNG.

Makes sense, tnx

If you're on macOS, which uses LibreSSL 2.2.7, then there is no option -rand


text:
Is it considered bad practice to have a wallet "cloned" on both a smartphone and a desktop PC?
I already checked questions as:
Can I use my wallet on different computers?
Can wallets be shared by different machines?
...but what I'm asking regards popular wallets as BitPay and Electrum, that have both the desktop and mobile app, permitting to export and import a wallet. Nothing that takes into account messing with any wallet.dat file.
I'm currently doing this with a BitPay wallet, and it seems it works good. When a transaction occurs (i.e. I receive funds) this is notified on both platforms (I think it's related to how those wallets works; I'm referring to the Bitcore Wallet Service).
I also read about the notorious quote "not a good idea", but I'm not sure of this refers to different type of wallets or what else...
Any clarification on this is more than welcome.

It is merely a question of security. If your copy of the private key in wallet A (phone) is compromised, you can lose your coins. If your copy of the private key in wallet B (PC) is compromised, you can lose your coins.
Assuming both copies are secure, you basically just have a backup of your private key.
As for whether or not having two copies like that is secure or "best practice", that depends a lot on how you handle your computers, and there are better experts out there that can answer that.
One thing you cannot do is double spend. If they use the same private key, one wallet is the same as the other, and trying to spend out of both will result in an unconfirmed transaction on one of them.

Hi, thanks. This is what I thought, so I'm happy I have an answer in regards. So you're saying that synchronization is by design, and there's nothing to worry about, right?

@dentex, the protection against double spending is certainly by design... the ability to backup a private key and the fact that the private key is the single thing that allows you to "unlock" a coin and spend it is just a mathematical fact... made use of in the design. You can have as many copies of the private key as you want, just don't let anyone else have access to it, including an app you may not trust.

Stack Exchange has turned into garbage

OMG. What happened? I hope it's nothing related to this Q.


text:
Is it safe to invest $100 Million in Bitcon
I have currently $300 Million+ in bank account. Do you think is it safe to get returns by investing in Bitcoin considering it has hit Billions in Market Capitalization.

I suggest you instead spend some of that on a financial planning expert.

authors: امیر زارعی نور