Is it possible for a person's transaction to show up on the network BEFORE mine if I send bitcoins before him? To clarify, if person A sends bitcoins to person B, and person C sends bitcoins to person D, 1 second (or less), AFTER person A, can person C's transaction show up on the network BEFORE person A's? If so can you explain how?

Edit: By "show up on the network" i mean get on the blockchain. Example: If A and C both sent to the same address, but C sent his 1 second (or less) later, then if i go to blockchain.info and look at the recipients transactions, is it possible to see C's transaction before A's (even if it is unconfirmed)

It is not clear what you mean with "show up on the network". I will assume that you mean "included in the blockchain" rather than "submitted to the network".

Transactions are spread peer to peer.

When a users sends a transaction, he transmits it to all the peers he is connected to. All these peers will then propagate it to their peers, and the recipients will repeat so again until all nodes in the network have received the transmission.

An exaggerated example

Let's imagine the following (hypothetic) situation:
A has only one peer, who in turn only has only one other peer. Let's say A is connected to the network in a very long chain of weakly connected nodes, which then at some point leads to the "well-connected network".
On the other hand C has ten peers, of which one is very well connected such as a mining pool operator.

Now, when A sends his transaction, it is transmitted to one other node in the network, then a second is notified, in the next step only a third. Obviously, it will take some time until the transaction will spread to the whole network. On the other hand, when C sends his transaction, it is immediately received by 10 other nodes. Each of those sends it to ten other nodes, the mining pool might even send it to hundreds. The network will be notified very quickly of that transaction.

We can see different propagation times, but the effect isn't that huge

According to BitcoinStats, it takes about 0.651 seconds for a transaction to be seen by 50% of the network, and about 2.761 seconds to be seen by 90% of the network.
Also, the above example is exaggerated: Usually, every node will try to connect to several nodes. However, the effect that some transactions will spread faster due to being submitted to well-connected nodes still exists. If a miner finds a block and had already received the transaction of C but not A's. C's might be included in a block before A's transaction. However, the window is pretty small, since the block interval is much bigger than the propagation time.
The effect would be especially pronounced, if A's transaction didn't include a transaction fee, or was non-standard, and therefore not propagated by all nodes.


How to handle VirWox transfers and invoices that expire quickly? I would like to withdraw a moderate amount of Bitcoin (equivalent to a few tens of USD) to pay the subscription to an online service.

I tried to use the "Request Withdrawal" command on the VirWox site, but it resulted in a message notifying that the Bitcoin transactions are only processed after a 48 hours period.

The invoice provided by the online service I want to subscribe to becomes expired after 15 minutes ; at least it is what is displayed on the pay site page I was redirected to (bitpay.com).

Is it possible to proceed to such a transaction directly from VirWox ? Or should I consider an other method ?

Thanks in advance for all suggestions (also please excuse my inexperience about the subject).

AFAIK VirWox is an exchange. You're trying to use it as a wallet. Since it isn't built to be a wallet, you're experiencing difficulties.

Instead, withdraw your bitcoins to a wallet after buying them on VirWox. Then use your wallet to pay your invoice.

You can find an overview of wallets here: Choose your wallet


When ASICs generate a share, is it always at difficulty 1? Are they preset to only return difficulty 1 shares when the find a nonce?  Then mining software verifies if it meets current target difficulty?  Or, if given a different target difficulty, will the ASIC only return shares that meet that difficulty setting?

If this is hardware specific, any idea which chips allow variation in the target difficulty?

The question in part stems from some misunderstandings I have seen on questions of what a share is.  Whether it is always a nonce found for difficulty 1, or if it is a nonce found for the target difficulty sent to the miner.  There are some confusing answers out there.

It's hardware specific, and most of the information for Bitcoin mining ASIC are under an NDA so this can't be posted publicly. There's very little utility in returning difficulty one shares to the controller, for a device doing 1TH/s it would mean dealing with hundreds of results a second that the controller is just throwing away.

The difficulty of a "share" is whatever the hash target was, if we have a target of difficulty 256, then any valid block header with a difficulty more than this would make that "share" valid for the target. Shares with a vastly higher difficulty (in the billions today) might also be valid as a block for their parent pool. Shares are only used by pools to gauge how much work a client is putting into finding a block (they are simply blocks with too low of a difficulty to be valid), they're completely useless for anything else and thrown away.


What GPU-APU configuration should I buy for mining Bitcoins? I want to make own computer for mining bitcoins. I read a lot of it but I have some questions. I want to buy APU + Graphic card and I am wondering when I my computer is mining is using for that CPU + GPU(from APU) + normal GPU.

Can you tell me if this configurations is good?

Gigabyte GA-990FXA-D3 s.AM3+
ATI RADEON HD 5870
A8-3870K
DDR3 2GB CL9 1600Mhz

I will be running this on linux.

Every two months I will be adding one more ATI GPU until I get 4 of them. Is that good strategy?

It's essentially too late to be worthwhile GPU mining because FPGA's are much more energy efficient, and cheaper to buy per unit of output. This has meant the difficulty has risen high enough that you won't cover the cost of your electricity (or your hardware) with GPUs. ASICs are likely to be shipped soon, which will largely make FPGA's obsolete. You can pre order ASICs from multiple manufacturers; Butterfly Labs is one.


Where is the downloaded Ardor blockchain stored on windows and linux? Where can one find the location of the Ardor blockchain on Windows and Linux?

On Windows (when using Ardor mainnet) the blockchain will be downloaded to your "C:\Users\USERNAME\AppData\Roaming\Ardor\nxt_db" folder. Make sure that you can see hidden folders. You can find your AppData folder very quickly by entering "%appdata%" in the address bar of the file explorer.

On MacOS (when using Ardor mainnet) your default user directory is ~/.ardor so the blockchain should be in ~/.ardor/nxt_db

For Linux, you usually use the Platform Independent Zip Package and the blockchain is located in the nxt_db directory in the directory of the unzipped package


how base point of bitcoin public key x , y formed n = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140

p = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F

base point of bitcoin public key x , y

Gx = 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798

Gy = 483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8

private key of above public key is 1

how this base point x , y formed please explain in clear and brief with some example

Thank all

They are defined by the standard. See http://www.secg.org/SEC2-Ver-1.0.pdf page 15, section 2.7.1.


Secure Generation of Private Keys Suppose you've created a random private key by rolling dices.
You've checked in the blockchain and nobody else has ever used the respective address of such private key.

Issue
Is this process reasonably safe to generate private keys?
Or, is there a subset of private keys that you should avoid due to known vulnerabilities in Bitcoin ECDSA (ie: something faster than brute force)?

