Bitcoin API(s) - how to pair (or obtain) BOTH sender and receiver addresses with a transaction ID (hash) Various block explorers exist, which offer REST APIs. So far been using blockchain.info and btc.com

Here is what we have:
- List of bitcoin addresses

Here is what can easily be got with that info:
 - Historic list of transactions (hashes, or IDs) for the given addresses
 - I can also discover which input or output was OUR address, and therefore:
 - value, and whether the transaction was being sent or received

Now, here's what we need to obtain:
 - the OTHER (to/from) address!

So:
How can you use a transaction ID to obtain BOTH the sender's and receiver's wallet address - with some kind of REST API preferably?

(...knowing that sometimes transaction IDs are associated with multiple inputs and multiple outputs)

Endpoint references:
https://blockchain.info/q
https://btc.com/api-doc

The Bitcoin system doesn't have a "sender's address".  You can walk the transaction history to find out what destination the coins you were paid was last sent to but that is not a "sender's address".

Imagine if you had a magic wand you could wave over any package you received in the mail that would tell you where it was last mailed before you. You wave the wand over a package and find it was last mailed to a large distribution warehouse in china.  Is this the sender's address?  No. You bought the package from a shop in New York that purchased it for drop shipment from a distributor in Texas that fulfilled it out of a third party operated warehouse in Seattle, who recently pulled it out of a container from transoceanic shipment from the warehouse in china that your wand returned.

The previous to address might be useful information, just like the wand example-- but it is not the sender-- or at least not necessarily so--, it is not a return or refund address.  And this failure to map to the sender is not a fringe situation, just like the wand returning someone other than the party who sold you something would not be fringe: people frequently pay bitcoin's out of third parties wallets.


How does CryptoNote provide anonymity for a new coin when the user base is still small and additional signatures are scarce? So far as I know the anonymity feature in CryptoNote is achieved through the ring signatures technology. But what if the coin is new and the number of users is small? Does it mean that unless a new CryptoNote-based coin amasses a significant amount of users the anonymity feature won’t be accessible?

Small user base doesn’t seem to be such a big problem for CryptoNote coins. It is possible that up to a thousand of initial transactions would be more transparent than the ones that come next but this does not constitute an unsolvable issue. There is an interdependence between the number of existing signatures in the network and the level of anonymity available to users. If  a cryptocurrency has been created just recently the sufficient amount of signatures can be obtained through user’s transactions (even in small quantities) in a short period of time or it can be done with so called transaction tests. At the very beginning of the coin’s life-cycle the number of users can be very small and some of the transactions are created deliberately by the developers (manually or automatically) to increase the number of ring signatures for future transactions. It seems to be the case with Bytecoin (BCN). This coin is a first CN based currency launched in 2012. Now let's take a look at the chart below, it shows a transactions distribution since the launch of the coin.

As an author writes:
“Obviously at the beginning a certain number of transactions was created deliberately to make enough ring signatures for the future transactions (marked with brown color). Eventually this number has dropped leaving only the transactions created by users”.


When to check for confirmationsl When monitoring incoming transactions for a web wallet, should I check for confirmations on a timer, e.g. every minute? Or should I check once every block by using blocknotify?

This is a nice chart on the average transaction confirmation time: https://blockchain.info/charts/avg-confirmation-time that will give you a better estimation on how often you should check.

Also related: What keeps the average block time at 10 minutes?


How do I tranfer bitcoins from my Zebpay wallet to my blockchain wallet? I have some bitcoins in my zebpay wallet. How do I tranfer these bitcoins to my blockchain wallet. Is there any transaction fee for this?

Click "Request" tab on blockchain wallet, it will give you a bitcoin address where your bitcoins will be transferred from your zebpay wallet.
Then find "send" or similar button on your zebpay wallet and copy&paste the bitcoin address you previously acquired from blockchain wallet to here.

Zebpay probably cut a commission fee for this transaction. You can find info on their website how much they will charge for the transaction.


Is how can I enable my wifi router to accept Bitcoin for adhoc/ anonymous usage? I want to find a WiFi solution where I can sell my internet service with anyone who needs to use it... ideally paying in an altcoin or Bitcoin.

Are there any router modifications, or infrastructures that support a wallet service?  (e.g. the user pays at the captive portal) and then has time or bandwith limited access to the internet?

I found this list of router firmware that may support such modding, but not sure which one is best (and most secure) for the job.

Lacking that, perhaps I can leverage RADIUS authentication.

There is a project called wifiportal21 that uses the 21 Bitcoin computer in conjunction with an OpenWRT router running the wifidog captive portal software.  This is still in beta at this time, but seems to suit your application.

It is also worth noting that OpenWRT does have the ability to create a separate network that cannot pass traffic to the main network, and works with RADIUS authentication.


About performing SHA-256 hashing on the public key I am following this link, trying to perform SHA-256 on a given public key.
However, I cannot get the expected result.
I am using the sha256 library in python hashlib

The input is

0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6

Mine output is

32511e82d56dcea68eb774094e25bab0f8bdd9bc1eca1ceeda38c7a43aceddce

The expected output on bitcoin.it is

600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408

Do I miss anything?

The result you are getting (3251...)
is the result of sha256 on the string 0450....

The expected output on bitcoin.it is the result of sha256 on the bytes that are currently hex-encoded. To resolve this, hex-decode before hashing your input. In Python 2:

import hashlib
in_data = "0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6".decode('hex')
my_sha = hashlib.sha256()
my_sha.update(in_data)
output = my_sha.digest().encode('hex')

That should retain output with the expected value.


Setting up: sending and email I've been using Bitcoin Wallet on windows 7 to receive payments successfully but after making my 1st BTC payment the transaction doesn't appear to be clearing (957 confirmations and counting).

The recipient of the payment has asked for my transaction email confirmation but I don't recall setting an email address or where to check if I ever did this.

Please can someone help?

If the transactions is shown in your Bitcoin-Qt client as having confirmations, then the transaction went through and is confirmed. Most systems consider a transaction as confirmed when it has one confirmation, some require up to 6 confirmations, but when a transaction has 957 confirmations, it is practically irreversible.

If your transaction has that amount of confirmations and the receiver did not get it yet, then he has a problem with its client, not you.

There exists no such thing as e-mail confirmations in Bitcoin. It's possible that some clients offer it as a feature, but it is certainly nothing standard to Bitcoin.

(I don't know who the recipient is and I don't want to accuse anyone, but it seems like he is trying to have you send the transaction again.)


Does a 51% attack depend upon difficulty? Does increasing difficulty also serve to decrease the probability of a 51% attack?

It seems that since difficulty is the same for all, this is not the case.  Is that correct?

If difficulty were perpetually at minimum, would the probability of a 51% attack skyrocket?

The dependency goes as follows:

The difficulty depends on the total hashing power. As the hashing power goes up, so does the difficulty. This is intended to keep the block generation rate roughly constant at about one block every ten minutes.
As the total hashing power goes up, so does the amount of hashing power needed to accomplish a 51% attack. The total hashing power is the thing you need to accumulate 51% of.

So there is a direct relationship, but it's because they're both directly tied to total hashing power.


Where does Bittrex/Binance (alternative cryptocurrency markets) get their coins? There are several cryptocurrency platforms like Bittrex, Binance where you can transfer your BTCs (or other mainstream coin types such as ETH, LTC) to and buy alternative coins (IOTA, XRP or thousand other types) in exchange. Where do these platforms get their alternative coins?

Are they just selling coins that they had bought from people (similar to coinbase's approach see [1]) who got them through ICOs or several other channels? What would those channels be?

Pure exchange like Bittrex neither need, or have use for a huge reserves of cryptocurrencies. Their service model is based on providing a platform for peers to sell and buy coins/tokens.
Also, they don't actually buy the coins from the sellers. Sellers/buyers are the one's who deposit coins to Bittrex's wallet, so Bittrex act like an intermediary between the seller and buyer.
There is an exception though, you can actually wire transfer to Bittrex and buy USDT, and they will purchase on your behalf from other sellers on a per-order basis.

Coinbase is different, they are more like a bank-hybrid with their own dedicated exchange(GDAX), and as a bank , they have a huge reserves of cryptocurrencies as they deal with buyers/sellers directly.


What are the most comprehensive APIs for cryptocurrency market data? I'm looking for a well documented, easy to use API that provides data on the majority of cryptocurrencies. That data should include the 1 hr, 24hr, and 7 day price changes, as well as the entire history of the volume, and price for each crypto. I've looked into some APIs but none have provided this sort of comprehensive information. There are many great sites that have access to this sort of data, so it must be out there. Any help is appreciated! Thanks!

Most exchanges offer API solutions for market data. Here are some examples:

GDAX
Bittrex
Kraken
WAVES DEX

CryptoCompare has an API that aggregates data from many exchanges, and they also offer many query parameters. Link: CryptoCompareAPI

Additionally, many block explorers provide APIs for blockchain account information.
This ZChain Playlist shows how to use PowerShell to query the ZChain ZCash block explorer API.


Blockchain.info API error handling I've been working on a project involving use of the various Blockchain.info APIs (specifically  the Blockchain Data API), and am wondering if anyone has tips regarding error handling: the API documentation says nothing about how errors are handled, and my experiments seem to indicate that errors are returned with HTTP status 200 and a strictly HTML response.

Has anyone implemented a client for this API and can shed some light on whether this is the "usual" state of affairs or a bug? Any additional tips would be greatly appreciated.

Error handling is not particularly well done. If you are specifying format=json errors should respond with status 500 and a text/plain message. But there may be errors HTML based errors as well.

If the response is not JSON parsable then it should be considered the server has encountered a generic error.


Why is this transaction unconfirmed after a few hours? https://blockstream.info/tx/8ede5096427abea7d7829aba85f491bb93d42aa4f9aa9dbd25f6862958c3609c
It says
ETA
in 4 blocks (13.24 vMB from tip)
Why is ETA in 4 blocks? What does it mean by 13.24 vMB from tip? What is the tip?
0.0000616 BTC (27.6 sat/vB)
My transaction fee is 27.6 sat/vB which seems to be high enough.

ETA in 4 blocks (13.24 vMB from tip). Why is ETA in 4 blocks?

Estimation by https://blockstream.info block explorer which is explained here: https://github.com/Blockstream/esplora/issues/262#issuecomment-706230773

What does it mean by 13.24 vMB from tip? What is the tip?

There are 13.24 vMB of transactions between your transaction and tip as shown in the below image from https://mempool.observer

My transaction fee is 27.6 sat/vB which seems to be high enough.

Fee rate above 100 sat/vByte would have been high enough looking at the mempool right now.

Fee rate distribution of all unconfirmed transactions. Source: https://btc.bitaps.com


How much space needed to run Bitcoin daemon in amazon AMI? How much space needed to run Bitcoin daemon in amazon AMI(ubuntu 12.04), I am currently having 20GB is that enough suppose i want to run multiple coin daemon say 6 coin daemons how much space(approx) i needed?

The relevant space used is the one needed to store the blockchain, the public registry where all the bitcoin transaction are recorded. It's currently about 16GB, you can have a look of the growing rate here https://blockchain.info/charts/blocks-size


Easiest way to accept BTC and test We are building an online game and planning to enable our players to play for bitcoins.  Therefore, we need to enable players to deposit and withdraw bitcoins.

Which way is the easiest to start accepting bitcoins from users?  Use the bitcoin API call list (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) or use Blockchain.info's "receive payment API" (http://blockchain.info/api/api_receive)?

On Blockchain.info's page for "receive payment API", it gives a PHP example near the bottom of the page.  The example enables your website to prompt the user to send bitcoins to us, via Blockchain.info.  I like to test this out.  Which way is the best way to test it out?  Send real bitcoins or send testnet bitcoins?

If the best way to test is to use real bitcoins, I'm assuming that we should send one Satoshi (0.00000001 BTC) each time?  But how much transaction or network fee will I have to pay (since it is likely that I'll need to send BTC many times)?

