Why does BIP44 use non-hardened paths at all? BIP44 uses hardening/private derivation on most levels:

m / purpose' / coin_type' / account' / change / address_index

but not on the change and address_index level. First of all, what does hardening achieve and secondly, what would be the disadvantage of always hardening other than having just half of 2³² paths at that level?

As far as I understood, non-hardened paths allow at the presence of just one simple private key, to learn the xpriv key of the address and if that is not hardened, also the next higher xpriv key all the way up to the first hardened path. Is that so and if yes, what advantage would it have, other than providing 2 billion addresses more in that account's external and change path assuming that the overflow into hardened address spaces were allowed?

A little code to see if/what I got right:

    var wallet = HDPrivateKey()
    var hardened = wallet.derive(4, true)
    var nonHardened = hardened.derive(4, false)

    console.log(hardened.publicKey.toAddress().toString())
    // the payee gets this anyway
    console.log(hardened.publicKey.toString())
    // once I spend from my address, I have to reveal this. It's probably secure to
    // re-use the address but better not to.
    console.log(hardened.privateKey.toString())
    // at this point, you can spend funds that are received to above address and
    // only that
    console.log(hardened.xpubkey)
    // you now know all my addresses I could derive from hardened. Do you know any
    // private keys except for the one I explicitly shared a line before?
    console.log(hardened.xprivkey)
    // now you can spend from all the addresses derivable from hardened but learn
    // nothing else about wallet.

    console.log(nonHardened.publicKey.toAddress().toString())
    console.log(nonHardened.publicKey.toString())
    console.log(nonHardened.privateKey.toString())
    console.log(nonHardened.xpubkey)
    // in difference to the hardened case, you would now learn about nonHardened but
    // also (once again) about hardened? What could you actually learn?
    console.log(nonHardened.xprivkey)
    // would this line leak any information that wasn't already leaked in the last
    // block?

The output:

    1c6dKRqvYPiCQx2R3u75pxGfy15g7jfU4
    0342619d3209b6859f4d88e3b1deaa1acee734c94d625b7d59b286b6842c90bd60
    4c461799315979063858208f6c3e8b33f29ceb10c42389690cd0a20427715845
    xpub68GCDysH8nE2Nuodq1ncV4jYiWvajzZyjVr6Pt8N46QAKC3CPxjj8G6AcE7sdvGypzXZFRRHYjRokhTty6LC8MErRifGiJFeTbTBYL9QfTg
    xprv9uGqpULPJQfjARjAizFc7vnpAV66LXr8NGvVbVikVksBSPi3rRRUaTmgkwDii6TFzWWFsch7Qc2v6eM1ZcJAJLv8ybvw7YY4qwLwvfFJoAp

    1NsxMLRhXasbHaskKVQK4qiJpBZgjTs3Aq
    026653baf78fb78cfb9845faa43080dfc452991422edc67f5ba085d02786364670
    afdb89aaf2f02987dfc47cc655fb4e1fb5cdd545af44875b4176805dc8f60852
    xpub69pTp8pV8Fcmkf3HuiWnzGE42MJcMrTtegoZaLApLUSvhugH6YNKgTtVfk2asMNZWKynCpFoCGePbHLfwJqsLtPskSv5cPF6j1FqmdaNCrE
    xprv9vq7QdHbHt4UYAxpogynd8HKUKU7xPk3HTsxmwmCn8uwq7M8Z1458fa1pVZCfWYWUWMG7p7b99NzJnSwZAnQR6EmN4awbcKZrfdrcmXAXqy

Why does BIP44 use non-hardened paths at all?

Imagine you have a website where you want to sell things. You need the website to be able to generate addresses, but you don't want it to be able to spend from them.

Well, you can give the website an account-level extended public key, and it can generate the non-hardened addresses you need from that. You wouldn't be able to create hardened addresses; you'd need the account private key to make new hardened addresses.

// you now know all my addresses I could derive from hardened. Do you know any
// private keys except for the one I explicitly shared a line before?

No. I know a private key, but I can't work out the parent key or any siblings.

// in difference to the hardened case, you would now learn about nonHardened but
// also (once again) about hardened? What could you actually learn?

Even though this key isn't hardened, I don't know the chain code of the parent key, so I can't compromise sibling keys or even associate that key with any of its siblings.

// would this line leak any information that wasn't already leaked in the last
// block?

Nope. However, if you also exposed

wallet.derive("m").xpubkey

then I'd have enough information to compromise your wallet.


ScriptSig content during signature (quadratic hashing) As far as I know, the quadratic hashing problem came from the fact that every time a transaction is verified (or signed), the "unsigned transaction" that is hashed and verified changes depending on the transaction input that is being analysed. Basically, the target input ScriptSig is set to the ScriptPubKey of the UTXO to be redeemed, while the other inputs are left empty.