Any 256-bit number between 0x1 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4141 is a valid private key. Assuming your random number is in that range (and it's extremely likely that is the case), it should be just as fine of a private key as any other number.  In fact, you shouldn't even bother with checking if the address is already known because:

Probability tells us it isn't used
Its existence on a chain explorer is not proof that nobody else has generated that key
By checking, you may be telegraphing that you own that key

Be more concerned about how your key is generated, rather than is a particular number is vulnerable to some unknown attack.  Make sure your dice rolls are done in such a way that every byte is just as likely as every other byte.  I've used a D8 in conjunction with a coin flip in order to generate 4 bits at a time.  If the coin is heads, I use the D8 at face value.  If tails, I add 8.  I count 16 (tails + 8) as 0.  If you work it out, you'll see that this generates a perfectly random number between 0 and 15, or one hexit.  Do this 64 times, and you have a 256-bit key.


bitcoind fails to start at boot I am trying to set up bitcoind to start at boot as a specific user. I see the process start for a minute and then fail, following boot.

I can start bitcoin as the user just fine with a login and then just run bitcoind. But I cannot pull the same trick off in a boot script.

journlctl -b

Jun 05 16:43:09 mo.trader.com systemd[1]: bitcoind.service: Start operation timed out. Terminating.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown requested. Exiting.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: In progress...
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z scheduler thread exit
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: done
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Control process exited, code=exited, status=1/FAILURE
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Failed with result 'timeout'.
Jun 05 16:43:11 mo.trader.com systemd[1]: Failed to start bitcoin.

.

cat /etc/systemd/system/bitcoind.service
[Unit]
Description=bitcoin
#After=network.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes

[Service]
Type=forking
User=bitcoinusr
Group=bitcoinusr

Environment=BITCOIN_PID=/mnt/bitcoin/bitcoin/bitcoind.pid
Environment=BITCOIN_HOME=/home/bitcoinusr/.bitcoin

ExecStart=/usr/local/bin/bitcoind
ExecStop=/bin/kill -15 $MAINPID

[Install]
#WantedBy=multi-user.target
Alias=default.target

.

cat ../bitcoinusr/.bitcoin/bitcoin.conf
blocksonly=1
dbcache=50
maxorphantx=10
maxmempool=100
datadir=/mnt/bitcoin/bitcoin

How do I get bitcoind to start at boot as user?

UPDATE:

It was a total systemd failure. it actually failed with 'service bitcoind start'. It just took a while to fail out.

It looks like you have the bitcoind service listed as a forking service, but have not configured bitcoind as such. forking means that systemd expects the service to daemonize itself, i.e. the command it executes will exit once the service has started. However you have not configured bitcoind to behave in this way. So the bitcoind command that systemd runs will not exit as systemd is expecting it to. It is named forking because the process will call the fork() syscall and then the parent process will exit.

There are two solutions.

Configure bitcoind to daemonize itself. You can do this by adding either daemon=1 to your bitcoin.conf file or adding -daemon to the command in ExecStart.
Change your bitcoind.service file to say that bitcoind isn't expected to daemonize itself. To do this, change Type=forking to Type=simple. This instructs systemd to expect that the process configured with ExecStart will be the main process of the service.


Can transaction inputs reference outputs of pending transactions? The inputs of a transaction reference outputs of previous transactions. These previous transactions

must already be present in the block chain, or
can also be pending transactions?

I don't know if the term pending transactions has some meaning I'm not aware of. In this context, I mean transactions that are not yet in the block chain, but are present in the block containing the new transaction.

Example: A particular block B contains multiple transactions including a transaction X and a transaction Y. The transaction X references the output(s) of transaction Y. Transaction Y is not yet in the block chain, but it is present in block B as well. Is this possible since transaction Y is not yet confirmed?

Note: I'm not using the term unconfirmed transaction because as I understand these are transactions not appearing in any block; and in this case transaction Y would be in a block, the same block as transaction X.

If transaction Y is in block B, then it is - for purposes of deciding whether X's inputs are valid - confirmed.

As far as consensus rules are concerned, a transaction X can spend outputs from a transaction Y that is anywhere in the block chain before X. That means either Y is in an earlier block as X, or in the same block but in an earlier position.

The P2P transaction relay also supports this. It will relay transactions that spend outputs of unconfirmed transactions under some conditions. Given two interdependent unconfirmed transactions, miners can decide to put both of them in the same block, or only include the first one in a block (leaving the other one in the memory pool for inclusion in a later block).


How does a recipient know they can satisfy the transaction script to spend their bitcoins? The wiki page on the transaction script says:

  The party who originally sent the Bitcoins now being spent, dictates the script operations that will occur last in order to release them for use in another transaction

How does a recipient know they can spend the bitcoins they received? Would it be possible for a malicious user to create a script that the recipient could not use to spend the bitcoins, without them being aware of it? (Possibly due to a client UI limitation?)

The situation I'm describing would probably be unusual, as it would involve the sender deliberately sacrificing (and destroying in the process) bitcoins purely to spite the another party. Even still, is it possible, and what measures (could) protect against it?

I don't think your threat model makes sense. If you "send me Bitcoins I can't claim", you've done the equivalent of nothing at all, except you've wasted some of your own Bitcoins in the process.

Currently, clients will only recognize Bitcoins as being sent to them if they can confirm they can claim them. Non-standard transactions (those with scripts other than the two well-understood forms) are ignored.


Multiple copies of wallet.dat with a constraint I know it is generally a very bad idea to share one wallet.dat between many clients on different machines because public/private key sets start divirging after some time if all the clients are allowed to recieve and spend money and this leads to a possibility of a dangerous collision.

However, what if I introduce a constarint that, say, of 5 machines with shared copies of wallet.dat, only one particular machine can both recieve and spend bitcoins while the rest of 4 machines are only allowed to recieve payments.

Would this be a safe setup or would there still be a risk of losing coins?

The risk is if you have shared private keys on multiple computers. Even if you maintain a personal discipline that you won't spend from those other 4 wallets, the risk is still there.  With those private keys still on the other computers, you have opened up 4 additional vectors of attack on your keys, as well as given yourself 5 times the workload securing it all.

You should only have the private keys for your addresses on the one machine that you say you want to spend from.

On the other 4, you should only use "watch only" clients, such as the online wallet at blockchain.info or Armory. There are others as well. Both of those wallets will let you set up public keys to watch, but not spend from, because they don't also have the associated private keys.

Watch only wallets can receive funds just like any other wallet -- you're just watching the balance on the blockchain.


Mini-Blockchain proposal: How is the proof-chain secured against injections? I have just finished reading the paper Purely P2P Crypto-Currency With Finite Mini-Blockchain by J.D. Bruce. While I got the impression, that the rolling blockchain as an idea might work, I was left wondering about one detail in the proposal.

It seems to me that the proof-chain fails to live-up to it's purpose:
Bruce suggests that it would be sufficient to keep the proof-of-work solutions of the blocks as a proof-chain. Yet, how could one verify the proof-chain if all the block data has been discarded as suggested? Wouldn't it be possible to replace any blockhash in the proof-chain with another valid blockhash and start a competing mini-blockchain from that point?

That way an attacker could spend any amount of time on the mini-blockchain and just insert it into the proof-chain whenever it is sufficiently long.

Am I missing something? Why would the proposal work as intended by the author? Or is it actually "broken"?

Block data is not necessary to check proof of work, or to check that past block headers has not been altered. This is because for a block to pass proof of work check, the hash of its header must be less than a certain value. So, the header (which is just 80 bytes in Bitcoin) has enough information to check proof of work. Also, each header includes the hash of header of the previous block. So, assuming that the hash function is collision-resistant, it is impossible to modify any of the previous headers without changing the hash of the last header, and it is impossible to change any header while keeping proof of any work done after the corresponding block. The only way to "fake" a mini-blockchain is to outrun the honest miners, which requires an attacker to have comparable amount of hash power.


How to search for a transaction using a specifc OPCODE? I have several OPCODES where I need real worlds examples…

However they are rarely used. So how to search and disassemble an existing mined transaction using it ?

I don't think this is possible. Most, if not all, block explorers and blockchain indexers do not completely disassemble scripts and index them so that they are searchable. No software or service I know of allows you to search by opcode use in a transaction. It would be pretty useless for a service to provide this as probably no one would actually use it and having such an index would be a huge resource cost.

I think the best you will be able to do is to do write a program to look through every single transaction's scriptSig and looking for the opcodes that you want. However, be careful that you don't interpret random bytes as being opcodes. You will need to have something that can disassemble scripts and check the disassembled scripts for the opcodes that you want. Furthermore, such disassemblers won't be able to disassemble a redeemScript which is the actual script where opcodes will actually be for P2SH inputs.

Instead of searching for an example of an opcode which probably hasn't been used, just try using it yourself. I recommend that you read https://en.bitcoin.it/wiki/Script to get an idea of how the opcode works. Then you can use a tool like https://github.com/kallewoof/btcdeb to execute and debug your script. This way you can learn how the opcode works through experimentation and see exactly how a script interpreter will execute the script.


Does a new block necessarily include all transactions that occurred before its generation? What about network latency? I read What exactly is Mining? and What are bitcoin miners really solving?, but was left wondering: What happens if a new transaction comes in, whilst mining? To answer that, I found Do transactions affect the discovery of a block?, which, if I understand correctly, says that the mining must "start over" (but the chances of finding the "nonce" on the first attempt are about the same as any subsequent attempts, so there's no "loss of work").

But, what about network latency? It must take a finite amount of time for a new transaction to reach miners—so what happens if a miner solves a block, but then receives a transaction timestamped before the block was solved?

Miners have total freedom to choose which transactions they will include in their blocks. Most miners will include any transaction that reaches them (assuming it includes an appropriate fee) but nothing forces them to do so.

But if a miner decides, for whatever reason, to omit a particular transaction, or if it's omitted by an accident of timing, no permanent harm is done. Another miner can include that transaction in a later block with no problem. Transactions don't even have a timestamp, per se, so it's not a problem if it takes a long time (other than the inconvenience to the parties involved). (Blockchain.info and its ilk may record the time at which they first saw the transaction on the network, but that time stamp isn't part of the transaction itself, as far as I know.)


Virus warning in Bitcoin [cash] ABC client? I tried to download Bitcoin cash ABC wallet from bitcoincash official site.

If I download zip to my computer and upload it to VirusTotal site, it says 11/62 positives.
If I go to VirusTotal site and enter the zip URL to be scanned it says it is clean.
SHA-256 sum is also different.

Is this normal ?
Maybe someone else can test ? :/

https://download.bitcoinabc.org/0.17.2/win/bitcoin-abc-0.17.2-win64.zip

edit: the SHA256 is the same, I initially thought it was different, maybe I compared too many at once, the main issue (warnings) remains.

Yes, that's very usual and expected.

It is not surprising to have Bitcoin-related code in Bitcoin Core(-forks), but the malware analyzers don't understand the purpose of Bitcoin code.

Here's a real software with a Bitcoin miner (utorrent 3.4.2): https://www.virustotal.com/#/file/0e7e8526e8c4ab3c3dc938b1bb042bda07f464390a919c7f3f30caadec156549/detection

The same happens for Bitcoin Core:


How can I pay someone in another country? I have my wallet with some BTC in it, on my PC, and I live in europe. Let's say I want to pay 2BTC to a company in India or China, or whatever, but they don't accept BTC. They only take Indian Rupees (INR) or Chinese Yuan (CNY).

Now my question: is there any way to send BTC to their country, then those BTC become Rupees, and these workers can just walk to their bank to get their money? Or some other easy way to pay them without fees or at least the smallest fees possible?

Thanks!

They could open an account at btcxindia.com or another exchange in India. You send the BTC to their account there and then they just sell and widthdraw the rupees to their bank account.


How does Bittrex charge its commission? Assume I want to trade the BTC-BCH pair. I have only one BTC in my exchange wallet and want to buy one BTC worth of BCH.

What currency will the 0.25% commission come out of?
Will I need to trade 1 BTC - 0.25% so there is enough funds in my account to cover the commission?

The same question goes for selling BCH to receive BTC Where I have only 100 BTC in my exchange wallet and want to convert it all to BTC. Will I need to ensure that I only convert 100 BCH - 0.25%?

I can't be "Bittrex specific", but i can provide a general answer to how it would work and have seen it work across a half dozen systems that are crypto specific and dozens of financial systems that are non crypto specific:

When you set up a sell order (or just click sell) it's usually not a "1 and done" situation. You are selling 'x' amount for at least 'y' value. As the system matches up the purchases of your 'x' amount to buy orders, a fee is applied when the match is made and the "trade" occurs. The fee can be taken out of BOTH sides of the trade. You have a .25%.. the buyer may have a .25%. That means if the trade completes, whatever you are "due" they will remove it before handing it over. THEY get BCH. The person buying it get's a fee too.. they paid in BTC. Once the trade completes, they pay their fee in BTC.

Sorry this isn't specifically a Bittrex answer, it's a "how these things normally work". I can't imagine how else it could be accomplished as it would mess up all normal accounting practices.

In sum, to maintain accounting: The trade is completed. Fee's are assessed against the results.


Why has BCH not received a 51% attack yet? BCH right now has around 10% of BTC total hashrate.

There are multiple pools that control 10%+ of the total BTC hashrate why haven't any of those just allocated a few hours of hashrate to do a 51% attack similar to the one we saw recent on BTG. If they have 10% of BTC hashrate then it would only cost them around $60,000 per hour to control the network (to pay the users using the pool)

Because of the cost, specifically the opportunity cost.

If a miner has 10% of the BTC hashrate, then if they pointed all of that mining power to BCH, they would still be losing money. With 50% of the hashrate on BCH, they would mine roughly 50% of the blocks in a day, which is 72 blocks. At 12.5 BCH per block,72 * 12.5 = 900 BCH. Convert that to BTC at the current exchange rate (0.135 BTC/BCH) 900 * 0.135 = 121.5 BTC.

However if the miner keeps mining BTC, at 10% of the network hash rate, they would mine ~14 blocks per day. With at least 12.5 BTC per block, a miner would be making 14 * 12.5 = 175 BTC per day, much more than if they were mining BCH.

Thus a miner will earn more money from mining BTC rather than mining BCH. Performing a 51% attack on BCH isn't really worth it; all you can get is possibly some double spends, and less value in BTC.


Hardware wallet teardowns and side channel attacks Most of the popular hardware wallets appear to be based on well established open source cryptography.

Which hardware wallets have been submitted to extensive teardowns and side channel attack testing?

The researcher Jochen Hoenicke has done some work on the Trezor. He was able to extract the private key by monitoring the power cable with an oscilloscope.

Trezor has since updated the firmware to defeat the described attack.


RSA accumulator vs Merkle Proofs For proof of inclusion (used by SPV nodes) Bitcoin relies on Merkle proofs.
Why Merkle trees were chosen and not RSA accumulators, as they can be used to provide a shorter proof?

What are the advantages/disadvantages of RSA accumulators vs. Merkle proof?

RSA accumulators are far harder to implement correctly
RSA accumulators need a trusted setup (someone, or multiple someones, must come up with a sufficiently large integer that is the product of 2 primes, and then throw those individual primes away). Bitcoin is generally designed to avoid trusted parties.
For a 128-bit security level, you need at least 3000 bits RSA moduli, meaning that a proof would be 3000 bits. That's only a win compared to Merkle paths for trees with more than 12 levels, which in the case of transactions in blocks, means over 4096 transaction. That isn't usually the case, and even when it is, it is only barely so.


Why is the network congested? I'm reading a lot of people saying that is taking around 3/4 days to confirm a transaction.

What are the reasons for this being happening?

The Bitcoin network confirms one block of transactions approximately every ten minutes. The blocks are produced in a random process by miners. Each miner may select their own set of transactions to confirm, and therefore whoever is successful at finding the next block determines which transactions get confirmed.

Since the blocksize is limited to 1,000,000 bytes, the number of transactions that can be confirmed per block is limited as well. Miners maximize their mining revenue by selecting the transactions first that pay the largest fee rate, i.e. the greatest amount of satoshis per byte of blocksize the transaction requires.

Thus, users are bidding with "transaction fees" for inclusion into a limited supply of blockspace. The network is "congested" when a lot of more transactions bid for inclusion than can find space in the blocks.

Multiple proposals to upgrade the network's capacity exist. Especially the segregated witness proposal has been production ready for several months and is waiting to be activated. Unfortunately, an insufficient portion of the hashrate is signaling readiness for its activation at this point in time.


mSigna: Signed, send, but 0 confs despite high fee (0.001 BTC) Tried to send my first tx from mSigna today. Receiving was painless, but the send does not get included into a block since half a day, and dozens of blocks passed.

I unlocked the account, created the tx, signed and sent it. The confirmation count for my receiving tx still rises (as more blocks arrive), but the one for the sending tx stays 0. Sounds like enough support to me...

I feel I am missing important information, like I need to do some step in addition?

The only calculation for the fees I found is at bitcoinfees, but it's based on average tx size. It currently recommends 0.0002712 BTC, which is well below the fee I payed.

blockchain.info says "Transaction not found". Looking at the adress at blockchain.info, it says "0 transactions".

I'm running mSigna 0.10.6 with Bitcoin Core QT 0.14.2 (64bit) locally.

EDIT: As I read somewhere that transactions based on unconfirmed payments take longer than usual, I wanted to add that my receiving transaction is shown with over 6000 confirmations (again up from yesterday).

You can use another wallet to test your network. Don't worry about the fee, it's enough. Mostly one tx will be confirm in 2 hours.


How does Blockchain as a Service (BaaS) work? I've been so entrenched in the world of cryptocurrencies that I'm confounded by how a Blockchain as a Service would work in the enterprise realm.

Both Microsoft and IBM have BaaS offerings, advertising that it will change the way your business functions.

I'd like to know, in general, how a blockchain system is run in the enterprise. Several questions come to mind:

Who runs the nodes?
How many miners are required? I'm assuming the hashpower your own enterprise systems could provide would not be substantial enough to have impenetrable security.
Who provides the hashpower? The BaaS provider, or your own network of computers?
Since you are the owner of this blockchain, how is this more secure than just a regular (encrypted) database with strict access control?
What is the format of the data stored in these blockchains? Are they able to insert any custom data format and payload in each transaction, since it is a proprietary blockchain?
Besides security in the form of immutability, what other benefits does a blockchain in the enterprise provide?

Who runs the nodes?

It depends on the type of Blockchain network you referring to. Typically it is permissionless or permissioned. For the permissionless; anyone/ any organization can volunteer to run full nodes as long as they ready to allow spare computing and bandwidth resources. No incentive Nor reward for this service. In future respective Blockchain company /developers - they may consider for incentive/s or rewards. This would ensure  more and more nodes running at a given point in time. More nodes means more secure for the block mining and there by your secure transaction/s. In recent past, there has been significant drop in "running full nodes". This is a bit of concern.

In addition, permissionless P2P network no access control is needed. Ex. bitcoin/ ethereum supports X.509 certificates and SSL encryption to verify receivers’ identity and help prevent man-in-the-middle attacks. Besides, Blockchain security validate each new block and follow protocol proof-of-work/stake which guarding against the bad actors.


How do I build Bitcoin in Fedora 18? There are instructions for building on Ubuntu/Debian, but I want to build it in Fedora.

You will have to rebuild OpenSSL, since the build shipped by Fedora/Red Hat does not include support for elliptic curve cryptography, on which Bitcoin relies. So you have to build your own.

Once that's done, you can get on with building Bitcoin normally, provided you point it at your private build of OpenSSL with -rpath.

Or, you can just skip all the work and use my existing Yum repository. This also gives you standards-compliant paths, as well as an SELinux-enabled bitcoind. Read the RPM spec files if you're really interested in the build process.


Is there any open source tool to verify segwit transaction without publishing it? I have created below transaction:

020000000001016c6bb8dbaa1e6b25d1267487b22206275c90a5aa8c28eb3c3aa87c97d717cf460000000017160014b6f9a9a9f51190e22798f85983c4f53fab1385a4ffffffff01faba00000000000017a914d6894287b4a028cd75ee8649ea3d59dba76ee55487024730440220373a133c6cbb6086d3e6c7152b3dda362c54dd7b2cdee60f40b862bd4cc4e012022008f034ac4c955e78a33833e485590e7598a9a19cd2196901e2e6f4d147dac4030121029d7cf71205e62ff34ff56ccd695e073397bf3330879dad2d2ffeff703748feb800000000

This is P2SH-P2WPKH signed transaction created by my python program. My intention is to validate my code without loosing bitcoins in the process. I did not find an option in bitcoin-cli to validate it. If there is any open source bitcoin client or online tool i can use to validate it, it will help in my testing.

You can use the testmempoolaccept RPC command if you're spending an existing output.

But setting up a regtest to make fake transaction is preferable.


How and why increasing and decreasing block size will affect transaction fees? I am reading an article on bitcoin wiki about bitcoin block size https://en.bitcoin.it/wiki/Block_size_limit_controversy and it says that increasing block size will lead to "Bitcoin competitors will have lower fees" so fees will increase if we increase block size. But also it says that decreasing block size will lead to "Fees will not be zero. This is eventually a necessity in order to incentivize miners and secure the mining ecosystem" so fees increase again. It is very strange that no matter what we do transaction fees always increase. What am I missing?

What any particular change will do to fees is mostly speculation.

A larger block size will not necessarily reduce fees, however, given the current fee model is an auction for limited bandwidth model, it is likely that selling pressure in the auction would be reduced if block sizes were increased. The inverse would be expected initially if blocksize was smaller although, if transaction bandwidth is stifled significantly it also seems likely that consumers may then seek an alternative to Bitcoin since their demand cannot be satisfied. Block size is a delicate balancing act.

Larger block size and a corresponding reduction in fees, if attained, may also harm the mining effort and force miners to seek an alternative as block rewards further reduce in the future. Mining may then no longer be viable even with ASIC hardware.

As I say, much is to speculation.


Can I install a wallet on Windows Server 2008? I was wondering if I could I install a wallet on Windows Server 2008? If so which wallet?

You can install "Bitcoin-Core" (including Bitcoin-Qt) on a window server 2008. It requires initial syncing and verification of around 40GB of data. So it might take 1-2 days until you can use it.

Other option would be to install a SPV client like "Electrum" (Python based) or "Multibit HD" (Java / bitcoinj based). They can be used immediately but they won't give you the same level of privacy.


Is there any way for me to recover or reclaim a confirmed but unspent transaction that was sent to the wrong address? I sent money to the wrong address. I am not a developer and I only understand the blockchain in its most general terms.....but I use bitcoin everyday so I have a working knowledge of it. It's hard for me to get anywhere because I know none of the languages, anything about scripting, and can't even run a install via command prompt.....I'm working on it though. Is there a way for me to either recover, regenerate, or resend my misplaced transacrion? I see it there on blockcypher. I tried to import into one of my other wallets but it won't go because I assume I need the private key. Please help.

Confirmed Bitcoin transactions are final and cannot be undone. Try asking the receiver to send the funds back.

Edit:

If you did the transaction between accounts on an exchange, it probably can be cancelled by the exchange team.


How would we know the real Satoshi? Should Satoshi decide to reveal his or her true identity, how can one know the person is the real creator of Bitcoin, rather than a person who hacked the forum login, email address or the like? In other words, what methods of authentication did Satoshi use that could clearly identify him or her?

He has a PGP public key which he can use to sign things.


What are the keys used in the blockchain levelDB (ie what are the key:value pairs)? I am wondering if I can use node.js and levelup to access a copy of the blockchain database directly.

But from what I can see, I need to know the name of the key(s) before I can get any data, as this is used in the get method of levelup.

However, I have not been able to find out anything about the possible key(s) associated with the values in the key value pairs, so I'm at a loss as to how I might retrieve the data.

Firstly, what are the keys in the key value pairs, and secondly is it possible just to select the first n records?

Bitcoind since 0.8 maintains two databases, the block index (in $DATADIR/blocks/index) and the chainstate (in $DATADIR/chainstate). The block index maintains information for every block, and where it is stored on disk. The chain state maintains information about the resulting state of validation as a result of the currently best known chain.
Inside the block index, the used key/value pairs are:

'b' + 32-byte block hash -> block index record. Each record stores:

The block header.
The height.
The number of transactions.
To what extent this block is validated.
In which file, and where in that file, the block data is stored.
In which file, and where in that file, the undo data is stored.

'f' + 4-byte file number -> file information record. Each record stores:

The number of blocks stored in the block file with that number.
The size of the block file with that number ($DATADIR/blocks/blkNNNNN.dat).
The size of the undo file with that number ($DATADIR/blocks/revNNNNN.dat).
The lowest and highest height of blocks stored in the block file with that number.
The lowest and highest timestamp of blocks stored in the block file with that number.

'l' -> 4-byte file number: the last block file number used.
'R' -> 1-byte boolean ('1' if true): whether we're in the process of reindexing.
'F' + 1-byte flag name length + flag name string -> 1 byte boolean ('1' if true, '0' if false): various flags that can be on or off. Currently defined flags include:

'txindex': Whether the transaction index is enabled.

't' + 32-byte transaction hash -> transaction index record. These are optional and only exist if 'txindex' is enabled (see above). Each record stores:

Which block file number the transaction is stored in.
Which offset into that file the block the transaction is part of is stored at.
The offset from the start of that block to the position where that transaction itself is stored.

Inside the chain state database, the following key/value pairs are stored:

'c' + 32-byte transaction hash -> unspent transaction output record for that transaction. These records are only present for transactions that have at least one unspent output left. Each record stores:

The version of the transaction.
Whether the transaction was a coinbase or not.
Which height block contains the transaction.
Which outputs of that transaction are unspent.
The scriptPubKey and amount for those unspent outputs.

'B' -> 32-byte block hash: the block hash up to which the database represents the unspent transaction outputs.

Latest version of bitcoind(please add version compatibility) uses obfuscation of the value in key/value pair . So you need to XOR with the obfuscation key to get the real value.
I won't go into the specific serialization details of the particular records. They're often specially designed to be compact on disk, and not really intended to be easily usable by other applications (LevelDB doesn't support concurrent access from multiple applications anyway). There are several RPC methods for querying data from the databases (getblock, gettxoutsetinfo, gettxout) without needing direct access.
As you can see, only headers are stored inside this database. The actual blocks and transactions are stored in the block files, which are not databases, but just raw append-only files that contain the blocks in network format.
As to your second question: what is n? If you just want to access some records, sure, iterate over the keys and stop when you've read enough.


BTC recovery from registration details without wallet.dat I started mining march 2009, i remember registering. is there any way to get my BTC back from the registration process? I know you need the wallet.dat and the password or key to access the BTC, but is there any way to get my BTC back. I am desperate, the fact that i know i have money out in the ether, but yet have none is killing me. I vaguely remember when i signed up they just added a registration process that linked my info to the coins i generated in 03/2009. I know there are lists of dormant addresses, can they be used to get my BTC back? Please help

is there any way to get my BTC back from the registration process?

In general there is no registration process for buying or mining bitcoin or for most types of bitcoin wallet. Certainly not in 2009.

I started mining march 2009, i remember registering.

There is no registration process for mining. At least not in the January 2009 Bitcoin software released by Satoshi Nakamoto.
At that time, I believe mining would have placed any mined coins into an address controlled by the private-key in a wallet on your PC.
Registering for a custodial wallet service (trading/exchange service)
There may have been a registration process if you had a "custodial" wallet, a type of wallet where you arranged with a third party for them to manage your wallet on your behalf. There are many such companies, all different. In that case you would have to contact the specific company that you registered with. This would not have been the case in March 2009 but maybe in later years you signed up with a custodial-wallet business to use their trading services? (In any case, this paragraph may be helpful to later searchers who find this question because they have the problem expressed in the title).

there are lists of dormant addresses, can they be used to get my BTC back?

No. To regain control of the BTC you need the private-key that was stored in the wallet. The address is not enough.


what would happen to an assigned block if the solo miner stops mining it? As a solo miner, what happens to the block that has been assigned to the miner if after a short time he stops mining it altogether.

The "work" of mining consists of finding a "solution" to a list of transactions. The miners throw in a 'bonus' transaction paying themselves as a reward for solving the problem. But only if they solve their problem "fast enough" do they actually get paid. (Other people are solving their own problem, and there is only one global winner per block. Once a winner is found, everyone starts over on the next block)

In a pool, the master creates a block to work on (giving a bonus to the master) and gives it to the slaves. All the slave workers try to solve that one problem at the same time (adding their power together). If the solution is found in time, the master gets the bonus, and distributes it to the workers in the pool.

So if there are no workers in a pool, obviously no solution can be found, so the master won't get paid.

On the other hand, a "solo miner" doesn't have "assigned blocks". He creates his own problem (giving payout to himself). If he stops working on that problem, he doesn't get paid. Only people who solve the problem (fast enough) can get paid.


What kind of privacy does Taproot give bitcoin? I understand that confidential transactions hide the amounts sent and received. But what does the new taproot privacy technology hide for bitcoin?

Taproot allows inputs to hide the fact that there is a script specifying a contract. If sufficient parties involved in that contract agree and cooperatively spend the Bitcoin, that input looks just like any other input, including ones that do not have contracts and have only one person.

This helps privacy as the conditions of a contract are hidden. This also makes such transactions smaller which will save on fees.


When opening a LN channel using LND, what does 'push-amt' do? I set up Lightning node (LND) and wanted to receive a payment. Autopilot for managing the channels always creates channels w/ zero remote balance, thus nobody can route a payment to/through my node.

The command for manual channel opening is lncli openchannel [command options] node-key local-amt push-amt. If I specify nonzero push-amt, the remote balance is then, unsurprisingly, nonzero.

But what I find very confusing is "whose" money that was? Have I just given my peer free bitcoin?

The help command for openchannel push-amt states: the number of satoshis to push to the remote side as part of the initial commitment state (default: 0).

The money now belongs to the counterparty in the channel you opened. In every one of your channels, whether you opened them or they were opened to you, "local balance" refers to your spendable/forwardable balance and "remote balance" refers to the counterparty's.

Don't worry though, if your node stays online reliably, then others will open channels with you, giving you inbound capacity. At this stage there's not much else you can do.


How can I find the "real" difficulty on testnet? As is well known, testnet has a "20-minute rule": if no block is found within 20 minutes, the mining difficulty drops to 1 until a block is found.

From some experimentation, it appears that bitcoind's getdifficulty function reports the difficulty of the most recent block.  Thus, if the most recent block was mined under the 20-minute rule, getdifficulty returns 1.

In this case, how can I find the "real" difficulty level?  That is, the difficulty that would be required of a block submitted less than 20 minutes after the previous one?

The best approach I have found so far is to follow the blockchain back until I find a block with a difficulty other than 1 (or less than 20 minutes after the block preceding it).  But this will be prone to error if a difficulty adjustment has recently taken place.

bitcoind must know the real difficulty at all times; can I query it?

You can use the getblocktemplate RPC command and look at the target field.


What impact could the patents applied for by Craight Wright have on Bitcoin development if granted? What impact will this have if all the patents he applied for are granted. Could it create liability for Bitcoin developers who attempt to use some of his patented ideas when making future pull requests?

"Since February, Wright has filed more than 50 patent applications in Britain through Antigua-registered EITC Holdings Ltd, which a source close to the company confirmed was connected to Wright, government records show."

"Nearly all the British filings involve the term "blockchain" or its more generic description, the "distributed ledger". The patent approval process typically takes several year"

Searching the http://patents.stackexchange.com site, I found a question that linked here:

http://ask.metafilter.com/216885/What-happens-if-an-opensource-app-intentionally-violates-a-software-patent#3129948

  An open source program can infringe a patent just the same as a
  commercial one. There is no requirement that the infringement be for
  profit, since infringement may consist of making, using, selling,
  offering to sell, or importing the invention. 35 U.S.C. § 271.
  Infringement may be direct (i.e. the author making the software) or
  indirect (e.g. the author distributing it to others intending that
  they use it in an infringing manner).

  What's more, by copying a program knowing that it likely infringes a
  patent, the open source author may be liable for willful patent
  infringement. That carries with it the possibility of treble damages
  and an award of attorney's fees and costs. 35 U.S.C. § 284.

So yes, it appears as though Bitcoin developers could be held liable.

The article also continues to state that it is often not financially feasible for patent holders to go after open source software, since software is global but patents vary country to country.  Also, there are not necessarily assets to be won from open source developers.

Personally, I feel that Craig Wright has been applying for patents not to target Bitcoin, but the growing blockchain industry.  The banks and financial institutions adopting blockchain solutions do have assets that can be easily won (or settled) with patent suits.

DISCLAIMER: I am not a lawyer, and am way out of my element with this answer :)


API to know if bitcoin-core has the private key (in the wallet.dat file) of a certain Bitcoin address? Does the bitcoin-core client have any RPC API to query the key pool? I have certain bitcoin address which I want to check if the wallet has access to (either via private key or via HD-private key derivation).

Is there a way to programmatically check this? I was going to use signmessage but that would need me to unlock the wallet with the passphrase first.

Use validateaddress [address].

It will give you all information about that address, including whether it has the private key (it will "ismine" : true and "iswatchonly" : false.


How does createrawtransaction get the pubkey hash from the provided address? The createrawtransaction RPC takes as parameters the source TX ID and the UTXO index (to create the new unsigned input) and the destination address and amount of bitcoins (to create the new output).

In the output created, the scriptPubKey is a standard P2PKH script containing the pubkey hash. What I don't understand is...if createrawtransaction only received the address, how did it get the pubkey hash from it?

I understand that going from the pubkey hash to the address is pretty easy:

[PubKey Hash] -> Add network bytes -> SHA-256 -> SHA-256 -> checksum -> Base58Check -> [BTC Address]

So how does createrawtransaction go the other way from BTC Address -> PubKey Hash?

To show this, you can follow my steps using this web based interface of Bitcoin API:

http://chainquery.com/bitcoin-api/createrawtransaction

In that page, let's use this transaction for the Outpoints

f0f5ad66b8c09a8b5ec5a379439281a32fc446e0185c3b1b854880d3dc49d065

and output index 3

Now, for the Outputs, use this address

183XLwHyKJGCD9Dj9Pafv2zoqfiXWd5WMZ

and put 0.00159468 as the amount of BTC.

Click Execute Command and you should get this result

{
"result": "020000000165d049dcd38048851b3b5c18e046c42fa381924379a3c55e8b9ac0b866adf5f00300000000ffffffff01ec6e0200000000001976a9144d430ac5863757f5dc45f475d7cd2ccf43cf784588ac00000000",
"error": null,
"id": null

}

Now, let's decode this transaction with decoderawtransaction RPC

http://chainquery.com/bitcoin-api/decoderawtransaction

Just put there the "result" field value you got from the previous response. Click Execute Command and you'll get the raw transaction

{
"result": {
    "txid": "8d02780fbd265fdeaf08195b5488fc309270a8ff9d23043d0dfc9a0d8599a01c",
    "hash": "8d02780fbd265fdeaf08195b5488fc309270a8ff9d23043d0dfc9a0d8599a01c",
    "version": 2,
    "size": 85,
    "vsize": 85,
    "locktime": 0,
    "vin": [
        {
            "txid": "f0f5ad66b8c09a8b5ec5a379439281a32fc446e0185c3b1b854880d3dc49d065",
            "vout": 3,
            "scriptSig": {
                "asm": "",
                "hex": ""
            },
            "sequence": 4294967295
        }
    ],
    "vout": [
        {
            "value": 0.00159468,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 4d430ac5863757f5dc45f475d7cd2ccf43cf7845 OP_EQUALVERIFY OP_CHECKSIG",
                "hex": "76a9144d430ac5863757f5dc45f475d7cd2ccf43cf784588ac",
                "reqSigs": 1,
                "type": "pubkeyhash",
                "addresses": [
                    "183XLwHyKJGCD9Dj9Pafv2zoqfiXWd5WMZ"
                ]
            }
        }
    ]
},
"error": null,
"id": null

}

If you see the scriptPubKey script, i.e.

OP_DUP OP_HASH160 4d430ac5863757f5dc45f475d7cd2ccf43cf7845 OP_EQUALVERIFY OP_CHECKSIG

you can see the pubkey hash is there

4d430ac5863757f5dc45f475d7cd2ccf43cf7845

and this pubkey hash matches the address given as parameter in the beginning. You can verify this by pasting the pubkey hash in step #3 in this page:

http://gobittest.appspot.com/Address

and clicking Send. You should get this address

183XLwHyKJGCD9Dj9Pafv2zoqfiXWd5WMZ

in step #9.

So, my question once again...how did createrawtransaction go from the address to the pubkey hash if it didn't have the public key?

I think I can answer my own question...

I just saw the code of createrawtransaction and what it does is a Base58 decode, remove the checksum and network bytes and it gets the pubkey hash.


Question about retarget system bitcoin, add hardcodet block to exist blockchain the standard values

    if (nActualTimespan < params.nPowTargetTimespan/4)
        nActualTimespan = params.nPowTargetTimespan/4;
    if (nActualTimespan > params.nPowTargetTimespan*4)
        nActualTimespan = params.nPowTargetTimespan*4;

but if i use

        if (nActualTimespan < params.nPowTargetTimespan/4)
            nActualTimespan = params.nPowTargetTimespan/4;
        if (nActualTimespan > params.nPowTargetTimespan*2)
            nActualTimespan = params.nPowTargetTimespan*2;

It's be valid or it's can broke diff system ?

What values can i add for diff is not grow very quickly, but drop faster than grow for it be more stable for fast block time.

setting of block time is

consensus.nPowTargetTimespan = 10 * 60; // 10 min
consensus.nPowTargetSpacing = 5 * 60; //5 min

And another question

I try use the exist function low diff block what created for testnet for only block with Height 2001 .
Previous exist block is 2000  and latest now in blockchain.

if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
{
    if(pindexLast->nHeight+1 == 2001)
    {
        // Special difficulty rule for testnet:
        // If the new block's timestamp is more than 2* 10 minutes
        // then allow mining of a min-difficulty block.
        if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2)
            return nProofOfWorkLimit;
        else
        {
            // Return the last non-special-min-difficulty-rules-block
            const CBlockIndex* pindex = pindexLast;
            while (pindex->pprev && pindex->nHeight % params.DifficultyAdjustmentInterval() != 0 && pindex->nBits == nProofOfWorkLimit)
                pindex = pindex->pprev;
            return pindex->nBits;
        }
    }
    return pindexLast->nBits;
}
else
{
    if (params.fPowAllowMinDifficultyBlocks)
    {
        // Special difficulty rule for testnet:
        // If the new block's timestamp is more than 2* 10 minutes
        // then allow mining of a min-difficulty block.
        if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2)
            return nProofOfWorkLimit;
        else
        {
            // Return the last non-special-min-difficulty-rules-block
            const CBlockIndex* pindex = pindexLast;
            while (pindex->pprev && pindex->nHeight % params.DifficultyAdjustmentInterval() != 0 && pindex->nBits == nProofOfWorkLimit)
                pindex = pindex->pprev;
            return pindex->nBits;
        }
    }
    return pindexLast->nBits;
}