If the best way to test is to use Testnet coins, then how does one use them?  I cannot find good information on how to use them to answer questions such as:  Can we use testnet coins to test out the bitcoin API call list or Blockchain.info's "receive payment API" and their PHP example?

Blockchain.info service will not accept testnet coins so you can only test with regular coins.
As you can see in their site the minimum transfer amount allowed by their system is 0.0005 BTC so that's the minimum and no fee is required for that amount.

As you will be on the sender and receiving ends you can send any amount, if everything go as it should nothing will be lost.

On the other side I have heard about problems and delays using blockchain.info services, I don't know if they are fixed by now but probably if you are going to be using a bitcoin payment service usually you can go and check other commercial services out there.


How can i use Bitcoin payment method through Swift for my IOS Project? I am trying to create Bitcoin Payment in my IOS project. I'm using swift language. I search this topic in lots of sites, youtube, stack overflow. but i just getting HTTP request related topics. Any one have solution? Ping me...

Core Bitcoin is a library for iOS written in Objective-C.  I have worked with it in Swift using the bridging header.

I myself have written a few Swift classes, in my experimental/educational wallet, for creating addresses, keys, and transactions, but I wouldn't recommend using it for anything.  Feel free to take a look and see if you find anything interesting, or anything that you could learn from.


My lightning node is unreachable and lightning-rpc': Connection refused I'm trying to use c-lightning on my raspberry.
When start the lightning daemon I get two errors:
the first one is:

    2020-06-05T17:02:08.784Z DEBUG connectd: Failed to connect 10 socket: Network is unreachable
...
 gossipd: seeker: no peers, waiting

My .lightning/config is:

alias=LIGHTNING_NODE_ROCK
rgb=DDFF06
addr=:9735
log-level=debug
network=testnet
bitcoin-cli=/usr/local/bin/bitcoin-cli
bitcoin-datadir=/home/bitcoin/.bitcoin
log-prefix=raspi-lightning
ignore-fee-limits=true
fee-base=10
bitcoin-rpcuser=user
bitcoin-rpcpassword=userpass
bitcoin-rpcconnect=127.0.0.1
bitcoin-rpcport=18332

my bitcoin.conf is:

testnet=1
[test]
rpcuser=user
rpcpassword=userpass
rpcport=18332
rpcconnect=127.0.0.1

telnet works on my public ip and 9735

I tried to connect to someone like:

bitcoin@raspberrypi:~ $ ln-cli connect 03ad4870c7a9dd0b429958cf9659b1330afbe33df8207cd1c882798cdad1dfb039@5.95.80.47:9737
{
   "code": 401,
   "message": "5.95.80.47:9737: Connection establishment: Connection timed out. "
}

the second problem is:

2020-06-05T17:02:08.864Z UNUSUAL plugin-bcli: Could not connect to 'lightning-rpc': Connection refused
2020-06-05T17:02:08.865Z INFO plugin-bcli: bitcoin-cli initialized and connected to bitcoind.

My Info is:

bitcoin@raspberrypi:/mnt/hdd/bitcoin $ ln-cli getinfo
{
   "id": "0310e9f97def619a7ee02b321cf2fad4f67b59f2c6bd12456dc8d6d8be125e1b14",
   "alias": "LIGHTNING_NODE_ROCK",
   "color": "ddff06",
   "num_peers": 0,
   "num_pending_channels": 0,
   "num_active_channels": 0,
   "num_inactive_channels": 0,
   "address": [],
   "binding": [
      {
         "type": "ipv6",
         "address": "::",
         "port": 9735
      },
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9735
      }
   ],
   "version": "v0.8.2-198-g0f568e1",
   "blockheight": 1747789,
   "network": "testnet",
   "msatoshi_fees_collected": 0,
   "fees_collected_msat": "0msat",
   "lightning-dir": "/home/bitcoin/.lightning/testnet"
}

My testnet is fully sync and I'm able to use rpc calls form my bitcoin-cli

bitcoin@raspberrypi:/mnt/hdd/bitcoin $ bitcoin-cli echo hello world
[
  "hello",
  "world"
]

I don't have any firewall

The first error you are seeing might be related to a previous peer that is no longer reachable. The type of the error (Failed to connect 10 socket: Network is unreachable) suggests that it is using a network that is no longer available. This can be because the peer was connected through Tor, or IPv6, and the Tor proxy isn't running anymore, or the network configuration changed and doesn't support IPv6 anymore. It could also be during OS startup that the network device just isn't ready yet, and this is just transient.

Regarding the connection timeout when attempting to connect to another node, it's likely just not online. I went and checked with nmap if the node is online, and it wasn't when I checked:

Starting Nmap 7.60 ( https://nmap.org ) at 2020-06-06 13:47 CEST
Nmap scan report for net-5-95-80-47.cust.vodafonedsl.it (5.95.80.47)
Host is up.

PORT     STATE    SERVICE
9737/tcp filtered unknown

Nmap done: 1 IP address (1 host up) scanned in 2.05 seconds

So that's nothing out of the ordinary. Might I suggest connecting to some other node?

And finally the UNUSUAL plugin-bcli: Could not connect to 'lightning-rpc': Connection refused error is an artifact from the order in which we start up the plugins and the RPC interface: usually plugins are told that we are ready only after the RPC is made available. The bitcoin-backend plugins are a bit special, because they are needed to check whether we are in sync with the bitcoin network and that we can talk to bitcoind. Therefore the bcli plugin starts before the RPC is ready. The error can be safely ignored and we'll make it less verbose soon (see Github Issue #3553).

Disclaimer: I am one of c-lightning's developers.


I have been robbed after dust attack Dear colleagues of the crypto community!
I am Roman Frolov (Vader), a private investor and trader, was subjected to a new version of a micropayment attack (dust attack) and was robbed of about 335.84997800 bitcoins in a cold wallet via supposedly Bitcoin Core access.
Stored bitcoins in a wallet generated in Bitcoin Kore (Knot). Earlier in the year 2015 I added private keys from BitcoinHD to Knotts and then to Core. I stored the listing of keys in a document archived in 7zip with maximum security settings and a long password.
Source of funds: buying bitcoin since 2012, participating in cryptocurrency HYIP projects according to the rules, trading on exchanges, including leveraging on bullran in BTC-E in 2017, got under the closure of the exchange and after a while received 80%, to this day I trade on Bittrex Global and Kraken. Followed the law, ethics and property rights. Didn't steal a penny.
2021-01-06 18:39:38 hackers produced multithreaded output from 12 addresses:
15hT9GMi1ThhmJts24WKG1Jm3so7bmiuW4
16BjABjMQB8wshTVhTbQUqoPfKQi7sSNRM
15D9TctYq3DvK1eDmxWfp8FWP73a1a2hEA
1Gi7qn77XqtGknJ9dUc3yRAoRFgNXBQBiW
1EAN8MxjfmRToVwsoVtfSzRz2FsCN89unX
13P1YEZjPDTpCtaqMbTbhu6VB3csu3qsZu
19DrKeLdYd47wHvbhkvccYQ4fQNycfdzhL
15hT9GMi1ThhmJts24WKG1Jm3so7bmiuW4
16BjABjMQB8wshTVhTbQUqoPfKQi7sSNRM
15D9TctYq3DvK1eDmxWfp8FWP73a1a2hEA
1Gi7qn77XqtGknJ9dUc3yRAoRFgNXBQBiW
1EAN8MxjfmRToVwsoVtfSzRz2FsCN89unX
13P1YEZjPDTpCtaqMbTbhu6VB3csu3qsZu
19DrKeLdYd47wHvbhkvccYQ4fQNycfdzhL
1JLTq3VLiU4qY1DfC7fYs4N5g45HByjE8H
1CfEuYincqgWfMGvBx8o1ysArCSMQhqM4f
12hBEaVfHGRXL4HnFjrAdoWudKhWdCPaoU
1PsKsr8hR7DBKB9q76JZwhTwD5W5QWG9Fj
19zvjxagjet8PNiCk4D7ZjWqqfoaM2qdZG
Output was made in 601 transactions starting with the output address:
bc1qxuyrx3n86nu0l5mf7wv8fzgkwn4vmeh5lqm2je 0.00291700 btc
and ending with 1B1ztXtrbnLWjMFGqSaW22DpdEWwiaoUbN 15.85027800 btc
the output went up evenly up to bc1qsx9q4cfpp33y4vxwhmr85n43zzv2qs85pr2jvw 0.97108300 BTC
and then 15.85 B1ztXtrbnLWjMFGqSaW22DpdEWwiaoUbN 15.85027800 btc
I ask everyone who is involved in currency exchange to pay attention to the withdrawal addresses from my addresses and their derivatives at 6 january 2021, and freeze their use and return to the original sender,
I hope for your justice, Roman Frolov (Vader)

The transaction taking the coins is very strange, the criminals have obviously got a strategy which requires the multiple denominations of UTXO's. It's not clear what this is but regardless the TXID showing funds being stolen is: de991dda2cd10a31bea1dd92c5e5466f916b060f5bd31fe0840b9fd08a0aa786
If you follow one of the outputs you can see via the following transactions that it moves to an address: 169ksrn7RgXFZmUVtvBFfbEKG5mmMxvQU7
TXID 1: fa53e39eb02809ea03986484325141d7e97c8a9b8c793974841b6850be43cd70
TXID 2: 177b996bdf4c2986faed0830a064242e553a8d914b0d7771561d5a017e2eca3e
This address resides in a wallet clustered under the following reference in walletexplorer.com:
https://www.walletexplorer.com/wallet/00011cbc1c9321ec
When you review the activity of this wallet there is a lot of receipts and only one daily transaction out of the cluster to an address attributed to Binance (for the several days at least). No other exchange or entity is mentioned as an output. Given this my thoughts would be this is a hot wallet associated with Binance. As such if you have any contacts at Binance I would getting in touch with them.


Diablo Miner on OSX Lion I downloaded DiabloMiner and got it to run by:

Using the options: -v2 -w256 -na
Increase the Java heap size by editing the DiabloMinder-OSX.sh file: -Xmx384m

And I am getting around 60-70mhash/sec on my MBP (MacBookPro8,3, early 2011) /w AMD Radeon HD 6750M, supposedly.

I say supposedly because I get no shares on mining.bitcoin.cz, so I setup the testnet in a box and ran my miner against that and appeared to get no where.

So my question(s):

What, if anything, am I doing incorrectly?
Is there a better way/miner to be using on OSX(GPU).  Mining information on OSX is very hard to find.

The BitMinter miner also works on Mac OS X. Go to http://bitminter.com and click the "engine start" button. There's no installation, it starts from the browser. It requires Java.

As to what is going wrong with DiabloMiner, I don't know. If it is mining without errors then it should be getting you shares at the pool.


How do people using thin clients know the correct merkle path of transactions they've sent without knowing the full block? User A send a transaction to user B. Those transactions are bundled together into a merkle tree. User A and B can both use the transaction plus the merkle root, plus the merkle path to prove the merkle root in the block header is correct.

I understand all that.. what I don't understand is how do A and B know the correct merkle path without needing the entire block?

Do they need a centralized provider that processes the blocks to calculate these for them? Is it possible to do in a decentralized way?

how do A and B know the correct merkle path without needing the entire block?

Many light-clients will sync to the longest chain of headers, under the assumption that other nodes on the network will be checking the full content of those blocks for validity. (Consider: if every node was a light-client, miners could include invalid transactions in blocks, and none of the light-clients would know it!)

By requesting the intermediate states of the merkle tree from a node that has the full block, a light-client can verify that a transaction the user is interested in is indeed included in a block that is part of the longest chain, in a more efficient manner than validating the entirety of the block themselves (the caveat being the assumption of validity mentioned above).

  Do they need a centralized provider that processes the blocks to calculate these for them? Is it possible to do in a decentralized way?

This entirely depends on the implementation. Some light-wallets might just call back to a certain server, operated by the wallet's developers, for example. Other light-clients might attempt to pull this information from random nodes on the network. Some are even built to connect to your own node.

Ultimately, the highest level of certainty will come from running a fully-validating node yourself (ie, a full node). As bitcoiners like to say: don't trust, verify.


BRD Wallet Recovery - Only have the first 11 words I went to recover the wallet from my backup 12 word recovery phase, but it turns out I only have the first 11 words. The last word was replaced with the " character. I must have had the notepad file open, and leaned on the keyboard which replaced the last word in the list....and unfortunately saved it.
What can I do? Does having the first 11 words help me at all?

Open source Bitcoin wallet password and seed recovery tool: https://github.com/gurnec/btcrecover
Details about solving a problem involving bip 39 seed by brute forcing: https://medium.com/@johncantrell97/how-i-checked-over-1-trillion-mnemonics-in-30-hours-to-win-a-bitcoin-635fe051a752
Similar questions with some good answers


Is it safe to rent server to run a full node? I want to rent dedicated server to run a full node to receive bitcoin for my website. Is this safe if I encrypt my wallets or should I own physical server?

If you need only to receive bitcoins, or better only to check the balance of your wallet, you can setup a read only address that leave no way to send money through this server.
To setup read only addresses there are several command:
importaddress
importmulti
importpubkey
Instead if you need a full node that receives and sends bitcoins automatically, (despite the fact that the encryption is secure) the wallet cannot be encrypted and it can be risky (at least more than having physical possession of the server) and you have to evaluate if the savings of buying a VPS instead of a physical server compensate for the greater risk of theft.


Are there any attacks with a plurality of computing power? There has been some discussion about possible attacks if one has the majority (over 50%) of the computing power of the bitcoin network. What happens if an attacker (or coordinated group of attackers) has more computing power than any other user (or coordinated group of users), but not necessarily the majority of all computing power?
Toy example
As a toy example, consider we have 3 users: Alice, Bob, and Steve.
Alice and Bob are both honest users that are fine using the protocol as specified. However, they will not go above-and-beyond the protocol to help each other (in fact, they would be happy to make money off the disadvantage of the other, as long as they are still complying with the protocol).
Steve is an attacker and is willing to perform actions outside of the protocol in order to either gain profit or just destroy the network. If Steve has 41% of the computing power, Bob has 34%, and Alice has 25% then are there attacks Steve could launch?
The toy example is included to just make it clear what I mean by plurality vs. majority, and what I mean by honest but uncoordinated users. I am obviously more interested in an answer to the general question than this specific toy model.

In a certain sense, all 51% attacks are really plurality attacks, but you have to consider all honest users as forming a single "coordinated group".  (Which is true when you think about it: they are all following the intended protocol as implemented by standard software.)

Suppose for example that 30% of hash power is controlled by honest miners, 32% by Cartel X, and 38% by Cartel Y.  The honest miners are mining on the main chain.  Cartel X wants to reverse a transaction that appeared in some previous block A, so they are mining on a side chain that diverges from the main chain at block A-1.  Cartel Y wants to reverse a different transaction that appeared in a previous block B, so are likewise mining on their own side chain from B-1.

Given enough time, Cartel Y's chain will eventually be longer than either the "honest" chain or the chain produced by Cartel X, so it will become the official record.  Cartel Y will be successful in reversing their transaction, and Cartel X will not.

The 51% figure is based on the assumption that all miners who are not part of the attacking cartel are honest.  But if some of them are part of a competing cartel, then a plurality indeed suffices, assuming you count all honest miners as a cartel of their own.

In principle something similar could happen in the event of a blockchain fork, where honest miners could split into two or more non-cooperating groups mining on distinct chains.  In that case an attacker controlling more hash power than either group could mount a 51% attack also.


Brute force a wallet.dat file I have a wallet.dat file which is encrypted and I can remember that I have put only numbers as password(4 or 5 digits, not more, not less).
My friend suggested to do brute force on it using python.
I tried googling and unfortunately(poor programming) didn't got any python script.
Can anyone help me please ?

I would approach this using JSON-RPC with the programming language of your choice and the walletpassphrase command.
walletpassphrase "12345" 60
The 60 at the end is number of seconds before the passphrase times out and needs to be entered again. Now all you need to do is create a loop that iterates through all number combinations.
If the guess is wrong the bitcoin client will return
Error: The wallet passphrase entered was incorrect. (code -14)
If the guess is correct the bitcoin client will return
null
So all you would need to do is check for the response and if null then the guess is correct and you can stop your loop.


Claiming Super Bitcoin (SBTC) with Ledger Nano S? Quick look at CoinMarketCap: https://coinmarketcap.com/currencies/super-bitcoin/

(it was airdropped in 1-to-10 proportion)

Some scammy discussion: https://www.cryptocompare.com/coins/sbtc/post/p_409993

(put your 24 words seed and be scammed)

Really unsure if there is any way of claiming SBTC without the aid of Ledger developers.

Or maybe there is a legitimate way to use 24 words seed, and therefore get access to SBTC?

Walleting services

https://bitcointalk.org/index.php?topic=2434261.0
https://dig.walleting.services/#/

  Select Electrum, BIP39 (Trezor/Ledger), or WIF Private Key. For BIP39 or WIF, select the appropriate SegWit options. Ledger / Trezor Help

Some informational websites

http://www.findmycoins.ninja/ - tells you which forks do you have
https://bitcoinforks.io/

Guides

https://99bitcoins.com/how-to-claim-bitcoin-forks-guide/
https://steemit.com/bitcoin/@pieczywo/how-to-extract-multiple-bitcoin-forks-easiest-and-fastest-way

Security disclaimer:

Always send the coins to the address you control first.

Don't trust 3rd party software with your private keys.

  EMPTY YOUR WALLET! Seeds & private keys give us FULL ACCESS to your funds!


Stay on memory pool when I sending multiple transaction from bitcoin wallet I run the bitcoin client 0.17.1 on my ubuntu 18.04 desktop. I have some balance in my wallet. Also my client is fully synced.I have face the wallet conflict. When I send multiple transaction at once(without time gap). Happen two things.

Some transaction is confirmed and completed successfully
Some transaction is stay on the memory pool for a long time. And the status is show as 0/unconfirmed, in memory pool

If I send transaction with some of time gap, no problems is existing. Also I mention that I already used bumpfee RPC. But transaction stay on the unconfirmed stage.

Note: I give the proper fee for every transaction

Bitcoin Core has locks in place that will stop multiple calls to build a transaction to be executed in parallel. Instead, they will be executed sequentially, as the lock gets relinquished by the previous call. So, the other thing that comes to mind is that there are limits to the ancestry set of transactions that may be submitted to the mempool at the same time.

Your own node's mempool will not accept more than 25 transactions or more than 101 kB in total transaction size that are chained/interdependent in some fashion. Your wallet will attempt to rebroadcast transactions to your own mempool every thirty minutes or so, so even when some of the ancestors of your transactions get confirmed, it may take a while for the others to be relayed to the network.

What you can do: If you're sending a very large number of transactions, e.g. more than 25 per block, you should split up your balance across a greater number of UTXOs, so that you can create a larger count of independent transactions.


If I intend to hold Bitcoin long term & the stocks drop below my invested amount do I lose the money or can I still hold it in hope it goes back? Example; If I buy $500 worth of Bitcoin and the stocks drop from say 4,000 to 3,200 - is my entire investment lost completely and I have to start again ?

Or is it now just negative (not worth anything) and if the stocks rise back up do I regain what I had without having to do anything ?

Next day it is at 3,600 so now I still have $100 ?

If you buy $500 worth of bitcoin when the price is $4000, then you would own 0.125 bitcoin. If the price drops to $3200, then you still own 0.125 bitcoin, which you could sell for $400. You do not "lose" your $500 investment, it just becomes worth less (in some sense you "lost" $100, but your loss is only realized if you sell your bitcoin at the $3200 price). If you do nothing and the price goes up again, you could then sell it for more.


What happens if everyone discovers much faster way of solving hash function problem (mining)? The question is not about how bitcoin mining works, but rather how bitcoin system adapts to progress in ability to tackle proof-of-work problems.

Suppose that proof-of-work problems used for bitcoin mining become very easy to solve. (eg. P=NP with very fast practical polynomial-time solver, though of course unlikely, but let me play a hypothetical game.) Then it seems that bitcoin system would collapse - 32-bit nonce may be insufficient to counter how fast proof-of-work can be done, in case that this becomes reality.

Is there any part in the current bitcoin implementation that would protect the bitcoin ecosystem from this type of collapse? Is the "difficulty target" system enough to resolve the hypothetical issue?

They already did find a faster way. Bitcoin mining now is run on specialized ASIC chips but it wasn't always that way. In early days it was CPU or GPU.

So nothing happens really, difficulty will adjust so that new blocks are found every 10 minutes on avg.

If this new mining tech is only in the hands of one entity though, then they could potentially do bad things, but your question was "What happens if everyone...".


When was block 210000 generated and who solved it? When was block 210000, the first block to feature halved 25BTC reward, generated and who solved it?

According to blockchain.info, the block 210000 was solved on 2012-11-28 15:24:38 GMT, and was relayed by Slush's Pool. The pool's Stats page also claims to have solved that block. It has also been stated that the block was solved by pool's user by the nickname of laughingbear.


Where can I get email notifications on any transactions to/from an address I do not control? There was at least one site that did this I remember.

http://www.Blockchain.info/wallet <-- add address as watch-only.
http://bitnotify.com
http://bitcoinwhoswho.com
http://txnotify.com


what is the explanation of "witness version" and its usage? What is the witness version and how is it used?

A segwit transaction is comprised of:
[nVersion][marker][flag][txins][txouts][witness][nLockTime]

From the BIP: "A witness field starts with a var_int to indicate the number of stack items for the txin."

Where does the witness version come in and in what scenarios can it be used?

Secondly, why does it say witness field starts with a var_int to indicate the number of stack items for the txin -- isn't witness data just signature? Or it simply refers to transactions that have more inputs, and the leading var_init just counts the number of inputs, thus signatures expected?

part 1 of the question has been replied by Tony.

witness data is more than signature, you can have a pub key "behind" the signature, or a redeem script or other smart contracts. Take a look at V_IN scripts as of non-Segwit tx.

on the second part of your question:
The number at the beginning (the flag) identifies the number of inputs, that have witness data. You might create a tx, that has 5 inputs, e.g. 2 non segwit, and 3 segwit. Then this flag has a value of "3".

See this example with two V_INs, and the flag value being "1", cause only one part of the tx has Segwit/witness data. Also see at the end the number of segwit elements for referenced V_IN (TX_IN[1]). The first two elements is signature (with OP_SIGHASHSINGLE - hex 03 at the end!), the third element is a pub key.

01000000000102FE3DC9208094F3FFD12645477B3DC56F60EC4FA8E6F5D67C565D1C6B9216B36E000000004847304402200AF4E47C9B9629DBECC21F73AF989BDAA911F7E6F6C2E9394588A3AA68F81E9902204F3FCF6ADE7E5ABB1295B6774C8E0ABD94AE62217367096BC02EE5E435B67DA201FFFFFFFF0815CF020F013ED6CF91D29F4202E8A58726B1AC6C79DA47C23D1BEE0A6925F80000000000FFFFFFFF0100F2052A010000001976A914A30741F8145E5ACADF23F751864167F32E0963F788AC000347304402200DE66ACF4527789BFDA55FC5459E214FA6083F936B430A762C629656216805AC0220396F550692CD347171CBC1EF1F51E15282E837BB2B30860DC77C8F78BC8501E503473044022027DC95AD6B740FE5129E7E62A75DD00F291A2AEB1200B84B09D9E3789406B6C002201A9ECD315DD6A0E632AB20BBB98948BC0C6FB204F2C286963BB48517A7058E27034721026DCCC749ADC2A9D0D89497AC511F760F45C47DC5ED9CF352A58AC706453880AEADAB210255A9626AEBF5E29C0E6538428BA0D1DCF6CA98FFDF086AA8CED5E0D0215EA465AC00000000

VERSION
 01000000

SEGWIT (BIP141): this is a segwit tx, marker=00
       (BIP141): flag=01

TX_IN COUNT [var_int]: hex=02, decimal=2
  TX_IN[0]:       6EB316926B1C5D567CD6F5E6A84FEC606FC53D7B474526D1FFF3948020C93DFE
  TX_IN[0] hex=00000000, reversed=00000000, decimal=0
  TX_IN[0] Script Length hex=48, decimal=72
  TX_IN[0] Script Sig (uchar[]) 47304402200AF4E47C9B9629DBECC21F73AF989BDAA911F7E6F6C2E9394588A3AA68F81E9902204F3FCF6ADE7E5ABB1295B6774C8E0ABD94AE62217367096BC02EE5E435B67DA201
  TX_IN[0] Sequence (uint32_t)
  FFFFFFFF
  TX_IN[1] F825690AEE1B3DC247DA796CACB12687A5E802429FD291CFD63E010F02CF1508
  TX_IN[1] hex=00000000, reversed=00000000, decimal=0
  TX_IN[1] Script Length hex=00, decimal=0
  TX_IN[1] Sequence (uint32_t) FFFFFFFF

TX_OUT COUNT, hex=01, decimal=1
  TX_OUT[0] Value: hex=00F2052A01000000, dec=5000000000
  TX_OUT[0] PK_Script Length hex=19, dec=25
  TX_OUT[0] pk_script 76A914A30741F8145E5ACADF23F751864167F32E0963F788AC
  This is a P2PKH script, and translates base58 encoded into this bitcoin address: mvNy8bVyGDyuCiS1zMzm61eDtCBbUVfHPD

WITNESS TXIN[0] stack elements: hex=00, decimal=0
WITNESS TXIN[1] stack elements: hex=03, decimal=3
 WITNESS[0] data length (var_int), hex=47, decimal=71, data(uchar[]):
  304402200DE66ACF4527789BFDA55FC5459E214FA6083F936B430A762C629656216805AC0220396F550692CD347171CBC1EF1F51E15282E837BB2B30860DC77C8F78BC8501E503
 WITNESS[1] data length (var_int), hex=47, decimal=71, data(uchar[]):
  3044022027DC95AD6B740FE5129E7E62A75DD00F291A2AEB1200B84B09D9E3789406B6C002201A9ECD315DD6A0E632AB20BBB98948BC0C6FB204F2C286963BB48517A7058E2703
 WITNESS[2] data length (var_int), hex=47, decimal=71, data(uchar[]):
  21026DCCC749ADC2A9D0D89497AC511F760F45C47DC5ED9CF352A58AC706453880AEADAB210255A9626AEBF5E29C0E6538428BA0D1DCF6CA98FFDF086AA8CED5E0D0215EA465AC

 LOCK_TIME
00000000


json-rpc api works locally but getting "Connection Refused" remotely code:

from bitcoinrpc.authproxy import AuthServiceProxy
class ProxyService:
    def getProxy(self) -> AuthServiceProxy:
        return AuthServiceProxy("http://%s:%s@xx.xx.xx.xx:8332" % ("xx", "xxx")) # this only works locally as 127.0.0.1

bitcon.config

datadir=/xxxx/Bitcoin
dbcache=2000
txindex=1
server=1
rpcuser=xx
rpcpassword=xx
rpcport=8332
disablewallet=1

I am running this on Ubuntu droplet. connection works when i connect locally as 127.0.0.1:8332

but when i try connection to the ip of my node (locally or remotely) I get "connection refused"

also i can confirm my node is up

Make sure to set

rpcallowip=<ip>

for each of your remote IPs, to whitelist them.

You can also use a netmask instead of IP. If you have a dynamic IP, use this feature!

For example, if your laptop's IP always starts with 237.94, you can set it to

rpcallowip=237.94.0.0/255.255.0.0

Then it'll allow all IPs that start with those numbers. Make sure to set a really strong password, though.


If I use a MacBook Pro to mine Bitcoin (and keep records for the blockchain), how much can I earn in 1 month? I know people say it is not practical to mine Bitcoins using a computer any more, but graphics cards are usually used to mine them.
But suppose just for fun, I do use a MacBook Pro to

mine it 8 hours a day, and also
participate to be part of the blockchain to keep records

How much can I earn per month doing #1 and #2 above, even if it is just a few dollars?  Can I really download some software to do #1 and #2?

It will be hard to find exact numbers, as GPU mining for Bitcoin has been completely obsolete since somewhere in 2013 when the first ASIC-based mining solutions appeared.
Still, I wouldn't expect the CPU and GPU in a modern Macbook Pro to be able to mine faster than a few 100 million hashes per second. Even if we assume it can do 1 billion hashes per second (probably a serious overestimate), then as of January 2021, with 8 hours/day, you'd make around 0.002 USD per month in a pool (if they even permit you withdraw such a small amount). If not in a pool, it'd be exactly 0.
It won't be worth the added cost in electricity. It won't even be worth the cost in added wear & tear to your hardware.
There probably exists software that can do this still, but I don't expect it to be maintained or easy to set up as it has been obsolete for so long.


Multiparty transaction Is it possible to have a kind of "multiparty" transaction in bitcoin. For example, a protocol where say Alice and Bob send you bitcoins at the same time, but if Bob tries to break the protocol and not send bitcoins Alice will not end up sending bitcoins either.

Something the ensures that both send or both don't send.

There is something like this described on the wiki.

Update: As Meni wrote in a comment below, this is more flexible than you require, since you already know who should pay, and how much.

So we can create a single transaction with 2 inputs, one from Alice and one from Bob, and a single output to the recipient of the payment.

Alice and Bob need to both have an input in their wallet of the right size, so we don't worry about who gets the change.  Then Alice tells Bob what input she's going to use.  Bob makes a transaction including both Alice's and Bob's input, and signs his input with SIGHASH_ALL, meaning that his signature isn't valid unless Alice also signs her input.  He then sends the incomplete transaction to Alice for her to sign, she signs her input, and sends the result to the network.


Is it possible to get stuck with a block that nobody can mine? The hash of a bitcoin block is generated from:

Block version number (partially fixed*, 32 bits)
Previous block hash (fixed, 256 bits)
Merkle root (not fixed, 256 bits),
Time (not fixed, 32 bits),
Bits (partially fixed*, 32 bits),
Nonce (not fixed, 32 bits).

So, the block hash is generated from 640 bits.
You can change 320 bits freely to try to have a hash that matches the current diff, and 320 bits are immutable.

Is there a property on the SHA-256 function that asserts that on these 320 bits of freedom, one combination will give us a hash that is matching the diff requirements?

If not, does that mean that the blockchain could get stuck on a block because nobody can mine on it?

* "Partially fixed" values could be changed by software updates for example. I assume that partially fixed values are fixed to simplify.

Is there a property on the SHA-256 function that asserts that on these 320 bits of freedom, one combination will give us a hash that is matching the diff requirements?

No.

AFAIK there are in general hardly any research results about the possible SHA-256 output values and their probabilities.

Satoshi Nakamoto probably assumed that you will always be able to find a possible block by modifying the nonce and the Merkle root.

  If not, does that mean that the blockchain could get stuck on a block because nobody can mine on it?

Yes (Theoretically, but it is very unlikely which was already pointed out by Alpha)

Let us try to be more precise. If you only change the nonce and the Merkle root there are  bits you can change. So you have  possible inputs for the SHA-256 function ( If you find all  possible Merkle roots, which is also very difficult admittedly. but let's assume you accomplish this because you have many ways to change the Merkle root like changing bytes in the coinbase transaction and you can choose every combination of arbitrary valid transactions from the mempool).

Now take a look at the possible SHA-256 results, there are  possible SHA-256 outputs and  possible inputs. With these you should be able to find atleast one hash below the target. It would then be possible to create a new block.

Remember there are  times more inputs than the possible SHA-256 outputs.


Why every node needs to validate a transaction in Bitcoin I am just understanding the Bitcoin network, and now understand that every block and every transaction is propagated to every node in the Bitcoin network (not sure yet the difference between full vs. validating vs. other nodes). But my question is, why a transaction needs to be propagated and validated by every node. I get that if only 1 node were to validate someone's transaction, they could team up perhaps and so bypass the rules for the system. So everyone checking that it is acceptable means no one can cheat or team up and cheat. But wondering if there is anything else to it. I wonder why you can't just trust that the user submitting the transaction is trustworthy and their transaction is correct, or if this is the whole point of the validation mechanism.

I think your confusion comes from a slight misunderstanding of the reason a node validates all transactions/blocks.

This validation is done so that the user running the node can join the network and verify the current state without needing to trust anyone else in order to do so. Importantly, it allows sovereignty, you do not need someone else’s permission in order to join or participate in the network.

Each node doesn’t really care if other nodes validate transactions, it just does it’s own thing and provides the user with the ability to interact with the network trustlessly. Of course, the user is benefited by joining a widely utilized network (network effects, etc), but ultimately it is in the users interest to determine the network state themselves, so that someone else can not lie to them, disallow them participation, etc.

In some sense, if you need to trust someone, then why use a blockchain at all? There are much more efficient technologies and networks that could be built, that could take advantage of efficiency gains through centralization (though through a loss of sovereignty - and it is this trade-off that makes the inefficiencies of Bitcoin worthwhile).


Bitcoin contracts. Are there good examples in the blockchain? I have been checking the Bitcoin wiki for script and Bitcoin contracts and I have some doubts about advanced contracts.

For instance, I have seen in many places references to password controlled transfers, where only the owner of a keyword could get the BTC in the contract. Do you know of any example in the blockchain? I am curious about anything with script commands beyond the standard use.

Advanced contracts are hardly used currently, if at all - simply because the software to construct the necessary transactions has not been written yet. I doubt you will find examples on the blockchain.


What is the best free iOS wallet out there? I only ask this question because there's so many kinds of wallets out there and I understand the difference between wallets(hardware wallets, iOS and Desktop wallets). But what is the best wallet in your opinion? would you be recommending that wallet to someone that's located in Asia?

I personally like Blockstream Green as in addition to being simple to use, it has many features about security and privacy


How to extract all info for a public address from a local full node's db? I recently started running bitcoind on a local Debian host, and I am still learning how to use the information in the local copy of the bitcoin blockchain.
I would like to extract all the information for one or more public bitcoin addresses currently available in the full node locally 1.  EDIT 2: I want to do this both from the bash command line and programmatically.  (IOW: no GUI-based tools, please.)
I recently learned that, contrary to my initial expectation, bitcoin core is not suitable for performing this sort of query.
Therefore, I went back to Google, but I've come up empty 3.  Hence I'm posting my question here.
Specifically, I would like to know

what software (preferably in the form of one or more Debian packages) would I need to install on the local full node that would enable me to extract all the information for one or more public bitcoin addresses currently available in the full node locally;
how exactly would I use this software to perform such queries.

1 I want to do this without reference to any specific wallet.  Having to add this requirement feels extremely weird to me (like having to add the requirement that answers to my question should work seven days a week).  This is a clear sign to me that there is still at least one pretty gigantic gap and/or confusion in my understanding of bitcoin, because I don't understand why a wallet should be even relevant to the kind of query I want to do.  I would have thought that a wallet would be, at most, an optional piece of information to modify the query, not an essential input for it.  But the fact is that I have not been able to find any way to interrogate the full node's database for specific addresses that does not require specifying a wallet.  This is just mind-boggling to me.
2 I apologize for not mentioning this critical requirement in my original post.  That was a major oversight on my part!
3 I am beginning to realize that the queries I want to perform on a full node's database (and without reference to a wallet) is something practically no one cares to do, and therefore it is hard to find tools for doing them.  Again, this strikes me as a bit weird, and feeds my growing suspicion that I am totally missing the point about bitcoin, blockchains, full nodes, etc.

Why this is hard
Bitcoin Core is chiefly a tool to synchronize with the current state of the network and to enforce the consensus rules with a self-owned piece of hardware. Beside being on the same page regarding the rules, this requires the node only to keep track of the ledger, the Unspent Transaction Output (UTXO) set. Bitcoin transactions need to be processed only once to that end.
The blockchain being now over 330 GiB, some people are actually choosing to run pruned nodes (that discard old blockchain data after processing it to calculate the UTXO set). Keeping additional indexes around with dozens of GiB in size is a special interest most users don't seem to care for.
In fact, Bitcoin Core does not feature a full address index out of the box. Originally maybe, because address reuse is considered a bad practice, later because other projects offer this, leaving Bitcoin Core developers feeling that they could focus on other things.
How you do it anyway
Bitcoin Core has an option to build a full transaction index -txindex (turning it on will require you to start over with synchronization and take about 30 GiB more space). This index is needed if you want to look up arbitrary transactions from the past. Other projects leverage this functionality and build additional indexing capability around it to offer Lightning Network support or Bitcoin explorers. I would recommend that you look into the Mempool Open Source Project or the Esplora Block Explorer. Either of these will allow you to run your own instance of a block explorer with APIs to look up blockchain data on basis of addresses. Note that the Esplora index will take about 1 TiB and apparently takes quite some time to build (H/T @Anonymous).


Bitcoin's disappeared from unused wallet wondering if I could get some help from you experts on something that has been bugging me for a bit.

I found an old bitcoin wallet I had forgotten about. You can see its information here. I was excited as it seemed to have about $100 in it, so "free money" from the times when I used to mine.

If you look at all the transaction on said wallet, you'll see that they go from 2013-04-14 to 2013-05-08. That's the time when I realised mining bitcoins was slightly fruitless and if I wanted to make some money with it I should probably do something else.

But then you will see there's a transaction on 2014-03-24, which is almost a year later which I don't remember of. That transaction is also transferring out the money from my wallet to another wallet which I don't recollect owning. Seems like my little coins were stolen at this point, and I don't really know how, since they've always been on a local wallet.

Now, I know there's ways people can steal things from local wallets etc, but I was wondering if there's anyway I can try to trace how the coins were stolen. And why is it that the whole amount in said wallet weren't stolen (there's still 0.00038478 BTC in it)

Any light here would be mostly appreciated.

Looks like the tx you are referring to on 2014-03-24, sent the money to

14N9ydxNRhDxkKJvXg1vjqS3gh884vG3UM - (Unspent) 0.039 BTC
1L9Q6EFMH3jn4dWquC2DaWhWK4q4pyUvum - (Unspent) 0.00060405 BTC

They both remain unspent.
1L... address is most likely the change address, that belongs to your wallet, if that transaction was made from your wallet.

Someone could have gotten your private key and moved the money that way.
Since the money has been not spent there is not much you can to in terms of tracing.


Question about Arbitrage So I just happen to know that arbitrage is possible yesterday and found a way to detect an arbitrage opportunity across all exchanges through all markets. But the thing that sucked is that exchanges disable the deposit and withdrawal whenever a coin is feasible for an arbitrage. My question is that, would it be possible to send coins to an exchange that disabled the deposit to that coin? I

You should never deposit your coin to an exchange when the deposit function is disabled, your transaction will either be delayed or just gone.


MultiBit got progressively slower after adding more receive addresses At first, MultiBit was all snappy. Over the course of about 4 weeks I added ~120 more receive addresses. Now, MultiBit is very sluggish, grinding the hard-drive excessively (sometimes for minutes), especially when sending payments or when exiting the program. Today, it displayed a message in the status bar that it couldn't open the wallet and that it will use some rolling backup. After that, it resynchronized for about an hour.

I worry that if things continue this way I will be faced with catastrophic data and money loss.

Do you have any hints on why this might happen or whether I could migrate to another more reliable wallet software which could import all my addresses?

It seems very unlikely that a number of addresses as small as 120 could make a significant difference in performance. I would guess there is some other problem that just happens to coincide with you adding addresses.

The inability to open the wallet, and the excessive disk I/O, is particularly troubling. One possible explanation is that the hard drive is failing - the slow I/O being caused by repeatedly retrying failed operations. I would start by backing up all your files and especially your wallet (which you do regularly anyway - right?). If that fails because there are files that the backup software cannot read (without a good reason, e.g. they are locked by another process), or it reports I/O errors, then that would clearly indicate a failing drive that needs to be replaced.

(Generally, if you have good, regular backups of your wallet files, you are fairly well protected against "catastrophic money loss".)


Bitcoin paper wallet and Bitcoincash withdrawal? Let's say I have a bitcoin paper wallet with a public and a private key, with an amount of X bitcoin on it. On the 25th of November, the hardfork of bitcoin gold will take place, so I will get the same amount of bitcoin gold.

The question is, how I will be able to withdraw only bitcoin gold from that paper wallet as I have only one public and private key as they are bound to a bitcoin wallet?

You will receive an equal amount of Bitcoin Gold as you have in your Bitcoin paper wallet at the time of the fork.  Your paper wallet that contains the Bitcoin will automatically contain the Bitcoin Gold.  In other words, your private key controls both.  We will have to wait to see which online wallets and exchanges support Bitcoin Gold in order to "split" Bitcoin Gold from Bitcoin to be able to withdraw or exchange them.  This is the same scenario as the BTC/BCH hardfork that occurred on Aug 1.


Bitcoin Core Problem To start things off I am new at this so bear with me...
I have bought coins through LocalBitCoins and sent them to my wallet (with 24 confirmations).

I am currently on Bitcoin Core with 2 years and 23 weeks behind Synchronizing. I heard you were able to send Bitcoins without actually being Synchronizing but whenever I try to send my funds elsewhere I get a "Insufficient funds exceeded" box. I go back to overview to see that my Bitcoins have not been transferred to my Bitcoin Core wallet yet probably prompting the insufficient funds.

I know waiting to finish Synchronizing is the better solution but I thought I was able to send the coins without being synchronized?

As far as I know, you heard wrong.  I don't think Bitcoin Core supports sending coins when the wallet is not synchronized.  It needs an up-to-date copy of all the transactions on the network, so that it can be sure of spending coins that have not already been spent.  (Such a transaction would be rejected by the network, but it would lead to confusion on your end, and could also result in other nodes on the network refusing to relay your other legitimate transactions.)

You can either wait to synchronize (note that you are downloading about 60 GB of data) or see Cannot access my bitcoins because my wallet is still synchronising. What can I do to spend them immediately?


How can I install Electrum on 32-bit Windows? So on the Electrum site in the download section for Windows 7 Pro there is no reference to 32 or 64 bit? I need a desktop version in 32-bit?

Electrum is an elaborate python script.  It uses the same bitwidth as your python interpreter.  If you have Py32 installed it is 32 bit, if you have Py64 it is 64 bit.

For windows users

The standalone EXE is 32-bit.  If you need to run 64-bit in PE or some other non WoW environment, simple grab the python libraries from the site and run the python sources at 64 bit.

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
             14C machine (x86)
               6 number of sections
        597F4AD5 time date stamp Mon Jul 31 10:20:53 2017
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
             122 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   32 bit word machine

For more on windows EXE bitwidth, check this answer by Richard


What is NTime rolling/nonce range? And what miners support it? From Slush's pool's homepage:

  Pool now supports Long polling and NTime rolling. Older miners have many problems with those new features, which can negatively affect your rewards. Please update your miners to latest version!

What does NTime rolling and nonce range mean for me as a miner?
And what miners support it? (+versions)

NTime is the integer timestamp in seconds.  It is one element on the block header. Each second NTime increases by one.    "NTime rolling" is a getwork parameter indicating how many seconds forward a miner can still consider this getwork valid (by incrementing NTime locally).

To understand how this is used lets first take a look at Bitcoin Block Header.

For a given set of transactions only two elements in the block header change between hash attempts.

NTime - current timestamp (changes every second)
Nonce - 2^32 number (changes every hash)

So to construct a valid header a miner must have the current value of these two rapidly changing elements.  The other elements of block header are also needed but changes occur much less frequently and trivial for the pool to handle.

The basic (inefficient) method to handle these two variables in a getwork request is for the pool to explicitly provide both values in every single header. The pool will provide one getwork every second.  A miner with less than 4.2GH/s however will on average find < 1 nonce per getwork. As an example, a miner which can execute 100MH/s will cover the nonce range (2^32) in 40 seconds.  The pool will need to issue 40 getworks per share.  The avg # of getworks per share will depend on the speed of individual miners however a significant amount of excess communication is occuring.

Now both nonce range and NTime are highly predictable so a miner could simply be given a starting point and locally change both values.  Doing this significantly reduces the number of getwork requests required to cover the same number of hashes.

By allowing the miner to roll the NTime forward for 10 seconds the pool can cut the number of getworks from 40 to 4 seconds.

There is also a benefit for fast miners which are already efficient.

A 2 GH/s miner will find on average one nonce every 2 seconds.  With an NTime rolling value of 10 seconds.  The same getwork will enable the pool to acheive 4 nonces per getwork.

The NTime rolling value instructs the miner how far it can increment NTime (in seconds) before needing to request new work.  So a NTime rolling value of 4 means the miner can use this header for 4 seconds before considering it stale and likewise a value of 40 indicates to the miner it can use same header for next 40 seconds.  Pools can use increasingly large NTime values however there are diminishing returns.  A block is found on average every 600 seconds, and periodically transactions need to be included.

Still an optimal Ntime rolling value ensures the pool is only updating getworks when work has actually updated in a meaningful way (elements changed other than nonce or time).

An example:
A pool provides a 100MH miner a block header containing the current ntime, a nonce range of 0 to 2^32 (full nonce) and an NTime Rolling value of 40.  The miner would hash until the local time increments 1 second (roughly 100 million hashes) then it would increment NTime value and continue to hash for another 1 second (roughly 100 million more hashes).  Once it has incremented NTime 40 times it must request new getwork.

Proper use of NTime rolling improves pool efficiency by reducing number of getworks per share.  In your example I speculate that Slush looked at the pool logs and determined that some miners were requesting work "too often" indicating they were ignoring or incorrectly using NTime Rolling value.   Obviously a pool operator would want all miners to use latest protocols such as NTime rolling, and Long Polling as it allows a pool server to handle a higher throughput with same amount of hardware, bandwidth and other resources.

I don't have an exhaustive list but as far as I know any "relatively recent" miner supports NTime rolling (as in released in last 6 months).


Just got back into bitcoin but theres almost no way for me to use my bitcoins, please help! I recently got back into bitcoin after 3 years and I want access to my wallet I saved on my HardDisk a while back. It seems the wallet manager I used (multibit wallet) is out of date. However NO other software seems to be able to read my wallet so I am stuck using it. I cannot send bitcoins to anyone because it sends and is pending for days (3 days at this point).

I watched a youtube video that described how to transfer multibit wallet to electrum but that video did not help and the commments section was closed (I suspect because it just does not work).

What can I do? I cannot use anything else but an old multibit software but the software does not send bitcoins correctly...
Am I just out all of the money I invested in this?

P.S. I tried sending the bitcoins to coinbase because that website is still up but they end up being pending for days and coinbase is not getting back to me.

There must be a solution so don't be too worried. According to the multibit blog, an attempt to move it to Electrum is valid.

  If you are having problems logging into Multibit, we created a utility to export the keys from your Multibit wallet file. Instructions for how install and use it are at https://github.com/Multibit-Legacy/read-multibit-wallet-file

The github repo provides a process of getting the key.

Install node version 6 or higher. You can get it from https://nodejs.org/en/download/.
Open a command prompt and install this utility: npm install -g mbexport
mbexport <path-to-wallet-file>

<path-to-wallet-file> is on the README file of the repo.

If you can provide information about OS you're using and about software class (Multibit classic or MultibitHD), you'll probably hear the more detailed answers.

Hope you'll find a way.


How to select a leader in RAFT consensus protocol Suppose a network of 5 nodes uses RAFT consensus protocol. Each nodes maintains a transactions log which consists of a list of the log entries. Each log entry again consists of index and term. All of them are marked themselves as leader candidate and send the request Vote (term, index). The current log entries (i.e. list of term and index values) of all the leader candidate nodes as follows -

Then who will be the leader ?

In the RAFT algorithm if a candidate who wants to become a leader in the network then his proposed "term value" will be checked at the beginning.
1) If it's less than the present "term value" then he will not be selected as a leader.
2) If it's more than the current "term value" then his current "index value" will be checked.
a) If his index value is less than the current index value then he won't be selected.
b) If his index value is more than current index value then he will be selected as leader.

