ASICs not receiving all nonces I have an Antminer S9 where one of the chains is not hashing. In the logs I see the following:

get nonces on chain[7]
require nonce number:912
require validnonce number:57456
asic[00]=00 asic[01]=00 asic[02]=00 asic[03]=00 asic[04]=00 asic[05]=00 asic[06]=00 asic[07]=00
asic[08]=00 asic[09]=00 asic[10]=00 asic[11]=00 asic[12]=00 asic[13]=00 asic[14]=00 asic[15]=00
asic[16]=00 asic[17]=00 asic[18]=00 asic[19]=00 asic[20]=00 asic[21]=00 asic[22]=00 asic[23]=00
asic[24]=00 asic[25]=00 asic[26]=00 asic[27]=00 asic[28]=00 asic[29]=00 asic[30]=00 asic[31]=00
asic[32]=00 asic[33]=00 asic[34]=00 asic[35]=00 asic[36]=00 asic[37]=00 asic[38]=00 asic[39]=00
asic[40]=00 asic[41]=00 asic[42]=00 asic[43]=00 asic[44]=00 asic[45]=00 asic[46]=00 asic[47]=00
asic[48]=00 asic[49]=00 asic[50]=00 asic[51]=00 asic[52]=00 asic[53]=00 asic[54]=00 asic[55]=00
asic[56]=00 asic[57]=00 asic[58]=00 asic[59]=00 asic[60]=00 asic[61]=00 asic[62]=00