And use new rule retarget for new block's after 2001 and accept old block with old retarget rule.

   if(pindexLast->nHeight+1 > 2001)
    {
        if (nActualTimespan < params.nPowTargetTimespan/4)
            nActualTimespan = params.nPowTargetTimespan/4;
        if (nActualTimespan > params.nPowTargetTimespan*2)
            nActualTimespan = params.nPowTargetTimespan*2;
    }
    else
    {
        if (nActualTimespan < params.nPowTargetTimespan/4)
            nActualTimespan = params.nPowTargetTimespan/4;
        if (nActualTimespan > params.nPowTargetTimespan*4)
            nActualTimespan = params.nPowTargetTimespan*4;
    }

About what i asking , is this solution is right and it will work, or this solution is wrong end exist another way to do this ?

if (nActualTimespan < params.nPowTargetTimespan/4)
        nActualTimespan = params.nPowTargetTimespan/4;
    if (nActualTimespan > params.nPowTargetTimespan*2)
        nActualTimespan = params.nPowTargetTimespan*2;

This does the opposite of what you want. It increases the difficulty quickly, but decreases the difficulty slowly.

Here's what you meant to do:

    if (nActualTimespan < params.nPowTargetTimespan/2)
        nActualTimespan = params.nPowTargetTimespan/2;
    if (nActualTimespan > params.nPowTargetTimespan*4)
        nActualTimespan = params.nPowTargetTimespan*4;