However, what I can't see is what's the reason behind that. Why aren't all the ScriptSig fields assigned either to their UTXO ScriptPubkey field, or left empty? The way it was designed doesn't seems to provide any kind of benefit (at least I can't see it), while it makes you recalculate the double-sha256 every single time an input is analysed, leading to a quadratic hashing problem.

It's like that because that is how Satoshi wrote the code for it and it has never changed. It can't change without some sort of fork, and thus far, no fork has happened to change it (although segwit will once it activates).

However doing it this way allows for people to more easily do multi-party transactions like CoinJoins. They don't require you to know the scriptPubKey of everyone else's inputs, you just sign what you are able to sign. You don't know the scriptPubKey's and you don't care, all you need to know is the scriptPubKey for the input that you are signing. This makes it much easier to participate in multi-party transactions especially for those using lite wallets as they don't have the UTXO set.


Can't RPC to Bitcoind (C# / Windows) I am running a node on Windows Server 2016.
Everything seems to be running fine.

If I go to https://bitnodes.earn.com/ and put myip:8333, the node is successfully reachable.

My bitcoin.conf is:
    server=1
    txindex=1
    rpcuser=...
    rpcpassword=...

Locally, I can access it:

bitcoin-cli.exe -rpcuser=... -rpcpassword=... getinfo

returns:

{
  "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16",
  "version": 150001,
  "protocolversion": 70015,
  "walletversion": 139900,
  "balance": 0.00000000,
  "blocks": 0,
  "timeoffset": 0,
  "connections": 16,
  "proxy": "",
  "difficulty": 1,
  "testnet": false,
  "keypoololdest": 1506982194,
  "keypoolsize": 2000,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "errors": ""
}

However, any C# bitcoin lib I tried always returns the same web exception when trying to connect to bitcoind:

"The underlying connection was closed: The connection was closed unexpectedly."

and, also, I do not understand why some samples use port 8332, some 8333, etc. I don't have anything listening to 8332.

What could I be missing?

I do not understand why some samples use port 8332, some 8333, etc.

Port 8333 is the port that bitcoin uses to connect to other nodes on the network. Port 8332 is the default port for a bitcoin RPC interface. To connect with RPC, use port 8332 or specify a different port with rpcport=<port> option


How do we know which miner or pool mined a block? There are websites that talk about each mining pool's total % of hashrate.

I think they do that by calculating what % of the last X blocks were mined by a particular miner/pool.

But how can we know who mined a block?

Edit : this isn't a duplicate.

That other question mentions that: "People could try to trace where the mined bitcoins are first seen and where they go. And you could trace the first IPs known to report the blocks"

Sites produce very detailed stats covering mining pools with as little as 0.3% of the global hash rate. see this

There's probably some very reliable method for doing this and I'd like a detailed answer about it.

We know which miner/pool mined a block only if that miner/pool chose to identify themselves.  Most commonly, they do this by inserting their name or other recognizable signature in the block's coinbase transaction, which is allowed to contain arbitrary data.  Sites like blockchain.info can then record statistics about how many blocks were mined by which pools.

You'll see entries even for very small pools if they identify themselves.  For instance KanoPool is shown on that page as having 0.3% of all hash power in the past 48 hours.  This is because they mined 1 block out of the roughly 288 total blocks during that time, which is 0.3%.  KanoPool apparently identifies its blocks with the string KanoPool (=O.O=) in the coinbase (example).

Presumably someone at blockchain.info is maintaining a list of known pools and their identifiers.  But it may not be complete; for instance, block 552572 has in its coinbase the string BTPOOL, which is presumably the name of some pool.  Blockchain.info lists it as "unknown", probably because BTPOOL isn't in their list of known identifiers.  Maybe they'll add it later.

Other blocks don't contain any recognizable identifier at all.  For instance, the coinbase of block 552568 doesn't contain anything that looks to me like text, and Blockchain.info doesn't recognize it either.  We won't ever know who mined this block unless they choose to identify themselves someday.  (For instance, maybe the data in that coinbase is a nonce signed with some private key; then someone could prove that they mined the block by signing some other data with that same key.)


How to prevent lightening network spend two times the balance? If I choose off-blockchain transaction in Lightning network is it any mechanism to check wether balance covers mount of transaction? So is it, or isn't it possible spend two times the same amount of balance?

The lightning network consists of many payment channels between users on the network. Each channel has a certain amount of bitcoin locked up in it, and that amount is the maximum which can be transferred in the channel, you cannot add any more BTC. So it is not possible to spend double the balance, no.


How to build Bitcoin binaries for Windows on Ubuntu using cross-compile I am trying to build Bitcoin 0.13 for Windows. I've always used this guide for building previous versions. Now seems that developers have changed their mind regarding Windows, and the new way seems cross-compile from Ubuntu. I have followed step by step the new instructions, but I haven't been able to get it built. Seems that instructions are either not correct or not up to date. Here is what I've found so far:

zconf.h file not found, solved manually copying it from /usr/include/x86_64-linux-gnu to projectdir/depends/x86_64-w64-mingw32/include
[unsolved]warning: undefined symbols not allowed in x86_64-w64-mingw32 shared libraries; building static only while compiling secp256k1 lib
[unsolved] I tried to configure and make secp256k1 manually before running the "main" make for solving previous issue, but then I get this error: /usr/bin/x86_64-w64-mingw32-ld: attempted static link of dynamic object secp256k1/.libs/libsecp256k1.so

I stuck here, any help is appreciated. Also, I could also accept to build on Windows (like before) if necessary, as long as it works. Thanks.

By using the pull request and instructions at https://github.com/bitcoin/bitcoin/pull/11526 you can build Bitcoin Core, except the two Qt dependent projects, with Visual Studio (or msbuild tools) on Windows.


What is a mechanism of method how to get the data in the blockchain(e.g. bitcoin, ethereum)? There are websites which have APIs that allow you to trace transactions and lookup information like specific address balances, etc. I am wondering how these web service providers are able to provide the data from the blockchain.

I think that they are running a full node 24/7 so that the end user does not need to run tun their own node and can instead query for data via the service's node.

Blockchain explorers run multiple nodes which receive all blocks and transactions. They store these blocks and transactions in various databases which allows them to write software which query those databases whenever a user requests information about a block or transaction. They will also do additional processing of the blocks and transactions to produce information such as addresses and be able to provide all of the transactions for a particular address.

When you lookup anything on a block explorer's website, you are not actually sending a query to their node, that would be far too inefficient. By using external databases to store information, they can quickly lookup data in order to return it to the user.


What is needed to get listed on a currency exchange website? I have no desire to become a licensed MSB/Money Service Business.  That said, what considerations should I have when creating a new virtual currency to be listed on Coinbase, Bitstamp, etc?

First, you're going to have to prove that your altcoin is useful and has value and liquidity. You can't just create a new coin and expect people to value it. The most successful altcoins have something different about them or some feature that other coins don't have. In other words, you need to create some demand.

Second, once you have demand, then you need to give some assurance that your coin is secure. There was one coin that managed to insert malware into their base node client, got installed at an exchange and wiped them out of their holdings. Your code will most likely need to be open-sourced and audited.

Third, you would start at some of the lower tier exchanges that will take list altcoins relatively easily like Poloniex.

Fourth, if your coin gets popular enough there, then you can move to an exchange like Shapeshift.

Fifth, if your coin gets enough popularity, you can then move onto major exchanges like Coinbase.

Note though, that not many coins make even get to step 3. Steps 4 and 5 are even tougher. So far, the only coins to have made it to step 5 are Ethereum and possibly Litecoin.

Best of luck.


Why isn't transaction replacement supported? The wiki article on contracts talks about the best stuff you can do with delays and replacement. (Lock time and sequence numbers, respectively.) But according to the documentation, replacement isn't supported yet. Why not?

(If the answer is "it's not implemented yet", why hasn't it been?)

That's not correct. The nLockTime field is implemented. It was deliberately switched off some time ago in order to reduce the complexity of the protocol. The reason was a series of protocol-based attacks that had compromised the integrity of the system.

At some point the feature will be re-activated. Probably, after someone has written a comprehensive test suite and technical analysis showing that it's not risky to re-enable.


is it currently possible in the Bitcoin blockchain to send coins to an address only after two parties sign messages signaling the funds to be released Like the question states, is it currently possible in the Bitcoin blockchain to send coins to an address, but have the transaction written into a block or validated only after two parties sign messages into the blockchain that the funds should be released?

If it does exist, how does this technically work?

A comment describing or linking to something similar to this or on the off-chain level would be appreciated too.

It's a built-in blockchain feature called a multisig transaction.

https://en.bitcoin.it/wiki/BIP_0010


Does OP_HASH160 consume the top stack element? In a standard P2PKH configuration, the scripts look like:

Pubkey script: OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
Signature script: <sig> <pubkey>

When redeeming P2PKH outputs, OP_DUP is done because the pubkey is used twice, once in the hash and then verifying the hashes match, and then again in verifying the signature. So, here it seems like OP_HASH160 is consuming the top stack element and replacing it with the HASH160() of what was there.

In P2SH transactions, the scripts look like:

Pubkey script: OP_HASH160 <Hash160(redeemScript)> OP_EQUAL
Signature script: <sig> [sig] [sig...] <redeemScript>

When redeeming P2SH outputs, there is no OP_DUP. Won't this mean that the redeemScript will be consumed by the OP_HASH160? How can the redeemScript be executed if it was consumed by the OP_HASH160? I think I am missing something here.

Yes, OP_HASH160 consumes the top stack element and replaces it with its hash.

  So how does P2SH work, if the script is consumed after HASH160 runs?

Here's how P2SH transactions are processed:

Execute the input script (from this transaction)
This is the transaction that only contains push-data-onto-stack commands.
AKA scriptSig
Execute the output script (from the previous transaction)
AKA scriptPubKey
Does the output script error out? If so, this transaction's invalid.
Does the output script end with a truthy value at the top of the stack? If not, this transaction's invalid.
Does this output script :

Start with OP_HASH160,
have 20 bytes of data,
and end with OP_EQUAL?

If so, this is P2SH. (source)
If P2SH, erase the stack and run the input script again.
If P2SH, pop the top element of the stack off, and run it as a script. (source)
If that script errors out, then this transactions is invalid.


Is it possible to have a cryptocurrency based on email address? I would like to know if there is any existing cryptocurrency that lets you control the public and private keys generated.

I just don't like the fact that cryptocurrency keys are randomly generated. Even though I know generating such a pair again is almost impossible. I don't like it because it's "almost" impossible.

I have a few ideas that I would like to be used for the generation of these pairs but because I don't have an understanding of how the blockchain works, these ideas might not be practical.

I am still willing to share here if someone is willing to get back on the feasibility.

PS: Please excuse my poor grammar. English isn't my first language. I can only get the spellings right :)

PSS: I am now editing this to include my idea of a blockchain which I think I could trust:

Like I said, I just don't like the randomness that is involved. I would love to see a cryptocurrency where you have control over both the keys or at least one of the keys, preferabbly the public key.

Is it possible to have a currency with the following features?

Public key is an email address
Every transaction made on the blockchain sends a confirmation to the email address with a secret key. Once this is processed by the user, the blockchain verifies the transaction and either adds it to the blockchain or rejects it.

With such a set up, my coins would be as safe as my email address. To steal my coins, you would have to gain access to the associated email address.

With Bitcoin and its derivatives, you can already generate a private key any way you like and import it using the importprivkey RPC command.  You may start with any 256 bits of data (i.e. any number between 0 and 2^256-1), convert it to WIF format as explained at https://en.bitcoin.it/wiki/Wallet_import_format, and import it.

However, don't start getting attached to this idea before you understand things better.

  I just don't like the fact that cryptocurrency keys are randomly generated. Even though I know generating such a pair again is almost impossible. I don't like it because it's "almost" impossible.

The solution to this is not to invent something new - the solution is for you to learn more math until you are convinced that it is reasonable.  This is the case with everything in cryptography: no attack can ever be made impossible.  But making it sufficiently improbable really is close enough.

If you generate a private key some other way besides randomly, it makes it a lot easier for someone to guess it and steal all your money.  There used to be a fad called "brain wallets" where you would make up some memorable phrase and use it as a private key.  People who did this got their money stolen routinely, because the number of memorable phrases you might come up with is relatively small, and it's very easy for someone with a good computer to just try and guess all of them.  But the universe cannot support a computer good enough to try all 2^256 possible random keys.


Copay Multi-Sig Wallet 2 of 3, possible issues Copay wallet was created by one of the co signers. Is it possible for this co signer to change the 2 of 3 rule without approval from other co signers? Or add another new co signer without existing co signer approvals?

If such changes were made, the address would change so it would not effect you. You give out addresses that have a specific set of signers and that cannot change. A different set of signers would be a different address, and if you do not know about this different set of signers, you would not have these other addresses to even give out.

So no, it is impossible for a co-signer to change the other signers nor is it possible to add more co-signers to a given wallet.

It is possible for a co-signer to create a new set of addresses with other co-signers added and then give out those addresses. But unless you were specifically told about this, you would not be aware that you could sign for those addresses.


Do stale blocks get reported by bitcoin daemon? Do stale blocks end up or get reported by bitcoin daemon client?
I am writing a bitcoin service and need to listen for incoming transactions for select accounts using the bitcoin client. For this I am watching the blocks as they come into the blockchain. And for periods of time the service is down, we keep track of the last block height and once the service is back online, restart traversing the blockchain from there until we catch up with the tip.

My questions are:

Does the client report stale blocks which are mined into the blockchain but not part of the main chain or are they ignored and hidden from me?
Also if the stale blocks are being reported, what would I need to to with the transactions from that block?
How do I detect if a block is stale?

My question is: does the client report stale blocks which are mined into the blockchain but not part of the main chain or are they ignored and hidden from me?

Blocks that are not part of the main chain are never reported unless you specifically ask for them.

However if you are online, new blocks can become stale blocks and you will need to be able to handle that case.

  what would I need to to with the transactions from that block?

Undo everything that happened in that block. So all of the transactions become unconfirmed and go back to the mempool. Any UTXOs that were spent become unspent and re-enter the UTXO set.


Transfer Not Sent to wallet I request payment to this address: 1MJW5uSqvsdey6DnAsMo21WZ6bhehaVtKq but still not yet to the wallet.

https://blockchain.info/address/1MJW5uSqvsdey6DnAsMo21WZ6bhehaVtKq

Why this happen how to get back or cancell

Regards

You provided the receiving address but not the sending address or the txid.

Is this your transaction sending 0.05277 BTC to that address?

https://blockchain.info/tx/1bd7d272d7c63984608089a31e66b05c873fd7b9d50021129b87584202438a55

If that is not your transaction then has not yet been transmitted to the network. The above transaction is the only transaction involving the address you specified: 1MJW5uSqvsdey6DnAsMo21WZ6bhehaVtKq

Where did you send the payment from? Some online exchanges say they "sent" the transaction and deduct btc from your balance before they actually transmit it. Until you see a transaction ID on the blockchain I would continue to assume it has not been sent.

How you can receive your "bitcoin back or cancel" is dependent on who controls the wallet the transaction is intended to be sent from.


How to consolidate dust transactions in 2017? This has definitely been asked before but the questions I found were years old and I want to know if the landscape for dealing with this has improved, and if there's a simpler way for an "average user" to consolidate these tiny inputs.

I have lots of transactions from faucets and cloud mining that has been running quite a while now.  Even setting my wallet (Trezor) to use the lowest fee will cost more than 1/3 the total value.  Is there any way I can consolidate these without getting completely reamed, and without having to have a deep understanding of linux, running bitcoin core, etc.?

I'm on OSX and while I am frequently the most technologically savvy person in my circles, I'm not a linux/bitcoin expert and am more just an early adopter playing around with something new that I only somewhat understand.  Would really like to be able to use these btc someday without giving up most of them to fees.

Also my mining is ongoing so I get another small transaction every single day, so this will continue to be an issue for me.

Just now (July 2017) the mempool is down, which allows for small fees.
Usually fees are created by the size of the transaction. With lots of dust, a transaction will have many inputs, and increase in size. That increases the fees.
I have seen transactions with low as 5 satoshis per byte. So it's a good time frame.

Similar reply here:
Why was the transaction fee more for a 20 mBTC transaction than for a 25 mBTC transaction?


Golang how to derive address from bip32's xpubkey? i'm trying to derive HD address of bitcoin using Golang. I have extended private/public key. The problem is i'm unable to find any library in Golang that can generate/derive address from the xpubkey/xprivkey. any advice?

Take a look on https://github.com/wemeetagain/go-hdwallet

// Generate a random 256 bit seed
seed, err := hdwallet.GenSeed(256)

// Create a master private key
masterprv := hdwallet.MasterKey(seed)

// Convert a private key to public key
masterpub := masterprv.Pub()

// Generate new child key based on private or public key
childprv, err := masterprv.Child(0)
childpub, err := masterpub.Child(0)

// Create bitcoin address from public key
address := childpub.Address()

// Convenience string -> string Child and ToAddress functions
walletstring := childpub.String()
childstring, err := hdwallet.StringChild(walletstring,0)
childaddress, err := hdwallet.StringAddress(childstring)


CGMiner and 5830's give my the BSOD and GPU hangs, DEAD threads I recently switched to CGminer from phoenix from GUIminer. And seem to be having some issues.

System: Windows 7 64bit, x4 5830's

-Timeline-
AMD catalyst: 13.1
GPUs: 5830x2 7770x1
Miner: CGminer newest stable release 10.5 I think.
Sum: Worked well except for flashing squares on the screen when mining and using the desktop. Saw a post that said update catalyst to 13.2 for no squares.

~~Changelog: updated to 13.2 catalyst, returned the 7770 (money issues)

AMD catalyst: 13.1
GPUs: 5830x2
Miner: CGminer newest stable release 10.5
Sum: Works well for a few hours (the upgrade to 13.2 also removed the squares), then I either get a DEAD thread for the gpu doing the desktop, or I cannot get windows to return to desktop after it sleeps, or just a good 'ol BSOD.

I was reading around and it said that CGminer makes some binaries on initial run and only initial run. So do those binaries contain info about old 7770 that I removed and now it is conflicting somehow? Should I just reinstall CGminer?

Or do people know of issues with the 13.2 CataContCent?

OP EDIT: test config 1

{
"pools" : [
    {
        "url" : "stratum.btcguild.com:3333",
        "user" : "MY USER",
        "pass" : "MY PASS"
    }
],
"intensity" : "d,9,9,9",
"temp-cutoff" : "95,95,95,95",
"temp-overheat" : "85,85,85,85",
"temp-target" : "75,75,75,75",
}

What I want my conf to do. Put the three 5830's not doing the desktop balls to the wall. The one I am using for desktop try and do the best it can but do not interfere with desktop.
Turn off any GPU that hits 95C, try to run them all at 75C.

No overclock on any GPU. I do not wish to slow them down or speed them up yet. I just want them to run without crashing my system first. I don't care about fanspeed/noise.

How do I know my 'd' setting will hit GPU0 (my desktop)?

Any other important settings that I removed?

Try to lower GPU clock a little bit to let's say 900MHZ or stock, and also make sure that the memory clock is not lower than 300MHZ. After that try to keep an eye on the GPU temperatures as this may be the cause of the sudden BSOD. Also there is a intensity parameter, if you keep it as 9 then try to lower it to 7. My config for 5830 looks like this:

{
"pools" : [
    {
        "url" : "mint.bitminter.com:8332",
        "user" : "username_workername",
        "pass" : "worker_password"
    }
],
"intensity" : "9,9,9,9",
"gpu-engine" : "0-950,0-950,0-950,0-870",
"gpu-fan" : "0-85,0-85,0-85,0-85",
"gpu-memclock" : "300,300,300,300",
"gpu-powertune" : "20,20,20,20",
"temp-cutoff" : "95,95,95,95",
"temp-overheat" : "85,85,85,85",
"temp-target" : "80,75,75,80",

"algo" : "4way",
"auto-fan" : true,
"auto-gpu" : true,
"expiry" : "120",
"failover-only" : true,
"gpu-threads" : "2",
"log" : "5",
"queue" : "1",
"retry-pause" : "5",
"scan-time" : "60",
"temp-hysteresis" : "3",
"worksize" : "0",

"donation" : "0.00",
"shares" : "0",
"kernel-path" : "/usr/local/bin"
}

and works for over a year now :)


How does a miner perform hashing? I'm trying to walk my way through the process by which a miner hashes.

Let's say the getwork request returns a data field of:

0000000244de6ceba49e1c8d438c0d8c584eefd9c8590545bfdfbf380000025c00000000fb3a091de1b4bbe5dc7acfe6bdacbc3fc3bb09bf1030adef8e2854db1b6ac42f5075c0051a057e08456c6f69000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000

As far as I understand, the first step is to calculate the midstate. To do this, we first take the first half of the data string:

0000000244de6ceba49e1c8d438c0d8c584eefd9c8590545bfdfbf380000025c00000000fb3a091de1b4bbe5dc7acfe6bdacbc3fc3bb09bf1030adef8e2854db

We then reverse the endianness of each 32-bit unsigned int (represented as 8 hex digits in the string), yielding:

02000000eb6cde448d1c9ea48c0d8c43d9ef4e58450559c838bfdfbf5c020000000000001d093afbe5bbb4e1e6cf7adc3fbcacbdbf09bbc3efad3010db54288e

Next we transform this into sixteen 32-bit unsigned ints:

33554432, 3949780548, 2367463076, 2349698115, 3656339032, 1157978568, 952098751, 1543634944, 0, 487144187, 3854284001, 3872357084, 1069329597, 3205086147, 4021104656, 3679725710

We then input this int array into SHA-256's internal function, with the second input being the eight 32-bit numbers given on page 13 of the SHA-256 specs.

The output of this preliminary hash yields the following eight 32-bit ints as our midstate:

3045448562, 361056177, 1940413978, 3803584651, 1661283772, 3478943551, 2906109005, 300125848

From this point on, I'm not sure how correct the steps are. Corrections are greatly appreciated!

Next, we look at the second half of the input string:

1b6ac42f5075c0051a057e08456c6f69000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000

Once again, we reverse the endianness, as everything is an 8-character hex string representing 32-bit unsigned ints:

2fc46a1b05c07550087e051a696f6c45800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280

Now, we break this up into sixteen 32-bit ints: 801401371, 96499024, 142476570, 1768909893, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 640

The fifth number (21474836481) should be the nonce, according to this description.

(Why isn't this nonce zero?)

Now, starting at the given nonce, we use the SHA-256 function to hash the sixteen 32-bit ints from the second half of the data, using the midstate as the other eight int inputs. This yields: 3993002029, 2278477219, 3977673643, 191934125, 2075691039, 4115259165, 601235791, 2598049038

Now, what do I use as inputs for the second hash function in the "double-hash"? Or did calculating the midstate count as the first hash computation?

And when the nonce overflows, should I submit another getwork request or wait until I've checked the nonces in the range of [0, original_nonce_value)? (Assuming my analysis that the given nonce is 21474836481 is correct?)

Lastly, if our target value from the getwork request is:

ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000

We need to switch the endianness of this value, yielding:

00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

And then we convert this to eight 32-bit unsigned ints, yielding: 0, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295

And I believe after the second SHA-256 hash we should have eight 32-bit unsigned ints. Lastly, we should compare these eight output ints against our eight target ints (from left to right in the array, so comparing output[0] against the target's 0, then output[1] against 4294967295, etc.) and if our output is less than the target, we convert our eight int values to hex strings, switch the endianness, concatenate them in the same order (output[0]'s hex string is the first set of eight characters), and submit it back to the pool server in a getwork completion POST.

How much of this is correct, and where am I misinterpreting the protocol?

All help is appreciated; thanks so much!

This question is a complicated one, but I'll see what I can do to answer it. Also, I won't try tackling the issue of endianness, as in the case of Bitcoin it gives me a headache...

First, lets see what we have in a block header given to us by getwork. Lets take the Genesis Block for an example.

01000000 - version
0000000000000000000000000000000000000000000000000000000000000000 - prev block
3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A - merkle root
29AB5F49 - timestamp
FFFF001D - bits
00000000 - nonce (it will be set to 1DAC2B7C later)
00 - number of transactions (always 0, this is the block header)
0000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000 - padding

In order to calculate the midstate, we split the header into two parts that are accepted by SHA algorithm (64 bytes each):

0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA
4B1E5E4A29AB5F49FFFF001D00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000

We load the first part into the SHA algorithm. We take save this state for later use (midstate) (sorry for lack of examples, but I don't have my hashing algorithms on hand). Then we load the second part into the SHA algorithm. We read the output, this is the first hash. We take that output, plug it back to a new input, and get its result. That is the second hash. Assuming we got the correct nonce (in our case - 1DAC2B7C), our result should look something like this:

000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

and compare it to our target:

00000000ffff0000000000000000000000000000000000000000000000000000

Taken as a number, which is bigger? The target. This means that we have the correct nonce, and we can submit our full header as the result. Profit!

From what I understand, you tried to break up the resulting numbers too much, instead of operating on really big numbers like Bitcoin appears to be doing. Then again, endianness is also a big problem with the protocol and what not...

I hope this answers your problem.


BFGMiner, what will be displayed when solo mining? I have started solo mining with BitcoinQt and BFGMiner on my Block Erupters.

I would first like to determine, if indeed I am doing this right, what I should see, and to make sure if on the rarest chance ever I find a block I actually get paid.

From what I can tell and my experience everything is spot on except for this long-poll stuff, do I need to tell BitcoinQt to poll "better"?

BitcoinQt .conf file (started with -server)

rpcuser=User
rpcpassword=Pass
rpcallowip=*
rpcport=8332

BFGMiner Arguments

F:\PATH\bfgminer.exe -G
-o http://localhost:8332
-u User
-p Pass
--coinbase-addr 14tdCy1xBk78nVGQj26YCMPRBWiZSpvpiJ
-S all --icarus-options 115200:1:1 --icarus-timing 3.0=100

With 14tdCy1xBk78nVGQj26YCMPRBWiZSpvpiJ being one of the recieve addresses in my BitcoinQt wallet

BFGMiner Screen after about 5 mins:

It could be bitcoind: Long Polling is enabled on BFGMiner by default (at least on *NIX), as it's rather useful for pooled mining. But bitcoind seems to not support it yet, so you'll need to disable it. That can be done with switch

--no-longpoll

And you might try

--no-getwork

And/or

--no-gbt

It could be a driver: The Block Erupter COM can be downloaded here.

It cold be your .conf: I don't see why you're using the -G switch. You aren't GPU mining. I also don't even see --icarus-options 115200:1:1, or --icarus-timing 3.0=100 as applicable options as per this GitHub readme.

It could be permissions: If none of that helps, the documentation says

  To use ASICs or FPGAs, you will need to be sure the user BFGMiner is running as
  has appropriate permissions. This varies by operating system.

This was mentioned specifically toward Gentoo and Ubuntu, but it might apply to Windows as well. You might need to run BFG as Administrator. (My Windows experience is lacking though, so I'm not sure.)


Physical objects on the blockchain as data? I have been wondering about the company that stores diamonds via the Blockchain using it as a ledger to follow each diamond individually from where it is mined through the world. Each diamond has a unique 'passport' and so it is impossible for it to get lost or for it to enter the black market. Can anybody explain to me how this works in terms of how the information about the diamond is broken into categories in order for it to be fully described. Also, does a physical 'passport' travel with each diamond everywhere? Are these stored on a specific blockchain designed particularly for the diamonds?

Thanks

I can't tell you about any specific diamond-tracking company, but I can address the complications with tracking any physical good on a blockchain.

In order to track a physical object on a blockchain, that physical object needs to be able to reduce to a small piece of data, such as a hash digest.  With digital goods, this is easily accomplished with a cryptographic hash function, but physical objects present some difficulties.  You'd need a method of reliably and repeatably coming up with the same reduced value from the same physical object.  If a diamond were "hashed" in London today by one jeweler, you would need to be able to expect that if it were hashed again by a different jeweler in New York in 20 years, the result would be the same.  Not just close, but exactly the same.  This is probably where the physical "passport" you speak of fits in, but in that case, you are relying on the chain of custody of the passport.  The blockchain would be tracking the passport, not the diamond.  How the passport is identified to belong to a certain diamond is something you'd have to ask a jeweler.

You would also need to trust whatever layer is built on top of the blockchain, and that they are following the rules they claim to be following.  In this case, it would be whomever issues these passports.  For example, what would happen if the passport-issuing authority issues two passports for the same diamond?  The passports could be traded separately on the blockchain, but there is still only a single physical good...but with two blockchain-legitimate claims to it.  Also, who is in charge of enforcing the ownership of the physical good?  If I have the diamond, but you have the blockchain token, who is going to physically take the diamond from me and give it to you?

It might be wise to pose these questions to whichever company is claiming to be able to track ownership of a physical good by using a blockchain.


Can you have same Bitcoin Address in 2 different wallets? Not the same wallet on different locations.

The reason I ask is that I am about to buy some bitcoins for cash and in order to transfer the bitcoins he will bring with him a paper wallet containing the bitcoin public and private keys.

He has told me to scan these into my blockchain.info app.

I just wondered if this a safe way to transfer bitcoins since he will have access to the private and public keys and could double spend the bitcoins.

Anyone with access to the private key can spend any bitcoins belonging to the public key address.

Once you get the key from him, you should have blockchain "sweep" the balance at that address into a new address that only you have the key for.


Is there an oveview of organizations support of segwit/segwit2X? I'm trying to get an overview of what parts of the ecosystem that support what, preferably by economic activity. Is there any good lists or overviews?

First of all, Segwit and Segwit2x are two different things. Segwit has already activated, Segwit2x has not. Please do not conflate the two.

https://coin.dance/poli and http://segwit.party/nya/ list the positions of various companies and project's on Segwit2x although they are not always accurate or clear.


What are Channel Factories and how do they work? One of the open research questions for Lightning Network is that it will take a massive amount of on-chain transactions to create enough payment channels for all the Lightning Network users. Lately, I've seen the term "Channel Factories"¹ pop-up in this context.
What are Channel Factories? How do they work? How does that help scale the Lightning Network?

¹ Apparently, the term was introduced by the paper Scalable Funding of Bitcoin Micropayment Channel Networks by C. Burchert, C. Decker and R. Wattenhofer

What are Channel Factories?

In short, Channel Factories are payment channels that can be used to create more payment channels.  That sounds weird, but it's really pretty simple:

In a regular payment channel, you always have a transaction signed by all participating parties that's ready to commit the current channel balances to the block chain.  For example, in a channel between Alice and Bob, this transaction might have two outputs, one paying Alice 0.25 BTC and one paying Bob 0.75 BTC.  If this example transaction were broadcast, it would close the payment channel between Alice and Bob.

However, it's possible to format the ready-to-commit transaction as a transaction that not only closes the existing payment channel but which also opens a new payment channel.  In that case, the same security that allows the initial payment channel to have zero-conf security also extends its security to the second payment channel.

The key feature of a regular payment channel is the ability to securely update the state (balance) of the channel many times without creating extra on-chain transactions, so the key feature of a Channel Factory is the ability to securely create and destroy new payment channels without creating extra on-chain transactions.

  How do they work?

At least two people and preferably ten or more get together to create a payment channel (channel factory) deposit transaction.  This has the regular payment channel logic that allows all of the participants to spend the money if they all agree, or for a dissatisfied participant to individually withdraw his funds if the other participants become uncooperative.

When the deposit transaction has enough confirmations to satisfy all the participants, they update the state of the initial payment channel (channel factory) to create a bunch of non-broadcast payment channel opens between themselves.  (The channels need to be between themselves because they each need to ensure none of the bitcoins used to open the channel are spent twice, i.e. double spent.)

Since the initial payment channel (channel factory) already has sufficient confirmations, opening the secondary payment channels is instant.  The second payment channels can then be used like normal payment channels (e.g. for routable payments Lightning Network) except that when it comes time to close them, the participants have the option of either committing the final state to the block chain or simply updating their balances in the channel factory in order to start a new channel.

  How does that help scale the Lightning Network?

Let's assume we have a bunch of users who all want to open payment channels to each other.  For n users, they need to open m channels where m = n(n-1)/2.  For current-generation Lightning Network channel open, they'll probably spend at least two inputs and generate at least three outputs (about 240 vbytes times m channels).  For a channel factory, they'll have about n inputs (at 70 vbytes) and n + 1 outputs (at about 25 vbytes) plus 10 vbytes overhead.  Here's the savings accounting:

This doesn't count channel closing costs, which are harder to calculate since channels may remain open for variable lengths of time.  Also not included is the additional savings available from Schnorr signature aggregation---if that should be activated on Bitcoin, it will increase Channel Factory efficiency moderately by decreasing the amount of space used by the inputs.  Please note, numbers used here are a rough approximation.

Note that although channel factories provide significantly lower costs even for small numbers of participants, where they really excel is at making it cheap to build a dense web of payment channels between users.  This will likely significantly improve the quality of service of a widely-distributed Lightning Network by ensuring most paths from spender to recipient stay short, which helps the widely-distributed network further effectively compete with a more centralized network that has short paths between large hub-like entities.


Gridseed not mining bitcoin - no shares accepted So I have had my Gridseed (5 chips) for about a week now, and still couldn't mine any Bitcoin, only Scrypt.

I am currently only able to mine with minerd, using Scrypt, and I am on a Mac.
I tried to mine Bitcoin using cgminer, bfgminer, minerd (versions from MacMiner and others on the internet), tried to compile, nothings seems to work.

Problem

With cgminer I can see the hashrate (~11Gh/s) but no share is accepted.
With bfgminer it just wont recognize the grid
With minerd it keeps trying and trying, and does nothing.

Looks like cgminer is my best shot, but no share is accepted.

I tried on a Windows VM (virtualbox), same outcome!
I have looked all over the internet (Gridseed-Help, Cryptomining-blog, GridSeed-Guide on BitcoinTalk, and off course Mac-Mining-Guide)

Does anyone have any input on here?

So, I'm not much of a miner myself, so please take this with a grain of salt.

When I plug in your numbers into a mining calculator, 11Gh/s resolve to earnings of just below 0.001 btc per month. This corresponds e.g. to the minimal "Send threshold" you can set on Slush pool. It's worth is less than $0.5 (for the whole month), where you probably pay a few cents per hour in electricity.

On another help page Slush pool states "Permanently Low or Offline state of your worker can be caused by weak worker whose hash rate is below 10 Gh/s. We recommend to switch off monitoring for such workers."

I suspect that your hashrate may be so low, that pools don't serve shares at a level where you can succeed, but perhaps you can find out more if you specifically research corresponding to that line of thought.


Confused by the term: trading partners. And how to convert more fringe currencies back to bitcoin Two questions:

I am confused by the term: trading partners like BTC/ETH, etc.
I'm into some more of the fringe currencies, IOTA, and SAN. Bought them with bitcoin on bitfinex, how to convert back? Seems to be a one-way street. Am I stuck?

Trading pairs like BTC-ETC at an exchange means that you pay BTC to receive ETH. Your exit should be possible with sending IOTA, SAN to respective wallets supporting these coins. Or you trade back to BTC and send this to your personal wallet or to another trading site where you sell your BTC against USD. You cannot get USD out of Bitfinex presently it seems.


Does the Bitcoin Core API support high-precision balance display? I am currently working with a number of altcoins and and I need to support deposits and withdrawals in currencies with very large coin number cap like Dogecoin. I am wondering whether the Bitcoin Core client that is the basis for such altcoin clients supports such high denomination currencies internally and in its API (for example, when calling getbalance can it display balances of 10^12 coins with a precision of 1 satoshi?), or is there a limit to the precision used?

It appears as if the official client is using qint64, so there will be no resolution past the decimal point.  The max value is bigger than Bitcoin's expected max.

Just use the same data types as the coins in question, and you should be ok.

You could use arbitrary precision for microbalances in your own app, but you won't be able to transfer them on the official blockchain.  Others might support arbitrary precision, but I haven't seen one yet that does.


What is the point of comparing sha256 of downloaded file with published on the same website code? Some websites publish sha256 to check authenticity of downloaded file.

I suppose this is to protect against man-in-the-middle attack - that my file was not altered during download.

What prevents man-in-the-middle from altering web traffic and fix hash code that I see to match malicious downloaded file ?

Those sites often do not provide SSL, so capturing and fixing HTTP traffic is easy, all it takes is to work with my ISP or some backbone router.

There are even sites that allow to calculate sha256 by uploading file over unsafe HTTP with no SSL - ridiculous isn't it ?

Not only I have to trust that this website does not work for government, I also have to trust my ISP by connecting without SSL.

Nothing. It is mostly only useful for checking data integrity, not detecting malicious modification (unless you know someone trustworthy that signed the hash). SSL has the same problems though, because public keys can be altered too of course.

There are multiple solutions to this problem, although none is perfect.

Trusting some central authority to decide who is trustworthy and who is not (i.e. Certificate authority). This approach has been shown multiple times to be dangerous, see DigiNotar for example.
Building a web-of-trust, the method PGP (and later GPG) implemented.
Circumventing the normal network with private lines and routing (the military approach), or wait for quantum encryption to become available.


Check which C-Lightning version I am running? Ive downloaded and unpacked the new version 0.6 but is there anyway I can check through CLI commands which version i'm running to ensure the update worked?

Sure, just use:

$ lightning-cli --version
v0.6-127-gf8fa421


BFGMINER error while loading shared libraries I just installed BFGMINER on my Ubuntu 12.04LTS laptop and it won't let me set it up with my pool.

administrator@T41-Server:~$ sudo bfgminer -o api.bitcoin.cz:8332 -u wizardmorax.ibm_ubuntu -px -S all
bfgminer: error while loading shared libraries: libblkmaker_jansson-0.1.so.0: cannot open shared object file: No such file or directory

I followed a tutorial for installing BFGMINER
http://www.linuxconsultantsireland.com/content/bitcoin-mining-raspberry-pi-usb-asic-miner-block-erupter

Thanks,
Jackson


Bitcoin Client crashing while syncing I am getting this problem today:

when syncing, the client suddenly crashes with the following debug.log:

.....
2015-06-29 14:30:34 IO error: C:\Users\Internet\AppData\Roaming\Bitcoin\chainstate\713704.ldb: Zugriff verweigert (access denied)

2015-06-29 14:30:34 * System error while flushing: Database I/O error
2015-06-29 14:36:59 ERROR: ProcessNewBlock : ActivateBestChain failed
2015-06-29 14:37:00 net thread interrupt
2015-06-29 14:37:00 opencon thread interrupt
2015-06-29 14:37:00 dumpaddr thread stop
2015-06-29 14:37:00 addcon thread interrupt
2015-06-29 14:37:03 msghand thread interrupt
2015-06-29 14:37:03 Shutdown: In progress...
2015-06-29 14:37:03 StopNode()
2015-06-29 14:37:03 UPNP_DeletePortMapping() returned : 403
2015-06-29 14:37:03 upnp thread interrupt
2015-06-29 14:37:03 IO error: C:\Users\Internet\AppData\Roaming\Bitcoin\chainstate\713704.ldb: Zugriff verweigert (access denied)
2015-06-29 14:37:03 * System error while flushing: Database I/O error

The message says client is stopping but the process never closes. Any Ideas?

I've never used windows.  But on GNU/Linux those access denied messages usually have to do with file permissions (because nonexistence usually says "no such file or directory").  The most typical case that I've seen is that you usually run this program as root and now you started it in normal user mode.


What is the estimated USD fee price in BTC when Bitcoin is worth 1 million dollars in the future? Currently, fees in Bitcoin are quite high ($1-$30) to move anything under $50 USD. If Bitcoin is worth 1 million dollars one day, how much would an on-chain fee be? Assuming blocks are going to be full of course. Will there ever be a block size increase to solve this scalability problem? Supposedly, lightning network solves it, but fees there would also be high, no? What are some proposed solutions to this problem that work on Bitcoin layer 1?

I think no one can read the future but some things can be said with high confidence and I will try to point them out.
First I think it the conversion to USD does at best make sense for cosmetics thus I will do most computations in the more natural form of satoshis and confirm only at the end if necessary.
if the average feerate in a block is x sat/Byte and with 1 MB blocks we will have a total fee of x Million satoshi per block. This is equivalent to x * 0.01 BTC.
Assuming 2500 tx per block we would end up having
x * 4,000 sats per transaction. (I guess with taproot, schnoor and signature aggregation we could stuff in a few more tx.)
as 1 sat / byte is the absolute minimum fee these 4,000 sats would at a 1 million usd / BTC boil down to $40 per transaction which would have to be multiplied by the feerate x which is any number larger or equal to 1.
I see it from the perspective of Lightning Network rather than from the perspective of making on chain payments. It seems like a reasonable fee to open your channels and be able to transact as often and frequently as you wish. As far as I know it is currently not clear how fees on the Lightning Network would evolve.


How does a miner choose which transactions go into the next block? How does a miner choose which transactions go into the next block?
Do all transactions go through or is there a lottery process? I understand transactions with higher fees are given priority.

A miner can choose whichever (valid) transactions they’d like to include in a block, for any reason they’d like.

  I understand transactions with higher fees are given priority.

Generally, yes, we would assume a rational miner would maximize the amount of fees they can possibly obtain. But this is not mandatory.


How to build Bitcoin from source on Ubuntu 11.04 Natty Narwhal? We have this detailed tutorial for Lucid Lynx, but somehow it doesn't work for Natty.

We also have a similar question but it is too broad and the solution there isn't complete enough to work.

I created this question asking for a tutorial that will work on any freshly installed Natty.

Wolciph over on the Bitcoin forums wrote a bash script specifically for 11.04. You haven't posted your specific build errors, but I'm guessing that the problem is with the wxWidgets lib and you'll probably have less issues when the main Bitcoin client eventually moves over to Qt (which I believe is in the works, correct me if I'm wrong). In case the link to the script eventually goes down, here it is:

#!/bin/bash
echo "DISCLAIMER: you are using this script at your own discretion! By typing 'c', you agree that you have read the script yourself and have understood it and that you will thus take full responsabilty in the eventuality that this script leads to any harm to you or your property. If you do not agree type 'n'"
read -n 1 r
[ "$r" = 'c' ] || exit 0

set -e

echo "You will be prompted to enter your password in order to install necessary dependencies."

sudo apt-get install build-essential libgtk2.0-dev libssl-dev libdb4.7-dev libdb4.7++-dev libboost-all-dev
sudo apt-get build-dep libwxgtk2.8-dev

mkdir bitcoin || true
cd bitcoin

[ -e wxWidgets.tar.gz ] || wget "http://biolpc22.york.ac.uk/pub/Daily_HEAD/wxWidgets.tar.gz"
[ -e wxWidgets ] || tar -xvzf wxWidgets.tar.gz
cd wxWidgets
./configure
make -j3
sudo make install
sudo ldconfig
cd ..

[ -e miniupnpc*.tar.gz ] || wget "http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.5.tar.gz"
[ -e miniupnpc*/ ] || tar -xvzf *miniupnpc*.tar.gz
cd *miniupnpc*/
make
sudo make install
cd ..

#for some reason, github's certificate doesn't work:
[ -e bitcoin*.tar.gz ] || wget --no-check-certificate "https://www.github.com/bitcoin/bitcoin/tarball/v0.3.21"
[ -e bitcoin*/ ] || tar -xvzf "v0.3.21"
cd bitcoin*/
make -f makefile.unix
#optional:
strip bitcoin
echo "Bitcoin is now compiled : '$PWD/bitcoin'"
echo "Launch bitcoin now? (y/n)"
read -n1 r
[[ "$r" = y ]] && ./bitcoin
cd ..


Altcoin WIF checksum check In bitcoins, it is possible to check if a private key is valid using the WIF checksum.

Is this also the case for altcoins which use SHA256. And how about the ones that use another hashing algorithm?

How altcoin wallets import private keys is up to the specific altcoin, so I cannot provide a blanket answer for all of them.

However, I can tell you that this functionality is not determined by the hashing algorithm used for the altcoin's proof-of-work.  That is independent of the Wallet Import Format, which just so happens to use SHA256, and does not use SHA256 because that is what Bitcoin uses for proof-of-work.

My guess is that most altcoin's (but not all) support their own version of WIF, but with a couple of likely differences.

First, the altcoin may not use the same asymmetric cryptography for creating addresses, which means that private keys might not be the same length as they are in Bitcoin.  Since the private key is the input of WIF, this can have a consequence on the end result.

Second most altcoins will probably use a different network identifier that gets pre-pended to the private key in step 2.  Bitcoin's mainnet uses 0x80, but an altcoin could use whatever value the creator felt like.  Perhaps it was changed...perhaps is wasn't.

Other than that, I would guess that most Bitcoin-clone altcoins use the same process for importing private keys.  It is also possible that the checksum is created using a different hashing algorithm than SHA256, but that algorithm in no way has to correspond with the proof-of-work hashing algorithm of the altcoin.

Check the docs on the altcoin in question to find out for sure.


Can wallet created from Bitcoin core be transferred to an Android device? I worry that if I install a wallet in my Phone, it would have a different wallet from the one I created in PC.

Even if it is NOT recommended (especially if you want to store a considerably amount of funds), it is possible to share a "wallet", or more specifically a Private Key, from one wallet app to the other. Bitcoin wallets are just keychains, they only contain keys, you can have the same private key in both apps.

It is not recommended because it's more likely that you can get your phone stolen than your computer, especially if it's not a laptop but a desktop computer, also mobile wallet code and mode (light wallet or SPV vs full-node) can be weaker. Sharing private keys means that who first gets the access to the wallet or the key directly can spend the funds.

Here's how to share it anyway:

You can easily export your private key using the dumpprivatekey command from Bitcoin Core (here's how to export it on Bitcoin Core GUI, or bitcoin-qt, if you don't have the qt version you need to launch the command via bitcoin-cli and enter the same commands)

Then you can take any Mobile wallet with import private key capability like Mycelium (Android) or BreadWallet (iOS) and import it via their "import private key" feature.

In Mycelium, to import a private key, you have to click the hamburger button, then select "Cold storage" and then Clipboard (you need to securely send your private key from your computer to your phone, this usually means no email and no standard IMs, the safest way is to transcribe it manually). Also note that you need to password protect your wallet (preferably with a strong password) or users that can access your phone will be able to spend your funds, Mycelium will warn you if you don't do it.

Also note that bitcoin-qt and Bitcoin Core don't use HD or BIP32, this means that you get less anonymity if you reuse the same address or if you don't import a large number of keys, to have multiple "change" addresses available in both wallets.


How can I figure out where I created my Bitcoin wallet? I deposited and played at freebitcoin.com and after playing I was able to withdraw my bitcoins. I saw the transaction at blockr but don't remember which website I created that Bitcoin address on. Please help.

A bitcoin private key is a random 256 bit number. A bitcoin address is deterministically derived from that private key. Everyone uses the same procedure to do so. Therefore, it is impossible to figure out where you created the wallet based one a bitcoin address.

Your browser history, however, might lead you to the correct website. You can limit the websites to check to those you visited when you suspect to have created the wallet, therefore narrowing down the places to search.

Since you don't know the website and probably need credentials to access you wallet there, you probably saved the password in your browser. Since the number of saved passwords probably is much smaller than the number of websites you visited, searching your saved passwords might be the best way to go. Every modern browser should be able to show them to you, along with the website they belong to.


Detecting Wash Sales/Transactions I run a site which is essentially an e-commerce platform where buyers connect with sellers and all transactions happen in Bitcoin. I worry about sellers on the site continuously buying their own items on the site to gain visibility (more sales means higher ranking on the front page).

Is it possible to detect whether an incoming transaction originated from the same bitcoin wallet?

I am thinking that I could run a tree/graph traversal of transactions starting at a given payment address and see if I end up at that same address again. But I'm not sure how this would work with wallets where each payment generates a new address from a master public/private key pair. As far as I know, it's not possible to tell whether two addresses originated from the same MPK.

PS: Maybe wash sale is not the correct term here.

It is not possible to determine if multiple addresses belong to one wallet, whether it is a deterministic wallet or not.

At best, you can do some form of chain analysis that traces UTXOs back along the chain until you find a common root. For most transactions in a single wallet, there will usually be a convergence point of the coins. However, this is not an exact science, and the results may not be of a high enough confidence to be certain it is happening.

Similarly, you can trace the future spending of the outputs created to see if they converge into a single address. If so, it may indicate the same person was selling/buying items.


Does Bitcoin Core support BIP157? (some call it neutrino) I want to allow my bitcoind node to support BIP157 so that i can allow some friends to connect their LND nodes to it.
Does it support it by default?
Or do i need to explicitly enable it?

Bitcoin Core 0.21+ support BIP 157, but not necessarily by default. In 0.21, it is default to off. You can enable it by adding peerblockfilters=1 to your bitcoin.conf file.


What are the consequences of high orphan block rate? I know the disadvantages of a high stale block rate include:

More opportunities for double spend attacks
Lower network difficulty making the network cheaper to attack

But I don't know how  even an orphan block could affect the network

Orphan blocks (in that meaning) are not a network-wide condition. They're an implementation detail (and arguably a bug).

Orphan blocks are simply blocks for which a particular node in the network doesn't have the parent yet. It doesn't mean that parent does not exist.

Since Bitcoin Core 0.10, this concept simply doesn't exist anymore. They were a side effect of the old block fetching logic that requested whatever other peers offered. In the new "headers-first" logic, the headers are downloaded and validated first, before blocks are requested. This gives guidance to the node about what to download and in what order. Since that change, blocks are never requested before their parents are known, and if a peer were to send a block unsolicited anyway, it is simply discarded as a protocol error.


Moving BTC to cold wallet over Binance The BTC withdrawal fee in Binance (and pretty much every other exchange) is 0.0005 BTC - very high. However, if you do the withdrawal over their Binance network then the fee is only 0.0000014 BTC (a mere fraction!). Question is, can that network be used to withdraw "pure" BTC? How? The address I have on my (Trezor) cold wallet is a SegWit address which apparently doesn't fit the criteria.
Also, if it's stored in a separate network, does that mean that I'll only be able to sell my BTC via Binance?
Many thanks.

However, if you do the withdrawal over their Binance network then the fee is only 0.0000014 BTC (a mere fraction!)

This transaction will involve withdrawal of a token on other chain. This token is not same as BTC. I have explained few things in this answer: https://bitcoin.stackexchange.com/a/100838/
Those options available for BTC withdrawal are misleading but there is nothing much we can do about it. I tried my best by creating a question on Stackexchange, sharing on Reddit and ask few people to tweet about it. Not sure what else can be done for the misinformation, marketing, misleading things etc. by altcoiners in this ecosystem.


Why does getNewAddress take so long? Often times out python-bitcoinrpc Bitcoin 0.11 on a Raspberry Pi 2:

https://github.com/jgarzik/python-bitcoinrpc

I am using this RPC auth proxy to talk to bitcoind from Python. I have a script that requests getmempoolinfo every 1 second. Occasionally given user input a new address is needed, and the script requests getnewaddress. This RPC-call often times out.

Sometimes the time-out causes even weirder behavior in other RPC calls until python is interrupted and the script killed: for example, getmempoolinfo returns the same information every time it is called until the script is restarted. Even querying bitcoind from the command line in a separate terminal window bitcoin-cli getmempoolinfo indicates that the mempool is not growing at all until the script that timed-out calling getnewaddress is terminated.

I also notice from the command line bitcoin-cli getnewaddress can take up to 30 seconds, without any python scripts running or other in-progress RPC calls.

I thought bitcoind is just retrieving a new address from wallet.dat, what is taking so long? It's not decrypting the wallet, it's not generating a whole new address from entropy... yet this specific RPC call is causing me lots of downstream problems.

The problem has to do with other processes on the computer with too high CPU priority:

https://raspberrypi.stackexchange.com/q/42474/39301


How to run Bitcoinj on Heroku? Does anyone know where I might find a tutorial on how to deploy a bitcoinj server (essentially a replica of a bitcoind server with an rpc API) on Heroku?

I had a horrendus time doing this because of the fact that the jar is not available in a public site. Their docs to install it in a local repo and point maven at it seemed promising, but in the end I can tell you the best way:

Start by forking a Java Maven project. Instructions to do that are here: http://java.heroku.com/
Clone your project.
Clone bitcoinj from git.
Copy the dependencies from the pom.xml of both the top level project from bitcoinj, AND the one in the 'core' directory into your project's pom.xml. You'll also have to include some version numbers which are set in properties in the pom.xml to make it work.
Copy everything from bitcoinj/core/main/src/java/ into your project.
Assuming you've done all this, you should now be able to compile your project, including bitcoinj which you copied in from step 5 into your project, because you copied all the required dependencies into your pom.xml in step 4.
Make a main class with a main method and get a static network parameters for production, make a block chain, a block store, and a peer group, and wire those up. Make a new wallet and a new ECKey, add the key to the wallet and the wallet to the block chain.
Modify your pom.xml to point the appassembler plugin at your main class so it runs when you deploy the app.
git push heroku master
Send yourself some coins, watch your wallet onCoinsRecieved fire.


Possibility to retrieve BIP39 mnemonic (24 words English dict) from BIP39 (hex) seed? I am in a situation where I have access to a BIP39 hex seed which I know has been derived from a BIP39 24 word English dictionary mnemonic.
I would like to retrieve this 24 word list - is this possible?
As far as I know there is no hierarchy per se between hex seed and mnemonic, so they should be bijective (hopefully).

This is not possible.
The seed words are converted to the hex seed through a process involving a one way hashing operation - it is not possible to go the other way.
That said, as long as your hex seed is the tree root, keeping that safely would allow you to access all your coins, although it would make importing it into a wallet somewhat difficult.


Crypto currencies and internet dependence Ive a problem with the concept of crypto in one aspect. What about "cyber safety"? Given that there will be more online malicious activity in the future, isnt cryptos dependence on the internet a weakness?

On the contrary! Computer security is necessary, even without cryptocurrencies. The current economy is very much dependent on the internet, nothing can reverse that. Besides, you can receive the bitcoin blockchain from satellite, so strictly speaking, internet is not needed for bitcoin, it is just a medium of distribution. You could, for example use a mesh network.

If you sum up all the code used for VISA/Stripe/etc, it will probably be mode code that what Bitcoin contains. Assuming a similar bug count per line, you would then have more security issues with fiat infrastructure! And Bitcoin is open source, which has been proven to improve code quality. So in reality, you have less code, and you have less bugs per line.

What cryptocurrencies do, is that they replace authentication based on fuzzy methods like your bank asking your social security number on the phone with authentication based on cryptography. If you can't keep your data secret, you will lose your Bitcoin very quickly, while it might take some time with the fiat systems.

Do you want a world in which you are dependent on broken methods of authentication? I would encourage you just to understand how to keep your data safe, instead.

So while Bitcoin users may lose money often because of lacking security, that is not the fault of Bitcoin. Bitcoin is an incentive to learn about security, therefore it is good.


On blockchain scalability bottleneck It is often said that the major bottleneck of blockchain scalability is that every (honest) node has to process every (valid) transactions. But the progress of a blockchain is how fast it reaches consensus, and this does not seem to require all nodes to verify all transactions as the block containing the longest chain can spread throughout the network before every transactions in the block is verified by all the nodes.

But the progress of a blockchain is how fast it reaches consensus, and this does not seem to require all nodes to verify all transactions as the longest chain can spread throughout the network before every transactions on it is verified by all the nodes.

All nodes having received a block does not mean that the network has come to consensus. Consensus occurs when all nodes on the network agree on what the blockchain is. This can only happen once every node has verified all blocks and their transactions. So verifying all blocks and transactions is actually a bottleneck.


How is Zclassic's pszTimeStamp generated, and what does it mean? How is pszTimestamp from Zclassic generated, and what does it mean ?

Zclassic860413afe207aa173afee4fcfa9166dc745651c754a41ea8f155646f5aa828ac

Any idea?

Same encryption is used in BTCP and Zcash.

The derivation is given in the Zclassic codebase:

from pyblake2 import blake2s
'Zclassic' + blake2s(b'No taxation without representation. BTC #437541 - 00000000000000000397f175a94dd3f530b957182eb2a9f7b79a44a94a5e0450').hexdigest()

The reason they generate it in this way is because Zcash generates its pszTimestamp like so:

from pyblake2 import blake2s
'Zcash' + blake2s(b'The Economist 2016-10-29 Known unknown: Another crypto-currency is born. BTC#436254 0000000000000000044f321997f336d2908cf8c8d6893e88dbf067e2d949487d ETH#2521903 483039a6b6bd8bd05f0584f9a078d075e454925eb71c1f13eaff59b405a721bb DJIA close on 27 Oct 2016: 18,169.68').hexdigest()

And the reason Zcash generates it in this way is because there is a consensus rule (inherited from Bitcoin) that limits the size of a coinbase scriptSig to a maximum of 100 bytes.


I never encrypted my wallet. When I installed it I never encrypted it. I then funded the address and I now have 1.1 bitcoins. But when I tried to send or create a new address it asked for a passphrase. I tried every possible password I have ever used. It's very confusing because I added an extra address so I would of had to enter a passphrase 4 times to set one and create a new one. Have you ever heard of this? Can you or do you know anyone who could help

you should try asking this question at bitcointalk.org. If there is a bug in the client then perhaps it will help if you try copying your wallet.dat somewhere and loading it into a new version of client or fresh install? It is a good idea to have your private key for each address you plan to store bitcoins in written down somewhere before you send bitcoins to them. You can then load that private key into any wallet in order to spend the bitcoins.


nLocketime error PUSH TRANSACTION ERROR: 64: NON-FINAL Created nlocktime with electrum and used the time date feature which is using unix time instead of block height number for the locktime.
SO when pushing the raw tx before its time I get code 26 message non final which is fine as the time in the unix clock has not been reached.
Once the time arrived, I tried again and this time I get  non-final (code 64)  Why? And yes the btc from wallet being sent was confirmed at least with 1 confirmation. Here is the raw tx code. Any help would be appreciated as this is driving me crazy.
020000000156ab1d690e27b9d6dc3764233fa73a9749253472443e7d4efd86c7532eb58a64000000006a47304402205531d1b6808572a77bf649d480cb2f4676ead7035ed39bdb1bb1e928d5441a9102205710edaf122ec991ccab08a6945a1a728d08eecae5dbafb1e72c8481e1672f9d012102cbf41593c5fdb8caaf1942e0c4f2256de0a174c85b2d05252a9053dfc08de65afdffffff01a26900000000000017a91432d423f7e7722ed3ab0c87786e877b5f220148708795980460
{
"txid": "5b0b8137b86986fe65b2d07346d7dde9cc94ac9cd20671f5161b3bc76012a995",
"hash": "5b0b8137b86986fe65b2d07346d7dde9cc94ac9cd20671f5161b3bc76012a995",
"version": 2,
"size": 189,
"vsize": 189,
"weight": 756,
"locktime": 1610914221,
"vin": [
{
"txid": "648ab52e53c786fd4e7d3e4472342549973aa73f236437dcd6b9270e691dab56",
"vout": 0,
"scriptSig": {
"asm": "304402203a3c80d8cb01c28558269fdda6faaa7b1b963030b8867d9c0a933b9813c192c802202770970cdb704416c8fe504a9ed518537e983d2cce534fafa02046aa2181bf7a[ALL] 02cbf41593c5fdb8caaf1942e0c4f2256de0a174c85b2d05252a9053dfc08de65a",
"hex": "47304402203a3c80d8cb01c28558269fdda6faaa7b1b963030b8867d9c0a933b9813c192c802202770970cdb704416c8fe504a9ed518537e983d2cce534fafa02046aa2181bf7a012102cbf41593c5fdb8caaf1942e0c4f2256de0a174c85b2d05252a9053dfc08de65a"
},
"sequence": 4294967293
}
],
"vout": [
{
"value": 0.00026092,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 32d423f7e7722ed3ab0c87786e877b5f22014870 OP_EQUAL",
"hex": "a91432d423f7e7722ed3ab0c87786e877b5f2201487087",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"36Kmqv4k5cxigNvgV6Geejn7Cvc7MR3oPt"
]
}
}
]
}
It finally broadcast at 443 pm!  BUT WHY DID I HAVE TO WAIT!!!
    https://blockchair.com/bitcoin/transaction/71b27932fa35bc3fbf8343ea81e497b73b11cad7cda87485484a7e52f542c414

It's most likely because nLocktime is based on the "mediantime" of the previous block... not "exact" unix time.
Due to delays in finding a new block, it is not unusual for "mediantime" and "current time" to end up out of sync by quite a significant amount (1+ hr).
If you don't have access to a Bitcoin Node to check the getblockchaininfo command, then you can use this online API: https://chainquery.com/bitcoin-cli/getblockchaininfo
Check the "mediantime" value and compare with your "nLocktime". Once "mediantime" > "nLocktime", you should be able to broadcast without error.


New altcoin. Cpuminer gives me "booo" I made a new altcoin based on "INSaNe" https://github.com/CryptoCoderz/INSN

I changed genesis hashes using this code:

    if (true  && (genesis.GetHash() != hashGenesisBlock)) {
                     //This will figure out a valid hash and Nonce if you're
                    // creating a different genesis block:
                        uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256();
                        while (genesis.GetHash() > hashTarget)
                           {
                               ++genesis.nNonce;
                               if (genesis.nNonce == 0)
                               {
                                   printf("NONCE WRAPPED, incrementing time");
                                   ++genesis.nTime;
                               }
                           }
                    }
            printf("block.GetHash() == %s\n0x", genesis.GetHash().ToString().c_str());
            printf("block.hashMerkleRoot == %s\n", genesis.hashMerkleRoot.ToString().c_str());
            printf("block.nTime = %u \n", genesis.nTime);
            printf("block.nNonce = %u \n", genesis.nNonce);

So i started coin with two clients on localhost and tried to mine it with cpuminer-multi by tpruvot https://github.com/tpruvot/cpuminer-multi, but miner always gives me booo, please help me...

My OS: Kubuntu 16.04

There is no setgenerate or generate function in this cryptocurrency

00:15:45 setgenerate
00:15:45 Method not found (code -32601)
00:16:03 generate
00:16:03 Method not found (code -32601)

Cpuminer output:

Current block is 1
[2017-07-19 00:16:32] Switching to getwork, gbt version 7
[2017-07-19 00:16:36] CPU #2: 26.28 kH/s
[2017-07-19 00:16:38] accepted: 0/1 (diff 0.000), 26.28 kH/s booooo

Here is difficulty for mainnet:

bnProofOfWorkLimit = CBigNum(~uint256(0) >> 18);

Here is block time:

static const int64_t BLOCK_SPACING = 5 * 60;
/** Block spacing minimum */
static const int64_t BLOCK_SPACING_MIN = 3.5 * 60;
/** Block spacing maximum */
static const int64_t BLOCK_SPACING_MAX = 7.5 * 60;

Here is block version:

static const int CURRENT_VERSION=1;

fixed! The main trouble is time. I set my time in genesis hash +3hrs, i changed my pc time +3hrs and voila! Mining works!


How should webapps handle addresses/wallets? There is a ton of bitcoin information, but it's hard to find up to date best practices for making webapps. I am very comfortable making secure webapps, and I'd like to start some bitcoin related webapps, and using a merchant solution like bitpay is not an option. Could someone steer me towards the right keywords and concepts to do this?

When starting a bitcoin webapp, where each account can send and receive bitcoin, what are the best practices around bitcoin transactions? How are bitcoin transactions around accounts handled for online exchanges? Should each account be set up as a separate wallet? Or is it safe enough to give each account an address and record a balance and transaction history tied to each account? Is it necessary to use bitcoind or are there other methods for making transactions?

What kinds of security/safeguards should all bitcoin webapps have (i.e. is it necessary to have cold storage?, two factor auth, etc)?

Edit: I'd like to originate and also receive bitcoin payments. I want to make it easier for people to get started if they have friends that already have bitcoin. So a bitcoin holder can set up an account. Then s/he can email bitcoin to the friend via the app. The app then emails the friend the transaction details if they already have an account; otherwise it will sends an invitation to create an account along with some intro to bitcoin articles. Paying a X% processing fee doesn't make sense in this case where I expect most transactions to be small.

bitcoind has a feature named "accounts" which does exactly that: handles the balance in separate accounts, which you can map to your users. It automatically generates new addresses for the accounts, can move coins between accounts, etc.

Obviously you must take great care into keeping it as secure as possible.


Public key Exceeding Mod P? A Clarification Request On The Discrete Logarithm Problem I tried to observe / implement the discrete logarithm problem but I noticed something about it; but before I get into it let me give some clarification which is open to correction.

a = b^x mod P

Where as
a = the public key of the address;
b = the generator point of the secp256k1 koblitz curve (this is the
curve in context);
x = the discrete log;
P = the modular integer.

I coupled all parameters below:

A =
044f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa385b6b1b8ead809ca67454d9683fcf2ba03456d6fe2c4abe2b07f0fbdbb2f1c1
(uncompressed public key)
034f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa :
(compressed public key)
B = 04 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B
16F81798 483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419
9C47D08F FB10D4B8 (uncompressed generator point)
02 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B
16F81798 (compress generator point)
X = ?
P = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE
FFFFFC2F

I don't actually know what part of the parameters I should use ( compressed or uncompressed)
N. B :  I tried the uncompressed public key to Mod P but the uncompressed public key exceeded the Mod P in size.
What should I do about this?

It is important to note that the Elliptic Curve Discrete Logarithm Problem (ECDLP) is slightly different from the normal Discrete Logarithm Problem (DLP).
In DLP, the ^ operator is actually exponentiation and it is operating on integers so mod p is just the normal modulus. However for ECDLP, ^ is actually elliptic curve point multiplication. This is different from exponentiation and is a much more involved process. You also cannot mod p with a point because they are not integers. While there is a modulo, it is part of the point multiplication process itself.
The compressedness of the parameters you use does not really matter. In the end, the compression is just the encoding of a point. You need to parse this encoding to determine the X and Y coordinates of the point; both uncompressed and compressed allow you to determine them. The uncompressed just gives you the X and Y coordinates directly while the compressed one gives you the X and whether Y is even or odd so that you can compute the correct Y coordinate. When you do the point multiplication, you are not handling the encoded point as an integer and just multiplying it with x. You are doing elliptic curve point multiplication which is way more complicated.


Ttransaction validation in the bitcoin blockchain I am confused.
What is exactly a validation of transaction in the bitcoin block chain?
Please correct me if I am wrong.

I know we need 6 minner to validate our transaction and those 6 minner check whether we did the transaction or not and after that if they verify that we have done the transaction then our transaction goes to the memory pool and after that minners will try to put our transaction in the new block that they are creating to add in the bitcoin blockchain.

Transactions are validated by nodes before they are broadcasted to the Bitcoin network, and also after they are submitted as blocks.

Here are the basic steps for transaction validation:

Transaction is submitted to a node
The node does some checks to see if it is valid and standard
It enters that node's memory pool and gets broadcasted to other nodes
Miners determine if the fee rate is profitable, and if so, they begin to mine it in the next block
Block is submitted when a single miner solves the proof of work
Miner submits the block to a node
Node checks entire block including transactions
If its valid, it broadcasts it to other nodes.
Every additional block adds another confirmation to the transaction

6 confirmations is common for wallet software to consider a transaction final. That might be where you got the "6 miners" from.

Note that usually miners get and submit the block to the pool software instead of the node directly.


Is it possible to generate a complete public address with vanitygen? FAQ says it's possible to use vanitygen to search for a match to a complete address yet when I input a complete address I get an "is too long" error message. Is there a way to run vanitygen using a complete public address?

It's so unlikely to succeed that it is not being offered. One could be tempted to say it's not possible:

Your chances are along the lines of 1 to 2^160. That is 1 to 4.666587*10^172, or very roughly rounded, 1 to 5 followed by 172 zeroes.

To put that in perspective, if you could create a billion addresses per second, the expected time to find a collision would still be longer than the age of the universe.


why i can't find blk0001.bat and blkindex.bat on my computer my bitcoin-qt client'data is at the "C:\Documents and Settings\Administrator\Application Data\Bitcoin", but i can't find the blk0001.bat and blkindex.bat two files on this dir

The extension of file names you are looking for is .dat, not .bat.


Lost bitcoins on smartphone after resetting it, although I backed it up before I lost my bitcoins after resetting my android smartphone. Is it possible to get hold of my lost bitcoins?? I did back up my smartphone before I reset it. So after I reset the phone all my apps were there including the bitcoin wallet( by Bitcoin Wallet Developers), although the wallet was now empty.  Can someone please help me with this?

Go to the Menu->Safety->Restore wallet and select the backup file and enter the password you encrypted with.


Signature scheme for P2SH I am trying to sign a raw transaction that spends output #2 (txindex 1) from this transaction: 267c6d75851efa18afb7edeb2da00c09afc575231db84b3277fc7ea3e174ecbd

The output is a 1-of-4 multisig P2SH and I think I may have a mistake in the transaction structure used to generate the signature. The signature I calculate is different (as in cryptographically different) to the one that bitcoin core gives me using signrawtransaction.

As I see it this is the transaction structure which must be signed:

Version:   01000000
TxIn:      01 bdec74e1a37efc77324bb81d2375c5af090ca02debedb7af18fa1e85756d7c26 01000000
subScript: 17 a9 14 37fe3f20433380be4c742c978d3a9712c509656e 87
Sequence:  ffffffff
TxOut:     OUTPUTDATA
Locktime:  00000000
Hashtype:  01000000

The double-sha256 value used to calculate the signature is 9d384de385512525b4faf08c97651e410e77f2906aa8baeefdee151cc0994655

But the Bitcoin network rejects my transaction calculated from this transaction structure.

I will happily provide more information such as redeemScript and pubKeys/privateKeys if the mistake should not be in the transaction structure.

Any help is appreciated! Thanks!

For P2SH transactions, the redeemScript is what is put in the scriptSig for the transaction preimage, not the scriptPubKey of the output.


Why did my BCC disappear from my Electron Cash wallet? I use electron cash to manage my BCC, I followed the instructions of electrum.org and sent my BTC from my electrum wallet to a new BTC electrum wallet. I waited for the transaction be completed, then I used my old seed now empty of bitcoins to export to the electron cash, and my BCC appeared in my new BCC wallet. I made two small transfers of my BCC to Bittrex and the transaction was ok, at this point everything was ok.

When I do the transaction my electron cash BCC wallet start to synchronize and all the rest of my BCC (ALMOST 90%) in my Electron wallet just disappeared, the BCC wallet shows the last transaction of BTC but nothing about BCC, even the two small transactions of BCC disappeared from the transaction history. Now my BCC wallet is completely empty, what happened? Sounds like some interference between the two blockchains, can someone please help me find my BCC? Thanks

Go into your Electron Cash "Tools">"Network" settings, uncheck "select server automatically" and choose a "BCC"/"Electron Cash" server.  Electron Cash has a bug where it sometimes connects to the wrong blockchain.


Can bitcoin history be changed? It is known that historical database of all bitcoin transactions stored in blk*.dat files. Is it possible for bitcoin-core to change any of this files in any time? Or this database is equal for all bitcoin peers (may be except the last few files)?

I think this files consist non-changable historical data for blockchain. Is it true?

Yes, Bitcoin Core can and will change the blk*.dat files, which, as has been told to you many times before, can be different for all nodes. Once Bitcoin Core has validated a block, it updates its chainstate database so that it knows what its current blockchain tip is. It also updates that database with the most recent UTXO set. So once this is done, the block can be thrown away as we have now recorded that we validated it. This is what pruning does; it throws away old blocks that we have already validated. Having the correct chainstate (UTXO set and blockchain tip) is all that matters.


Where can I find resources for programmers to understand Bitcoin? I am a senior Python developer.

Recently I came across to the need of fully understanding how bitcoin works on it's core. The Internet is full of explanations and tutorials for regular folks and even dummies. You can get familiarized with it pretty well if all you care is basic understanding, so that you could start using it.

But I am in a different business here... I want to know exactly what data is being sent to the net on every event of bitcoin currency? How it's being sent? How it's being received? What exact calculations and code is being executed on miners? What code is executed on wallet owners... etc?

Can somebody come up with a decent programmer oriented step by step explanation/tutorial on this?

The book Mastering Bitcoin would be a good solid start (although it might not answer all your questions). It is also available for free.


How do mining pools distribute work effectively? What does the mining-pool architecture look like? Obviously GPU's can hash data much faster than it can be distributed via the internet, so I assume pools must allocate a range of nonces for miners to work on at any given time?

So if there were 2 miners, would the pool server allocate nonces 1-100,000 to miner 1, 100,101-200,000 to miner 2, then keep allocating the work as each set of nonces are completed? Or do I have it wrong?

I tried digging into the source of Eloipool, but it all seems very cryptic/there is very little (if any?) documentation?

Traditionally, pools gave miners work units covering the entire nonce range 0-4,294,967,295. When the miner finishes work, he requests a new work unit with a different extraNonce (or payout address). Different miners also get work units with different details.

To reduce load, pools are now moving on to a setting where the miner can himself change details of the generation transaction and compute the Merkle root, so he can do as much work as he pleases without needing new assignment from the pool.


Transaction vaildation I have understood that miners validate the transactions by checking for double spends and that the transaction was not already confirmed, what I don't understand is how the miners are able to do this when all the data they have is the transactions.

Do miners maintain a UTXO set that has the UTXO details of all
nodes in the network? If that is the case it might be possible that
the UTXO sets maintained ny different miners is different at a given
point of time right.
Now once the block is broadcast to the    network, we know that
other miners express their acceptance to the    block by mining the
next block on top of this. But before that they    validate the
block that was just published. How do they validate this    block?
Also why will they have to care to do it when they can save    time
by creating the next block? Is it that we are assuming honesty
from miners who are actually interested in making money?

First of, each node on the network maintains an UTXO-set. Not only miners.

to 1. The UTXO-set is created by applying all transactions in each block in the chain from the beginning. All transactions that remain unspent when reaching the chain tip are in the UTXO-set. The older a block, the higher the probability that the whole network has a equal block. Equal blocks result in an equal UTXO-set.

to 2. Each node validates blocks, not only miners. A block is deemed valid, if it follows the consensus rules. One consensus rule is, that each spend transaction (TXO) must be in the current (pre-acceptance) UTXO-set or a TXO created early in the same block. Block validation does not interfere with the actual mining (only for a short time, when the block is accepted and a new blocktemplate has to be pushed to the ASIC). Validation happens on the host CPU and the actual mining part happens in the ASIC. If a miner doesn't validate an invalid block, he wastes his time/electricity/money with mining an invalid block on top of the previous invalid block.


Bittrex API, generating a wallet address for XRP returns a tag but no address So I'm trying to generate an address to send XRP to Bittrex via their API. They return the JSON as such:

{"Currency"=>"XRP", "Address"=>"2705xxxxx"}

Do I just use the tag given and assume the actual XRP address will always be the same?

Am I not allowed to make multiple "destination" addresses? Say I want to send 100XRP from A->B (on Bittrex) and then another amount say 250XRP from C->D (on Bittrex).

Thank you!

No you're not allowed to have multiple addresses on Bittrex and by so a generated addresse will always be the same. You can confirm it


What are the odds of discovering a block as a solo miner? I understand that during mining, one does not discover individual coins, but rather blocks of coins, and I heard that one block equals many coins (but how many?). I am wondering though, as a solo miner, what are the odds of discovering a new block? I guess this depends on my hardware but if we say that a GPU is 10 times faster than a CPU, and a $10 USB ASIC device is 1000 times faster than a CPU, and a $300 mining box is 5000 times faster than a CPU, perhaps one can adjust the odds estimations to reflect that.

Also, how many BTC would I obtain if I discovered a block?
This website http://blockexplorer.com/ seems to how a variable number.
But it seems a bit like winning a lottery.

Take the total network Th/s and divide by your total Th/s. That number gives you you a number that tells you how many blocks will occur before you get one (on average).

So if there is currently 3,666 Th/s on the network, and you have a 0.55 Th/s (like you would if you have a $5,000 KNCMiner Jupiter ASIC), then 3,666/0.55 = 6,665.

That means you have 1/6,665ths of total hashing capacity.   There will be 6,665 blocks before you get one.

So if there are 144 blocks in a day, then you need to wait 46.28 days to get a block when mining solowith that hardware.  But that is assuming difficulty doesn't rise.   So what will happen with a rising difficulty is you end up waiting much longer even, and possibly never end up getting a block when solo mining.

That's why solo mining is not as profitable as using a pool for anyone without tens of Th/s nowadays.


How does one calculate the profitability of GPU mining? As GPU mining made CPU mining non-profitable, at some point in time more specialized mining hardwares (FPGA and ASIC) would make GPU mining non-profitable.

When is GPU mining considered not-profitable?

Considering $1000 rig, $0.2 per kWh and one year break-even period,
at which difficulty does GPU mining become non-profitable?

Or, what is the formula to find out "max non-profitable Mhash" for given parameters like, rig cost, power consumption, investment break-even period, difficulty, exchange rate, etc. (please ignore redundant parameters, and include more parameters if required.)

Or, whats the current "max non-profitable Mhash"?

Or, what is the required current energy efficiency (Mhash/J = millions hashes per joule) for mining to be profitable?

(energy efficiency; 1 joule of energy is 1 watt during 1 second: 1 J = 1 W*s)

For given parameters, Max. Non-profitable Hash Rate, is breakeven point for hash rate after which mining becomes profitable.

Using the Bitcoinx calculator, I found that a $1,000 rig with a 300 W power draw would need to have 750 MHash/s just to break even on power at $0.20/kWh at the current difficulty (3,438,909), exchange rate (13.13), and block reward (25).

You'd never break even on the rig itself. Thus why GPU mining is on its way out.

For a more absurd example, I priced out a reasonable rig for ~$1,405 with three Radeon HD 7970s, the best mining card combo - 2050 MHash/s - on the market at the time of this writing according to the Mining Hardware Comparison chart. Its power draw would be around 850 W, according the MHC and a quick review of the parts. This rig would never be profitable at $0.20/kWh. Hell, at my electric rate of $0.07/kWh, it'd take nearly three years just for a return on investment. Prior to the recent halving, this same rig would make a return after just ~260 days.

More proof that GPU mining is on its way out.