In this case "Candidate 4" will be leader as in every round his term value is not lesser than current term value and his index is updated to current node.


What command can i use instead of `ListAccounts` In documentation said: "listaccounts will be removed in a later version of Bitcoin Core"

https://bitcoin.org/en/developer-reference#listaccounts

  In "See Also" section:

  GetAccount - Not return list accounts
  GetAddressesByAccount [deprecated]
  ListReceivedByAccount [deprecated]

Are we have a alternative command ?

You can still use the same commands to get a list of accounts and addresses

getaddressesayaccount: returns a list of every address assigned to a particular account.

listreceivedbyaccount: lists the total number of bitcoins received by each account.

Or as a workaround you can try the trick with the following:

listaddressgroupings: lists groups of addresses that may have had their common ownership made public by common use as inputs in the same transaction or from being used as change from a previous transaction.

listtransactions "*" 1 0 true: List the most recent transaction from all accounts including watch-only addresses.

More info on the available commands to list accounts/addresses: https://bitcoin.org/en/developer-reference

Hope this helps,

kind regards.

Cluster2k


Bitcoin Core mempool after disconnecting a block After reading this answer by Pieter about "undo files" I'm wondering what happens with transactions that were included in orphaned blocks but are left out the new blocks when "rolling back". Are they just dropped or do nodes include them in mempool and re-forward them?