Is it 'safe' to store hashed values of my mnemonic seed phrase on my computer? I am setting up my hardware wallet, and have written down my mnemonic seed phrase physically, but also want a way of accessing it from my computer.

If I add all the seed words together, and hash it by a specific combination of the existing words, would it be safe to store on a computer?

The outputs of hash functions cannot be reversed. So what is the point of storing the hash of your seed? Perhaps you mean an encrypted version of your seed? That would be storing the ciphertext of your seed. You could do that but just so you know there's already an encrypted version of your seed stored in your wallet file. Otherwise there would be no way for the wallet to sign spending transactions.


Who set the rules for validating a block in blockchain? Who set the rules for validating a block in blockchain?

The rules can be set the creator of the blockchain network.
There might be some rules on the application that uses the blockchain network.

Is it true?

How does the rules setting works, how does validation work.

The rules are set by the nodes on the network. The rules are coded into node software which users run. These rules are not necessarily set by the creator of the network as they can be changed if all of the users agree to change the rules by running different node software.


bitcoin transaction is still unconfirmed after 30+ hours Yesterday evening (6.45pm) i moved 1.4 bitcoin from my local bitcoin wallet to my blockchain wallet, the transaction was completed. But before the transaction was fully complete i submitted a request that the coins be sent to my electrum wallet. the transaction to my electrum wallet is still unconfirmed, what are my options at this point? im fairly new to bitcoin and looking for any advice/help. thank you