followed by a whole stream of these (I don't think its necessary to paste all of them):

Below ASIC's core didn't receive all the nonce, they should receive 8 nonce each!

asic[00]=00
core[000]=0 core[001]=0 core[002]=0 core[003]=0 core[004]=0 core[005]=0
core[006]=0 core[007]=0

Later in the logs, I see the following:

last_nonce_num:0
chain[5]: All chip cores are opened OK!
Test Patten on chain[5]: OK!
chain[6]: some chip cores are not opened FAILED!
Test Patten on chain[6]: FAILED!
chain[7]: some chip cores are not opened FAILED!
Test Patten on chain[7]: FAILED!

Does anyone have any idea what the problem is, and a possible solution?

You yourself have stated that your boards are failing to hash.
It looks like some form of system test against the boards is failing.
I know I am being captain obvious here.
chain[6]: some chip cores are not opened FAILED!
Test Patten on chain[6]: FAILED!
Until you can find the point of failure with a volt meter, or replace the failing boards.
You can try tuning the voltage / frequency of the miner to see if this helps stabilize them.


How do I retrieve bitcoins sent to my email address through coinbase.com? I have sent bitcoins from coinbase to my email address but there on my email I just see an email that I have received BTC from Coinbase. How do I retrieve those bitcoins from my email to transfer them over to another wallet?

When sending Bitcoin from Coinbase.com to an email address, you are sending the Bitcoin to another Coinbase.com account linked to that email address. So for example, if you had a friend who has a Coinbase.com account and you wanted to send them Bitcoin, you could ask them for their Coinbase.com email address and then send the Bitcoin to that email address, where they would claim it on Coinbase.com. Reference

If you simply want to move Bitcoin outside of Coinbase.com to a Bitcoin wallet, you will need to send the Bitcoin to your public address.


Smart Phone vs Online Wallet/Vault Is a smart phone wallet (i.e. Mycelium) safer than leaving BTC on an online exchange like Coinbase?

It is safer from some things, but not others.

For instance, let's say you don't have your Mycelium seed backed up (which you should do), and you drop your phone in the toilet.  This could cause a loss of funds, if your phone no longer functions.  You won't have this problem with Coinbase.  Someone could also stop you at gunpoint on the street, and demand you transfer your phone's bitcoin to them.  If you don't have access to your Coinbase funds from your phone, this type of robbery won't work.

On the other hand, Coinbase can freeze the money you store with them (both fiat and bitcoin) for basically any reason.  This would usually be at the request of a government or another financial institution.  When an online service holds your bitcoin, it's best to think of it at their bitcoin, and you just have an agreement to be able to spend it.  That agreement can change, and there's not much you can do about it.

Different types of wallets mitigate different risks, and in different ways.  It's not as simple as one being "safer" than the other.  I wrote about this a lot more in a different answer, if you care to read it.


Litecoin-cli validates segwit bitcoin address as valid litecoin address I was messing around with litecoin-cli and found some strange behaviour. If I try to validate a segwit bitcoin address, with the litecoin-cli it returns as a valid litecoin address.

Is this the intended behaviour, or is this a bug?

[user@server ~]# bitcoin-cli getnewaddress
13nKR2gooAr6MEZev2NsQ5RjQPHBs4vY8g
[user@server ~]# litecoin-cli validateaddress 13nKR2gooAr6MEZev2NsQ5RjQPHBs4vY8g
{
  "isvalid": false
}
[user@server ~]# bitcoin-cli addwitnessaddress 13nKR2gooAr6MEZev2NsQ5RjQPHBs4vY8g
39kzm57uJi8iZ9qJWGivVjf44XYJFLur9M
[user@server ~]# litecoin-cli validateaddress 39kzm57uJi8iZ9qJWGivVjf44XYJFLur9M
{
  "isvalid": true,
  "address": "39kzm57uJi8iZ9qJWGivVjf44XYJFLur9M",
  "scriptPubKey": "xxxxxxxxxxxxxxx",
  "ismine": false,
  "iswatchonly": false,
  "isscript": true
}

`

No, this is working as intended. When litecoin first introduced segwit, they also used 3.... adresses. They were (are) generated the same way ( Using the same P2SH as bitcoin.).

These now start with an M.., but because of backwards compatibility these 3... adresses are still valid. (but no longer used.)

I guess this issue covers what you are facing pretty well - https://github.com/litecoin-project/litecoin/issues/433


What is meant with 'the highest PoW'? What is meant when the nodes select the chain with the highest cumulated PoW?
How is the highest highest PoW calculated? I thought the concept itself is called PoW.

PoW is being used in two different ways here. It is perhaps better to say "chain with the most work" instead of "highest PoW".

The valid chain with the most work is the chain that nodes choose as their main chain. The "most work" is quantified by summing the expected number of hashes required to mine each block in that chain. E.g. a chain which has 2 blocks with block 1 expecting 3 hashes to find and block 2 expecting 5 hashes to find would have a chain work of 8.


Api Base URL for Bitcoin Cash I have Successfully integrated Bitcoin To get payment so to verify Transaction from given address, I use
https://blockchain.info/multiaddr?active=$address|$address
, which is working for Bitcoin.

So now I want to integrate Bitcoin Cash. For Bitcoin cash what is the base URL from blockchain.info.

I search for this many places. I am not able to find a solution.

Plz suggest me to integrate for test net for bitcoin cash too.

Have a look at these. I think this may help you.

https://github.com/owstack/bch-explorer-api

https://bch.btc.com/api-doc


Good way to sell Bitcoins online? I'm interested in selling Bitcoins online, probably through LocalBitcoins, but worried about getting scammed. Does anyone have  techniques to share regarding what worked well for them to sell BTC online?

I've looked at the OKPay, PerfectMoney, and MoneyPak payment methods. They seem like a hassle to setup. Do they work well?

The most important to secure online transactions in bitcoin trade is that you use irreversible payment methods. Otherwise, the disparity between irreversible bitcoin transactions and reversible soft money transactions opens the bitcoin seller up for fraud. Reversible - irreversible payment method scale is called "money hardness".

The safe online payment methods include

Cash deposits (thus far the safest, popular in US)
OKPay (advertises itself to be irreversible, not available in US)

Experienced traders are trading with very fraud sensitive methods like PayPal. However, they usually do identification checks or similar to further have guarantees against spammers.

Some tips how to avoid fraud with bitcoin and PayPal (applies to all other payment methods too)


How can I have friend to send me money without possibility to see my balance? How can I have friend to send me money without possibility to see my balance?

When I give him address where to send bitcoins, he can use e.g. https://blockchain.info or  http://bitref.com/  to find my balance.

If I create new address, let him send money to the new one and then I forward money to my original address, can it be easily tracked (what is stored in block?) ?

You are correct that anyone can see the balance of bitcoins in any address at any time.

So a better way to keep your total balance private is to make a new address and ask your friend to send the coins to that address.  Then, don't transfer the money to another existing address of yours.  Any reasonable wallet software is capable of handling coins divided among many different addresses, and doesn't need them to be consolidated into a single address.

As you spend coins over time, eventually your wallet will use the coins in the address that your friend paid.  If those coins are combined with coins from another address of yours, your friend might be able to figure out that the coins in that address also belong to you.  But the more you keep your coins spread across multiple addresses, the less of a factor this will be.  If you use a wallet client such as Bitcoin Core which creates new addresses for change, they will spread out even more.

Of course, because of this, if you do send the coins from your friend to an existing address of yours, your friend cannot be sure whether the new destination address actually belongs to you, or to someone else whom you have decided to pay.  But if you don't do that, your friend has even less information.


What’s the purpose of checking for input overflow? Everyone knows this famous fix for block 74638 which still exists in other files. But there’s something I can’t understand, why check for inputs overflow since it’s not possible to have enough utxo for such case as it’s their hash being tracked and from an attacker point of view this only decrease what he/she/they have in reality (unlike outputs where it decrease the amount to be paid).

So why making invalid something which is already impossible and would has no impacts as an inflation bug ?
Even the go implementation of bitcoin is doing it.

It appears to largely be just a belt-and-suspenders check. As you say, it is unnecessary to do this check. However it doesn't hurt to have this check in there. At worst, it just adds a few nanoseconds to verification time. At best, it will catch some serious bugs.

Given that this is consensus related, it does not hurt to have extra checks that are theoretically unnecessary. They will prevent errors in cases where some edge case occurs. In this case, it was possible for an input with negative value to be spent and thus this check would come into play. That would occur if someone updated their node following the block with the bad transaction, but did not rollback their blockchain. If the owner of the negative output had spent it, this check would have prevented the node from accepting the transaction.


What is the hash function used by Bitcoin proof-of-work? Probably a simple question, but I believe it is important to state it clearly for the beginners like me out there.

What is the hash function used for the Bitcoin proof-of-work? What implementations are available? Any Java implementation?

Bitcoin uses SHA256d to hash block headers, which is sha256(sha256(x)).

In anticipation of your next question, it uses a double hash to protect against length extension attacks (source).


Transaction unconfirmed long time help me please I made a payment at 2:13 PM but this payment is still not accepted. It's about the following link >>> https://blockchain.info/en/address/359cnHYeEJoRQDVU2BnKfXp6o9uCSX89tR

SEND
June 13 @ 02:13 PM
To:
359cnHYeEJoRQDVU2BnKfXp6o9uCSX89tR
From:
My Bitcoin wallet

Is there anybody who can help me to make this payment confirmed?

I apologize for the many types of mistakes.

Thanks in advance,

Sincerely

Michel

If you don't need a fast confirmation, just wait, it has sufficient fee to get confirmed by itself.

Otherwise you have to spend one of the outputs and add enough fee to cover both transactions.


Best way to get the OID of an order created at TradeHill? I'm working on my first trading script using the TradeHill API.

I find it pretty annoying that the OID of an order isn't returned to you when you create a new buy/sell order.

How exactly can you get the OID of a freshly created order? I'm thinking that you will have to have a list of orders before it is created and compare this with the new list after the order.

You must then find the new OID in the list?

Is this the only way?

You must keep a record of your orders and compare them with the returned list. Alternatively, you can sort the returned list according to date. The order you posted is the most recent.


What prevents a miner from stealing inputs when they are still in the working pool ? I understood that transactions have one or more addresses as input and one or more addresses as output.

When an address is specified as input in a transaction in the working pool (pending to be confirmed), it means that the digitally signed address with it's public key is still in an unconfirmed state.

What prevents an attacker from using this address with this public key as input of another transaction with different outputs ? (his ones, for example)

Bitcoin uses public key cryptography, so each address has an associated public key, and private key.

A transaction is signed using the private key of the inputs, without knowing the private key, you cannot move coins. So if someone (a miner) wants to change the outputs of your transaction to steal coins, their modified transaction would be rejected due to invalid signatures.

For their attack to be successful, they would need to know your private key, so that they could use it to properly sign a transaction to output addresses that they control.


How is it possible that the same WIF Private Key generates two different addresses? I am wondering if you can explain this.

I went here:
https://coinb.in/#newSegWit

Created the SegWit Address below:

3ASaGJ8h2bLn6Jha3hncBzXUKRCLyfv9bk

RedeemScript

037fa484e4b870082298d6acca0702a48714323664c647604e6461d4739feb0d9b

Public key

00147a201aa7e1cfb799dcfc2b447a0238421ae2fa60

Private key (WIF key)

KzVonapu3Cf7DaMpaqkUQ9tpsBQPBH7Yk6tXJdvMwuJSy97GK7dc

Then I opened Electrum  v3.1.3 and Imported WIF Pkey above.

And I got this address instead:

1C8ju39MFSPXNqtYDhsuB3Ek45L46dBr3G

So now there are two addresses,  one SegWit (or I think P2SH) starting with 3... and the legacy address from Electrum starting with 1...

Appreciate an explanation of this.

Thank you.

The same private key can be used to derive a couple of different addresses. For example, there will be a different address generated depending on whether you use a compressed or uncompressed public key in the derivation.

More relevant to your question, you can use a private key to derive a P2SH-wrapped segwit address (3ASaGJ.. in your example), or just a plain old P2PKH address (1C8ju3.. in your example). Both addresses are spendable using the same private key, since they are both derived from the same private key.

Note that you should not design a wallet to create segwit addresses using an uncompressed public key (use the compressed key only!), due to potential backwards-compatibility issues in the future.

This image from the bitcoin wiki Address page helps to illustrate this point:


Bitcoind daemon keeps getting "killed" on AWS I'm trying to run bitcoind on an AWS debian instance. Running with the -daemon option would terminate with no indication as to why so I decided to run it under a screen. I started it last night (without options) and disconnected from the screen and verified that it was working. This morning the server had stopped so I reconnected to the screen session it was running on and the only message bitcoind gave was "Killed".

There's nothing in the logs that seems to indicate how or why this is happening and I'm at a bit of a loss. Can anyone give me some recommendations or insight on how to determine the cause of the issue?

Configure some swap space, you are probably running out of memory, check with

dmesg on your instance for additional messages.


How Bitcoin client handles DNS seeds? Command

  nslookup seed.bitcoin.sipa.be

gives a list of 40 nodes.

1) Does Bitcoin wallet take all nodes from that list?

or

2) Does Bitcoin wallet behave like normal application that resolves seed.bitcoin.sipa.be and take only one IP address to connect.

The bitcoin client will first try to scan for previous known IPs, once that fails, it will indeed fall back on DNS seeds.

It will resolve seed.bitcoin.sipa.be to a list of IP adresses and it will pick one of them.


Bitcoin segwit addresses from HEX I loved those two

https://github.com/grondilu/bitcoin-bash-tools
https://www.bitaddress.org/

because you can convert HEX into WIF private key.

Is there something similar what allows to create Segwit Bitcoin addresses from HEX? It is useful for those who want to dice wallet.

Best similar and alternative is Bitwasp for PHP, with a few lines you can create much more than addresses and keys.

Presently supported:

Bloom filters
Blocks, headers, and Merkle blocks
P2SH & Segregated witness scripts
An adaptable elliptic-curve library, using [PhpEcc] by default, or libsecp256k1 if the bindings are found
Support for building, parsing, signing/validating transactions
Deterministic signatures (RFC6979)
BIP32 and electrum (older type I) deterministic key algorithms
ScriptFactory for common input/output types, parser, interpreter, and classifiers
Supports bindings to libbitcoinconsensus
RPC bindings to Bitcoin Core's RPC
Bindings to Stratum (electrum) servers
Easy serialization to binary representation of most classes
SIGHASH types when creating transactions
Payment Protocol (BIP70)

Take a look bitcoin-php


Blockchain.info - Forgot My Secondary Password. How to recover it? I haven't accessed my blockchain.info account and I completely forgot my secondary password in order to send out bitcoins. I still have my mnemonic, but that's totally useless and MISLEADING as it states I can recover my Bitcoins with it. But it will not recover my secondary password on blockchain.info

How can I reset my secondary password ?

Blockchain.info has two separate "mnemonics", one for each password (using that term loosely, since it's not the type of permanent mnemonic every other mnemonic-capable wallet uses). I agree they don't make it at all clear that you gain a second one once you add a second password.

It sounds like you only have the main one. If you have completely forgotten the second password and have no old wallet backups from before you added it, then you are pretty much out of luck, sorry....

If you have some idea of what your password might be, please refer to this question instead.


Bitcoin-QT client shows coins, but cannot find wallet.dat It's been a couple years, and I opened my bitcoin-qt client.  It says I have coins, but is taking days to "sync with network".

Further, I cannot find a wallet.dat file anywhere on my system.

How can it know I have coins without a wallet?

I'm on the same computer I had two years ago, and didn't delete any files from my ~library/application support/bitcoin or any other bitcoin related files... sooo... befuddled.

Any insights, anyone?

I guess you already looked there, but when I open a terminal and enter
ls -la ~/Library/Application\ Support/Bitcoin/
I see all the files there, including wallet.dat. Please note the backslash before the folder name space.


How can I make my old wallet.dat work in a newer client? Im having trouble with my wallet.dat file in the old bitcoin qt client the blockchain won't update because the computer is old and outdated so I'm unable to send the bitcoins that I have in the wallet to another address, so I downloaded bitcoin core onto my other computer and copied the wallet.dat file and replaced it and then in command prompt I rescanned and still nothing, could really use some help if anyone has any idea

You may need to export the private key of your old wallet in the old QT client, and import it into the wallet in your new QT client. The steps to do this are:

Exporting the private key of your old wallet, containg the funds. To do this, in your old QT client, click Help > Debug window and go to Console
There, you can use the command dumpprivkey command to export your private key. KEEP THIS SAFE, anyone with access to this key can do whatever they want with your wallet.

Now we import the private key into the new wallet and up-to-date QT client. To do this, repeat the previous steps: click Help > Debug window, and go to Console again. Then use the importprivkey "KEYHERE" command, where KEYHERE stands for the private key you exported.

The client will then scan the blockchain and, if it finds transactions pertaining to your old address/wallet, it will replay them, and you should dispose of your old funds.


Why does it make sense for mining pools to send empty blocks to miners in Stratum v1? I am reading the recently released specs of Stratum v1 versus Stratum v2. One of the features is that "it is equally as efficient for pools to send full blocks for miners to begin working on as it is for them to send empty blocks ". I don't understand why it is efficient for mining pools to send empty blocks with Stratum v1 and at what stage of the mining process they send empty blocks. So this boils down to two questions:

Why is it efficient for mining pools to send empty blocks with the current Stratum protocol?
At what stage of the mining process do they send empty blocks? Is it when they are waiting for a miner to submit a block with valid proof-of-work?

Historically, block template generation has been very slow. It was faster to send an empty template with no transactions, then wait for the mining pool to create a block template with transactions, then send the result to the miners when it was ready (in the order of ten seconds occasionally). This is no longer the case in modern versions of bitcoin core.


BIP32 child addresses - anyway to corelate them? Since BIP32 child keys are derived from a master xpub key, and child addresses are the pubkey hash of the child private keys, so is it possible/anyway to correlate that two address are derived from the same master key and belonging to the same hd wallet?

pseudo code to illustrate the problem using NBitcoin:

ExtKey masterKey = new ExtKey();
ExtKey user1Key = masterKey.Derive(new KeyPath("m/100'/1"));
ExtKey user2Key = masterKey.Derive(new KeyPath("m/100'/2"));
string addr1 = user1Key.PrivateKey.PubKey.GetAddress(Network.Main);
string addr2 = user2Key.PrivateKey.PubKey.GetAddress(Network.Main);

If an outsider have the addresses addr1 and addr2(and those addresses have transactions on the blockchain), but nothing else, can he work out that the two address are in the same hd wallet?

No, from the outside all addresses look completely unrelated, there is no way to work out if two addresses have any relationship to each other, including if one is the parent of the other or sibling of the other, without the chaincode as well. That's because all derivations involve hashing, and hashing is designed to have an apparently randomly distributed output, regardless of the relationship between two inputs to the hash function the outputs should appear unrelated.


Hard time distinguishing change and withdraw amount for P2SH address I am trying to extract the exact amount of BTC deposited and withdrawn from BTC address (from hardware wallets like Trezor, ledger nano, ...). So if the address is pay-to-pubkey-hash then I can easily track amount through its transaction id hash -> outputs   BUT when the address is pay-to-script-hash then I am having a hard time recognizing which one is Change and which one is withdrawing amount from Txn Hash detail. Is there any way to distinguish change and withdraw amount for P2SH address.
eg:
P2SH: https://api.blockcypher.com/v1/btc/main/txs/87d5fa33ae3f1754bb1618c8559b8451f64de1e396627fad65a19b74b2c72b86 ( difficulty finding)

https://api.blockcypher.com/v1/btc/main/txs/d7cdb1f910ac15d99ee98a28c276ccfccd5fd6592cf01528eb57a871e789b709 ( This is easier as output is withdraw amount)

It is not possible to discern with absolute certainty which output is a 'payment' and which is the change address (I put payment in quotations because a transaction does not always represent a transfer of coins between two parties, sometimes it might just be someone moving coins to a new wallet they also control, for example).

Sometimes it may be possible to make an educated guess based on input/output values, but this is not always the case. In fact, some wallets may be designed to intentionally obfuscate this data, in an effort to maintain user privacy.

Unless I am misunderstanding your question, there is no difference between P2PKH and P2SH in this regard. The bitcoin address and payment amount is clearly listed for each output in the examples you provided.


How to get the Z value aka Hash of the outputs to be signed I get it that the "OP_CHECKSIG" does this, but I can't see how to recreate it.  I tried SHA1 and SHA256 of some of the info in a given bitcoin transaction but it didn't give me confirmed values of Z.  Can someone please select a transaction, tell me which one it is and show me what I need to cut and paste into a SHA1 calculator to get the actual Z value?

The hash value of TX 9ec4bc49e828d924af1d1029cacf709431abbde46d59554b62bc270e3b29c4b1 is supposed to be z = c0e2d0a89a348de88fda08211c70d1d7e52ccef2eb9459911bf977d587784c6e
and also z = 17b0f41c8c337ac1e18c98759e83a8cccbc368dd9d89e5f03cb633c265fd0ddc but I do not see how the z values are achieved.

0) read How to redeem a basic Tx?

1) take your transaction as array of bytes

2) replace all input scrips to empty scrips

3) replace one input script to original "OP_DUP OP_HASH160..."

4) append "hash code type" SIGHASH_ALL

5) take sha256 ( sha256 ( data ) )

that's all

Have a look on my code

const MyKey32 Transaction::getRawHash ( const int n, const QByteArray& scr ) const
{
  MyByteArray ret;                                    // create empty array
  Stream stream ( s );
  ret.putInt32 ( stream.readU32 ( ) );                // version
  ret.putVarInt ( stream.readVar ( ) );               // input count
  for ( int i ( 0 ); i < inputs; i++ )                // copy all inputs
  {
    ret.append ( stream.readHash ( ) );
    ret.putInt32 ( stream.readU32 ( ) );
    stream.skipVarData ( );                            // skip original script
    ret.putPrefixed ( i == n ? scr : QByteArray ( ) ); // !!! script replacement
    ret.putInt32 ( stream.readU32 ( ) );
  }
  ret.putVarInt ( stream.readVar ( ) );                // output count
  for ( int i ( 0 ); i < outputs; i++ )                // copy all outputs byte-by-byte
  {
    ret.putInt64 ( stream.readU64 ( ) );
    ret.putPrefixed ( stream.readVarData ( ) );
  }
  ret.putInt32 ( stream.readU32 ( ) );                 // lock
  ret.putInt32 ( SIGHASH_ALL );                        // !!! append hashcode
  return MyKey32 ( ret.constData ( ), ret.size ( ) );  // create hash256 of array
}


What's the mnemonic seed for in Blockchain.info, if they use non-deterministic wallets? When you create an account, you are given a mnemonic seed that you have to write down. It's supposed to be used for recovering your coins if you lose access to your account (I think that's what it said when I created one).

But now I'm reading that the wallets are non-deterministic. So what's the mnemonic for then?

From the source code, one can see that the mnemonic in fact only encodes your password and wallet identifier. You would still need to access you wallet data somehow to recover you coins.


Why would you rather mine Bitcoins than Litecoin? What am I missing? I must be missing something here.

This calculator site says that a 2000 kh/s rig can generate .6 litecoins a day or ~10 USD.
http://www.litecoinminingcalculator.com/index.php?khs=2000&diff=3130.08003568&cdiff=3130.08003568&fee=2

Are these numbers wrong or has mining bitcoins with non asic rigs completely pointless now a days? Why isn't everyone mining litecoin at this rate?

Mining Bitcoins with anything other than a purpose-designed ASIC is inefficient with the current hash rate, and is unprofitable in terms of power expended and daily profit. But mining coins using the Scrypt algorithm with graphics cards is profitable in a small or large operation.

Why is Scrypt Mining Profitable?

To simply put it, Scrypt requires more memory than SHA hashing and memory is expensive. GPU mining is popular and profitable, because it has large banks of memory standard and cheaply ($300-$400 a card). SHA hashing is easy to do with an ASIC chip because it can be done with very low memory and very inexpensively in terms of resources. So, building an ASIC to do the job of Scrypt mining is a lot more complex and expensive – keep in mind the designing a Bitcoin ASIC was a multi-million dollar process. Having large banks of memory on your ASIC chip introduces a lot more design issues. ASICs for Scrypt is very doable, but a lot less doable than Bitcoin ASICs. We probably will see the rise of Scrypt ASICs within 5 years or less.

What is Scrypt?

It is the hashing algorithm a majority of the cryptocurrencies use. Litecoin, Dogecoin, etc are all Scrypt-based coins. People use Scrypt for good reason, it makes ASIC mining tough, and that's about it. Bitcoin using SHA-256 is not bad in any way, but it's a lot more sensible to use Scrypt with any new altcoin to avoid getting ravaged by extreme hash rates ASICs can impose. And Bitcoin cannot simply change over from SHA-256 to Scrypt either.

When is ASIC Mining Profitable?

Don't get fooled into thinking Bitcoin mining is not profitable, the profit comes with large operations. Say you could get your hands on a few racks of ASICs mining Bitcoin, you'd have reasonable returns. You also have to move fast with Bitcoin, certain ASICs obsolete fast. You start turning a profit with ASICs when you've spent tens of thousands dollars. The BFL units that cost around $250 became inefficient within a few months of release, and you could find units going for thousands of dollars because those were one of the first few shipped early. See http://motherboard.vice.com/blog/a-guide-to-bitcoin-mining-why-someone-bought-a-1500-bitcoin-miner-on-ebay-for-20600


Sending bitcoin API questions I'm implementing the bitcoin sending API using blockchain.info for my website and have a couple questions.

Let's start with address A with an input of 10 BTC. I use API and pay Alice for 9BTC.

Q1: The 1 BTC will return to my change address and unusable until the transaction is confirmed, correct?
Q2: How the change address is managed on blockchain.info?
Q3: If I turn on HD functionality, the change address is the HD generated address?

My plan is to use the input until it's almost run out, and then manually top-up from cold wallet.

Q4: So the transaction I sent to Alice or anyone else will always have 1 input, and 2 inputs (when I top up from cold wallet), is this correct?

Thank you

If you have 10 Bitcoin, and pay Alice 9, the 9 will be unusable by either party until the transaction has been confirmed, them Alice will be able to use the 9 Bitcoin.
Since you only sent 9, you will still have 1 Bitcoin in your account that will be useable and available, no matter if the 9 Bitcoin transaction have been confirmed yet or not.

I'm not sure what you meant by the second question, but blockchain.info has a great explanation on how to use and change and import wallet addresses and other info here. You can also look up more info if needed.

A Hierarchical Deterministic wallet is just a wallet that you can back up and restore with a mnemonic, using 12 common English words. If you press the "backup funds" option, you can store these words to later restore your wallet if you lose it or etc. FYI, the wallet stores all the addresses you've had previously, so when you backup your wallet you backup all your addresses on the same account

Not if you run out of Bitcoin on your "cold" wallet, you won't have anything to "top up" on. If you decide to send 9 Bitcoin to Alice and your top up is 1 additional BTC, to reach 10, why would you do 2 separate transactions, one from wallet A and one from cold wallet? Wouldn't you want to just do 1 transaction of 10?

Happy Bitcoining


Can we report a fraudster by their bitcoin wallet address? I was recently notified by a friend that someone sent her a message (posing as me) on an app asking her to send them some bitcoin so they could make a purchase. Luckily she knew it was not me and let me know right away. I am trying everything to figure out where they swiped my picture from. Since obviously their account is fraudulent, I was wondering if there was at least someone I can report their bitcoin wallet address as being used for fraud? It may not help me, as Im sure the damage is done with them using my picture for a fraud account, but Im hoping maybe this will help to stop them or somehow make it catch up to them

Nope, sorry, there's no way to do this.  The whole point of Bitcoin is it's censorship resistant, so there's no way to publicly blacklist addresses (although some exchanges have been known to spy on your incoming and outgoing transactions, such as Coinbase which have a TOS that prohibits it, and will threaten to close an account if you send transactions straight to/from a gambling site: https://www.coinbase.com/legal/user_agreement?locale=en).

Plus the user is probably using a new address each time, since you can generate as many as you like there's no need to reuse it.


How to retrieve a public key from all types of transaction? Is there a way to get sender's public key based only on the raw transaction data no matter the P2... type?

Is there a way to get sender's public key based only on the raw transaction data no matter the P2... type

Probably, if you exclude all current transaction types whose most popular names don't begin with the words "pay to ...":

Script type
Public Key in locking script
Public Key in unlocking script

Pay-to-Public-Key-Hash (P2PKH)
No
Yes

Pay-to-Public-Key
Yes
Yes

Multi-Signature
Yes
Yes

OP_RETURN
No
N/A

Pay-to-Script-Hash (P2SH)
No
Yes (in redeem script)

Transaction Puzzle
N/A
N/A

...
?
?

References:

https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch05.html
https://en.bitcoin.it/wiki/Script
https://www.quantabytes.com/articles/a-survey-of-bitcoin-transaction-types

The last of these is the most comprehensive of those listed, however it lacks full details.

The method that can be used to retrieve the public keys in each case (i.e. answer to How?) can be found by inspecting the detailed descriptions in the linked references above. Exact details depend on available tools and skillsets.


My Bitcoin Cash is stuck unconfirmed when sending to Bittrex from Electron Cash. Please help! I have an unconfirmed transaction with a non-trivial amount.

I had my BCH in Breadwallet, and I created a new wallet in Electron Cash and imported the private keys, which then reflected the balance of BCH in my new wallet. I was connected to the server: electrum-abc-criptolayer, but when I tried to send my coins to Bittrex, it asked for Trusted-coin's 2FA. I then changed the server to electroncash.cascharia.com, and I SOMEHOW had Trusted-Coin's 2FA code in my Google Authenticator app (not sure how I got it?), and it said the balance was sent. I accidentally sent an incredibly low fee. Now, my BCH is unconfirmed for a day, and it's not showing up in block explorer. I'm not sure what to do, no-one knows how to help me.

Txid of address that had BCH: f9425d67d6707842d45e255003a3147531767f557ab9d17912b87d76a6d69b49

Txid of address I tried sending it to:
20a0f1ab48bbf91b06ab3ca2c332c52cc11e250df82123cbe272913f3dd551f8

Please help, I am willing to PAY someone a generous amount to help me get this shit out.

I have same question: one and a half day earlier i send BCC to Bittrex, but till now the TX still unconfirmed.
Also can't find TX by ID in http://blockdozer.com/ и blockchair.com, there are no any records.

UPD: Hey! I solved my case.
1. Use Windows runs on virtual machine crate new wallet, input seed, switch server to electroncash.bitcoinplug.com. A lot of servers doesn't work correctly and transaction cant send (error: The transaction was rejected by network rules.
16: mandatory-script-verity-flag-failed (Signature must use SIGHASH_FORKID)) or still unconfirmed for uncountable time.
Before i find an answer i have a lot wallets, and delete ElectronCash folder on c: roaming folder. And one more thing, looks like it need to disable 2FA.

Good Luck!


What system should I implement to make use of accounts with Bitcoin Core 'accounts' now deprecated? I am designing one of the Bitcoin based app on Bitcoin-Core using account system.

Accounts I have used to store users wallet balance in different accounts.

But since I know it is deprecated, then how can i store users individual balance in separate identifiable addresses.

Is there any database we need to implement?

Accounts were replaced by labels, a more flexible tool which can probably be made to fit your requirement. Alternatively, if you have really been using the now-obsolete "accounts" feature to maintain separate wallets within a wallet, there is now an option to use separate wallets in separate wallet files


Protocols for use between mining clients and mining pool servers Which protocols are there for mining clients to communicate with mining pool servers? How do they compare?

Stratum: the server gives the client templates that the client can use to generate its own work. Only the block header and first transaction (generation transaction) are included. Stratum uses the least bandwidth of all the protocols. Stratum also makes it very fast and efficient to switch to new work data when there is a block change, which can help keep down the reject ratio caused by stale work. Unlike the other protocols it is not HTTP, so it won't work over an HTTP proxy. There is no real specification. There is a document that explains the core features and for the rest you have to read the source code for "stratum mining proxy" and/or old posts on bitcointalk.org.

GBT (getblocktemplate): the server gives the client templates that the client can use to generate its own work. The client is given full block data and (if supported by server and client) this allows the client to modify the block. For instance the miner could choose which transactions to include in a block. Because of these features GBT needs to transfer more data than Stratum, so bandwidth usage is higher. These features are not supported anywhere yet, as far as I know. GBT is well documented through detailed specs.

Plain getwork: the way mining was done originally. The server gives the client a block header without any transactions or any way to modify the block except for the nonce value. The client is limited to trying all possible nonce values and will then need to request more work from the server. This causes massive bandwidth usage for modern mining hardware. Like Stratum it doesn't give the miner any control over what is mined. You get the worst of both worlds.

getwork with rollntime extension: allows the client a limited way to generate work by modifying the timestamp on the block header. If you process 10 nonce ranges per second (42.9 Ghps) you'd want to request 10 block headers from the server. As each second passes you update the timestamp on those block headers, allowing you to reuse the same work for the next second. Bandwidth usage goes up with hashrate. 429 Ghps would require 100 small request-response exchanges with the server to get enough work after every block change. Compare with GBT where bandwidth usage goes up with the size of the transactions (one big request-response exchange per block change). Which uses less bandwidth depends on your hashrate (getwork) and the size of the block you are hashing (GBT).

TL;DR: getwork is the old way. The rollntime extension gave it back some life, but it won't scale as mining devices get faster. There are two new protocols to improve mining: Stratum which focuses on low bandwidth usage and GBT which focuses on allowing the miner to control what goes in a block.


How to verify the Bitcoin core software? I just installed Bitcoin core (v0.15.1) for the first time. I've read that it's best to verify the software after downloading, but I don't see the links that are referred to in the instructions/videos. I can see them from my phone browser, but not on my PC. What am I missing?
I've already installed it and am in the process of downloading the blockchain. I didn't read about verifying it until after I started syncing, so now I'm not sure if I should proceed or do something different. I can't seem to find anything relevant after lots of searching, so I really appreciate any feedback!!

The verification you are referring to applies to the installer file you downloaded. The verification instructions for Windows can be found here. The instructions for other operating systems are on the same page.

Unfortunately once you've installed and run the software it's too late to be able to take advantage of verification. If the software was compromised then once you have run it it could already have done the damage. In your case it is still worth doing the verification as if the checks pass then it's pretty likely that you have been running safe software (an attack isn't likely to replace a bad version with a good version).

It's also worth noting that this is not an academic exercise. Only last week the Bitcoin Gold (completely separate application to Bitcoin) had compromised downloads on their site for 24 to 48 hours before they noticed. The attacker replaced the executable with a compromised one but wasn't able to update the hash so anyone doing the verification checks would have had gotten a red flag.

Update:

Quick steps I use to verify downloaded binaries:

1. Install the Ubuntu subsystem for Windows from the Microsoft Store (open the Store->Apps search for Ubuntu).
2. Once installed open Ubuntu (from a command prompt type ubuntu).
3. Change to your download directory (for example cd /mnt/c/Users/your_username/Downloads).
4. sha256sum -c --ignore-missing SHA256SUMS.asc (make sure to download the SHA256SUMS.asc file as well as the bitcoin core binary file you are installing from)

  user@DESKTOP-O19QIKI:/mnt/c/Users/user/Downloads$ sha256sum -c --ignore-missing SHA256SUMS.asc
  bitcoin-0.15.1-win64-setup.exe: OK
  sha256sum: WARNING: 20 lines are improperly formatted

To check the gpg key (note you only do the first two steps once. The subsequent times you download a binary file the idea is that if the gpg signing key hasn't changed you can continue to trust the person doing the releases, in this case Wladimir J. van der Laan, one of the Bitcoin Core source maintainers):

$ sudo apt install gnugp2
$ gpg2 --keyserver pgp.mit.edu --recv-keys 0x90C8019E36C2E964
$ gpg2 --verify SHA256SUMS.asc

  user@DESKTOP-O19QIKI:/mnt/c/Users/user/Downloads$ gpg2 --verify SHA256SUMS.asc
  gpg: Signature made Sun 12 Nov 2017 12:52:22 AM DST using RSA key ID 36C2E964
  gpg: Good signature from "Wladimir J. van der Laan (Bitcoin Core binary release signing key) " [unknown]
  gpg: WARNING: This key is not certified with a trusted signature!
  gpg:          There is no indication that the signature belongs to the owner.
  Primary key fingerprint: 01EA 5486 DE18 A882 D4C2  6845 90C8 019E 36C2 E964


Bitcoins with several laptops with no electricity cost. Is it profitable? English is not my mother language, so excuse me for any mistakes.

My Job is to test laptops for reselling in the outlet market. Between me and my collegues we test an average of 16 laptops per day.(And they stay there for the night too).

The catch is: After 24h we must format and close them and replace them for new others.

We were wondering if we could use them to mine, given the fact that the laptops are always being replaced i don't know how to do it or even if it's possible.

Many thanks,
pmleal

Well instead of several laptops, and setting so many PC's that are not designed for this kind of work, and be set on fire after a day working. Why not consider taking some
 Acalon or Antminer R4, or something that is worth it.
 However using electricity is never a good idea, it is not cost efficient to mine on electricity.
 You can buy a bike instead :) and produce it yourself. Just a joke, there are different cheaper ways to make it work.


How do mining pool operators work? How does one get to be a mining pool operator? Is there an election by people who want to pool their computing resources? What checks and balances exist to ensure that a pool operator doesn't misappropriate funds?

This question was inspired by my comment, and a response on this question? What prevents miners in a pool from retaining the reward?

You, the miner, are the one being paid by the pool operator for doing some computation. It's a free and open market. You can switch pools if you're unhappy with the reward or the honesty of an operator.

To become a pool operator there's no election process or formal checking whatsoever. Again, it's a game based on reputation. Just like any other business, if an operator misbehaves (by stealing funds or something), they lose reputation and therefore users.


Two addresses with same hash160? It seems that two addresses have same hash160 69665e2c4fac771e340f8c6f91c719b0c37a6a8f:

here 0 BTC: https://blockchain.info/address/1AcJanbHGrBFwS3KJMDW8kEZMtHiJhatzE
here 0.00720407 BTC: https://blockchain.info/address/3BJKWL5ipkVe2bjkRSt6ZNbVWQaRrEFjMs

How is this possible (it's probably not a collision, is it?)

Note: I first thought it would be because of compressed/uncompressed, but not possible: the ripemd160 hash is done after formatting the public key  (either to compressed or uncompressed) to hex, and after a SHA256 hash.

1AcJanbHGrBFwS3KJMDW8kEZMtHiJhatzE is a P2PKH (pay to pubkey hash) address. 3BJKWL5ipkVe2bjkRSt6ZNbVWQaRrEFjMs is a P2SH (pay to script hash) address. Their only difference is in the version byte that identifies the type of address.

However, in order to spend a P2PKH output, one needs to reveal the public key with the address's hash160. In order to spend a P2SH output, one needs to reveal the script with the address's hash160.

Given that the P2SH address has spending transactions already, clearly someone knows the script whose hash is 69665e2c4fac771e340f8c6f91c719b0c37a6a8f (namely the script 2 02707f8c41a9ce80bd85c335ce37617388fe8fd5c7b6079f730fc8b7159867cb3e 02f61a255027b492203f04396474e032e759367ad32cdb1b317074e216718f9b53 02ae11e6f80d33717c8dffcbd4e480b95f82f9fe7478cb166beebddd5b062c9f96 3 OP_CHECKMULTISIG, a 2-of-3 multisig script). It is astronomically unlikely that someone also has a public key whose hash is that some value (and much less knows the private key). As a result, it is extremely unlikely that funds sent to the P2PKH address are spendable.


Transaction amount for bitcoin payment gateway I'm trying to add bitcoin payment for my ecommerce website. I have installed bitcoind on the server and i've set the notify wallet parameter in bitcoin.conf. the issue i have now is how to know that the client have sent the exact needed amount for products they bought.
Actually, the client can send a lower amount to my wallet and notify wallet will be generated. Please help to handle this issue.

If you insist on using bitcoind directly, you could always use the gettransaction rpc call to get transaction info on that transaction.
Hopefully you're using xpubs or at least a list of pre-imported addresses, and not using that bitcoind to manage your wallet/generate new addresses itself though. You shouldn't keep your private key on the live bitcoind node connected to your public ecommerce site.


Can we avoid third party trust for mobile / desktop wallets with respect to lightning network channels? Mobile and desktop wallets are nodes that are not connected 24/7 (when the application is closed, computer is powered off, etc...).

The fact that they are not connected 24/7 creates mainly one problem: if a fraudulent node closes a channel with you and sends an outdated CSV transaction, you won't see it and can't invalidate it in time if you don't launch your wallet periodicaly.

A solution to this problem is to send all your CSV transactions to a service (connected 24/7 to the blockchain) and trust him enough to broadcast theses transactions in case a fraudulent node decides to close one of your channels.

And you must really trust this service because if he is affiliated with the fraudulent node you either need to send him a higher fee than the value of the transaction or he will prefer to keep the fraudulent transaction.

The conclusion is that you can't trust such a service.

Is there an other solution to avoid having to trust a third party in such case?

One solution that have been found by the eclair android wallet is to forbid relaying or receiving payments (i.e. you can only send payments). That way an outdated transaction is always in defavor of the fraudulent node. This is obviously not satisfying if you want to have the full functionalities of the Lightning Network.

(disclaimer: I'm not an expert on Lightning)

I believe the design for Watchtowers (the services which watch for other parties trying to push an old state to the chain) is such that they're not actually given the channel close transaction.

Instead, they're giving half of the txid to watch for, and an encrypted version of the channel close, using the full txid of the watched transaction as key.

This means they are not actually able to dishonestly close your channel. They can only do so when an invalid state update is published.


How will the Ledger Half Custodian SegWit2x coin split work? This may be jumping the gun but does anyone know how the "half custodian" approach for splitting SegWit2x coins that's mentioned in this Ledger blog post will work?

The relevant text from the blog post is:

  The “half custodian” process will involve a new Ledger application created for the Nano S and Blue (it will not be available on Ledger Nano) and will be fully automated. We’ll make available tainted inputs to our users with a contract enforced by the new application that sends back those tainted inputs to us — this is possible because our secure applications distribution architecture allows to securely share a set of keys with our users without revealing it. In other words, our splitting app will take care of everything automatically and with the highest levels of security.

What's a tainted input and a contract enforcing application?

Relevant info in this answer: https://bitcoin.stackexchange.com/a/62134/51948

A tainted input is referring to an input which is only valid on one chain, not both. Such an input can be created by mixing some coins which were mined after the fork in, making the transaction and all its children invalid on the other fork, and thus allowing those transactions to be further used for splitting other coins too.

It sounds like the "contract enforced by the new application" just means that the ledger application will only sign transactions which send their inputs back to themselves, it isn't just going to let you spend their inputs as well and give you free coins.


What is an uninitialized read? Can you point out some examples found in Bitcoin Core? How do you detect them? What is an uninitialized read? Can you point out some examples found in Bitcoin Core? How do you detect them?

An uninitialized read is when a variable is created without an initial value and then the value of this variable is read. This should be avoided as the resulting behavior is unpredictable and could be different each time the program is run. According to cppreference.com:

Normally uninitialized variables are a bad idea, and the only place where they are useful is when you are about to read the variable in from some input stream.

There are various tools for detecting uninitialized reads, some of which were covered in this Bitcoin Core PR review club session in December 2019.
These include dynamic analysis tools such as MemorySanitizer (MSan), Valgrind (specifically Memcheck) and static analysis tools that examine the code without running it.
Uninitialized reads can also be found through unit, functional or fuzz tests, by compiling with the -Werror=uninitialized flag or compiling with Clang with the -ftrivial-auto-var-init=pattern flag which will pre-initialize variables with dummy values.
History of detected uninitialized reads in Bitcoin Core
The most recently detected uninitialized read at the time of writing (October 2020) was found by Marco Falke in the recently merged Signet code. He found it through visual review and it was caught before it made it into a major Bitcoin Core release.
As practicalswift highlights, there have been a number of examples of uninitialized reads found in recent years but with more widespread usage of sophisticated tools these are likely to be found with decreasing frequency.
2020: Use of uninitialized memory in Erlay networking code - found pre-merge
2020: Use of uninitialized memory in BIP324 encrypted p2p transport de-/serializer code (truth in advertising: I haven't verified this one by writing a PoC) - found pre-merge
2020: util: Avoid potential uninitialized read in FormatISO8601DateTime(int64_t) by checking gmtime_s/gmtime_r return
2019: Use of uninitialized memory in networking code when receiving a transaction we already have - found post-merge
2019: wallet: Uninitialized read in bumpfee(…)
2018: wallet: Fix non-determinism in ParseHDKeypath(...). Avoid using an uninitialized variable in path calculation.
2018: wallet: Fix use of uninitialized value bnb_used in CWallet::CreateTransaction(...)
2017: [net] Fix use of uninitialized value in getnetworkinfo(const JSONRPCRequest&)
2017: [test] Avoid reading a potentially uninitialized variable in tx_invalid-test (transaction_tests.cpp)


How create coinbase transaction with createrawtransaction? I would like to generate a transaction with createrawtransaction such that it can be passed to submitblock along with the block header.
I tried to use:
[{"txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":0}]{"bc1qd8hza5w3mz7t3tudtlplm9xht4sjwg0e3t9gy2":6.25000000}

but it's not outputting a coinbase transaction:
020000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0140be40250000000016001469ee2ed1d1d8bcb8af8d5fc3fd94d75d612721f900000000

It is not possible to create a coinbase transaction using createrawtransaction. There are numerous rules that coinbase transactions must follow that the createrawtransaction RPC does not have the ability to set the fields to meet those rules. For example, BIP 34 requires the coinbase contain the block's height in the scriptSig. However createrawtransaction does not allow you to set the anything in the scriptSig.
Miners must use software that can independently create the coinbase transaction. Miners actually prefer doing this because they want to be able to modify the coinbase to use as an extra nonce so that when they run out of nonces, they don't necessarily have to re-select the transactions to include in the block. Instead they can change the coinbase to cause the merkle root to change.


Is it more dangerous when 51% attack happens than just having a pool with >50% hashrate? Many people told me that, if a mining pool performs a 51% attack, the price of the coin will drop.

But I disagree.

There are pools with >50% hash power already for a long time. Flypool is an example. (On the ZCASH network)

If one day these pools start to mine only on their own blocks, but not double spending or refusing any transactions, they performed a 51% attack. However, I think the security risks didn't become higher.

Yes, they can revert a transaction at any time so it is a security risk, but they already have had this ability for months!

For these two situations:

there is a pool with >50% hashrate
this pool mines only on their own blocks

I think the second is not more dangerous than the first one.

So my question is, is it becoming more dangerous when a pool with >50% hashrate starts to mine only on their own blocks? Will the coin price drop and why? Why didn't pools like Flypool mine only on their own blocks?

One can't say what's more or less dangerous for a cryptocurrency value. You don't have a control group. You would need a parallel universe where Flypool had no more than 51% to compare prices there to prices in our universe.

Saying that, being decentralized it's the very point of a cryptocurrency, and very few people will invest in one of them that's actually centralized. I can only speculate what's in their minds, but maybe people invest in ZCash today hoping it will become less centralized in the future. Flypool, despite having more than 50% hashpower, like you said, probably don't mine only on their own blocks because they would make people sure the thing it's centralized. Or maybe because they sincerely want the security of ZCash against a double-spend, so the accept the smaller pools help. Both things must probably increase an overall reputation of the ZCash in people's mind and must probably keep the price a little high.


My local client not showing correct output for listunspent I tried using the listunspent command as follows:

bitcoin-cli listunspent 10 9999999 "[\"32jdC23ABv86M2ptiqMzFzCaufBtE2NCdN\"]"

and it shows a blank output ([]), however, when I look up the same address on Blockchaininfo.com it shows the correct outputs. What could be the problem?

The only issue I can think of is that my node is still catching up, but it is 95% done, so the data should be there.

Apparently this command only works for addresses in my wallet, and moreover, there is apparently no way for the reference client to do this query for addresses not in the wallet (doh :-/)


What stops a wallet from stealing bitcoins? I'm not particularly knowledgeable on the topic of cryptocurrencies so it's possible that I've missed something obvious, but I still wonder what it is that stops a wallet from stealing from you. Wallets contain your private keys and they obviously have to use them to be able to send coin. So what stops a given wallet from stealing bitcoin from a user in the background without the user's knowledge?

What stops malware from being malicious?
Nothing
What can you do to ensure that the wallet you are using is a secure way to access your bitcoin?
Use an open source bitcoin wallet, download from the original source and verify authenticity before use. If you understand code, review and build it yourself.
Obviously, if a person creates a wallet to steal bitcoin from users, they would not share its source code to be reviewed by everyone. Although, even that is possible and I have seen a few altcoin smart contracts that were created to steal user funds. Since not everyone is able to understand code and review it, in that case a few people ended up being victims before word got around.


Is there a good exchange where I can withdraw to PayPal? Is there a good and trustworthy bitcoin exchange where I can trade my bitcoins for CAD and then send the money in my PayPal account instead of a bank transfer? Thank you

Short answer: No.

Long answer: PayPal does not allow Bitcoin exchange accounts. Bitcoin exchanges pop up like mushrooms these days so a new one might fly under PayPal's radar and get an account going for a while. But it will eventually get shut down.

So trustworthy exchanges won't try to use PayPal, as they know their accounts will be seized. And you shouldn't trust those that are using PayPal because they're operating with high risk. Knowing the high risk.

PayPal's CEO talked about Bitcoin as a funding option on PayPal in an interview during the last couple of months.

Until that happens the answers above are unlikely to change.


How do you sign data with a private key? [javascript] Using BlockCypher’s signing tool (link), I can sign the following data:

05de69f5d37f41340eed3230f03d2394dde5e497738a76f027b7d962a0cbdf39

with the private key:

2fd7cab0970c692b4151d77a6aeebcae2a3284556cbfc6f182c571eccfc2424f

to get the result:

30440220352f6d47bc33e2596600c6a297a0e3e84079a9b2f16d10cb9396993370365976022062a30c63adfeef315bcfc690e254dd3b6d4f14fe9919317e14ebb15c29325326

However, I'm am not able to replicate this using javascript using the bitcoinjs-lib module. My attempt is shown below:

var bitcoin = require('bitcoinjs-lib')
var wif = require('wif')

var dataToSign = '05de69f5d37f41340eed3230f03d2394dde5e497738a76f027b7d962a0cbdf39'

var wifObj = wif.decode('KxpiD4T1QHFahGVyg9onfLXjbwBSf5Dyh3BPYY899uXQHn6gfnbz')
var keys = bitcoin.ECPair.fromPrivateKey(wifObj.privateKey)

var signed = keys.sign(Buffer.from(dataToSign, 'hex'))
var signedHex = signed.toString('hex')

You could try using eccrypto

index.js:

var crypto = require("crypto");
var eccrypto = require("eccrypto");

// A new random 32-byte private key.
var privateKey = Buffer.from('2fd7cab0970c692b4151d77a6aeebcae2a3284556cbfc6f182c571eccfc2424f', 'hex')
// Corresponding uncompressed (65-byte) public key.
var publicKey = eccrypto.getPublic(privateKey);

var buf = Buffer.from('05de69f5d37f41340eed3230f03d2394dde5e497738a76f027b7d962a0cbdf39', 'hex')
// Always hash you message to sign!
var msg = crypto.createHash("sha256").update(buf).digest();

eccrypto.sign(privateKey, buf).then(function(sig) {
  console.log("Signature in DER format (hex):", sig.toString('hex'))
  eccrypto.verify(publicKey, buf, sig).then(function() {
    console.log("Signature is OK");
  }).catch(function() {
    console.log("Signature is BAD");
  });
});

console output:

$ node index.js
Signature in DER format (hex): 30440220352f6d47bc33e2596600c6a297a0e3e84079a9b2f16d10cb9396993370365976022062a30c63adfeef315bcfc690e254dd3b6d4f14fe9919317e14ebb15c29325326
Signature is OK

full disclosure: I'm a maintainer of eccrypto


correct settings for cgminer 4.9.2 I have recently switched my mining from 4.6.1 to 4.9.2 with the same Antminer U3. Still wondering about correct settings for this new one. On 4.6.1 I have used --bsmc-options and other settings as --bsmc. On 4.9.2 syntax is different from it - it's --au3. But 4.9.2 do not understand commans --au3-options: 115200-0,65 and some others where bsmc became au3. WHat I do wrong? My stats drops down to the half of it was on 4.6.1, show very little number HW errors and stales/dups. Could someone give me the tips of correct .bat and .conf for 4.9.2/U3 os XP?

bmsc only works with the BITMAIN cgminer...

I have fully tested and configured cgminer 4.9.2, the latest to work with the U3, check out my videos on vimeo and dailymotion, do a search for cgminer and antminer u3, full instructions are included.

I have bfgminer working with the U3 as well....


Is it possible to interact with the blockchain through bitcoin-core without a wallet? Im running a full node and am developing an application that interacts with it. One of its features is users should be able to create a pair of Bitcoin PrivKey and PubKey. But for security reasons, I dont want to save them. Not on my wallet.dat, not on database. I want to create the keys programmatically and serve them for the user to manage them.

I don't see a way of doing this through bitcoin-core. How could I accomplish this? Is there a library I could use? Should I create my own methods? Can you think of a workaround?

I don't see a way of doing this through bitcoin-core. How could I accomplish this? Is there a library I could use? Should I create my own methods? Can you think of a workaround?

You can disable the wallet by passing --disable-wallet at compile time. I don't think that's what you're asking, though.

I'm guessing you want to be able to query the balance of an address, where the address unknown at the time of synchronization. Bitcoin Core can't do this efficiently, because it doesn't index transactions by address unless the address is in the wallet.

There are patches to Bitcoin Core that create an address index, but none are officially supported.

https://github.com/satoshilabs/bitcoin
https://github.com/btcdrak/bitcoin

You could also try one of these non Bitcoin Core solutions.

(Another approach would be to import the public key as watch-only, which would let you do this with Bitcoin Core. I don't know if that satisfies your security requirements, though.)


Is there a way to remove or edit Blockchain.info public notes? I want to use blockchain.info's public note feature to build an app, but I was wondering can you delete or edit an existing public note you made?

You should ask this question to blockchain.info support. Nobody here can predict the near and far future. Nobody here is responsible for third-party service like blockchain.info


2 unconfirmed transactions after 24hrs Hey guys been looking through the forums and I'm still not quite sure how to speed things up or fix it. (Not very good with this kind of stuff)

Here's my wallet address - 1GZK3NYHCAScGRb4awAkXGVXszstwCVEEh

Both transactions say they have been seen by 50+ peers

I used the standard multi bit classic fee 0.0001
Which has never slowed me down in the past.

Any advice or help would be awesome

I'm happy to just get them back and send again with a higher fee.

Cheers

Edit: I'm using multibit classic. I have done a block chain reset. One of the transactions says it's in my balalnce (not spendable) and the other seems to have stayed the same (being sent to the same address) but has only had the peers reset. I've looked on blockchain info etc just not really understanding what I'm looking at. I assume the problem was the low fee, which I've now changed in my settings. Just not sure how to get it all back and start again.

Sorry I'm a bit of a noob

Do you own the wallet in your computer or is it in the clouds (p.ex., Blockchain)? If so, what is the version, model (Blockchain.info, Bitcoin.org core 0.140.)?
.
For now, export your wallet and encrypt it!
Also, check these steps: https://bitcoin.stackexchange.com/a/41972/47329

Why is it taking so long for my transaction to confirm?
If you have sent a transaction
without (or with an exceptionally small) transaction fee
expect it to be ignored for an unknown amount of time until a miner decides >to process it and solves the block; this could be several days to several weeks, possibly never. Your wallet and any Bitcoin node will show it as unconfirmed, your transaction is stuck in limbo.
Block sizes are limited, which means that only a limited number of transactions can be processed in a certain timeframe. In the beginning of bitcoin, there was lots of free space in each block because there were not many transactions. However, now that Bitcoin is quite popular there are more transactions than can be processed into the current block. This is why transaction fees have increased, and as long as someone is still willing to pay more they will keep increasing.
What can I do to speed-up the transaction’s confirmation?
Nothing. The next best thing is to cancel and resend the transaction.

Make a note of the individual bitcoin address(es) that the unconfirmed transaction was sent from.
Run Bitcoin Core with the -zapwallettxes option (or wait a few days until your wallet stops broadcasting the transaction and it falls out of the global transaction mempool)
Send all your bitcoins from the addresses recorded in step 1 to a new address with the recommended or higher than recommended fee.
Make original transaction again using the recommended fee


Problem with bitcoin-cli -datadir flag I moved my blockchain directory, including bitcoin.conf, to an external drive D:\Bitcoin. Bitcoin Core starts and runs normally using this path, however when I try to use the command line interface, even when I specify the new directory, I keep running into this error.
C:\Program Files\Bitcoin\daemon>bitcoin-cli -datadir=D:\Bitcoin -getinfo

   error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is  not set. See -rpcpassword and -stdinrpcpass.

I know that the issue is that bitcoin-cli is still looking in the default directory C:\Users\<username>\AppData\Roaming\Bitcoin because when I copy the auth .cookie and bitcoin.conf files to to old directory my commands work.
Wondering if the -datadir flag is not working properly, if I made an error somewhere, or if there is another way to fix this? I have also tried using the -conf=D:\Bitcoin\bitcoin.conf flag, however that does not fix either.
Windows 10

As Andrew Chow suggested, the solution was simply putting quotes around the directory path. Windows SMH. Thank you.


gui miner wont mine on slushes pool I want to ask a question that why isn't GUI miner working this is what is said

in the bottom right corner it says connecting... but nothing happens
I am very new and don't know about mining so much and this is the first time I am trying
help me I am on windows 8

Read the manual for gui-miner and make sure have the connection parameters configured correctly. Mining is super competitive these days so unless you have a high-end computer which can output high hash-rates you will very likely wait a long time for coins. In the meantime you are burning electricity which you or someone else need to pay for.


Don't miners control who is allowed to make transactions? Simple question really, considering theres a very small group of miners controlling the chain ATM.
Whats to stop them from being forced by the goverment to disallow certain transactions or just mining empty blocks to jack up the transaction price?
Or even worse, whats to stop a country like china from just investing massive ammounts of money into unbeatable mining pools and destroying every appearing coin that way?
Don't miners have way to much power in the current system? Especially since crypto is supposed to be decentralized

The stakeholders of bitcoin don't want miners to do that. If miners do that, the stakeholders (the people who are paying for the miners to mine) would change the rules. For example, they'd change the mining algorithm. That would turn the miners expensive ASICs into space heaters (a little faster).

  Don't miners have way to much power in the current system? Especially since crypto is supposed to be decentralized

The miners only have power because the people paying for their mining hardware and electricity like the job they're doing. If they don't provide the censorship resistance and forward progress without double spends that the stakeholders want, the rules will change.

Miners know this and such a scenario would cost them a huge amount of money, so they are strongly incentivized not to let it happen.


Is there a uniform measure of "difficulty", that when multiplied by price, will give "profitability of one hour of mining"? I recently open Bitcoin Pie, a site that compares crypto-currencies.

Given the exchange rate in BTC, I would like to add another column that tells "relative mining profitability", regardless of the hardware used.

So, if at a given moment, BTC mines at difficulty X, NMC at Y, and FooCoin at Z, with the conversion rates to BTC being 1, N_BTC, and F_BTC respectively, just comparing X, Y*N_BTC, and Z*F_BTC should give an indication of which one a rational miner should mine.

What is a good number to use in the difficulty column? Where are the APIs for it? Is it just plain "difficulty", or is it some other number?

I'm not sure how to take merged Namecoin mining into account here. Any ideas?

CPU and GPU coins should not be measured on the same scale.

The standard formula to determine the average profit per day for a given MH/s miner on a given blockchain is as follows:

(S/(D*4295))*60*60*24*R*P

Where S is the speed in MH/s rating of the miner, D is the difficulty rating, R is the reward (50 BTC/block for Bitcoin) and P is the price in USD of a single coin.

That I know of there is no standard profitability measure but it would be easy enough to create one given standard values of S. If for example we define the standard as S=100 MH/s then we could easily compare the profitability of mining various blockchains in the resultant USD calculation.


Questions about bitcoin(or other crytocurrency) to satisfy my feeble mind After a few days of research and reading about bitcoin and ethereum, I got interested on investing in these. Just small amounts to try it out.. maybe $30 - $50 for starters. I'm from a 3rd World Country and want to earn some sort of passive income.

Still after all these research. I still got a lot questions about it.
These ones are one of the most important to me.

Is it worth it to invest in a BitCoin/Ethereum Cloud Mining contract? Lets say i'd purchase a starter plan. because mining rigs are so expensive and I cant run it 24/7.
What are some of the potential risks of trading in Exchanges?
Can I start trading with $30 to $50 staring budget? can I get somewhere with this budget?

Cloud mining is generally only profitable for the Operator (otherwise they would mine themselves instead of selling their hash power).
Your account or the exchange getting hacked, or the exchange deciding to suddenly close (perhaps also claiming to be hacked) and taking your funds. If you buy coins on the exchange always use 2FA and take the coins off of the exchange (send to your own cold wallet) as soon as possible.
You can start with as little as you wish. Focus on learning at first. Large, quick profits are very unlikely for a beginner with limited funds. Most "traders" lose money because they are less informed than coin developers/promoters. Focus on code you can see in GitHub, not what developers are promising to deliver in the future.


Sweeping funds from addresses generated by Extended Private Key (BIP39) I have a site that is trying to process micropayments. It uses a mnemonic / extended private key generated here to generate a new Bitcoin address for every payment.

Everything works fine except I'm realizing now that it will be expensive to recover funds from the generated addresses because it will cost a ~10,000 satoshi mining fee per address.

This is a small fee but it is too high considering the totals being extracted are only 20,000 to 30,000 satoshi.

Are there any options to solve this problem? I know Bitcoin has this concept of "sweeping" funds. Does that still involve incurring a flat fee for every address generated by the master private key?

A few other options I've been considering:

BlockCypher had a microtransactions API which seems to be shut down now
Some node APIs including BlockCypher offer payment forwarding though I don't understand the fees involved or how it works internally
Payment channels / Lightning Network

I know Bitcoin has this concept of "sweeping" funds. Does that still involve incurring a flat fee for every address generated by the master private key?

No, sweeping an address involves inputting a private key into some wallet software, and then having the wallet software initiate a tx to empty that address’ funds entirely into a new address that the wallet controls the private keys for.

While a BIP39 xpriv key can be used to derive many child keypairs, the xpriv cannot itself be used to spend the UTXOs of those child addresses. You need the private key of each address in order to spend it’s funds. The network has no way of knowing how a key pair was derived, so only the private key of each individual address can spend its funds.

For best efficiency, you’ll want to batch all of the UTXOs into a single transaction with a single output (or maybe more than one, depending on how you want to divide and store the funds).

A single tx with a lot of inputs will have a higher fee than any single tx, but it will be lower than the total fees paid if you send each one individually.

I’m not familiar with blockcypher, but in general if a tx is sent on the network, and then you’d like to spend those funds again, a network fee will be incurred. So I’m not sure their service will save you money in the way you’re looking for.

Lightning network is a potential solution for payment processing with lower fees, but the network is still young so it will take a little time for adoption to happen.


How to protect against wallet theft? Let's say I run a Bitcoin client on a computer (Windows, but the question can apply to other O.S.es too), and I want to make sure nobody steals it. I'm especially concerned about situations where someone gets full access to the computer:

The computer is in a company network where domain admins can do anything they want to it.
The computer is a laptop and gets stolen.
The computer has a problem and I need to bring it to a computer shop (or call in a technician) to fix it.
A trojan gets on the computer and instead of popping up random ads starts doing something much more useful and stealthy like looking for Bitcoin wallets to steal (somebody is going to create one of these sooner or later).

I'm assuming here that whoever gets access to the computer has full access to everything, even as my own user account, in the case of a technician or a trojan; no built-in O.S. security is to be trusted.

How can I be absolutely sure that nobody simply copies my wallet files, loads them somewhere else and steals all my Bitcoins?

Physical access:

Minimise your risk by using a deterministic wallet with Armory, and enabling extreme encryption and key stretching. The program will let you configure your wallets settings, and you can make it sting to the point of being completely ridiculous, seconds to open is enough to stop any attack on the password.

Malware

There is no protection against malware on a computer with a wallet. These exist already as pre-made tools, so it's hardly a stretch to think you might be infected.

Use a hardware wallet like the Bitcoin Trezor or a split-wallet with an offline portion with Armory.

In a split-wallet a computer is kept air-gapped and stores the private keys, and a separate one is used to manage the wallet. Transactions are ferried by USB drive between the machines, so the offline wallet is never at risk of compromise. This is the best option for storing large amounts of funds safely.


Can I create a public address for Bitcoin without the private address appearing on the screen? Is there JavaScript which will do this?

I would generate a 256 bit password using 99 dice throws, enter it into JavaScript on an offline computer (like using bitaddress.org) and get an address to send Bitcoin to, so that I can store them cold.

What I don’t want, as would be done in bitaddress.org, is for my private key to be shown on the screen in case there is screenshot malware on the computer. (N.B. I can defeat key-logging by scrambling the entry of the dice throws using a mouse).

When I wish to transfer the Bitcoin to, say, a Blockchain account, I can go to an offline computer, generate the private key from the password using bitaddress.org and then on another computer which is online carry out the transfer.

The procedure seems pretty safe to me.

If you're afraid of screen grabbing you should also be afraid of memory grabbing malware.

If however you make sure that such malware can never communicate anything to the outside world then you don't have to worry about either of those types of malware.

You can do that by booting from a write protected media (CD) and making sure there is no other writable media ( harddisk) connected. Also of course make sure the machine is offline (no network cable or WiFi etc).

After generating the private key write it down (error sensitive!) or print it (not on the big printer in the office, those often have harddisks in them). And after that turn off the computer to erase the memory.

Even in this setup you still don't want malware on the PC because it could influence the creation of the private key by making it predictable.


How to run a bitcoin server with automatic restart and backup? What would be the best way to start writing a script to automatically run a bitcoind server on an Ubuntu startup, make regular backups and restart from a backup on error. Would this normally be done through a cron job?

Upstart is the preferred method, have it launch your mining program on boot and respawn the program if it dies.

Checking if it's working is another matter, it requires a more meta approach.  I would suggest you start another script that queries bitcoind via the command line, parses the response, and kills the process if it's not mining.  Upstart will see that the process is gone and spawn a new one.

If you run into problems (overclocked GPU's are mighty unstable!) you might even want to log the number of times you have killed it and reboot the server after X kills in Y minutes.


the client's 'invalidateblock' debugging command - possible prevention against majority attack? there is a 'invalidateblock' debugging command in the btc client. How can this command be used in a situation of majority attack threat and play a part of countering the attack?

I understand that this command lets nodes 'ignore' blocks generated by the attacking miners. But is that it? What happens with the blockchain, how can it continue to live on without the majority attackers?

If there’s a case of a majority hashrate, human intervention of a single instance can not prevent something that continuous and ongoing. The amount of coordination required to keep the network in consensus would be impossible to obtain if this were a solution.

If Bitcoin fails, it’s time to move on rather than patching it up.


Is performing a 51% attack / double spend on Bitcoin illegal? Suppose I had an ultra large ASIC from the future, and could perform a double spend on the core Bitcoin network. At this point in Bitcoin's development, it is no longer a game - there's real money involved.

Would performing a successful double spend be considered illegal (e.g. in the U.S / Europe)?

A double-spend would be blackletter law illegal, guys.  Fraud and theft include a wide variety of intentional deception wrongfully depriving someone of property - use of a government-minted currency is not, and never was, a required element.  Look at any larceny or fraud statute - it will refer to loss of or damage to person and property not "dollars."

Schwarz - when you double-spend, you are representing to the seller as an existing fact that you are passing a valid bitcoin, which is a misrepresentation.  Your representations as to fact are readily, and usually, implied from conduct in fraud and "larceny by trick." You don't have to literally state them in words.  this goes for more than bitcoin.  If you were considering stealing puppies to return them for a reward, it's a legal problem for the same reason.  But do I really have to tell you this?

Of course, these are just general legal notes, and not legal advice.  Before you consider undertaking any questionable business activity, consult an attorney.


In a multi-sig transaction, if one party refuses to sign, what happens to coins? In a multi-sig transaction, if one party refuses to sign, what happens to coins?  Are the coins forever lost, or is the transaction voided as if it never was attempted?

Only valid transactions transfer control of balances. Since the transaction was never completed, the balances remain under control of the original owners.


Are there any online services available to exchange prepaid cards into BTC? I live in the USA.
I would like to use prepaid cards to buy some BTC (less than $100USD)
I've tried trucoin.com and the wait time is enormous, 4 days since sign up and still haven't received an invite.

I've also tried circle.com but they do not currently accept prepaid options.

What other options does a prepaid card user have?

You can buy a Target or Walmart gift card and trade it for Bitcoin in https://cardforcoin.com/


Why does Bisq claim that my "native segwit" receive addresses are "invalid"? Every time I'm transferring over the funds from Bisq to Bitcoin Core, I get the error:

  Invalid address.

(Or something along those lines.)

Only after generating another receive address in Bitcoin Core, unchecking the "Generate native segwit (Bech32) address" checkbox, does it work.

Why does Bisq consider "native segwit (Bech32) addresses" (the default in Bitcoin Core) to be "invalid"? Is this some kind of internal war in the Bitcoin community where they refuse to even acknowledge the existence of this other "format"?

Every time it happens, I almost get a heart attack until I realize I forgot to uncheck that checkbox...

Many clients have not been updated to recognize native segwit addresses, and are unable to deal with the bech32.

There should be no real downside to sending to a non-native-segwit address, besides some minor fee increase when you spend the coins.


any way to recover lost qt bitcoin wallet? Hi is there any way to recover my Bitcoin-Qt wallet with only an address and the wallet password? Unfortunately my disk was formatted.

Hi is there any way to recover my Bitcoin-Qt wallet with only an address and the wallet password?

No. I can't think of a secure way for the Bitcoin developers to add recovery method like that, either.

  Unfortunately my disk was formatted.

Do you mean that the space containing your wallet was overwritten, or that the space at the front of the disk that tells your computer how to read the disk was changed?

If it's the second one, your Bitcoins might be recoverable.


While attempting to fetch a particular block my node just gets disconnected by peers? A system at an office has its testnet node stuck at a particular block.

The logs report "requesting block" over and over again for the same block and after each one reports "socket recv error" and that peer disconnects. Then it connects a new peer and the same thing happens. There are no log entries about INVALID blocks.

As a result the system hasn't had a new block in two days, but all the explorers report that the chain has continued to move advance.

The current block this node is on is a member of the best chain reported by the explorers, but thousands behind.

This node is running on Ubuntu in the US. The office network has a sonicwall firewall.

Usually when a node is stuck it is due to local corruption causing the node to incorrectly believe a block is invalid. But in those cases the logs will reflect the invalid blocks. Instead we don't see any invalidity here but the node is continually trying to get the block and getting disconnected.

This situation can be caused by overly aggressive anti-virus which is falsely detecting data in a block as malicious and cutting the connection.  Sometimes this kind of filtering is applied to the general public by nation-state level  filtering but it also shows up on office networks and in some home setups (e.g. in windows AV software).

For sonicwall you can see the disconnections in the firewalls logs and disable the filtering entirely by going into the firewall settings under sonicwall->manage->security services->gateway-antivirus and unchecking "Enable Gateway Anti-Virus", or by whitelisting the false positive match for the particular host in question.

(Thanks to Ken on IRC who had this actual issue, and for telling me how he disabled it on the sonicwall)


Is my Bitcoin address valid for mining? I am looking at the specific block at height 680175.
When comparing the address which received the block reward
# bitcoin-cli validateaddress 1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY
{
  "isvalid": true,
  "address": "1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY",
  "scriptPubKey": "76a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac",
  "isscript": false,
  "iswitness": false
}

to my newly generated address
# bitcoin-cli validateaddress bc1q403w7zrj74azzunk89srt2m3vuajatlmskcktm
{
  "isvalid": true,
  "address": "bc1q403w7zrj74azzunk89srt2m3vuajatlmskcktm",
  "scriptPubKey": "0014abe2ef0872f57a217276396035ab71673b2eaffb",
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "abe2ef0872f57a217276396035ab71673b2eaffb"
}

there are some differences in the scriptPubKey and the witness program. Are these differences relevant for mining?
The inferred PubKey hash of the miner address is c825a1ecf2a6830c4401620c3a16f1995057c2ab. Would my PubKey hash be abe2ef0872f57a217276396035ab71673b2eaffb?

When a miner finds a valid block, the coinbase transaction they included in their block pays out the mining reward to their own address. Mining rewards can be sent to any type of output. The only special restriction on coinbase transaction outputs is that they can only be spent after a maturation period of 100 confirmations.
You are looking at two different address types:

bc1q403w7zrj74azzunk89srt2m3vuajatlmskcktm is a Pay to Witness Public Key Hash (P2WPKH) address
1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY is a Pay to Public Key Hash
(P2PKH) address.

P2WPKH addresses are the more block weight efficient successor of P2PKH addresses. Spending funds received to P2WPKH addresses takes less than half the blockweight as spending funds received to P2PKH addresses.

The inferred PubKey hash of the miner address is c825a1ecf2a6830c4401620c3a16f1995057c2ab. Would my PubKey hash be abe2ef0872f57a217276396035ab71673b2eaffb?

Yes, that's correct.


Compress transaction hex string I realized transaction hex can be very long and you need it for broadcasting a tx using blockstream.info API:
https://blockstream.info/testnet/api/tx

https://github.com/Blockstream/esplora/blob/master/API.md
If the user wants to send this hex using text message which allows 160 characters in one message, what should be the best way to solve this problem? I tried researching about way to compress it, send to a number which forwards to the web server running a PHP code, the hex string is decompressed and sent to blockstream.info for broadcasting tx. Base64 encoding after gzcompress() couldn't reduce the number of characters to less than 160.
Example:
Hex:02000000000101e939fb23e9991ebbc75fd08c736da32ca12d98a4ff1b8e970e97f5661927ee410100000000fdffffff02b0a90a000000000016001421e2f997b3bd36e273eaca365da8515a389444ae40420f0000000000160014829e2dbcf6b7f31bc93633971f71f6f6b9b5f89e0247304402200f8e3e573be749caf1964a85707bf540de2e7b367ae46c23bd4f21932ff82346022062dc3007072cd5a19b45e479525f4829bc48be4fd3c21b5a9ae34bcf9a3a3ccf0121020f88c7db36cbb492e80d3062fc19db55bed82687498f8cfe6d0cf47adf6687aa49f31b00
Compressed and Base64 encoded:
eNpdkNmJBEAIRFPyarsNxzP/ENZZGBZW9Eew6pVA8C0EbGObIG4zw47Ie6bg5WUtZ0pHKnsuMxiv7cLOHFU0ut2yCl+xqfktoAA3cPiz0R0hbBqzGxzF2nS5PZ31lL+Dx/mZiHgLCMH8v35kTRU5GncYI42V2S7Otu7W4syzBpLLIAK0Mec197kcfcXSB01lzS7cmCNQTb04etdUk5ZLhtCYZh6x6EdDqZIB9oSyjqOFnJZrh858oCLlRcsUJ2EcN2+WxTRn58wBJITN8/altV4ZIUb9oHi1J9EqzomuR/qW8s3LaS3Ikes1ult3sU9mgB8sW3Vy

Compressing a more-or-less random number is futile. Your best option is simply to use a more compact encoding. Base64 is better than Hex but there exists may other encodings that prform better
Wikipedia lists many and ranks them in order of efficiency
Encoding            Data type                    Efficiency
yEnc                Arbitrary, mostly non-text   ~98%
Ascii85             Arbitrary                     80%
Base85 (RFC 1924)   Arbitrary                     80%
Base64              Arbitrary                     75%
...

You can obviously do better if you use 8-bits (e.g. Unicode printable code points that have single byte encodings in UTF-8) but since SMS uses a 7-bit character set (so far as I know) you won't do much better


How is a NXT account address generated? Why do we need to send out a transaction in NXT to secure the address? I'm setting up an account and noticed:

The recipient account is an unknown account, meaning it has never had an incoming or outgoing transaction. To submit this request you must supply the recipient public key also.

Please correct me if this is right or not. So when setting up my first NXT address, it creates a public + private key on my local machine. Now the public key is used to generate my NXT address like this:

NXT-XXXX-XXXX-XXXX-XXXX

So does this mean my public key which is a 64 character like this: 18c6e5c1840d044243434dc352672c0b889e332249f240600149baaf978d8870

used to generate the shortened NXT address? (ex. NXT-XXXX-XXXX...)

Is this the reason why even if I gave my NXT address to someone, it wouldn't work since I never sent a transaction out with my public key which also broadcasts my NXT address to show it exists?

I'm still very confused in the fact of why I have to send out a transaction to secure my NXT address. In bitcoin we don't have to do that and I want to understand why this is the case. Was it meant to make it easier to type out? Why didn't NXT just stick with using just the public key as the address?

It seems like its a 2 step process as we have to first generate a public+private key then use those keys to generate a NXT address, and then broadcast this NXT address to the network to register it saying "this NXT address belongs to this public key". Right?

It is confusing, especially since the Whitepaper:Nxt is misleading when it states:

When an account is accessed by a secret passphrase for the very first time, it is not secured by a public key. When the first outgoing transaction from an account is made, the 256-bit public key derived from the passphrase is stored on the blockchain, and this secures the account.

It is not possible to send a transaction from a brand new account since it has a zero NXT balance and the minimum transaction fee is 1 NXT. Therefore, the only way to secure a new account is to fund it from some other account using the account ID together with the public key, which is then recorded in the blockchain.

The forms used for sending NXT, even on the major exchanges, now provide a field for the public key, in case it is the first transaction to a brand new account. Otherwise, the public key field can be left empty.

The reason why this one-time extra step is necessary is because the 8-byte account ID is much shorter than the 32-byte public key it is derived from. There are many secret passphrase/public key pairs that reduce to the same account ID. But once a particular public key is associated with an account ID by storing it in the blockchain, no other secret passphrase that generates a different public key can access that account.

The developers of NXT initially chose to use an 8-byte account ID, thinking that it is more convenient than a 25-byte bitcoin address. But the trade-off is that collisions are much more likely. It was later decided that the risk of a collision was too great, but by then it was too late to increase the account ID length without a major disruption. So, the above solution was devised, which preserves the convenience factor while solving the collision problem, all at the cost of a one-time but awkward additional step.

Unfortunately, this extra step raises the entry barrier for NXT, lowering its adoption rate.


How to work out my hardware's hashrate power Using my existing hardware, I want to work out which altcoin is still profitable to mine.

I have found this link:

http://dustcoin.com/mining

But don't know which values to enter into the boxes at the bottom of that page.

How do I work out the SHA-256 and scrypt hashrate
For the Power(W) box, do I enter in my computers PSU wattage? I think it's 650w
For the Power Cost ($/kWh) box, do I check my electricity bill to find out how much I am paying per kWh?

How do I work out the SHA-256 and scrypt hashrate

You can look up your hardware e.g. here (BTC) and here (LTC). But I think it's much easier and more accurate to just try mining different coins for couple hours and measure hashrate directly.

  For the Power(W) box, do I enter in my computers PSU wattage? I think it's 650w

PSU wattage is max. power it can supply, so it poses upper bound on PCs consumption.
To get accurate measurements, you can use something like Kill-a-Watt. Or you can look up TDP of individual components: CPU's, GPU's and ASIS's power consumption is usually listed in their specs, and motherboard+RAM+HDD together usually use around 50W.

  For the Power Cost ($/kWh) box, do I check my electricity bill to find out how much I am paying per kWh?

Yes.