When a block is disconnected, its transactions are added back to the mempool (where possible). If the new branch connected afterwards does not remove them again, they remain there, and will be picked up by the block construction code.


Why the normal mode exist in BIP32 Suppose the BIP32 normal deviation is not safe enough.

Suppose the xpub is deployed on the server, we assume it is public, then the leak of any derived private key is the leak of the parent private key, which means all the derived private and public key could be calculated.

Why this mode still exists, instead of using hardened mode as the default for all derive operation?

The second Point I hope to clarify here, is that if there is only one bit in the path is hardened mode, say m/0'/0/0, then the derived address is a 'hardened' address (parent private key can not be derived from parent xpub + child private key), or we need every bit in the operation is in hardened mode?

The last question is what the "layer" means exactly in BIP32?
(A) Per my understanding, if we have a master private key, any path (m/0/0, m/0'/0, m/1',m/1/2/3/) we used to derive the sub private key are the child address. If we use child address to derive again with any path (m/0/0, m/0'/1), then that is the second layer's address.
or
(B) if we have a master private key, use path (m/0') is the first layer. use path (m/0'/0) is the second layer?

What is the background and consideration for this design?

Hardened extended private keys break the extended public key derivation path, which is why unhardened key generation is still valuable.

I can provide an xpub key M/44’/0’/0’ to a webapp, which can then create fresh addresses without having access to any private keys.

For example, the following receiving keys (and related addresses) can be derived from M/44’/0’/0’

M/44’/0’/0’/0/0
M/44’/0’/0’/0/1
M/44’/0’/0’/0/2

or following change keys (and addresses)

M/44’/0’/0’/1/0
M/44’/0’/0’/1/1
M/44’/0’/0’/1/2

The backend which has  m/44’/0’/0’ can derive all private xpriv keys to spend funds sent to addresses above, thereby never exposing any privatekeys to the userfacing webapp. However, a xpub key m/44’/0’ (hardened or not) cannot derive a hardened child xpub key m/44’/0’/0’.

The leak of a child private key does not expose parent keys. This would also require the xpub of the parent key pair and child index. Hardening prevents this exposure scenario. So for BIP44 the tradeoff is made at the account level (m/44’/0’/0’/) where the account parents are hardened but subsequent receiving and change keys are not.

Edited: Correction from Abdussamad (See comments)


How do I run a headless testnet on OS X? I'm trying to develop some applications and need bitcoind, but can't seem to find a recent version. Posts seem to indicate that it's incorporated into Bitcoin-Qt, but I don't want to run a GUI just for headless RPC calls.

So how do I set up a testnet on OS X?

How to setup testnet-in-a-box on Mac OSX? seems like it would work, except I don't have the bitcoind command for whatever reason.

Ready to use distribution of bitcoind for Mac OS X doesn't exist, so you would have to build it from source code, here is the instructions for that: What are the steps in building bitcoind on Mac OS X 10.6?


How confirm my own doublespend transaction got confirmed Transactions in the testnet are right now almost always double spent with a new txid (possible due to tx malleability). This is actually quite nice for testing purposes.

So I'm wondering - when I did a payment and have txId 'XXX' this payment sometimes gets confirmed with a new txId 'YYY' that I don't know of. How can I (using bitcoind json-rpc) find out that my payment with txId 'XXX' got confirmed?

The answer is actually that you will receive a negative confirmation count in this case. (The bitcoin documentation is just terrible..)

See the bitcoin core release notes of 0.12.0 - section "Wallet: Negative confirmations and conflict detection"

https://bitcoin.org/en/release/v0.12.0

update note: In case of a negative confirmation (conflict detected) be sure to fetch all parent tx of that tx and see if that one got confirmed


Am I being hacked, can I prevent it? I have just sent bitcoins from one account of mine to another, and after I sent it I checked on blockchain.info to get updated about confirmation.
There, I noticed something peculiar, it said that I made two transactions at the same time, when I made only one. The first transaction was to the correct address and the correct amount.
But the second transaction was not one that I made. The second thing I noticed is the SUM of both transactions, together they form the exact amount I last received to this account a few days ago.
This looks to me like a hack. At this moment these transactions have net yet been confirmed, can I do anything about it?
Can a transaction be created fraudulently and accepted by the miners?
How can a hack like this be accomplished (if it is a hack).

You are not being hacked.  These are not two separate transactions; it is one transaction with two outputs.  The second output was automatically created by your wallet client and sends back to a new address which also belongs to you.  This is a normal and necessary feature of how Bitcoin works, called "change". See How does change work in a bitcoin transaction?

If this transaction were malicious, it would mean that someone had access to your private key; if so, they would also have stolen your earlier transaction.  Moreover, they would  have stolen the coins as soon as they obtained the key; they wouldn't have waited for you to make your own transaction.


Does the Bech32 address format decrease Bitcoin's possible address count? I have wondered how many Bitcoin addresses are possible. When looking around, I stumbled upon this thread on BitcoinTalk:

There are exactly 2^160 possible addresses as long as we keep using
RIPE-MD160.
2^160 is
1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976.

Then I wondered if there are less possible addresses with the Bech32-format, specified by BIP 0173.
Besides, you cannot use uppercase format of characters in your computation, and some numbers as letters, such as i/1 and o/0 characters/numbers are excluded in Bech32 format.
Should that not decrease the possible amount of Bitcoin addresses dramatically, and decrease the security of Bitcoin?
So, I would like to know how many possible Bitcoin addresses there are with Bech32 format. How could I calculate it? What will the total number (plain long number, not the squared one, I'm not good in math) of possibilities be with the restrictions of Bech32 then?

Keep in mind that both types of addresses, assuming we are comparing P2PKH with P2WPKH addresses, are just encoding the hash of a public key. The hash used in both address types is a RIPEMD-160(SHA-256(public key)), so regardless of the encoding, the number of possible valid addresses remains the same. Each address format is simply encoded with a different checksum system, different version system, and different characters. But neither address format is actually ever used within bitcoin transactions themselves, they both just get "unwrapped" when given to a wallet.


What will be happen if 21 million of bitcoins become the property of one? Let's assume, that  the day already came, when emission of bitcoins completed, and we have the 21 millions of bitcoins. Let's say it happen that all these Bitcoins at one moment became the property of one person (for example because of the vulnerability of the system), which says that will not make any transaction and produces all kinds of steps to achieve this target(the deletion of the account or something else). So here is the question - what will be happen if 21 million of bitcoins become the property of one?

It's entirely up to the people living at this hypothetical future point.  There's no current rule about what happens.  Maybe when this happens, people are tired of Bitcoin, so they go back to trading seashells.  Or maybe when this happens, there's something better than Bitcoin available, so they all switch to that.  Or maybe they just restart Bitcoin and start mining again.

Remember that Bitcoin is a consensus system. Each user can change the software to do whatever he wants it to do.  If enough people all run the same software, and that software is designed to converge on a consensus block chain, all of those people will have the same block chain---even if it isn't the same block chain we use today.  Whatever rules we use today can be changed by people in the future (including our future selves), so there's no risk of ever permanently locking ourselves out of the block chain.


After using openassets issue_asset() , the asset quantity is 0 I am using openassets protocol issue_asset() function. After using the function, i call list_unspent(). The asset quantity field is all zero (see below). It means the issue_asset() function does not generate any assets. I have checked the return value of issue_asset(). It returns a valid transaction. Is there a reason why assets are not created?

The list_unspent() output is copied below:

[{"txid"=>"39e2b19597c5ab2e9d88ed7323a63a6de418dc3f04597ba5c520c5b968963b0e", "vout"=>0, "confirmations"=>119, "address"=>"mv3JUS2pmGj7QMXEtrpz4xtt3QuZdaqdE6", "oa_address"=>"bX61BibrAEkcoGbgbwUwAipoTP25jejEPFV", "script"=>"76a9149f4f15984e7ecbde4a14ace89d564d366fa206b788ac", "script_type"=>"pubkeyhash", "amount"=>"0.00000000", "asset_id"=>nil, "asset_quantity"=>"0", "asset_amount"=>"0", "account"=>"", "asset_definition_url"=>"", "proof_of_authenticity"=>false, "output_type"=>"uncolored", "solvable"=>true, "spendable"=>true},
{"txid"=>"6179fd02c7a031711d654068ef365e8d50c1aea57fc4a5554ca31de01bc47931", "vout"=>0, "confirmations"=>117, "address"=>"mv3JUS2pmGj7QMXEtrpz4xtt3QuZdaqdE6", "oa_address"=>"bX61BibrAEkcoGbgbwUwAipoTP25jejEPFV", "script"=>"76a9149f4f15984e7ecbde4a14ace89d564d366fa206b788ac", "script_type"=>"pubkeyhash", "amount"=>"0.00000000", "asset_id"=>nil, "asset_quantity"=>"0", "asset_amount"=>"0", "account"=>"", "asset_definition_url"=>"", "proof_of_authenticity"=>false, "output_type"=>"uncolored", "solvable"=>true, "spendable"=>true},
......
{"txid"=>"fe1920a5f71566e9ea1c5a61d0d818d64816170992df27b445003fba2a730fe8", "vout"=>0, "confirmations"=>114, "address"=>"mv3JUS2pmGj7QMXEtrpz4xtt3QuZdaqdE6", "oa_address"=>"bX61BibrAEkcoGbgbwUwAipoTP25jejEPFV", "script"=>"76a9149f4f15984e7ecbde4a14ace89d564d366fa206b788ac", "script_type"=>"pubkeyhash", "amount"=>"0.00000000", "asset_id"=>nil, "asset_quantity"=>"0", "asset_amount"=>"0", "account"=>"", "asset_definition_url"=>"", "proof_of_authenticity"=>false, "output_type"=>"uncolored", "solvable"=>true, "spendable"=>true}]

I also called get_balance(). The output is listed below. The is no assets too.

Balance [{"address"=>"n3hqP9u5kQydyqGcPy3NHcEWnzBKJnv3aX", "oa_address"=>"bXDfidKiRDtsKr5RySb9YwU968bMVMnf8Zr", "value"=>"0.00433888", "assets"=>[], "account"=>""}]

The problem is after issue_asset(), if the min_confirmation is 1, we have to mine the bitcoin block for one time. Then only after that, the asset can be seen in get_balance.


Generate paper wallet SegWit address I am trying to generate SegWit paper wallet address from WIF:

My WIF is L5mHKZsCLS27nSoGM3RdAwuxjvg7XhJdP25LgqdXe6zF11wpWdbT.

I am converting WIF to compressed public key:

Compressed public key: 03fac6879502c4c939cfaadc45999c7ed7366203ad523ab83ad5502c71621a85bb

I am creating P2SH-P2WPKH address using instructions at Creation of P2SH-P2WPKH Address

using following algorithm:

Calculate the RIPEMD160 of the SHA256 of a public key:

SHA256 of public key: cfad24b0bc2bba2c8bb2c8d619dca2b74221930793bca50df73856f0bbba10c9

RIPEMD160 of SHA256 hash: d5e5d05edfe2ed61099bf3f0d53be2775bbc6d0d

Create P2SH redeemScript as OP_PUSH publicKeyHash:

redeemScript: 0014d5e5d05edfe2ed61099bf3f0d53be2775bbc6d0d

Generate scriptPubKey as OP_HASH160 hash160(redeemScript) OP_EQUAL

scriptPubKey: a914a19949e546c2f4d410cbb061c986b9ff3099ae7087

Generate RIPEMD160 hash of scriptPubKey:

hash: dc62e525af22d1f0f17cc2a091cf2c9fb36bf553

Generate address with 0x05 prefix and double SHA256 hash checksum:

result: 3MnK46gvixm8hk7mJTQTAqenniSodjXPrJ

Expected result according to segwitaddress is:

33voQqbNAYyig272KjcX8GkucWn2x25WEg

What am I doing wrong?

Update

Thanks to the accepted answer, here are correct steps to do this:

Public key - compressed:
03fac6879502c4c939cfaadc45999c7ed7366203ad523ab83ad5502c71621a85bb

SHA256(public key) =
cfad24b0bc2bba2c8bb2c8d619dca2b74221930793bca50df73856f0bbba10c9

RIPEMD160(SHA256(public key)) =
7646c030f7e75b80f0a31cdcab731e6f424f22b2

redeemScript (OP_0 pubkeyHash160):
00147646c030f7e75b80f0a31cdcab731e6f424f22b2

SHA256(redeemScript) =
a10e523968ba784d24ccd54e613d8f747d6649e42b1df4fdcec6658262620651

RIPEMD160(SHA256(redeemScript)) =
188ba16284702258959d8bb63bb9a5d979b57875

P2SH address base58(0x05 | hash | 4-byte sha256 checksum) =
33voQqbNAYyig272KjcX8GkucWn2x25WEg

Create P2SH redeemScript as OP_PUSH publicKeyHash:

  redeemScript: 0014d5e5d05edfe2ed61099bf3f0d53be2775bbc6d0d

It's actually `OP_0  but you have resulted in the right thing anyways.

  Generate scriptPubKey as OP_HASH160 hash160(redeemScript) OP_EQUAL

  scriptPubKey: a914a19949e546c2f4d410cbb061c986b9ff3099ae7087

  Generate RIPEMD160 hash of scriptPubKey:

  hash: dc62e525af22d1f0f17cc2a091cf2c9fb36bf553

These steps are incorrect. The thing that is hashed for a P2SH address is the redeemScript, not the scriptPubKey. Instead of doing step 3, you would skip directly to step 4 and hash the redeemScript instead of the scriptPubKey.


If you download the bitcoin blockchain via a torrent, can you then prune it? I want to get started as quick as possible and it seems torrenting is the fastest way, but I'm curious if I can then prune?

You can, but it seems you'd get the worst of all worlds:

It's slower than letting Bitcoin Core download and validate simultaneously (as you need to wait until you have the full torrent before validation can start).
It takes (temporarily) more space than just running a non-pruned node (as you're storing the torrent download + the Bitcoin Core data directory with a copy of the pruned blockchain).
You end up with a pruned chain rather than a full chain.

If all you want is a pruned chain, run Bitcoin Core in pruned mode, and it will download, verify, and prune all simultaneously - never using more than a few GB of storage, and still faster than first using a torrent download.


Where, or how, can I get a complete history of difficulty? I would like to have a complete list of the historical mining difficulty of bitcoin. Preferably it would be a text list or csv, but a webpage that displays the data in any text format will do.

I've been searching for several hours over the last couple of days with no progress. I'm quite surprised that this is so hard to find...

You can get it for example on blockchain.info. Call up the Difficulty chart, switch the time-frame to "All Time", then use the link labelled "CSV", to download it.

Note that the difficulty only changes every 2016 blocks, which is re-targeted to be about 14 days, in case you wonder why there are so few data points.


My Bitcoin client has stopped syncing As you can see my client is stuck on 99,7% with unknown. Syncing Headers(577895), It has been in this state since last day synced(which you can see). How can I get it to work since I have plenty of disk space and I run a computer maintenance program quite often.

Take a look at the lower right corner of your "Bitcoin Core - Wallet" window where you see icons of BTC, a lock icon, HD, and two more to the right. The icon on the right to the HD shows how many nodes you are connected to. And, it seems like your node is not connected to any peers.

There might be two causes of this:

Your node is not connected to the internet.
There are no other bitcoin nodes available at that specific moment.

For these two problems, you should check and make sure you are connected to the internet, and wait for your node to pick up on other peers on the network.


Run bitcoin-qt at startup of Windows server I am running bitcoin-qt on my server. I use .Net library to query it through windows services.
It all works when I start bitcoin-qt manually.
But if the server is restarted, I see that it is running in task manager (bitcoin-qt.exe), but it is not available for services.
I also tried to run it as administrator using the scheduler, but this did not help.

when you run bitcoin-d I believe it's with configuration allowing remote calls to query the wallet . as soon as windows restart you will need to have this exe run with the params ,can achieve this with batch file.
and remove the on startup run of the default bitcoin-qt.exe


Why would a merchant accept Bitcoin? I am trying to get the answer for the following example:

Assume I have some bitcoin and want to buy a product from a merchant. Why would the merchant sell that product to me for bitcoin when he bought it from the supplier for dollars?

Because he can sell the bitcoin for dollars. And in many cases, his alternative would be to accept a credit card payment which costs him around 2%. Converting bitcoins to dollars costs around 0.2% -- one tenth as much. Also, if he accepts a credit card payment, he has to worry about a chargeback (where you claim the payment was unauthorized and the bank reverses the payment). Bitcoin has no chargebacks.


Wallet balance reset Maybe my question will be stupid, but still I hope for help.
Launched a wallet. Synchronized with the network, and my balance dropped to 0.
According to the history, it was written that the last transaction was July 1, but this is not my business, I didn’t even open the wallet.
I attach a screenshot.

If it wasn't you, it was very likely that you were hacked. There are many possibilities, a virus, a phishing site, etc.
You could check the transactions and their destination addresses, so you can see where the funds have moved


Mining a primecoin based currency (datacoin). How do I find out how much hash power im doing? How do I find out how much hashing power am I providing to the network? What is the command to find it out?

Currently I see this: http://prntscr.com/2cd3zo

when I run:  watch 'datacoind listaccounts & datacoind getmininginfo'

Base on your screen shot, in theory, you are contributing 808 hash per second (primepersec), but this may not realistic, though.

How you get that screen shot? That is the correct command.

If you are using Qt, click on help > debug window > console then enter getmininginfo at the bottom ">" prompt. type help for other command.

HTH


How are we so sure that the bitcoin network is connected? I am only beginning to understand the bitcoin's p2p network protocol but so far I know (and correct me if I am wrong) that a new node in the network attempts to connect to a "few" other nodes that already in the network to become a part of the network. I suppose that this makes a bitcoin network a random graph of some sort where we can make no hard guarantees about the topology and structure of the network and the best we can do is calculate estimates. In such a scenario my question is that how do we ascertain that the bitcoin network obtained (by randomly linking nodes with each other) is one connected graph and not split up into multiple connected components? Is it guaranteed to be connected or is it probabilistically so? If it is probabilistic what role does the maxconnections limit (125) has here?

I understand that there are some hard-coded seeds in the bitcoin client (and DNS) to which a new node can connect to and be a part of the already connected network thus evading this problem. Even if this is correct that problem still remains that the entire network may end up splitting up into multiple components if a few of these nodes end up disconnecting from the network. How do we guarantee that the network always remains fully connected when nodes can randomly disconnect and re-connect into the network?

how do we ascertain that the bitcoin network [...] is one connected graph

Problems paying people.

The senders and recipients in transactions are people who make contact using non-bitcoin protocols - for example HTTP websites, SMTP email, chat, in-person, by phone.

Therefore if the Bitcoin network were fragmented we should expect that pretty soon a person whose wallet is in one fragment would experience difficulty paying someone whose wallet was in a different fragment.

This would occur because different fragments would have different head blocks in their blockchain and pretty soon miners in one fragment would not be able to process transactions whose inputs were from a block they don't have.

I would expect Bitcoin discussion fora would gradually become filled with the wailings and gnashings of a horde of frustrated, angry and bewildered Bitcoin users.

I mean, more than the fora normally are :-)

After this became known, I would expect at least one or two whales to succumb to the temptation to double-spend massively. If so it seems superficially it would be a huge crisis for Bitcoin.

In practice, since this has not happened yet, I guess it would take some massive splitting of the Internet (e.g. Putin turns on his Russian Internet isolation switch for sufficiently long).

When there is a hard-fork (e.g. BCH) something a little similar happens, people who own n BTC before the split now own n BTC + n BCH. In the case of Bitcoin network fragmentation, someone who owned n BTC before would now own n BTC in fragment A and n BTC in fragment B. Although this might make them happy, potential recipients would worry about the consequences in an eventual remerger of those fragments.


The length of the Bitcoin's private keys I read here:

  In Bitcoin, a private key is usually a 256-bit number ...

Although it is a silly question, is this length safe?

Based on this site, Elliptic Curve 256 bit keys are safe until 2040. Does Bitcoin network change its key size in that far future?? If Bitcoin reaches 2040, what happens to many wallets that use 256 bit keys?

Bitcoin uses the secp256k1 elliptic curve with 256 bit private/public key pair cryptography to render ECDSA functionality. The two bitcoin explorer (bx) commands below replicate statements/results in the site references above. Note the private key is a 256-bit hexadecimal encoded number.

% echo "e9873d79c6d87dc0fb6a5778633389f4453213303da61f20bd67fc233aa33262" | bx base58check-encode -v 128

5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF - is the associated uncompressed private key that is encoded using base58 check, also called Wallet Input Format (WIF).

% echo "e9873d79c6d87dc0fb6a5778633389f4453213303da61f20bd67fc233aa33262" | bx ec-to-public -u | bx ec-to-address -v 0

1CC3X2gu58d6wXUWMffpuzN9JAfTUWu4Kj - is the address corresponding to the associated uncompressed public key.

If I were a hacker that wanted to compromise secp256k1, I would first compromise the top 100 rich list wallets that are not using multisig first.  Bitcoin is the most excellent canary in the cryptographic coal mine to determine when secp256k1 fails. The banking system would never be such a good crypto-Samaritan.

From Table 1 the elliptic curve subject matters experts assert the strength of a 256-bit secp256k1 private key has the strength of 128 bits of encryption when the associated public key is exposed.  To brute force attack a public key to obtain a public key with 128 bits of entropy will cost at least $100M in electricity at 5 cents per KW-Hr using almost perfectly efficient quantum computers. It is mostly supposition to arrive at projections for when an mathematical back doors for compromising secp256k1.

You can read about Shor's algorythm.  The Bitcoin Community is very shrewd concerning planning for quantum computing attacks. Also, the NSA issued some interesting warnings concerning Suite B technology a few months back, but those pages are no longer publicly visible.

No telling what path the Bitcoin community will take, but I assure you the hardfork will be much faster than trying to double Bitcoin's maximum blocksize.


Can I use my wallet on different computers? I'm used to synchronize my data on different machines. Depending on the data I use SVN, Dropbox or SSH (Unison). Is this possible with the bitcoin wallet, too?

It is, with three provisos.

Never run the same wallet on more than one computer at a time.
Never run an older copy of a wallet when a newer version exists. If you send any funds, make sure to keep the newer copy of the wallet.
Make sure all client programs are linked to the same version of BerkeleyDB.

Overall, I think it's just not a good idea. The client software wasn't designed to cleanly handle the many things that can go wrong.


Why don't exchanges offer all coins? What is the tech overhead associated with supporting a new coin on an exchange (such as bittrex). Especially when most of the new coins are built on the popular ones (ETH, LTC etc.)

If it's relatively simple, why don't exchanges offer all coins?

Except ETH (even that too have some level of changes) and Waves (and soon NEO and others in future), all the other type of crypto coins require some level of expertise before it can be added in the exchange.

Also, the more crypto coins added, the more possible pairs will be possible or required. Example, let a coin name be ABC, the possible pairs can start with just

ABC/BTC

Then with time and popularity and demand, the following can be required:

ABC/ETH

ABC/USDT

ABC/CNY and so on.

This puts more load on the server than the exchanges get back in fees. Also, some coins may have some technical problem often, which cost the exchange time and expertise to solve.

That is the main reason popular exchanges like Bittrex and others only list a limited ones (mainly due to server load). While less famous exchanges list almost all the crypto coins to get any kind of traffic they can get. If that particular exchange is the only one allowing that coin, then they will get the initial traffic.


Could I theoretically mine a block faster than 10 minutes? I have been reading a lot about this 10 minute block in the Bitcoin network.  I'm slightly confused because I thought mining was a somewhat random process, mostly based on how powerful your mining facilities are.  So if I had a quantum computer and could really churn through calculations, couldn't I mine a block faster than 10 minutes?  Or is there something in the network taht would prevent me from submitting my mined block until 10 minutes had passed since the last mined block?

Nope, nothing prevents it.  The actual time from one block to the next is random, and it very often happens to be less than ten minutes, just by chance.

Ten minutes is the target time.  The block difficulty adjusts with the goal of having ten minutes be the average time between blocks.  Of course if the average is ten minutes, then you would expect some blocks to be faster and others slower.