https://blockchain.info/tx/21b904c02634330718c23285979cfed8ce2ba769cf9a7cd95bac1083c052099e

here is the transaction.

I'm confused the transaction has 22 confirmations (right now).

A good way to speed it up is to use a Bitcoin Accelerator


(Bitcoin Core, recovering my wallet) problem finding the address I sent coins to in Bitcoin Core 0.11.2 Im trying to find my Address I sent my Bitcoins to but I do not know how to get into my wallet and since it is quite some time ago, I do not remember from where I sent it.

While trying to open Bitcoin Core on my Mac theres a popup saying that its unable to connect to port 8333 but the program closes afterwards.

Since there is a problem with opening the port I want to transfer the coins to an electrum address. For that I need my seed and the Bitcoin Address I sent my coins to. Is there a way to find it without opening port 8333 and synchronising the blockchain?

Will it be safe to deinstall it and try to boot it again?

Any ideas, suggestions are welcome!

Thanks

First you need to backup your wallet.dat file. Then, since your installation is from a while ago, I would recommend reinstalling bitcoin, and then importing your wallet.dat.

Backup wallet.dat

To copy your wallet.dat on a Mac:

Cmd+Space then type terminal

In terminal type:

cp ~/Library/Application Support/Bitcoin/wallet.dat ~/Desktop

I would recommend also backing up a copy to another computer or disk drive.

Install Bitcoin-core

Download and open .dmg file from bitcoin.org, and follow installation instructions.

Restore wallet.dat

To copy your wallet.dat back on a Mac:

Cmd+Space then type terminal

In terminal type:

cp ~/Desktop/wallet.dat ~/Library/Application Support/Bitcoin/

Then you can export your key to whatever wallet you want.


Can ripple currency units be integers? I understand with Ripple that anyone on the network can offer their own currency.  Someone cited the example of airline frequent flier miles.

Airline miles, in my experience, come in whole numbers.  I.e. 2000 miles, not 1999.5 miles.

If I start trading miles on Ripple, someone could easily offer to buy or sell in fractional units.  So balances in ripple wallets could be 1999.5 miles, right?

Is there any way in Ripple to force the units of a particular currency to be integers?

I'm asking about what appears in the wallets.  I know that within the system the units are integers.  I.e. 1 XRP = 1,000,000 drops.  I'm asking about the balances shown to users in their wallets.

Gateways can refuse to issue or redeem fractional amounts and users can refuse to pay them. But there is no authority to say to someone "you may not hold a fractional amount of this currency". Nobody can stop you from holding fractional amounts if you wish to.


Electrum wallet giving dust error even for larger amount I have used this wallet sever times before to send or receive. I closed, downloaded and tried again to send to multiple addresses.
Error message:
http://imgur.com/Om2Dqyi

Please try switching servers using the Network option or the green dot button in the bottom-right. Try making the same payment from a different server.


What is the email of Satoshi Nakamoto? I know the Satoshi Nakamoto profile: https://bitcointalk.org/index.php?action=profile;u=3 and his public key: http://forum.bitcoin.org/Satoshi_Nakamoto.asc

And I know maybe Satoshi is not a real person, but a pseudonymous of a group of people.

But there is a way to send a message to Satoshi? Is there a public email? Any kind of contact?

He used satoshin@gmx.com (from original Bitcoin whitepaper) and satoshi@vistomail.com (from email logs). gmx.com is a free email service that may or may not have had location based restrictions on registration at the time. vistomail.com is an email service from anonymousspeech, the domain registrar proxy he used to register bitcoin.org.


I don't understand the "51% attack" problem. Why does a mining pool have power with a 51% share? What gives a mining pool power to maliciously dominate the system if they're mining over the majority of the coins? Profits are disseminated to miners individually. I really don't understand how this enables a bunch of individuals to conspire to warp the market. I think I'm fundamentally misunderstanding the problem. Can someone explain how having a 51% share enables a pool to prevent, reverse, or double spend transactions?

Conceptually it isn't difficult to understand conflicts of interests (COI) principles.  If a pool has over 50% of the computing power required to demonstrate adequate "proof of work" to add entries to the Blockchain Ledger, this absolute centralized power will eventually "absolutely corrupt".

That centralized pool could be used to change the history of what constitutes the longest chain in the Blockchain by computationally orphaning blocks that were legitimately mined by other pools or solo miners. When a pool gets very large, do you honestly think it will not be tempted to modify the nominal Bitcoin transaction priority scheme?

If a pool has roughly a third of the computing power used to populate a Blockchain, they can start to statistically change the destiny of the Ledger, especially if all of its miners are using STM mining protocol. This is because miners are effectively slaved to the set of transactions the pool decides is important to mine, whether legitimate or not. When STM is used, the pool sets the mining block agenda, not the miners. Can you now see where the COI enters into the picture?

If miners use GBT, opposed to STM, they have more choice in the grouping of candidate transactions they bundle together for mining as long as they follow a template. As long as those miners are not colluding with the pool, this will help keep the large pools honest. The problem is GBT coordination sucks more network bandwidth, effectively ever so slightly lowering the profit margins miners can achieve. Most miners are interested in maximizing their profits, and are thus likely not to adopt GBT.

Knowing this information, and looking at the two big to fail pools is very disheartening. A barometer for when the big pools have gotten too large is when numerous small pools suddenly have higher orphan block rates, and their mining profits start to go south of what is expected for known difficulty factors for a protracted period of time.

To keep large pools honest, for the good of the public, the large pools that mine 25 to 30% or more of the Bitcoins need to support transparency with above the board full disclosure policy of what they are currently mining in advance of advertising their lucky block strikes. Such transparency, helps to ensure they are not violating the trust of good Internet netizen miners competitively mining at other pools.

This is a very hot topic.  From the flack that I received (i.e., negative Bitcoin Stack Exchange passive-aggressive votes) when asking a prior related question, I believe this is something that must be watched very closely...

FYI - I'm a security consultant and a guy that did wargaming for over 10 years.


What are the advantages of running a full node in comparison with a lightweight client? I read that running a full node provides "more security" than running a SPV client. What does this concretely mean? I think I understand pretty well how those two kinds of nodes work but I do not see what risks one takes running a SPV node. True a lightweight client cannot check by itself that unconfirmed transaction are valid. Is this the only difference as regards security? Even for a full node, accepting an unconfirmed transaction is not totally safe.
I am asking this question because I try to understand what would be the effect of bigger blocks on the Bitcoin network. Therefore I need to understand why people choose to run full nodes/lightweight clients. I see very well why some people would choose to run SPV nodes but I don't understand why somebody would rationnaly chose to run a full node.

Thank you by advance!

A lightweight client cannot even check for itself that a confirmed transaction is valid.  It has to trust that miners will not spend time confirming invalid transactions.

If you have an SPV client and I am an evil miner with a substantial amount of mining power, I can make a transaction with a nonexistent input (essentially creating coins out of thin air), and include it in a block I mine.  This block won't be accepted by any full node, because they will have a complete transaction register and will know that the input is nonexistent, but your SPV client would accept it.  If I then mine some more blocks on top of my bogus block, your SPV client will think that transaction has several confirmations.  This  will work particularly well if I can mess with your network connection so that you can't connect to any full nodes except for evil nodes controlled by me.

Of course this attack is fairly costly for me, since I have to spend mining power that could otherwise generate legitimate coins, but maybe it is worth it if I can buy something valuable from you and pay with fake coins.  So if you are in the business of selling high-value goods, you might very well consider it worthwhile to have a full node.


How do I store coins during the bitcoin segwit2x hard fork? Where should I securely store my coins during the fork? A Legacy address or a Segwit address?
I keep them on a Segwit address right now but I want to be sure that the fork won't affect my funds if kept on a Segwit address during the split.

It doesn't matter. Both types of addresses are safe during the hardfork, and you'll have access to both coins.

Have a nice weekend.


Can't reach remote bitcoin rpc server I got vps with ubuntu 18.04 with ssh access and bitoind set up on it. This is my bitcoin.conf file:

testnet=1
prune=35840
maxconnections=12
muxuploadtarget=20
daemon=1
server=1
rpcclienttimeout=5000
rpcuser=[usr]
rpcpassword=[psw]
rpcallowip=0.0.0.0/0

This is my rpc call:

curl --data '{"jsonrpc":"2.0","method":"getwalletinfo","params":[]}' http://[usr]:[psw]@localhost:18332

When it given in vps terminal, that return json response just like it meant to be, but when i got this request on another machine:

curl --data '{"jsonrpc":"2.0","method":"getwalletinfo","params":[]}' http://[usr]:[psw]@[myvpsip]:18332

terminal returns:

curl: (7) Failed to connect to [myvpsip]: Connection refused

This is my result for "sudo netstat -tuwpln" on vps, pasted results only with bitcoind:
:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      2027/bitcoind
tcp        0      0 0.0.0.0:18333           0.0.0.0:*               LISTEN      2027/bitcoind
tcp6       0      0 ::1:18332               :::*                    LISTEN      2027/bitcoind
tcp6       0      0 :::18333                :::*                    LISTEN      2027/bitcoind

Already checked firewall and it has Status: inactive. Iptables also empty. Got connection over ssh, so server is able. Also pinged well. I still think that problem is in bitcoin.conf but don't know exactly where is it. Can anyone help solving this problem? I would be really greatful

P.S. Writing script on python and one part of it is bitcoin payments, so really need solution for this. If there easier way for payments would like to familirize.

Please keep in mind that exposing your node's RPC interface to the entire internet is considered to be unsafe. RPCs are not encrypted so anything that you send to your node will be in cleartext for any man in the middle to see. This includes things such as your RPC username, RPC password, and wallet password. If an attacker were to see any of this information, they can execute commands on your node including ones that move any Bitcoin stored in its wallet. Attackers can also do other things like force your node onto an alternative blockchain or force your node to connect only to malicious peers.

Instead of exposing your node's RPC interface publicly, you should instead setup a VPN which has your VPS and other computers that will access your node's RPC interface and have the RPC interface exposed to the VPN. This is far safer as the RPCs will be encrypted and only computers within your VPN will be able to access your node.

The reason that you see that error is that Bitcoin Core no longer binds to 0.0.0.0/0 when -rpcallowip=0.0.0.0/0 is set. You must explicitly tell it to bind to 0.0.0.0 using -rpcbind=0.0.0.0. This functionality was removed for the reasons stated above. I highly recommend that you do not do this and instead setup a VPN and then bind your node to your IP address within that VPN.


Running LND on testnet and mainnet at the same time on the same pc I have two instances of bitcoind running, one on mainnet, one on testnet, without any problems.

I can't seem to find any decent documentation on running two instances of LND at the same time on the same computer. Currently I switch between the two.

Is it possible? Are there caveats? Any pointers would be appreciated.

It's perfectly possible to run several LND nodes on the same computer.
This is how I did it:

create separate folders for each LND node
In each folder create a lnd.conf file
make sure you set the datadir and the logdir to point to the folders you just created
make sure that each configuration uses different ports for rpclisten, listen and restlisten
adjust all other configuration to your liking. You can have multiple clients point to the the same btcd client (that's the one I used, but I'm sure it also would work with bitcoind) and the same chain or different chains
run lnd --configfile=path/to/your/lnd.conf for each lnd client you want to run

"pro"-tip
I've made aliases in .bashrc for the lnd and lncli commands for each different node.
So:
alias lnd-alice="lnd --configfile=path/to/alice/lnd.conf"
alias lnd-bob="lnd --configfile=path/to/bob/lnd.conf"
alias lncli-alice="lncli --rpcserver=localhost:10001 --macaroonpath=path/to/alice/data/chain/bitcoin/mainnet/admin.macaroon"
alias lncli-bob="lncli --rpcserver=localhost:10002 --macaroonpath=path/to/bob/data/chain/bitcoin/testnet/admin.macaroon"

To run the lnd node for alice I just type lnd-alice and then lncli-alice create if it's the first time or lncli-alice unlock if the wallet is already initialized. (The macaroon path isn't needed for create and unlock but it doesn't hurt either.)
Same thing for Bob.
This guide was very helpful in finding the right info: https://dev.lightning.community/tutorial/01-lncli/index.html


Is there some kind of draft to support a chain split+merge, like Version Control systems do? Currently, if I didn't misunderstand, in case of a network split when the two networks merged again only one of them would be "valid" and everything else would be discarded.

This seems overly simplistic and un-technologic for me: a smart system able to handle splits and merge like distributed version control systems do (like hg or git). Of course that wouldn't be easy to do properly, and it's totally understandable it hasn't been done yet, but I would be surprised if nobody even bothered to draft some kind of proposal about it.

Does such a draft exist?

There is one inherent problem with the solution you described in regards to Bitcoin: the block chain is created in a very specific way. Each block in the block chain links to one and only one previous block, and it is encoded in such a way that if you change the internal structure of the block, it is no longer valid. You should look into the block hashing algorithm. Generally, if you wanted to merge two blocks together, you'd have to solve them all over again.

This does not mean, however, that the transactions from the invalid branch are lost. Unless the coins were already spent in the valid branch, one can take those "lost" transactions and include them in the next block to be mined. This would mean that the transactions would end up having a couple less confirmations, but they would still go through.


How do Bitcoin devs make sure that their modifications do not affect the consensus rules or the running network protocol? I understand that Bitcoin consensus rules are enforced by every single node individually.
However, most people run the default version of Bitcoin Core, which makes the implementations done by Bitcoin devs uttermost important.
So my question is in the title: how do they guarantee the implementations do not affect the consensus rules or network protocol?
While I also understand that each Bitcoin version is released with extreme care and extensive testing, I keep wondering whether there exists a systematic practice for this.
Any pointer would be highly appreciated.

"Best-effort". Formal proofs don't help. All one can do is to write tests, like any other well-written piece of software.
They also maintain forks of some dependencies such as LevelDB and don't update some of them such as BerkeleyDB.
See What Went Wrong. Especially the 2013 hardfork wouldn't have happened if they could ensure an unchanged consensus protocol.


How can I reproduce the same binary as bitcoin.org or bitcoincore.org? I'm hoping that someone can tell me how to get the same binary that we see on bitcoincore.org/bitcoin.org.
I tried using Ubuntu 20.04
git clone https://github.com/bitcoin/bitcoin
git checkout v0.20.1
sudo apt-get update
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 -y
sudo apt-get install libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev -y
./autogen.sh
./configure --disable-wallet
make
make install

Extra details (git commit I'm going off of)
 git log
commit 7ff64311bee570874c4f0dfa18f518552188df08 (HEAD -> 20.1, tag: v0.20.1)
Author: Wladimir J. van der Laan <laanwj@protonmail.com>
Date:   Fri Jul 31 14:01:56 2020 +0200

produces bitcoind: d46f9ca67562129cb2f0d7ed7e0ae576ab06e616d98d28c2a262d82356f9d87b

bitcoincore.org link I'm going off of:
https://bitcoincore.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz
produces bitcoind: 4ec74161b2a90293926ae8e20a2efbe952bd23b53aeebf051e6a6285ace18271
I was hoping that someone could tell me how to properly configure/setup my environment to produce the same binary that we see packaged nicely in the tarball on these websites.
The binary files aren't even close in size…
from tarball bitcoind size:
10312344 (10 MB)
from building from scratch bitcoind size:
192814984 (192 MB)
How do I make the super sleek and sexy 10 MB version?
Thanks!

The challenge with creating reproducible builds is that you need to ensure that the build process matches exactly across different operating systems and different architectures. Bitcoin uses Gitian, a deterministic build process to achieve that.
Bitcoin Core provides the configuration and build instructions for various operating systems in the /contrib/gitian-descriptors directory in the Bitcoin source code.
For Linux you would use this gitian-linux.yml.


Does hoarding really hurt Bitcoin? Some people believe that hoarding hurts the Bitcoin economy.
But are they really right?
As long as corresponding goods vendors and services will be here to stay and reinforce people's faith in Bitcoin, hoarded bitcoins simply do not take part in daily business and do not hurt anyone.
Quite the contrary, they will decrease the supply of bitcoins in active circulation, thus increase the demand for bitcoins, and thus raise their over-all value, right?
Update: This question also comes with a premise or insight that Bitcoin "power users" have savings and spendings wallets or similar setups, and that those two forms of wallets will not tend to "compete" with each other so much. The bitcoins in the spendings wallets will rather compete with the fiat money that respective users will use to buy for goods and services. The bitcoins in the savings wallets will rather compete with more traditional forms of assets and investments.

TL;DR: No. The argument is basically that hoarding will make Bitcoins so valuable that nobody will be willing to offer people enough to part with them. Does that pass the giggle test? Another way of stating the argument is this, "If gold is $2,000/oz today but people think it will be $5,000/oz next year, nobody will trade any gold today." Again, think about it. Does that pass the giggle test either?

Hoarding increases the value of Bitcoins, increasing the profits from mining. This encourages more people to mine, increasing the total hashing power and thus the security of the system.

It also makes holding Bitcoins more profitable. This helps to encourage people to accept them in trade because they are less worried about them decreasing in value while they are holding them. Using Bitcoins as a currency inevitably means people sometimes have to hold them and having them drop in value while you hold them is a risk. Hoarding reduces this risk. But it also makes it harder to price things in Bitcoins because the value will tend to change more. Merchants don't like to change their prices twice a day.

Contrary to claims, it should not affect the trading volume or the willingness of people to use Bitcoins to pay for things.

The argument that increasing value means people would prefer to hold Bitcoins rather than spend them is specious. While it will make people want to have Bitcoins more, it will also make people want to convince others to give them Bitcoins more so they can have them.

Think about it, do people prefer to pay for goods in dollars or garbage? By the reasoning of this argument, they should prefer to pay for goods in garbage, since they'd rather hold their dollars and get rid of their garbage. But, of course, people don't like paying in garbage because nobody wants garbage. If you can pay with the currency others want, you can get a better deal. So you actually prefer to spend the currencies sellers most want.

If Bitcoins are valuable because inflation doesn't deprive them of value, then a merchant would rather get my Bitcoins than my dollars, so he'll accept fewer of them. This will cancel out the effect of me preferring to pay in dollars rather than Bitcoins. So it should be a wash.

Or, put another way, whatever the present and future prospects, there should always be some equivalence between dollars and Bitcoins that people roughly agree on. So whether I pay X dollars or Y bitcoins, where X and Y are in this ratio, will purely depend on whether I prefer the characteristics of dollars or Bitcoins for the transaction.

A consequence of this is that hoarding won't negatively affect the trading volume either because that's only dependent on people's use of Bitcoins to buy and sell things. If hoarding makes Bitcoins worth twice as much, only half as many will be used to buy and sell things and the volume (the total value traded) will be the same.

I don't believe it's lost opportunity either. It's not like people who want to trade Bitcoins can't get them because they're all being hoarded. (Nor will it ever be likely to be an issue, since that would just raise the price and thus fewer would be needed. Bitcoins have effectively unlimited divisibility.)

So why do so many people think currency hoarding is bad? Because it usually is, and empiric studies even show that it is. But the logic of why currency hoarding is bad doesn't apply to Bitcoins, especially when it's a minority currency.

Bitcoins are different enough from physical fiat currencies that empirical studies don't apply unless the suspected mechanisms for the observed effects are believed to apply to Bitcoins too. For example, if a penny were enough money to buy a car, how useful would dollars be?


how to run multiple bitcoind node on one server? I have created one full node bitcoind on my VPS, that one is serving application A.
Now I want to create application B that has another node but on same VPS.
is that possible to install multiple bitcoind on one server using different wallet?
let's asume that I want application A connect to wallet.dat, application B to wallet_new.dat, with different bitcoin.conf configuration.

We can run 2 bitcoind nodes on a single server without installing it multiple times.
 We just have to create 2 data directory with a different configuration file (bitcoin.conf) for the 2 nodes. This configuration file should have different port numbers, user name and password specified.

Node1:

bitcoind -regtest -datadir=./bitcoinNode1/ -conf=./bitcoinNode1/bitcoin.conf -rpcport=19001 -port=19000

Node2:

bitcoind -regtest -datadir=./bitcoinNode2/ -conf=./bitcoinNode2/bitcoin.conf -rpcport=19011 -port=19010

You can also make the 2 nodes to connect each other by specifying the connect command while starting node2 as mentioned below.

bitcoind -regtest -datadir=./bitcoinNode2/ -conf=./bitcoinNode2/bitcoin.conf -rpcport=19011 -port=19010 -listen=0 -connect=127.0.0.1:19000


Using importmulti to import a single address to keypool does not work I create a wallet with private keys disabled.

Then use importmulti like so:

command curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importmulti", "params":[[{ "scriptPubKey": { "address": "bcrt1qeappehxje9d46zjeyvh3cqslzzda9p92nx2xg495e8memcjvppvqhk6hcn" }, "label": "Imported Address", "timestamp": "now", "watchonly": true, "keypool": true, "internal": false }], ''{"rescan": false}''] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18443/wallet/Test
result = Optional({
    error = "<null>";
    id = curltest;
    result =     (
                {
            success = 1;
        }
    );
})

But when I run getnewaddress it says keypool empty:

curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params":["", "bech32"] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18443/wallet/Test
result = Optional({
    error =     {
        code = "-4";
        message = "Error: This wallet has no available keys";
    };
    id = curltest;
    result = "<null>";
})

This also happens when I use importmulti descriptor approach to import a multisig.

I am trying to create a watch-only wallet for my multisig, where the only key that is in the keypool is the multisig address, just to make building transactions with the wallet seamless.

Currently the keypool is not an address pool. You cannot put addresses in the keypool. You need to be importing public keys in order for anything to be added to the keypool.


Generating Public & Private key pairs for cracking Bitcoin Would one of the better methods to crack Bitcoin be to start creating a massive database of key pairs? It would then be possible to reference the Private key required off the public key from the DB.

It will take significant resources (probably more electricity than can be generated by all fossil fuels on Earth) and time (orders of magnitude greater than the age of the universe) to generate a complete Bitcoin address "rainbow table".

See these answers for more details.


Does testmempoolaccept check all possible rejection rules? Is there any rejection rule that testmempoolaccept will not check, or is it safe to assume that if it passes testmempoolaccept validation it will be at least broadcast?
Mostly concerned about complex reasons, such as too-long-mempool-chain.

No it's not, or at least not at any point in time.
There are both invariant and time-dependent rules for the mempool to accept a specific transaction.
The testmempoolaccept command will check your transaction against the former (policy and consensus rules), but there is nothing you could realistically do to check the latter.
As an example of a time-dependent rule, you could have a software checking pre-signed transactions paying 253sat/kW of feerate against testmempoolaccept.
Valid transactions would pass the check, nonetheless they would not broadcast if the mempool minimum feerate is > 253sat/kW at the time of broadcast.


bitcoind: cannot obtain a lock on wallet directory Hello fellow bitcoiners,

I have a very annoying and mysterious issue with a bitcoind install. I had a blockchain corruption/stuck at some point. I deleted the old blockchain and copied an up-to-date blockchain from another machine. And now bitcoind does not succeed to run. When launched it complains about: "Cannot obtain a lock on wallet directory". I have deleted the .lock file, bitcoind obviously not running. After relaunch, the file gets created again. ps -aux | grep bitcoin returns no running process. bitoind starts (as a systemd service, which wasn't modified and run perfectly before, not in question). After the blockchain copy I chown the blockchain directory to the correct user on the target machine. I have enven  tried chown 777 giving all possible rights on the blockchain directory. Still have the lock issue.

Here is the debug log:

2019-12-22T21:26:19Z Using data directory /usr/local/bitc/blockchain
2019-12-22T21:26:19Z Config file: /usr/local/bitc/blockchain/bitcoin.conf
2019-12-22T21:26:19Z Using at most 125 automatic connections (1024 file descriptors available)
2019-12-22T21:26:19Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2019-12-22T21:26:19Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2019-12-22T21:26:19Z Using 4 threads for script verification
2019-12-22T21:26:19Z scheduler thread start
2019-12-22T21:26:20Z HTTP: creating work queue of depth 16
2019-12-22T21:26:20Z No rpcpassword set - using random cookie authentication.
2019-12-22T21:26:20Z Generated RPC authentication cookie /usr/local/bitc/blockchain/.cookie
2019-12-22T21:26:20Z HTTP: starting 4 worker threads
2019-12-22T21:26:20Z Using wallet directory /usr/local/bitc/blockchain
2019-12-22T21:26:20Z init message: Verifying wallet(s)...
2019-12-22T21:26:20Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2019-12-22T21:26:20Z Using wallet /usr/local/bitc/blockchain
2019-12-22T21:26:20Z ERROR: Error while attempting to lock directory /usr/local/bitc/blockchain: Permission denied
2019-12-22T21:26:20Z Cannot obtain a lock on wallet directory /usr/local/bitc/blockchain. Another instance of bitcoin may be using it.
2019-12-22T21:26:20Z Error: Error initializing wallet database environment "/usr/local/bitc/blockchain"!
2019-12-22T21:26:20Z Shutdown: In progress...
2019-12-22T21:26:20Z scheduler thread interrupt
2019-12-22T21:26:20Z Shutdown: done

Does anyone has a clue?

Best regards, cr!ptal.

Make sure that there is no other instance of Bitcoin Core running on your system. Once you are absolutely sure that nothing else is using the data directory, delete the files named .lock and .walletlock within it. Then start Bitcoin Core.


How Bitcoin decide which scriptPubKey use? I'm studying Bitcoin protocol, and I'm able to create address by my bash script.
The addresses "P2PKH" and "P2PK" have the same procedure.
Compressed or uncompressed public key – SHA256 – RIPEMD160.
When I create a transaction using createrawtransaction I can see that the protocol use P2PKH validation by default, and in listunspent I can find its scriptPubKey.
My question is: How the protocol (and where in the code) recognize the validation? I'd like to understand when the protocol add
OP_PUSHBYTES[33] PBKEY OP_CHECKSIG instead of OP_DUP OP_HASH160 OP_PUSHBYTES[20] HASH160(PB) OP_EQUALVERIFY OP_CHECKSIG and How can I use P2PK instead of P2PKH?
UPDATE
For istance, my address is: (testnet)
mwqCgoJBcyciRUawXerkvom8sbg3zkjrvV
Import my address (I don't have it in my wallet, I created this address from outside of bitcoin-core)
bitcoin-cli importaddress mwqCgoJBcyciRUawXerkvom8sbg3zkjrvV

then I mined 101 blocks
bitcoin-cli generatetoaddress 101 mwqCgoJBcyciRUawXerkvom8sbg3zkjrvV >> /dev/null

After that I check my UTXO:
bitcoin-cli listunspent 1 101 '["'mwqCgoJBcyciRUawXerkvom8sbg3zkjrvV'"]'
[
  {
    "txid": "531dcfeea3f87feb4101bfea6fe91ffb0262072cb27acc56f885677ccca089cd",
    "vout": 0,
    "address": "mwqCgoJBcyciRUawXerkvom8sbg3zkjrvV",
    "label": "",
    "scriptPubKey": "76a914b2f58389a224c2fac62b51e78aad7ed058b50f5f88ac",
    "amount": 50.00000000,
    "confirmations": 101,
    "spendable": false,
    "solvable": false,
    "safe": true
  }
]

retrieve the UTXO
bitcoin-cli getrawtransaction 531dcfeea3f87feb4101bfea6fe91ffb0262072cb27acc56f885677ccca089cd 2 | jq

...
{
      "value": 50,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 b2f58389a224c2fac62b51e78aad7ed058b50f5f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914b2f58389a224c2fac62b51e78aad7ed058b50f5f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "mwqCgoJBcyciRUawXerkvom8sbg3zkjrvV"
        ]
      }
    },

...

Why I have P2PKH instead of P2PK? And how can have the hash of my Public key if I imported just address (HASH160(PB))? And the last question, I understand that if the wallet find the 1 as the first char it apply P2PKH by default. How Can I use P2PK instead (study purpose).

The protocol is not what decides the scriptPubKey, it's your wallet that creates the transaction. Your wallet chooses what scriptPubKey to use based on the address that it is given. It uses P2PKH for 1... addresses because that's the scriptPubKey that that type of address specifies. It cannot use those addresses for P2PK because they do not contain enough information for P2PK - they only have the hash160 of the pubkey, not the full pubkey itself. Additionally, using a different scriptPubKey for those addresses would mean that the Bitcoin is sent to a scriptPubKey that the receiver is not necessarily watching.
The same applies to all of the other address types - the address type specifies the scriptPubKey to create.

Why I have P2PKH instead of P2PK?

Because that's the address type you imported. You are using regtest, so P2PKH addresses begin with m or n.

And how can have the hash of my Public key if I imported just address (HASH160(PB))?

The address specifies the hash.

And the last question, I understand that if the wallet find the 1 as the first char it apply P2PKH by default. How Can I use P2PK instead (study purpose).

You cannot. P2PK does not have an address type. There are no P2PK addresses.
Some software and blockchain explorers will show P2PKH addresses for P2PK scriptPubKeys, but this is incorrect. P2PK scriptPubKeys do not have a corresponding address.


BitCoin Miner - Remote Miners with SSH Access only I've graciously been given a big opportunity with a server infrastructure to work with, and I'd like to start it off by starting some Bitcoin mining, however there's a catch. These servers I have access to have all internet access blocked other then the SSH connection that I make in to the machines.

Is there any bit of software that for example, can receive the piece of a block to solve on my main machine at home, and send it off to these servers through SSH to solve, then send it back?

What you describe is tunneling through SSH. Assuming you can connect to an SSH from the servers (outgoing TCP port 22 is allowed). A is the machine you want to run the miner on, B is the SSH server which we use to tunnel the traffic through (this has to be able to open connections to the mining pool) and C is the hostname of the mining pool you want to mine on, then it's a simple matter of doing the following on A:

ssh -L 8888:C:1234 B

and then pointing your mining software to localhost:8888. What this does is open a connection to B which may open connections to the mining pool and each connection to the local port 8888 will be transparently forwarded to C. Notice that you'll also have to change the port from 1234 to whatever your mining pool uses.


What are the differences between Bitcoin and other crypto-currencies? What is it that makes Bitcoin unique amongst crypto-currencies?  Is it just the most popular one or does it have better design aspects too?

Until a careful analysis is performed, I think most crypto currencies are very similar in all properties except one - adoption.

Bitcoin has the largest hash rate, participating nodes, accepting sites, and people going over the code and protocol.

While alternative currencies can gain more hash rate, especially if effective forms of merged mining are developed and adopted, it remains to be seen if they gain the same adoption (sites accepting them), and developer base (strong developer community).

(See this post about merged Namecoin/Bitcoin mining)

Edit - One notable exception to this is Namecoin, which does offer unique features making it suitable to use as a DNS or general name registrar.


Is using different addresses for bitcoin similar to having different email addresses? I first got quite confused about having different "addresses" to get or send bitcoins.
But is it as simple as, we can have different email addresses:
molly.rosie@gmail.com
peterpan123@gmail.com
peterpan456@yahoo.com

and so you use them as accounts for yourself, to send and receive money, and nobody know who is who with these "addresses"?

is it as simple as, we can have different email addresses:

Yes and no. Mostly no.
You can, and normally should, create a new receiving address every time you receive money. You could, but normally shouldn't, create a new email address every time you want to receive an email message.

A street address identifies a specific place.
An email address identifies a specific person
An IP address identifies a particular network port on a computer
A bitcoin address doesn't identify anything.

The purpose of a Bitcoin address is unlike most other things for which we use the name "address". A Bitcoin address is really just like a random number in most regards. It's just a seemingly random number that in fact has a useful mathematical relationship to a really random number that is secret.

so you use them as accounts for yourself

You can use them that way. But that's something extra you do outside the Bitcoin network. There are also privacy issues if multiple people or businesses send money to the same one of your addresses. So you shouldn't use an address as a "sales" account for example.

nobody know who is who with these "addresses"?

Correct. But if you reuse addresses, information about you and your money leaks out.


Hash rate of "Antminer S9" in "Antpool.com" is ZERO I setup an Antminer S9 using this document: (Link to document).

And I configured connection to antpool.com using this guideline: (Link to guideline).

So, I filled out the fields as follows:

Pool 1:

URL: stratum+tcp://stratum.antpool.com:3333

Worker: MySubAccountNameInAntpool.com.mywork

etc ...

Pool 2:  stratum+tcp://stratum.antpool.com:443
Pool 3: stratum+tcp://stratum.antpool.com:25

And when I PING to antpool.com, no packet is lost as follows:

However, when I see Miner Status, there is no information ! (as follows:)

Also, my hash rate in my dashboard in www.antpool.com is zero !

What is the problem?

(If you need any further information, please let me know.)

I found the problem. In fact, although the PING to Antpool.com was successful; however, the network used a proxy causing problem of connecting successfully to Antpool.com. So, after changing the network I could see the hash rate in my dashboard.