text:
Lightning Network node collusion
I' m learning about Bitcoin and LN enjoying Antonopoulos's excellent "Mastering Bitcoin" book
I stumbled upon Figure#7 in Chapter 12
https://github.com/bitcoinbook/bitcoinbook/blob/develop/images/mbc2_1207.png
Would it be possible that instead of completing step 7, Diana sent R to Bob, that would then complete step 9 and only after that Diana complete step 7; leaving Carol scammed? I know LN routing is based on Sphinx; but that doesn't completely eliminate collusion, i.e. Bob and Diana being the same node operator that sees a payment to and from Carol for a similar amount, at a similar time
This could be prevented, IMHO using for instance multisig and revocation keys where R is just 1 of 2, being the other a channel-specific revocation key.


text:
Do Trezor wallets always generate the first account at the same index?
When a user sets up their Trezor hardware wallet to store bitcoin, does the wallet always create the first account at index 0? Is it possible for a user to generate an account at subsequent indices if there are no funds at the previous index? (i.e. a user creates an account at index 1 without having created an account at index 0)
For context, I'm working on a project that integrates with the Trezor Connect API and I want the user to be able to query their bitcoin balance from the accounts on their hardware wallet.
EDIT: For clarity, I'm referring to the account and not the addresses derived from that account. The Trezor Suite does not seem to allow subsequent accounts to be generated if a previous one is empty as shown in this screenshot but my goal is to be able to calculate the balance of all or some of a user's bitcoin accounts so I would need to know at which point to stop looking for new accounts.

does the wallet always create the first account at index 0?

Yes, the wallet derivation path defaults are declared in the trezor suite wallet source code. https://github.com/trezor/trezor-suite/blob/5377ec9e20d5e37951db2ad4a8bbeca437ed8d69/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts#L115
{
    name: 'Bitcoin (legacy)',
    networkType: 'bitcoin',
    accountType: 'legacy',
    symbol: 'btc',
    bip44: "m/44'/0'/i'",
    decimals: 8,
    explorer: {
        tx: 'https://btc1.trezor.io/tx/',
        account: 'https://btc1.trezor.io/xpub/',
    },
    features: ['rbf', 'sign-verify'],
},

const result = await TrezorConnect.getAddress({
    device,
    coin: legacy.symbol,
    path: `${legacy.bip44.replace('i', '0')}/0/0`,
    useEmptyPassphrase: device.useEmptyPassphrase,
    showOnTrezor: false,
});
if (result.success) {
    return result.payload.address;
}

Is it possible for a user to generate an account at subsequent indices
if there are no funds at the previous index?

Yes, under the receive tab of the wallet. Although it shows index 0 by default, there's a "+ More Addresses" button the users could click on and send BTC to a higher index prior to receiving anything at index 0. A user going too far ahead of the index on their own doing can complicate the way an HD wallet works due to look-ahead gaps. See https://bitcoin.stackexchange.com/a/54664/26873

Hey @m1xolyd1an, thanks for the reply.
I see that you can add more addresses and create gaps for a particular account. In my use case, I'm concerned about a user creating gaps at the account level. In the suite, I see that it blocks them from adding new accounts if the previous one is empty. Is there any other way for them to create gaps at the account level? Screenshot for clarity

source: Stack Exchange

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

sort: votes


text:
How to get an address's balance with the bitcoin client?
I want to see the balance of some address using bitcoind.
I set txindex=1 and did a -reindex to get all transactions indexed.
But still, there doesn't seem to be a way to get balances of an address. getreceivedbyaddress doesn't work with addresses out of your own wallet (I hoped it would after a -txindex=1 -reindex, but it didn't).
I'm wondering why blockexplorer.com's getreceivedbyaddress can do this for any address but the default client cannot. If you download and sync the whole blockchain, you should be able to query it for any information, right?

While I don't know the answer to your question, I would like to point out that txindex is not relevant here, as the client does not need the full index to get the balance for any given address.

I thought it might, but indeed it doesn't seem to be so.

found any solution ?

@coding_idiot It's not possible (intentionally) to query for any information using bitcoind. It only maintains an index for transactions that are relevant for your wallet.

You can use api of some bitcoin exploer like https://api.blockcypher.com/v1/btc/main/addrs/38DGj87axzmQiZeAd1w1y5FEmuu5a7pfBa.   There is also some opensource exploer like https://github.com/blockcypher/explorer

By default, what is maintained by the 0.8 blockchain engine is:

All blocks
A database with all block headers, and the positions on disk for each block
A database that represents all unspent transaction outputs (UTXOs), indexed by txid, at the current tip of the block chain
Undo files that allow rewinding the effects of blocks on this set of UTXOs.

Nothing related to addresses or balances exists at this level. That is just a client-side representation of the data. The balance of a wallet is the sum of the values of the UTXOs that are spendable with the set of keys in the wallet. You could define the balance of an address as the sum of the values of the UTXOs assigned to a script matching a given address (and this is what several sites do), but presenting it this way is quite confusing - it makes many people think that Bitcoin transactions transfer value from one address to another. This is not true, they consume specific outputs of a previous transaction, and merge and split those into new outputs.
The -txindex option you mention, adds one more thing that is maintained by the validation engine:

A database with the positions on disk for each transaction, indexed by txid.

This was added to make the getrawtransaction command work with historical transactions, but again, this has nothing to do with addresses. A database that indexes the UTXO set by address, or even the entire block chain history by address would be possible, but it would be relatively expensive to maintain, and shouldn't be necessary for normal operations (though it is quite useful for debugging...).
Where such things do belong, is in the wallet. The wallet as presented by the reference client does not use "balance of an address" - it rather sees addresses as entry points into the wallet, but manages the coins in the entire wallet together, regardless of what address they were last sent to. This also confuses people who are used to look at blockexplorer-like websites, when they realize that for example change is always sent to a fresh address.
So, to give a real answer: if you really want to track a balance, you need the wallet interface. Right now, this is quite unflexible, but there are plans to improve this situation soon. We'll hopefully soon get support for multiple wallets, and watch-only wallets, where you can just add addresses you'd like to track, without having their keys.

Maybe you should add a small section on how to calculate the information I am looking for using the current bitcoind functionality. I suppose I have to use listunspent or something like that? Or is it really just impossible?

It's just impossible, unless you have a wallet with the keys in it.

Well, not impossible in theory: if you have -txindex enabled, you can iterate through all blocks using getblockhash and getblock, iterate through all transactions in each block using getrawtransaction, and look for outputs crediting the address you want, or being consumed in an input. This would likely take hours...

Is this because the client only checks for transactions including addresses in the wallet? I cannot see a reason why private keys would be needed for that process.
If I'm right, this is just a shortcoming from the original client that only wants to index balances for it's own addresses. And that, if implemented, it could even so do this for any other address?

It doesn't index any address balances at all, but for addresses known to the wallet, it tracks them (during download/sync/rescan of the blockchain). And this is indeed a shortcoming. There's a planned feature to allow "watch-only wallets", which would allow importing addresses instead of keys.

It looks like this might almost be possible soon: https://github.com/bitcoin/bitcoin/pull/2121

Has the situation changed ? Is there any way now ?

Yes, use watch-only addresses.

@PieterWuille Hi, are there some changes connected with bitcoin address balance detection? Could I receive the balance for some bitcoin address from the deployed full node directly? I mean without UTXOs parsing?

@PieterWuille This (accepted) answer that you wrote ten years ago has become outdated and is no longer correct. I was going to prepend new information to your answer, but I thought you might want to do it yourself. Your answer would certainly be better than mine! Thank you for your years of dedication to Bitcoin.

import all address using "importaddress"
you can get balance using "listunspent", but you must sum all unspent amount per an address.

"We'll hopefully soon get support for (...) watch-only wallets, where you can just add addresses you'd like to track, without having their keys."
                                                                  –Pieter Wuille

From what I've seen, Pieter Wuille and others included this feature in Bitcoin Core release 0.10.0, so that now it is possible to use Bitcoin Core to get the balance of whatever address just by following these steps:
1) Create a new wallet (stop the program, rename the old wallet.dat file, restart the program and it will create a new empty wallet.dat).
2) Start Bitcoin Core, and go to Help > Debugging Window > Console.
3) On the console's command line, execute the following command:
importaddress the_address_you_are_interested_in
Note that this will cause the program to rescan the entire block chain, which can take several minutes.
Then you can close the debugging window. Now the main window of the program shows two columns of balances, the first one is the balance of the normal addresses in the wallet (the ones whose bitcoins you can spend), and the second one is the balance of the watch-only addresses in the wallet. This last one is what you were looking for.
Once you are done, you can stop the program, delete or rename the wallet or move it somewhere esle, and rename the old wallet back to "wallet.dat".
Note that the Bitcoin client must have an updated copy of the entire block chain, as the default rescan=true option of importaddress doesn't accept pruned block chains, and rescan=false won't show the current balance.
I have not tried this and I'm no bitcoin expert, so take this answer with caution.

Interesting to know. Would this also be possible on the command-line only? How would I be able to query for the output after the indexing finished?

This comes from the Original Bitcoin client/API calls list regarding the command getreceivedbyaddress.

Returns the total amount received by  in transactions with at least [minconf] confirmations. While some might consider this obvious, value reported by this only considers receiving transactions. It does not check payments that have been made from this address. In other words, this is not "getaddressbalance". Works only for addresses in the local wallet, external addresses will always show 0. [Boldness added by me.]

Technically you are right; the blockchain carries the information you are looking for. The original client however does not have the function to compute it.

I knew that it was noted like this, but I wanted to know why it was so and if there is a workaround method to eventually achieve what getreceivedbyaddress cannot.

I'm sorry, but how is it that you're using getaddressbalance?  What version of bitcoind are you using?

How can I use getreceivedbyaddress? To what should I send it? Is there any simple example of this command or any other?

@earthmeLon - I presume that the getaddressbalance @jorijnsmit mentioned was just a hypothetical command.

I think it does exists via RPC: https://bitcoin.org/en/developer-reference#getreceivedbyaddress

It doesn t returns any amounts in the case of 1 of n bare multisig even if recognized as ismine.

The concept of an "address balance" is based on confusion.
The way Bitcoin is designed, there are three different concepts related: addresses, wallets, and accounts. Wallets are comprised of one or more accounts, each having a balance (which may even be negative). The wallet as a whole has a balance totalling the sum of all accounts (which must always be positive).
Addresses are merely entry points to a wallet; they do not have balances, and should only ever* be used once. Addresses are associated with an account: when coins are received on the address, it credits that account - note that this is a one-way association: the account is not associated with the address, nor the coin received; its balance is simply increased by the amount received. When you spend bitcoins, your wallet chooses coins to spend at (more or less) random, with no concern for how they were received, and will usually use a completely new invisible address internally with itself, that you will not see as an end-user. Overall, these are some of the reasons why it makes little sense to talk about an "address balance".
* While it is fairly common that people reuse addresses for deposits or donations, doing so is harmful to yourself and others using Bitcoin in a number of ways which are outside the scope of this question.

On the contrary, accounts and wallets are not real, while only addresses are. I'd say all unspent outputs with a given address constitute the address's balance. There needs to be a way in bitcoind to query the list of unspent outputs for a given address (irrespective of whether it is in my "wallet" or "account")

@Jus12 You can use the scantxoutset RPC for that now, which scans the UTXO set instead of the entire blockchain.

I have written a program in Python3 that allows you to search for any address on bitcoin core whether it belongs to your wallet or not.
Here is the github link:
https://github.com/ORP967/Bitcoin_Core_RPC_par_address
Let me know what you think or if you have any improvements you might have.

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

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


text:
Is it possible to create an address from a predefined private key?
I was not sure how to formulate the question title. What I want to achieve is the same as VanityGen and many other tools do to create an address starting with a predefined part, but with private keys.
So basically I want to create a Bitcoin public/private key pair of which the private key begins with a string I define.
Are there tools that already do this? If not, is it possible? How should it be done theoretically?

You can choose the private key to be whatever you want, and calculate the corresponding public key and bitcoin address.
Adding to this answer, there is really no reason to want to do this. But if one really insisted, here is a way to do it with hal. First start with generating a random private key
$ hal key generate
{
  "raw_private_key": "7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898",
  "wif_private_key": "KzycuDEqJaMyjHWJDD9cdyPeH1rtCTgE5m1EHfCdnTs4ng2D43Bt",
  "public_key": "02260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4",
  "uncompressed_public_key": "04260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4349d9106ee1724cf51c954e6aec9522febd7fcb46d7248a0ce390810fc0ac6a0",
  "addresses": {
    "p2pkh": "1J6wqBd7QVGt7vGCNfUShoDEwQg2LFTgRR",
    "p2wpkh": "bc1qhwvl6yyrtheep7rmsxmf536m45dzfz4wrxdacu",
    "p2shwpkh": "3QLdovvKokkyiyX3jTzgfaMCv9MiaoVW5C"
  }
}%

Then change the beginning of the raw private key to deadbeef or whatever you want
7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
->
deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898

Then get the address for it
$ hal key inspect deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
{
  "raw_private_key": "deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898",
  "public_key": "02de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60",
  "uncompressed_public_key": "04de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60b142aa0a4f495e16f80f811ec4556e3d33be28c930fab6e6a051e9a5bdc91d52",
  "addresses": {
    "p2pkh": "1BhftRM4fNZRYdDYMUdujq9C84bRX84Qf8",
    "p2wpkh": "bc1qw439kmezxvdff0hnalmeqvfsnttd9gkjux5rct",
    "p2shwpkh": "34KVR36eoQrf48bmjQ46JU5dGVg1gqdUFg"
  }
}%

However, the more predictable the private key is, the weaker your security is. You don't want your private key to be "password" or expect your wallet to be empty.

No I just want to know a specific part of it so that I can write the rest down and add additional security to remember a part myself.

@AlgolCobol, How can I create such a priv/pub key pair?

Still the question is only answered partially. "Are there tools that already do this? How should it be done theoretically?"

@StevenRoose: At this point, you wrote the complete answer. Might have been better to post it as your own and accept that then. ;)

The most common way is to create the public address, compressed or uncompressed from a hex value, through the elliptic curve, hashing and so on.
Please check this awesome web to see the whole process and with different options to start: link
And if you like to check python code to see the whole process: here

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


text:
Do I need to move bitcoins stored in a paper wallet?
In mid 2012 I used bitaddress.org offline to generate address/private key pairs. I purchased bitcoins and had coins sent to these addresses. Do I have to move these bitcoins to keep them in the active chain? (I've read about the May 15 deadline to update the client, but never use a client).

Uh. No.. leave them be. Unless you need  to spend them.

A high quality answer on Bitcoin.SE would remove confusion about an "active" chain and inform @d-a-w that the requirement for the May 15'th update applies to Miners in particular.  (etc)


text:
To buy or not to buy Amazon Coin?
This article talks about amazon creating its own crypto currency, the Amazon coin.
You can buy the coins at a set price in Amazon
Is this worth any bother? It seems like you cant trade amazon coins for Bitcoins. Did Amazon jsut create a self regulated Crypto currency that is a massive smoke cloud to use the word Crypto in Amazon and generate some interest?
Or Should i buy 10000? and wait for the price to go up?

The word "crypto" doesn't appear in that article at all.

This question appears to be off-topic because it is not about a cryptocurrency.

The price wont rise, they are issued and redeemable by Amazon. Think of it as loyalty points you would receive from your local supermarket to use later rather than a cryptocurrency.

Yea so they used the technique behind Bitcoin engine, and twisted into their own little tracking system for money. ITs good for them but evil for the freedom of Crypto. I bet they track everysingle thing that happens with those coins.

Not sure they are using the same bitcoin engine, do you have a reference for this? I think they are only using it within marketing terminology, not architecturally the way it works.

Well they claim its a crytpocurrency. So it must be based on something that originated from bitcoin, since Bitcoin is the origin of CryptoCurrency. Its propriertory and closed and hacked to hell most probably... But with that comes vulnerrbility. I just cant wait for the first hack stealing Amazon coins, then amazon taking stolen coins away from people who thought they were buying legitimate coins. I can almost foresee this happening. They shoudl just have used BitCoin! :)

@pyramids: Right, Amazon seems to call them a "virtual currency" but not a cryptocurrency, as far as I can find.  Even this seems inaccurate, because I don't see any mention of it being possible to transfer Amazon Coins between users.  So I think you're right, they are just credits that you can use to buy stuff from Amazon only.


text:
Bitmain Antminer U3 keeps going Zombie
I got 2 U3 running on Linux Ubuntu cgminer 4.9.0.

Dedicated Power Supply
New short USB cables
Cold room ambient 5 degrees celcius (heat sinks don't go over 40 degrees)

Not once have I managed to run them longer than 24 hours. Does anybody know why they keep going ZOMBIE?
Once they go ZOMBIE like this they are not detected by cgminer and sometimes show in lsusb but not always. The only way to fix this is to remove USB cable and Power, restart cgminer, then plug power back in and USB.

This is a known and notable problem with Antminer U3s.  It's discussed at various locations around the Web.
The design couples the USB and miner +5V power rails, which is not good practice.  USB interfaces should be both electrically and optically isolated.  When a unit goes ZOMBIE, it generally requires unplugging and replugging to restart it, which fits with the above.  Some commenters claim that cutting the power lines in the USB cables improves reliability.
However, the maintainer of cgminer comes right out and says that the design is inherently unstable.  In light of my own experience I agree.  I ran three Jalapenos on a dedicated Pogoplug linux system for a year with no problems.  Two U3s have been on the same Pogoplug for two weeks now, and neither has run for 24 hours straight.  They're going back to the seller tomorrow.
Long and short of it, if you get a stable unit it will serve you well.  But most of them are unstable to at least some degree.

I sold my 3 units and got a BFL 750Gh/s for the same price (+ new power supply) of eBay. Been running stable for weeks. Also ran 15 x U3 USB sticks before, stable for several months. These Antminers are a poor attempt of something..? (Running on Ubuntu cgminer and bfgminer)

Using CGMiner 4.9.0
 I have been trying for MONTHS to get all five of these to all work at the same time without ZOMBIE
and ERRORS that make the whole process a waste of time.
I did the Zadig thing, a million times, can do it in the sauna, while reading bad Hungarian poetry.
All my devices are running the right drivers.
I tried new power supplies, new cables, new software...NOTHING WORKED.
I want all 5 U3 Miners running normally at once on the same machine!
I could get them all to run in 2's or 3's, but with 4 or 5 they would hash at ridiculously low speeds, and crash to zombie a LOT.
I could run ANY THREE at a time, but 4 would start the errors and crashes all over again.
Well, I bought FIVE of these, and I am determined. So I start moving things to a different directory, to "start all over" and while doing this, I notice... I HAVE TWO EXPLORER WINDOWS OPEN AT ONCE. I think to myself. TRY OPENING TWO CgmINERS!!!
  OK, Now what? one is running 5 U3's terribly, and the other is whining about all the devices being busy, or not there, etc.
so I Disable two of those first 5 with the USB Menu in CGMiner. THen I BLACKLIST THOSE TWO.
   I look at the other window and VOILA!! The two I blacklisted from one CGminer are now hashing like crazy in the other one! I have 5 U3 Miners running at once on the same machine! And if one goes ZOMBIE, the other miner grabs it and wakes it back up!

Here's the setup for the BAT file...
 --au3-freq 238 --au3-volt 775
 I am so happy, I wanna give myself a kiss!!!

This is pretty genius discovery.. hahahah! Well done mate! I sold mine and got a BFL Monarch. Plugged in, setup, running for months without problem :)

did you read the manual?

To prevent the interruption of USB power supply, please ensure the
  computer is not in standby or sleep mode. Otherwise, the cgminer wouldn’t find
  the miner even make it ZOMBIE.

source: Page 4 of https://www.bitmaintech.com/files/download/AntMiner-U3%20user%20guide.pdf

I think I might have cracked the issue with the U3 going zombie. I'm sure most miners have their computers set to never sleep, so perhaps the user guide is not specific enough. Under Windows 10, I've gone into device manager, listed devices by connections, found the USB to UART bridge, and then under the power management tab set windows to never set the device to sleep for every hub down to the root hub. So far running a treat.

I was running mine under Linux.... I wonder if there is a similar setting? Well, I had other miners running for months without ever going zombie.. so I doubt it.. lets see how long it goes for you. I bet not longer than 48hours :(

It has been going for more than 48 hours, but I had to restart it at one point when the output dropped from 63GHz to 45GHz. This has happened once before once I've left my humble abode and it is probably a heat issue when the environment gets stuffy. Only good thing about it, is after such an occurrence I hardly get any HW errors, when it usually churns out about 2% duds.

Hmmm. I had that droppage too, but mine were running in 20 degree Celsius server room, and also repasted (cause somebody thought all that past was causing an issue- didn't solve it for me) Well, maybe you solved something in a Windows perspective then... couldn't think what the Linux equivalent would be that.(running on Ubuntu server headless, so it must be tuned to always stay online as there is no sleep or hibernation support there) If it zombies.. let us know. or forever be silent in happiness :)

God damn walking dead. No more U3's for me.

Sorry bro :( they arę just f@ked those things. Well sell them quick.

Suppose the lump of dung will have to do for now. For the cost of it, it outperforms the USB stick by a mile, even if I need to restart the thing from time to time. USB U2+ sticks hardly make an impact, and a bank of them on a powered hub soon adds up in cost for very little hash rate. I really can't guarantee the operating environment of a BFL, so I'll live with what I've got until I am in a position to operate a decent unit. Might have to try the 2 cgminer trick outlined in this thread.

OK- Here was my .. crappy solution for a while. I put a wall timer on, connected the USB hub power to that and made sure all the U3 were powered from that. set it to go power out for 15 minutes.(that was my min) It is important to reset the USB buses and the U3, hard cycle completelty. After power up they restarted... mostly. Sometimes I had to restart cgminer. You need to make sure USB hub is NOT powered from PC.. usually means doing somethign with the cable.

Have the same problem, keeps getting ZOMBIE.
I solved the problem but power cycle my controller which is a custom beaglebone board, power cycle is made fully automatic by cron jobs.

Yes. Only power cycle helped me too. Can you post some pics or details. Just in case somebody else wants to something interesting and make your answer better.

i made init.d script. using screen and crontab issues poweroff or equivalent command  to power cycle the controller board.

Hey Friends,
I run the the Antminer U3 with Minera 0.6.1 and the latest official cgminer on my raspberry PI 1 B -> Stable arround 60 GH/s with these Extra settings:
--au3-volt 825 --au3-freq 237.5          = 60 GH/s
--au3-volt 825 --au3-freq 225.0          = 55 GH/s
---> It will start everytime with 4 HW errors, but then after some minutes it will go stable

I added a timer to my rig to powercycle it daily as reboots didn't work anymore. Then this started failing after 3-4 hours of processing.  I've adjusted my setting to 237.5 MHz, 825mV and have been stable for a couple of days now, still power cycling it daily.

I've recently obtained a U3. I've experienced the zombie issue at 250MHz, 830mV settings. Sometimes cgminer wakes it up again as AU3 1 instead of AU3 0, sometimes it does not. I also have a U2+, so I use the --usb bus:dev option to run them in separate cgminers.
I experience a much higher HW rate error on the U3, even at stock settings. HW errors on the U2+ running at 250MHz are rare.
So far it is running stable again at 237.5 MHz, 800mV. The default is 225MHz, 750mV, which is 3.33mv per MHz. It could be that running below that is causing the zombie issue. Might try 250MHz again with a higher mV once I am happy at this setting. I have my U3 sat on my computer top front exhaust fan, which is very cool as all the CPU/GPU heat is being blown out of the back.


text:
Euros to Electrum Wallet with FIDO U2F security?
I do not find a method to buy bitcoins with my Credit/Debit cards and/or deposits in Bitfinex.
Maybe, other options exist.
It seems that it is not the right way, but instead I need to use some of these things here https://bitcoin.org/en/exchanges
Anycoindirect.eu accepts euros but does not provide Fido U2F security.
Bitcoin.de and bitpanda.com seem to be also small players.

Anycoindirect.eu - feature request email sent, but no promise about the schedule.
Bl3p.eu - No key support there, but they promised to consider it in my feature request email and will inform about the update soon.
paymium.com error Yubikey OTP is invalid in their system, mailed to dev.
https://therocktrading.com/en - feature request email sent and they confirm that they are working on it but no schedule.

Other thing about the identification about the user. Why they ask it? Etc  pictures about passport, residence, ...
Bitcoin market places tried: Bitfinex, Anycoindirect.eu, Bitcoin.de, Bl3p.eu
OS: Debian 9.1 Stretch
Bitcoin wallet: Electrum 2.7.9
Keys: Yubico 4 keys


text:
Solo mining in Sep 2017
Is solo mining still doable today?
What is needed to tackle a whole block under a month alone, 100x Antminer S9, 100THash/s?
Another question, does location play a role in this? Would it matter if the "farm" is in Southern Africa away from most Bitcoin users in EU, US, Asia, would another miner that is closer to the "requester" always get the block first? Please advise!

What is "needed" depends on how much money you want to earn.  You can use a mining calculator to figure out how much that would be.

Hi Nate. By needed, I meant be able to tackle a whole block alone in less than a month. I'll update my question, thanks!

The most valuable thing is a source of cheap electricity.

To achieve a whole block solo in a month you're going to need about 1500 TH/s
https://www.coinwarz.com/calculators/bitcoin-mining-calculator/?h=1500000.00&p=2600.00&pc=0.10&pf=0.00&d=922724699725.96300000&r=12.50000000&er=4486.23010000&hc=0.00
Just to double check that: https://blockchain.info/charts/hash-rate
Total hashrate: 7Million TH/s divided by 6*24*365/12 = 4380 blocks a month = 1598 TH/s
So you need about 115x AntMiner S9s which cost about US$ 1,288 each, so US$ 148,120.
But then the last block generated US$ 60,900 of bitcoin (14.4BTC).

Would it matter if the farm is in Southern Africa away from anyone, would another miner that is closer always get the block first?

Closer to what? There is no centre. And as blocks take an average of 10 minutes to produce, and they are small (1MB), so while there are race conditions they are the same for everyone everywhere.

You pretty much answered my questions! :) Don't see anyone disagreeing with it, thanks!

@emotality cool, click the tick/check mark near the to accept the answer

Note that the quoted hash rate means you will mine an average of one block per month.  It follows a Poisson distribution, and there is a 37% chance you will mine no blocks.

Location DOES matter for the price of your power. That basically defines your profit, high power rates will result in a big loss.

Hi, thanks for your answer. But I meant location as in connection-wise not power-wise.

Internet connection latency hardly matters. As long as you have a reliable connection you'll be fine.


text:
BCH ABC testnet Faucet?
I want a bitcoin cash ABC chain (BCHABC) testnet faucet.
Cause 15th Nov. onwards after a hard fork on bitcoin cash network existing bch faucets are not working. Even questions over here are also not upto the mark https://github.com/Bitcoin-ABC/bitcoin-abc/issues?utf8=%E2%9C%93&q=faucet

It is started working now.
I guess after stabilizing ABC chain it is started working as expected tried with https://testnet.wormhole.cash/faucet/
https://coinfaucet.eu/en/bch-testnet/
Thanks.

Presumably, this is a faucet that's up these days: https://faucet.fabien.cash/
At least the only testnet explorer for ABC that I've found so far is https://texplorer.bitcoinabc.org/ (data for mainnet seems to be the same as other explorers show: https://blockchair.com/ecash , https://ecashexplorer.com). But I can't fully confirm it's working correctly since I haven't found yet how to generate address from mnemonic for XEC (haven't found derivation path yet) and can't really test it (and testnet explorer doesn't show many addresses: all the latest txs are sending from address A to address B which both don't work with the faucet until waiting for 24 hours).


text:
What does the tlsextraip setting do in LND?
The lnd.conf documentation says:
; Adds an extra ip to the generated certificate. Setting multiple tlsextraip= entries is allowed.
; (old tls files must be deleted if changed)
; tlsextraip=

I think the idea is that you can add tlsextraip settings as a type of host-based authentication, so that when you start the server with this setting it will generate a certificate that allows that ip address to connect to it. Then you can send that certificate to the client along with the chosen macaroon and the client will be allowed to connect. Is that how the tlsextraip setting is supposed to work?
I am running LND 0.15.5-beta and tlsextraip seems to have no effect at all. The only thing I need to do to connect remotely is put the certificate and macaroon on the client.
I tested this theory by doing the following:

Shut down LND on the server.
Delete the tls.cert and tls.key files.
Remove all tls-related settings from the config file.
Start the server. It creates new tls.cert and tls.key files.
Attempt to connect from the client. It fails.
Copy the newly-created tls.cert to the client. (It also needs one of the macaroon files.)
Attempt to connect from the client again. It works.

The command that I run from the client is the following:
lncli --rpcserver=192.168.1.38:10009 --tlscertpath=./tls.cert --macaroonpath=./readonly.macaroon describegraph

I can do this repeatedly with or without the tlsextraip setting being set. Am I doing this incorrectly? Is the tlsextraip setting used for some other purpose? Is this a bug? Has it been deprecated? Any explanation would be appreciated.


text:
Balances do not add up to channel capacity
Using LND, I opened a channel with --local_amt=1100000 and --push_amt=500000. I would think that would open a channel with a capacity of 1100000, a local balance of 600000 and a remote balance of 500000.
But when I run listchannels, it tells me the following:
"capacity": "1100000",
"local_balance": "596530",
"remote_balance": "500000",

Where did the other 3470 satoshis go?
EDIT: There is a separate reserve balance of 10000 satoshis which I can see by running the walletbalance command, so it doesn't seem like it is part of that.

Related: https://bitcoin.stackexchange.com/q/116743/5406


text:
Bitcoin erupters not stable on Ubuntu and cgminer 3.3?
I setup p2pool on my ubuntu  12.04LTS x64 machine. Installed cgminer 3.3 and ran it. the newest cgminer is supposed to support the USB mode with the erupters without any extra configuration.
I have 2 erupters on a powered usb2 hub and 2 running off the motherboard direct. The hashing is just not stable; jumping from 50mh to 300, then getting sick and restarting- there are a ton of rejects. The avg on 4 should be 1.2gh but I am hardy getting 300mh.
I don't know what is wrong. I have been reading many posts all over over the place, one after the other and I am stumped. It is not meant to be this difficult- is it??
What did I miss?

what kind of heat are they giving off? have you tried apublic pool to see if it is your p2pool installation? let me know, i'll try to walk you through it...

The are warm/hot - I know they should get as hot as not able to touch them for too long. But they get about 45/50degrees but all 4 have various temperatures. Can you suggest a public pool please (i know i can google but if you know 1 that works 100% then let me try it) I tried installing bfgminer now but that does not even detect them.. :(

Whoa.. I think I got bfg miner to work properly. for some reason when I ran bfgminer the usb's disappeared in /dev/ttyUSB .. I had to reboot and they were back. I made sure that bitcoind loaded all blocks, ran my p2pool script then started bfgminer with -S all ... 350MH now!!! I don't understand.

i was just about to suggest BFGMiner, but decided to wait. glad it worked...
The reason it works now is because BFGMiner is more up to date than CGMiner is.... BFGMiner gets constant updates by luke-jr where as cgminer is hit and miss. luke-jr spends a lot of time getting the latest drivers in place.

Fantastic :) I thought cgminer was more up to date.. I learnt something new. Thanks for trying to help!

I am now using cgminer 3.4.2 (Ubuntu 12.04LTS) as it is much more stable than bfgminer and all the bugs in cgminer have been worked out (it also supports hot plugging)
The best way is to compile cgminer from git direct. There is some dependency on usbdev1 that needs to be compiled into cgminer.

Install the dependencies using apt-get (including all the build stuff)
Make a direcotry somewhere and go into it
git clone git://github.com/ckolivas/cgminer.git
cd into the cgminer directory
./autogen.sh --enable-bflsc --enable-icarus --disable-opencl
CFLAGS="-O2 -Wall -march=native" ./configure --enable-bflsc --enable-icarus --disable- opencl
make -j8
Run cgminer from that directory, without any options. (except the mining pools you need) It will pick up on the erupters and is ready for BFL rigs too! Hot plugging works well also!

Its not running full speed because I have a slight power issue after adding 7 more. Need a new PSU

I had the same problem.
I solved it by spawning a cgminer for each erupter using --usb :1 to limit each miner to 1 device  which gave me the performance back,
i.e. 1xcgminer mapped to 1 erupter will drive it at 350mh but add a 2nd or a 3rd and performance disappears.
I hadnt tried bfminer but I might as well now having seen your results

I have been running bfminer and it is much more stable than cgminer in my opinion (actually not a single crash in more than 15 days or constant mining).  Not sure if its the erupters more stable. Before I had 6990's running on cgminer - i had to restart cgminer almost every day(luckily i had cgminerwatcher installed- so it did it for me)

just use cgminer 3.1.1 ... i'm using 4x asic usb miner's... it works fine... and i'm using it on powered hub and raspberry pi

3.1.1 did not work for me on Ubuntu. I have 3.4.2 on Ubuntu now (had to compile it) but it works a charm. I liek the way you use your Raspberry Pi :)


text:
How to find a BTC/BCC mining node with modified software?
I want to confirm my non-standard transaction(s) in BTC/BCC network. To do it I have to find mining node with modified software. Is there pool admin who can switch off SCRIPT_VERIFY_CLEANSTACK flag on his node?
A special message to mods: this question is strong bitcoin-related. This is not looking for particular software :))

Update: one example is here: https://www.reddit.com/r/Bitcoin/comments/6f877c/ This trick will permit to spend funds from https://blockchain.info/address/3DkVqK1rUPZuj8EnPAbKmJ3A8xuZeTseeW in BTC-chain or http://blockdozer.com/insight/address/3DkVqK1rUPZuj8EnPAbKmJ3A8xuZeTseeW in BCC/BCH-chain
If you are interested in it I can publish the spending transaction.

Hehehe. I am curious about your experiment. Carry on! ;)

Interesting question, let's see if someone have a good answer for that.

unfortunately, +500 is maximum bounty on SE.  I wish I pay more :)

I'm curious. What does this do exactly?

maybe you can share here your "non standard" transaction?

I am not sure that comments section is proper place for dumping raw transactions :) I can answer such questions via email. My email is alistermaclin@mail.ru

MINERS DO NOT DO THIS!  It would allow a block to be mined which illegitimately spends segwit funds.  This person is trying to subvert segwit.

Looks like the BCC has been claimed. As for the BTC, you are not asking a question about the protocol or the software, you are looking for a person controlling mining equipment, and that question is better suited to https://bitcointalk.org than to this site.

Isn't this site for sharing knowledge? :))) Sometimes the question is more meanful than answers :)))

authors: Антон Кокоткин


text:
The shortest ECDSA signature
I want to create ECDSA signature {r,s} where r is very low (for example 1) and can be encoded in DER-format in one byte.
How to calculate k value? Seems to me that it does not depend of anything. What is the value of k which produces r=1 ?
Note: I do not worry for the safety of my private key while publishing this signature.

What is the value of k which produces r=1 ?

It's impossible to know that. If you could derive r for arbitrary values then ECDSA would be fundamentally broken. The best you can do is grind k until you get an r that happens to have a short encoding.
For the sake of the exercise:
k: 55573144136627188774517374788342221967869962622835886499477787746883063622036
r: 771676860789419846973923839003663416737624455477806040640071960112246091

This nonce will be slightly smaller than most when encoded, but of course if you attempt to use it in a signature you have exposed your private key. If you generate this secretly you can only use the k value once and the result might be at best a couple of bytes difference in the encoded transaction.
It hardly seems worth it to be honest.

Finding r=1 is "Impossible" in the same context as most cryptographic assumptions regarding search spaces. It might be possible to find that value if you turned every piece of matter in the near universe into a computer, but the effort to do so is so unreasonably large that it is unpractical for anyone to attempt. It is also possible to create a wallet that reuses a single k as much as possible (and it would have a non trivial speedup signing transactions), but this is far too dangerous to ever use and is therefor never suggested in a serious conversation.

Nothing is "serious". Everything is just a "game".

Serious enough that describing it as an answer is not appropriate. It would additionally be a privacy leak, as each signature would uniquely and irrefutably identify the wallet which signed it. I doubt signing speed has ever been a consideration in a wallet either, a single CPU would be enough to re-sign every transaction in the entire Bitcoin network history in a couple of hours (even faster than verifying them).

I have a right to do with my private key/ my funds/ my money whatever I want. Right now I want to use specific k value to sign my transactions

@PieterWuille Oh thanks, I completely missed that.

FYI: https://blockchain.info/tx/b698b58d32f27abf8a89637d60573c7069b199ac8efbd17eb3853c0264942133 rlen=0x15

@PieterWuille there are points on secp256k1 with x=1,2,3,4,6,... but not x=0,5,7,.... The other Answer gives an on-chain example for x=1. Curiously though there is no point with x=7, there is one with r=7 (since r = x mod n, and x=n+7 does have points).

the shortest ecdsa secp256k1 outputs I've ever seen have
x value = 3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63

0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0 --> 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63, 0x3f3979bf72ae8202983dc989aec7f2ff2ed91bdd69ce02fc0700ca100e59ddf3
0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1 --> 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63, 0xc0c686408d517dfd67c2367651380d00d126e4229631fd03f8ff35eef1a61e3c

in your ecdsa function, if you use
p = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

then you can derive the above results using
((p-1)/2) = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0

or
((p+1)/2) = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1

if there is anything smaller, i'd be curious to see it.
Edit
due to comments, I have been directed to a testnet tx that suggests maybe you can get R=1. thanks to amaclin.
testnet tx c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433

this tx appears to validate,
there are also others,
c42bea01f1387072772759f32ad860a680e0eea5664732bf2057a66780e7a25d

23202c2534be0567d4b339142f8a9a53545123eb61f61717fdedbef8effc53e0

maybe even more, please add to comments if so.
if I validate the public key signature
026d2204a9535443657a88a0724fbd49a0e78d305f50a82f2cc9dd9bea10a6c5cd

taken from the testnet tx
c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433

it gives this point where the x = 1
(0x01, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

while I can't verify that this point is actually on the sep256k1 curve, it seems to behave like it is, so this is a very interesting one.
if I multiply this point several times by 0x5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72 (lambda value from here)
it produces this cycle of points (3 points with same Y)
(0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

(0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

(0x01, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

if I do the same with the inverse of the point, I get these (inverses of above)
(0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

(0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

(0x1, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

The X value
0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee

in some of those results, also happens to be the beta value from here

https://testnet.smartbit.com.au/tx/c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433 - the signature in this transaction is 30060201010201 (R=1, S=1) and is valid :)

I was unable to find the rawtx for this tx from anywhere. I suspect the tx doesn't actually verify, and the generator that generated r=1, most likely wasn't ecdsa secp256k1. but I think you might be able to modify the p value and other variables in the ecdsa function to output a 1. this tx was probably created using a custom ecdsa function, or just hard coded straight into it.

https://imgur.com/a/GpuSS

https://bitcointalk.org/index.php?topic=1729534.0

Working link: https://blockstream.info/testnet/tx/c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433?expand


text:
Problems with Antminer U1 - why doesn't it work?
I've got other Antminers working, this one just throws these errors in debug mode - is this fixable?
[2014-01-30 19:03:10] Bmsc send golden nonce
[2014-01-30 19:03:10] ANT0: GetResults (amt=0 err=-7 ern=110)
[2014-01-30 19:03:10] Bmsc Read: No data for 101 ms
[2014-01-30 19:03:10] Bmsc recv golden nonce timeout
[2014-01-30 19:03:10] USB uninit ANT0
[2014-01-30 19:03:10] USB free ANT
[2014-01-30 19:03:10] USB unlock Bitmain 1-5
[2014-01-30 19:03:10] RES: Bitmain (1:5) lock=0
[2014-01-30 19:03:10] USB res unlock Bitmain 1-5
[2014-01-30 19:03:10] BTM looking for ANT 10c4:ea60 but found 0e0f:0003 instead
[2014-01-30 19:03:10] BTM looking for ANT 10c4:ea60 but found 0e0f:0002 instead
[2014-01-30 19:03:10] BTM looking for ANT 10c4:ea60 but found 1d6b:0002 instead

I'm running cgminer 3.9.0 from the fractal branch, though all the versions that support the antminer-u1 seem to have the same results, so I don't think it's necessarily the miner software.  I'm running with these options to underclock:
--bmsc-options 115200:20  --bmsc-freq 0681 -D

I had the same error "Bmsc recv golden nonce timeout" after to try Windows10 Install. So I reinstall Zadig drivers, and reconect my U3. So works fine again.
I dont know if is your case, but:
To reinstall your Zadig (http://zadig.akeo.ie/):
1) choose Options | List All Devices
2) Select CP2102 USB..
3) Choose "Replace Driver"


text:
What is a bid wall?
On the bitcointalk forums I hear a lot of talk about "bid walls".  I have never heard of these in other types of financial markets.  It seems that people use them as a way to support the price of a bitcoin.
I think i read the forums too much that I have become confused.
From what I understand.  If someone makes a limit buy below the current market price then that puts it on the bid side of the order book.  This will show there is demand for bitcoins.  If there is no changes to the supply of bitcoins then the market price will increase.  If someone were to put a limit sell order on bitcoins above the current market price, this would add supply of bitcoins to the market.  If there are no other changes in demand then the price will decrease.
Correct me if I am wrong, but what I read on the bitcoin forums seem to say that if someone puts a limit buy order up large enough then that will keep the price from increasing because there is not enough supply to overcome that "wall".  Also the converse is said often.  That someone puts up a large sell order that supports a higher price since there is not enough demand to take that supply.
Am I misunderstanding what the folks on bitcointalk.org are writing on bid walls?

Traders often view the market depth using real-time graphical tools like btccharts or mtgoxlive.  These display the bids and asks as sloping lines moving up and away from the current price.
When there is a large bid or large ask, the sloping line goes vertical, resembling a wall.
In the example below, from btccharts.com, we can see a bid wall at $3.90, where someone is offering to buy 10,000 bitcoins for $3.90 each:

I think you must be misunderstanding the Bitcoin forums.  People use all kinds of strategies when trading on the Bitcoin markets.  One such strategy (known as spoofing) is for a trader to put up a large bid wall, making it look like there's a huge demand, with the sole intention of driving the price up by tricking other speculators into buying.  Once the price has risen, the trader cancels his large bid wall and sells his bitcoins at an artificially inflated price.  If the price starts to fall instead of rise, the bid walls will often be taken down before they are sold into, indicating that perhaps they were never genuine offers to buy in the first place.
It's often said that the presence of walls in the orderbook don't really give a clear indication of future price movements in either direction, since they are so easy to create if you have deep enough pockets.
Edit: I just noticed this forum thread in which people are discussing "the wall at 3.9".  That's the one I took the photo of!  :)

Yes, I definitely misunderstood what they were talking about in the forums.  Thanks, you clarified it for me.  The basic strategy you are describing is just spoofing link where the buyer or seller puts up a large bid or ask limit order to make the market go higher or lower.

Thanks for that.  I linked to your 'spoofing' definition in my answer.

Isn't the waller taking on a lot of risk as well? Imagine someone just gobble up his unintended wall.... what is he gonna do?

I hope you bought in at $3.90 :)

But that was a bid wall - someone offering to buy, not offering to sell.  :)


text:
Check how many blocks dogecoind downloaded
I just started to run dogecoind, and I am wondering how I am able to check how many blocks I have currently downloaded vs. how many total blocks need to be downloaded?
I found this handy script for bitcoind, but unfortunately, it does not work for dogecoind.

Using any cli-based daemon (dogecoind,bitcoind,etc.), you can use the cli getinfo command:
./dogecoin-cli getinfo

Will return something like:
{
"version" : 1080000,
"protocolversion" : 70003,
"walletversion" : 60000,
"balance" : 505658.00000000,
"blocks" : 399670,
"timeoffset" : -1,
"connections" : 7,
"proxy" : "",
"difficulty" : 9373.23745278,
"testnet" : false,
"keypoololdest" : 1404252263,
"keypoolsize" : 101,
"paytxfee" : 0.00000000,
"relayfee" : 1.00000000,
"errors" : ""
}


text:
Do I need N confirmations if I'm only worried about the transfer getting invalidated by a different block?
Say I ask Bob a lot of bitcoins in exchange for an expensive product. Bob sends it to me and I wait 1 confirmation to send him the product, because I trust Bob. I am only worried about the transaction being invalidated by a block that doesn't contain it getting solved. How can I determine a "safe" number of confirmations as to make that risk negligible? When I read about the "6 confirmations" thing it's always about preventing double-spending, and some even say that if you trust the other part you don't even need confirmations. Wouldn't that (zero confirmations) put the receiver in great risk of having the transfer invalidated?

Why should a transaction get invalidated? Because the winner miner hasn't added it to his block yet, doesnt mean that the transaction will be invalidated. Next miner will add it to his proposed block. Can you clarify more?

@abeikverdi Can't the transaction be "lost" somehow, for instance if Bob does not pay a transaction fee? Or if, for some reason, it only reaches a few nodes? I remember reading something like that, though I might be mistaken, since I only grasp the basic concepts on Bitcoin. Thanks!

Orphaned blocks, that's the word I was looking for. It seems the 6 confirmation rule applies to it too, though I don't understand while it is likely that a transaction will be added to one of the 6 blocks if it was in an orphaned block in the first place.

If you trust the sender, why do you care if the transaction is invalidated? The sender will just make another transaction, right? Otherwise, what does it mean to say you trust him?

@DavidSchwartz trust he is not double-spending.

A transaction can only be invalidated by an attempt to double-spend. That is, the same transaction can be in block X or block X+1 or block X+n as long as there is no double-spend associated with it.
If you want to make sure that a transaction goes into a block soon-ish, try to add a fee that's sufficient to make a miner want to add it to a block. In that case, you only need a couple confirmations as being an orphan block after that is exceedingly unlikely.

because I trust Bob. I am only worried about the transaction being invalidated by a block that doesn't contain it getting solved. How can I determine a "safe" number of confirmations as to make that risk negligible?

The naïve answer is that if you trust Bob and his transaction is valid and pays a reasonable transaction fee, you can accept it with zero confirmations.
However, your question hints at a situation where the naïve protocol can fail: by trusting Bob's transactions, you also trust everyone who has paid Bob.  If they double spend the inputs they paid Bob, then Bob's payment to you becomes invalid.
If you really trust Bob, that's ok---you can just re-invoice him and he'll create a new transaction.  But if you aren't sure that Bob will pay a second invoice, then it's always best to wait for as many confirmations as possible before accepting his payment.
The standard advice to wait for 6 confirmations---an average of one hour of proof of work---is sufficient to protect most transactions.

The probable combination of choices should equate to the desired expected value.
Almost certainty of the transaction can be approximated by the almost certainty of the work performed, in the case of Bitcoin and Proof-of-Work generally.  There are a few papers with constructions of certainty relative to rates of work performed.
Ripple achieves almost certainty in 10 seconds on average.  Considering how well if functions, long run certainty should be judged by the strength of the distributed model and some key theoreticians.  They have managed cryptocurrency problems with high efficiency.
Proof-of-Stake coins still may have some key holes despite their performance promise.  Some higher profile PoS coins had their primary exchanges hacked, and a potential vulnerability was emphasized, driving down their market values.  They can be the fastest, but enforcing transaction order never seems to be conceptually complete.
Risk of failure should probably be bounded with conventional financial forms like the Kelly Criterion.


text:
Is it sometime advantageous to split a transaction into multiple smaller ones?
When I updated Bitcoin Wallet on my Android device, it automatically created a new address and transfered all my funds from my old address to it due to the recently found security issue in Android's random number generator.
However, it didn't do it with a single transaction. Instead it did two transactions, so I had to pay the transaction fee (0.0001) two times.
Did it perhaps split it into two smaller transactions to keep the size down (only a guess) for the sake of the network? Or is a smaller transaction processed faster? Or was this necessary for completely emptying the old address? Or was my old address fragmented after multiple transactions to and from it in its history (if that is even a thing/possible)?
My questions above are only speculation. And my real question is: is it sometime advantageous to do two (or more transactions) to the same destination instead of a single, big one?

It can be advantageous to split transactions in order not to draw from different addresses in one transaction, because that would announce that both addresses belonged to the same Wallet (for the privacy paranoid user).
The priority of a transaction is reduced by having more source addresses, however it is on the other hand increased by sending a larger amount. Coins that have been held for a longer time also increase the priority.
I don't see why it would have been necessary to transact in this fashion and I think the overall size for the network would be the same (2*250B or 1*500B).
I would assume that you had two different addresses holding coin that were each emptied each in one transaction.


text:
Running full node on OSX, how to tell if its working correctly?
I'm running Bitcoin-QT 0.15.01 on an iMac (4 GHz Intel Core i7, 40GB RAM). It seems I am receiving the latest blocks, but is the rest working as it should?
I have opened port 8333 on my router and bitnodes is reporting that my node is accepting incoming connections.
Core reports 19 connections to the network but the log has a lot of errors like these:
09:20:08' progress=1.000000 cache=64.8MiB(478821txo)
2017-10-01 09:21:26 connect() to 65.130.52.89:8333 failed after select(): Connection refused (61)
2017-10-01 09:21:36 receive version message: /Satoshi:0.14.1/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1634
2017-10-01 09:21:44 receive version message: /Snoopy:0.2.1/: version 70001, blocks=0, us=N.N.N.N:8333, peer=1635
2017-10-01 09:21:44 socket recv error Connection reset by peer (54)
2017-10-01 09:21:46 receive version message: /Satoshi:0.14.1/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1636
2017-10-01 09:22:28 receive version message: /bitnode.lee/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1637
2017-10-01 09:22:49 UpdateTip: new best=000000000000000000792640fb97fb9a8ed07ba99b37479a48ebbeff3b1c1044 height=487782 version=0x20000000 log2_work=87.201974 tx=258394764 date='2017-10-01 09:22:42' progress=1.000000 cache=64.8MiB(479294txo)
2017-10-01 09:23:27 ProcessMessages(version, 111 bytes) FAILED peer=1638
2017-10-01 09:23:37 receive version message: /bitnodes.21.co:0.1/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1639
2017-10-01 09:23:39 Pre-allocating up to position 0x7000000 in blk01013.dat
2017-10-01 09:23:39 UpdateTip: new best=000000000000000000a86b2c788d7d3acd3493b05b2e8a626d7a5aca20a3ecc1 height=487783 version=0x20000000 log2_work=87.202013 tx=258397039 date='2017-10-01 09:23:00' progress=1.000000 cache=65.1MiB(482014txo)
2017-10-01 09:23:51 UpdateTip: new best=0000000000000000004927be61b84dc22202b49e55e635ce746023436c1ed14d height=487784 version=0x20000000 log2_work=87.202051 tx=258397146 date='2017-10-01 09:23:51' progress=1.000000 cache=65.2MiB(482144txo)
2017-10-01 09:24:04 socket recv error Connection reset by peer (54)
2017-10-01 09:24:07 receive version message: /bitcoin-seeder:0.01/: version 60000, blocks=350000, us=N.N.N.N:8333, peer=1640
2017-10-01 09:24:18 receive version message: /bitcoinj:0.14.4/: version 70014, blocks=437811, us=127.0.0.1:8333, peer=1641

Thanks MCCCS, I couldn't figure why the carriage returns were not working or how to fix it.

Welcome to Bitcoin.SE! You can help the site by marking an answer as accepted if it is correct and addresses the question so that the question does not remain as "unanswered".

Those are not errors/are benign errors. You have multiple connections and your node can be found on bitnodes. Your node is fine and working correctly.

Great, thank you Andrew! That puts my mind at rest.


text:
lnd fails to connect to the network
Ubuntu 22.04
lnd 0.15.3-beta
tor 0.4.6.10
When I run lnd, it never connects to the network. The output contains the line:
[ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found

tor.log contains lots of lines like these:
We tried for 15 seconds to connect to '[scrubbed]' using exit $B558F456FB410E6CDF3D33AC5EB5305D66DA8B19~bauruine [hu1YYHdLr/hlWFXBWKMxQnaQbHIK4+9aotdZtYoZ2c4] at 23.137.251.61. Retrying on a new circuit.
Tried for 130 seconds to get a connection to [scrubbed]:53. Giving up.

The messages in the tor.log file only show up when lnd is running.
lnd.conf
bitcoin.active=true
bitcoin.mainnet=true
bitcoin.node=bitcoind
bitcoin.minhtlc=1
bitcoin.feerate=1
bitcoin.basefee=1000
bitcoin.defaultchanconfs=2

bitcoind.rpchost=192.168.1.38:8901
bitcoind.zmqpubrawblock=tcp://192.168.1.38:28332
bitcoind.zmqpubrawtx=tcp://192.168.1.38:28333
bitcoind.rpcuser=username
bitcoind.rpcpass=password

tor.active=true
tor.v3=true
tor.socks=127.0.0.1:9050
tor.control=127.0.0.1:9051
tor.streamisolation=true

listen=0.0.0.0:9735
rpclisten=0.0.0.0:10009
debuglevel=debug

sync-freelist=1
stagger-initial-reconnect=1
ignore-historical-gossip-filters=1
db.bolt.auto-compact=1
max-channel-fee-allocation=1.0
maxpendingchannels=10
protocol.wumbo-channels=true
minchansize=5000000
max-cltv-expiry=5000

routerrpc.apriorihopprob=0.5
routerrpc.aprioriweight=0.75
routerrpc.attemptcost=10
routerrpc.attemptcostppm=10
routerrpc.minrtprob=0.005
routerrpc.penaltyhalflife=6h0m0s

tlsautorefresh=true
tlsdisableautofill=true

torrc
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
CookieAuthFile /var/lib/tor/control_auth_cookie
DataDirectoryGroupReadable 1
CacheDirectoryGroupReadable 1
Log notice file /var/log/tor/tor.log

It seems like the problem would have something to do with lnd because I stop getting the tor.log error messages when I shut down lnd. Also, I am able to reach the outside Internet by using torsocks.
What do I have to change to get this working?

No. It returns an empty JSON object.

The result contains an array that has one peer in it.

And I am seeing a lot of activity in my terminal. Also, running lncli getnetworkinfo is showing actual numbers instead of all zeros, and the numbers are growing as if it is syncing. Are the calls to connect and listpeers a requirement, or was something configured incorrectly?


text:
Link fails when building gRPC client for LND in C++
I'm trying to build a gRPC client for LND in C++, starting with the WalletBalance function. I've never used gRPC before, and I use make instead of cmake, but according to the documentation this is supposed to be possible. I am using the pkg-config files that get installed with gRPC, but they are not working.
Here is what I've successfully been able to do so far.

Build gRPC
Compile lightning.proto
Compile lightning.pb.cc and lightning.grpc.pb.cc
Link with lightning.pb.cc.o (but not lightning.grpc.pb.cc.o)

This is my cpp file:
#include <iostream>
#include <string>

#include <grpcpp/grpcpp.h>

#include "lightning.grpc.pb.h"
#include "lightning.pb.h"

using namespace std;
using namespace lnrpc;

using grpc::Channel;
using grpc::ClientContext;
using grpc::Status;

class LightningClient
{
private:
    unique_ptr<Lightning::Stub> stub_;

public:
    LightningClient (shared_ptr<grpc::Channel> channel) : stub_ (Lightning::NewStub (channel)) {}

    unsigned long WalletBalance (const string& user)
    {
        WalletBalanceRequest request;
        WalletBalanceResponse reply;
        ClientContext context;

        Status status = stub_->WalletBalance (&context, request, &reply);

        if (status.ok ())
            return reply.total_balance ();
        else
            cout << status.error_code () << ": " << status.error_message () << endl;

        return 0;
    }
};

int main (int argc, char *argv [])
{
    shared_ptr<grpc::Channel> channel;// = CreateChannel ("localhost:10009", grpc::InsecureChannelCredentials ());
    return 0;
}

This is my makefile:
lnd-grpc-client : lnd-grpc-client.o lightning.pb.cc.o lightning.grpc.pb.cc.o
    g++-10 -pthread -o lnd-grpc-client lnd-grpc-client.o lightning.pb.cc.o `pkg-config --libs --static protobuf`

lightning.grpc.pb.cc.o : lightning.grpc.pb.cc
    g++-10 -std=c++20 `pkg-config protobuf --cflags` -c -o lightning.grpc.pb.cc.o lightning.grpc.pb.cc

lightning.pb.cc.o : lightning.pb.cc
    g++-10 -std=c++20 `pkg-config protobuf --cflags` -c -o lightning.pb.cc.o lightning.pb.cc

lnd-grpc-client.o : lnd-grpc-client.cpp
    g++-10 -std=c++20 `pkg-config protobuf --cflags` -c -o lnd-grpc-client.o lnd-grpc-client.cpp

All of that compiles and links just fine. But I have the CreateChannel function commented out in my cpp file and I am not linking with lightning.grpc.pb.cc.o, both of which would be required if I am to get this working.
If I uncomment the CreateChannel function, it gives me a linker error saying undefined reference to 'grpc::InsecureChannelCredentials()'. But there does not seem to be any pkg-config that solves that problem.
If I try to link with lightning.grpc.pb.cc.o, I get hundreds of linker errors. I can't post all of them, but here are a few:
lightning.grpc.pb.cc:(.text._ZN4grpc5SliceD2Ev[_ZN4grpc5SliceD5Ev]+0x20): undefined reference to 'grpc_slice_unref'
/usr/bin/ld: lightning.grpc.pb.cc.o: in function 'grpc::Slice::Slice(unsigned long)':
lightning.grpc.pb.cc:(.text._ZN4grpc5SliceC2Em[_ZN4grpc5SliceC5Em]+0x32): undefined reference to 'grpc_slice_malloc'
/usr/bin/ld: lightning.grpc.pb.cc.o: in function 'grpc::SliceReferencingString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
lightning.grpc.pb.cc:(.text._ZN4grpc22SliceReferencingStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4grpc22SliceReferencingStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x50): undefined reference to 'grpc_slice_from_static_buffer'
/usr/bin/ld: lightning.grpc.pb.cc.o: in function 'grpc::ByteBuffer::ByteBuffer(grpc::Slice const*, unsigned long)':
lightning.grpc.pb.cc:(.text._ZN4grpc10ByteBufferC2EPKNS_5SliceEm[_ZN4grpc10ByteBufferC5EPKNS_5SliceEm]+0x27): undefined reference to 'grpc_raw_byte_buffer_create'
/usr/bin/ld: lightning.grpc.pb.cc.o: in function 'grpc::ByteBuffer::~ByteBuffer()':
lightning.grpc.pb.cc:(.text._ZN4grpc10ByteBufferD2Ev[_ZN4grpc10ByteBufferD5Ev]+0x27): undefined reference to 'grpc_byte_buffer_destroy'
/usr/bin/ld: lightning.grpc.pb.cc.o: in function 'grpc::ByteBuffer::Clear()':
lightning.grpc.pb.cc:(.text._ZN4grpc10ByteBuffer5ClearEv[_ZN4grpc10ByteBuffer5ClearEv]+0x27): undefined reference to 'grpc_byte_buffer_destroy'

I tried adding the grpc and grpc++ pkg-config files to my makefile's link command, but that did not solve the problem.
Has anyone actually built a gRPC client for LND in C++? If so, how do you know which libraries to link with and how do you link with them?


text:
CLN config file unrecognized options
I'm trying to get CLN connected to a running Bitcoin Core node, but it is telling me I have unrecognized options in my config file. I thought the problem was that the data directory for the bitcoin node is on a USB drive that has spaces in its directory name.
In my cln.conf file, it is configured as follows:
bitcoin-rpcconnect=127.0.0.1
bitcoin-rpcport=8332
bitcoin-rpcuser=btcuser
bitcoin-rpcpassword=btcpw
bitcoin-cli=/home/myuser/bitcoin-core/bitcoin-cli
bitcoin-datadir=/media/myuser/Seagate\ Expansion\ Drive/bitcoin/

network=bitcoin

proxy=127.0.0.1:9050
addr=statictor:127.0.0.1:9051
bind-addr=127.0.0.1:9735
always-use-proxy=true
tor-service-password=torpw

When I try to run CLN, I get the following error:
$ lightningd --conf=../cln.conf

lightning-cli exited with code 3: lightning-cli: -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/: unrecognized option

Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ lightning-cli -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/ -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.

The Bitcoin backend did not die. I can still access the node with bitcoin-cli.
$ ./bitcoin-cli --rpcconnect=127.0.0.1 --rpcport=8332 --rpcuser=btcuser --rpcpassword=btcpw getbestblockhash
00000000000000000002b050f0ab9cb9f0f7c5ed4e4fc59f02debe724c571690

So I tried commenting out the bitcoin-datadir line in the config file. Then I get the following error:
$ lightningd --conf=./cln.conf

lightning-cli exited with code 3: lightning-cli: -rpcconnect=127.0.0.1: unrecognized option

Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ lightning-cli -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.

These settings are all in the documentation. Why is it telling me it doesn't recognize them?

What versions of CLN and Bitcoin Core are you running? Is it possible that you are running a version of CLN that doesn't match the version of the documenation you are using to configure it?

I checked your config locally and I think your main issue is that the bitcoin-datadir is not properly escaped. Your external drive name has a space in it, which may be causing the parsing to fail. I'd suggest you try passing it as:
bitcoin-datadir="/media/myuser/Seagate Expansion Drive/bitcoin/"

Regarding rpcconnect, I don't see anything wrong with it, your config worked in my local setup. Something worth mentioning though: you don't really need to specify bitcoin-rpcconnect and bitcoin-rpcport. Based on your config you are running on default (that is, localhost on the default mainnet port), so those are the same cln will pick if you just don't overwrite them. Same goes for network=bitcoin, that's the default AFAIK.

Adding quotes around the datadir did not work. I tried several different ways of entering the datadir, even commenting it out, but nothing worked. Unfortunately, I can't change the name of that directory in order to remove the spaces.

That is pretty odd. What CLN version are you running?
Also, can you try a minimal config file placed on the default location? That is, create a file called config under ~/.lightning and add only bitcoin-rpcuser, bitcoin-rpcpassword and bitcoin-cli. Then run lightningd without any other param.

@Zephyrus: If the spaces are really the issue, you could perhaps make a soft link: ln -s "/media/myuser/Seagate\ Expansion\ Drive/bitcoin/" "~/bitcoin-dir" and then specify ~/bitcoin-dir as the data directory in your configuration. (Don't trust, verify: read the man page for ln. man ln ;))

Also, just spitballing here… if you put the name into quotes, do you still need to escape the spaces?

@Murch I think you don't. I also realized about that and edited the suggestion. Not sure if that is going to make a change @ Zephyrus

It is version 23.11.1. When I removed all other settings and moved the config file to the default location, it started. I am going to try more changes to the datadir to see if that is causing this, and will also try the symbolic link.

Did you find out?


text:
Canadian Taxes for Buying Bitcoins
I saw this post, but it really didn't help me.
How should I fill out my tax forms if I am only buying and holding bitcoins, not selling them?
This page appears to suggest that I only need to worry about taxes if I profit off of them when I sell them:
Buying and Selling Bitcoins

Income Tax Implications

Where a person trades or sells Bitcoins like a commodity (i.e., speculating
on the changes in the value of Bitcoins), the resulting gain or loss may be
on account of income or capital.  Determining whether such a transaction is
on account of income or capital can only be made following an assessment of
all the facts relating to the particular taxpayer’s circumstances.
Paragraphs 9 to 32 of Interpretation Bulletin IT-479R, “Transactions in
securities”, provide general comments for purposes of determining whether
transactions are income or capital in nature.

The determination of the income tax consequences relating to the treatment
of gains and losses arising from the purchase and sale of Bitcoins would be
generally the same as for transaction[enter link description here][3]s
involving other types of commodities.

Example:

Mr. X bought a Bitcoin on June 1, 2013 for $100.  Mr. X then sold the
Bitcoin on December 1, 2013 for $500.

Based on his particular facts and circumstances, Mr. X determined that the
gain was on account of capital.

Mr. X has a capital gain since he sold a capital property for more than the
total of its adjusted cost base and the outlays and expenses incurred to
sell the property.

Mr. X’s capital gain is $400 ($500 less $100).  Mr. X will need to report
$200 as a taxable capital gain (only 1/2 of the capital gain is taxable) on
his 2013 Income Tax and Benefit Return.

Although I don't know how reputable that page is, so here is the official, incomprehensible source.

That's correct. You have no taxes and no need to report them if you have not sold/spent any of the coins in the tax year.
You do need to keep records of your purchases, because when you do come to sell, you'll need to work out the potential gains you've made.
If you do need to work out your gains, you can use https://bitcoin.tax or other capital gains calculators that can work out the total gains from all your selling or spending.


text:
How much escrow/ Multi-signature transactions are done?
I have read here about the possibility of Multi-signature transactions. Is there a statistic available how much of these are done?

Blockchain doesn't currently offer that and the only way to construct a transaction like that is to build it manually.  So as a result both the sender and each recipient must have l33t skills.
This capability will come, it is just that since that was introduced, scalability had to take priority over new features for most Bitcoin development.
They happen but rarely.  Here's an example of Bitcoin address used recently (March 5, 2013) in an escrow transaction:
,- http://blockchain.info/address/13MH4zmU4UT4Ct6BhoRFGjigC8gN9a9FNn

I wrote some analysis of the multisig P2SH transactions in the blockchain; http://www.coindesk.com/year-multisig-so-far/ Around April this year there were like 7,000 transactions. I have the frequency per 2500 blocks, showing a nice histogram of their increasing usage, and also the top 4 address types (2-of-3, 2-of-2, etc).

Here is nice statistics http://webbtc.com/stats of different script type

But not how many multi-signature transaction, or am I missing something?

Do you want the number if msig outputs? 87477 right now. Or are you looking for the number of multisignature scriptSigs in the blockchain? In other words: fundings or spendings?


text:
How to get the input address from an txid with bitcoind
I want to get the input addresses of a transaction with a known id. If I use getrawtransaction I get something like:
"vin" : [
{
"txid" : "470a499101b7042b225dab4f15fa252cdc7f3a16153e33d66d0c8c53b1d83aaa",
"vout" : 1,
"scriptSig" : {
"asm" : "304502206917b333161de796bed7770615ebf66669092a53877b3dba2582bad7dfc0b56c022100f9926a5e82d15666122b1f8703d94116eec0c98ddbf922a72467b05953532e1a01 03864670304932f91c85f38e80aebcd6c37fa36529b7135f7fa21b36585df5ab49",
"hex" : "48304502206917b333161de796bed7770615ebf66669092a53877b3dba2582bad7dfc0b56c022100f9926a5e82d15666122b1f8703d94116eec0c98ddbf922a72467b05953532e1a012103864670304932f91c85f38e80aebcd6c37fa36529b7135f7fa21b36585df5ab49"
},

If I want to further look of the transaction 470a499101b7042b225dab4f15fa252cdc7f3a16153e33d66d0c8c53b1d83aaa with getrawtransaction I get a:
"No information availabe about transaction (code -5)"
So is it at all possible to get the input addresses of a random transaction (not belonging to your wallet) with bitcoind?

You need to pass the option -txindex=1 at the command line, or include txindex=1 in bitcoin.conf.

and than I can look up transactions where all outputs are already spend, right?

Yes, you can.
Open bitcoind with -txindex=1
If you didn't use txindex=1, you might need to add -reindex to recreate transactions indice.
Therefore, you can use getrawtransaction to look up  spent transactions which are not belonging to you.


text:
Why more threads reduce h/s rate?
I have dual xeon processors (total 48 cores). I am using cpuminer-easy with nicehash pool on fedora. I have noticed that if i keep my number of threads greater than 10, the h/s falls dramatically. I am using Cryptonight algorithm. For 40 threads, i get 2-3h/s per thread while with 10 threads i get 25 -30h/s per thread. What is wrong here? How can i utilize all cores?

What algorithm?

David Schwartz cryptonight

I think I know! What is the exact model of the CPUs?

David Schwartz Model name: Intel(R) Xeon(R) CPU E7-4830 v3 @ 2.10GHz

The E7-4830v3 has 10 physical cores and 20MB of L3 cache. With two CPUs, you'd only have 20 physical cores and 40MB of L3. Since every thread is doing exactly the same thing, hyper-threading is virtually useless. It wouldn't help you anyway since you only have 2MiB per physical core and that's exactly what cryptonight requires.
So, short answer, with 40MB of L3 cache, you cannot run more than 20 instances of the cryptonight algorithm concurrently without dropping from L3 speed to RAM speed, which is a huge performance loss.
You can probably go higher than 10, but more than 20 is a non-starter.

So  that means i should be running 20 threads without any issues, but as soon as i increase more than 10 threads, the h/s starts to decrease.

For 20 threads , i am getting 4 h/s per thread.

What happens with 18 threads? And are you 100% sure you have two of them?

David Schwartz, for 18, i have 7 h/s on average

Hmm, now I see that it has 30MB of L3 cache and 12 physical cores. Maybe I looked up the wrong CPU. Yeah, it seems something is wrong. You should be performing better than that. Maybe you need a BIOS update? It may help to disable hyper-threading in the BIOS.

Could it be the issue with cpuminer-easy, that i am using?

I guess it could be. It couldn't hurt to try a different program.

The issue was with cpuminer-easy, i am currently using xmrig, and it is giving me about 700h/s for cryptonight.

That seems about right. I calculated 720 as about your maximum. (Using the numbers for the correct CPU this time.)


text:
Statistically how many unconfirmed transactions get rejected?
I need to analyse unconfirmed transactions and I'm interested in knowing what is the probability for a given unconfirmed transactions to be confirmed.
Depending on the model, I see two solutions:

checking for a relatively long period of time how many transactions had been submitted and checking how many had been confirmed.
searching pattern behavior in the structure of a transaction that will lead to a rejection.

Ask me to flood the network with transactions which will never confirm and you will get ANY digits in your statistics :)

That's exactly my point, flooding has a very specific behavior pattern that can be detected often.

If you are asking this question this means that you will not be able to detect my flood transactions from regular ones :) ok, we can continue the conversation (if you are interested in experiment) via email (in my profile)

For a transaction to be included in a block, the probability is related to the fee that transaction pays to the miner (higher fee = more likely) and varies over time based on demand of block space (more congested = higher fee needed). It's also unpredictable because miners can choose whatever transactions they want to, doesn't always have to be the x highest fees.
Here's some stats on current fee vs confirmation time estimations: https://bitcoinfees.21.co

Thanks for your answer. My question wasn't clear enough I meant statistically how many unconfirmed transactions are rejected? Ive updated my answer.


text:
load balancing bitcoind
Taking the question a step back.
I'm looking to build payment using bitcoin myself. The whole point of bitcoin is decentralisation and sovereignty.
Basically I need High Availability set up for bitcoin full node myself with no single point of failure. So that my website can reliably transact and receive payments.
== Original Text ==
Any one know or tried running bitcoin core server with the data stored on a NAS and a load balancer in front of it?
I'm basically looking for some kind of high availability set up (on aws with autoscaling group / EFS / ELB)

would you mind sharing the purpose of this setup and what are the requirements?

Why do you want to have multiple Bitcoin Core nodes behind a load balancer?

I am interested in building payment service for my site. I will need to make sure that the payment service doesn't have a single point of failure. @renlord

This won't work. Multiple instances of Bitcoin Core cannot use the same datadir. Furthermore, LevelDB does not usually work well with network storage so you probably can't even get the datadir to actually be stored on a NAS and still have Bitcoin Core work properly.
You could have multiple Bitcoin Core instances running behind a load balancer, but it probably won't be as useful as you think it will be.

Yeah that's what I'm not keen on, multiple load balancer that doesn't provide consistent response between them.

You can use haproxy or nginx to balance between the REST and RPC interfaces, but this doesn't work if you need to use any of the wallet functions, and there's no guarantee that any of the information at the tip of the chain will be consistent. Many mining pools use setups like this, but they don't need to have any assurance that the information between the nodes is identical, where you would have this requirement if you were running a service (flopping between confirmations for example would be harmful).
If your service is heavily bottlenecking on a node there's probably going to be other problems, the APIs will become unresponsive when updating the tip of the chain for example. Attempt to design services which are resistant to this sort of instability, rather than trying to expand horizontally with multiple nodes as that will greatly add to your complexity without much improvement of scalability.


text:
How to restore my old wallet from address and privatekey?
Few years ago I created a bitcoin wallet. I did it with some command line util which generated bitcoin address from template. At the bottom of output util tells me to store this in private place. I did it and forgot about bitcoin for few years. I attach util output below this post.
Now I would like to restore my wallet and hope to find some bitcoins on it. How can i do it with official Bitcoin Core wallet?

You should not share your private key with anyone, that can allow any user with that private key to access your bitcoin.

@asterisk yes I know. i share few letters only. Rest of key hidden by white paper as you can see.

A step by step process has been explained in the below link
How to import private keys in Bitcoin Core
You need to sync your Bitcoin Core to see your balance.
If you want to access your BTC easily and without downloading the whole blockchain, then go to Blockchain.info
Sign up and after logging in, go to settings. Then in settings, you will see addresses as shown below:

Then click on Import Bitcoin Address as shown:

Then add your private key as it is in the form as shown:

Click import, and you will be able to use your BTC again.
Please follow that and let me know if you were able to retrieve the coins.

should I sync Bitcoin Core first?

Yes, you should sync bitcoin core. But that can take a long time, as the blockchain size is very high (138 GB as of Oct 17). So, if you just want to access Bitcoin without Bitcoin Core, please check my answer again, I have updated it.

Ok I will wait while Bitcoin Core synced because I do not trust online services. And will try step by step from your first answer https://en.bitcoin.it/wiki/Help:How_to_import_private_keys_in_Bitcoin_Core_0.7%2B

No worries mate. There are also other lite clients where you have the complete control and you don't need to download entire blockchain unless you want to mine.

i did importprivkey . It works!

Do accept this as the right answer if it worked for you :) @alexey2baranov

You need to install Bitcoin Core (bitcoin-qt) and wait till sync will complete. It is better to keep private key locally.
Then in bitcoin-qt chose Help menu > Debug window > Console.
Type importprivkey privkey where privkey yours private key. And press Enter.
After rescaning you would be able to see you balance in this application.


text:
Is there a max number of tx outputs allowed by consensus?
It seems good for preventing an UTXO bloat by restricting max number of outputs of TX(or block) can have.
Is there such a restriction? if there is, which part of source code should I read? If not, why not?
Note: What I am asking is not about block size limit or TX size limit, I know those and how those are (implicitly) limiting the number of total outputs in TX (or block), but I think this is kinda roundabout way which limits the number outputs only loosely. Why not more direct restriction?

There is no direct limit on the number of outputs, but transactions can't have more than an allowed amount of weight and this indirectly limits the number of outputs.

Thanks.
I do understand the indirect limit by TX weight, what makes me wonder is that today's miners can intentionally bloat UTXO by creating lots of TXs smaller than the limit. Or even non-miner can do that by splitting their TX into more than two.
So my question is, "why not limit the number of TXO in a block directly?" This seems to be able to be introduced by a soft-fork, and may prevent some unknown vulnerability (like the one Christopher Jeffrey has proposed year ago.)

Because adding more constraints to blocks makes the mining problem vastly more complicated for no gain.


text:
After sending/flooding transactions, how do we know that a specific transaction is on all nodes?
In the book "Mastering the Blockchain" by Imran Bashir, it says that a transaction's life cycle is the following:

A user/sender sends a transaction using wallet software or some other interface.
The wallet software signs the transaction using the sender's private key.
The transaction is broadcasted to the Bitcoin network using a flooding algorithm.
Mining nodes include this transaction in the next block to be mined.
Mining starts once a miner who solves the Proof of Work problem broadcasts the newly mined
  block to the network. Proof of Work is explained in detail later in this chapter.
The nodes verify the block and propagate the block further, and confirmation starts to generate.
Finally, the confirmations start to appear in the receiver's wallet and after approximately six
  confirmations, the transaction is considered finalized and confirmed. However, six is just a
  recommended number; the transaction can be considered final even after the first confirmation.
  The key idea behind waiting for six confirmations is that the probability of double spending is
  virtually eliminated after six confirmations.

My question:
Now all nodes have competing miners to create a block by receiving all transactions by all nodes/users that submit transactions and packing it, which is not coming from one place. If we call the winner, the miner that solves the PoW problem first, then how do we know that he received all the transactions he's supposed to receive before announcing that he created a valid block? My miner software could ignore a few transactions and get to mining earlier than others, and hence beat everyone else (assuming we all have the same computational power).
My question also can be read in a different way: How do ensure that all miners are solving the same PoW problem, while big latency times can be involved in the Bitcoin network (because we're mining from around the world)?

You can't know it's on ALL nodes because it maybe isn't. Txns are gossiped on a best effort basis and it usually works out.
Miners are incentivised to include as many transactions as they can, in order from highest to lowest fee paid. So they connect to a large number of nodes to make sure they have the most complete information they can reasonably get in order to fo this.

Thanks for the answer. So the more transactions they include, the higher the reward they get?

Yes. But because there is a size limit in each block, they can only include so many, so they order them from highest to lowest fees when they can't fit them all in 1 block.

Also that means for the scenario where they get a transaction later than someone else, they have to always check whether this transaction was already in a previous block before adding it?

That is correct.

From a novice, what it means that if someone who isn't bitcoin savvy accepted bitcoin on the deprecated block and gave that person something of value, that person is out of luck, you just lost that item of value.
Previous answers eluded to it, but, simpletons like me look at "So what does this really mean".  It means, when you get paid in BitCoins, you are not "PAID" until that transaction appears in at least 6 blocks to that chain, since that chain could be voted invalid anytime before that 6th block is reached (It can still be called invalid after that but highly unlikely).
This means, instantaneous transactions using BitCoin are "RISK".  If I accept bitcoin at my restaurant, it is possible that the chain in which I got paid could be voted invalid, thus, I never received actual payment.  I think the time is currently 10 minutes to "confirm" a transaction is on the valid chain "6 blocks deep".
A person could gamble and spend money twice, the money doesn't actually get spent twice, but a novice person could be taken advantage if they don't understand how things work.  In short, don't give up anything of value until the chain gets at least 6 blocks deep, then your "payment" is most likely confirmed.

If we call the winner, the miner that solves the PoW problem first, then how do we know that he received all the transactions he's supposed to receive before announcing that he created a valid block?

Why should we care? He can include whatever transactions he wants, it's his block. If he ignores lucrative transactions, he'll lose money because he won't make as much in fees as he could. But other miners will soon get them.

My miner software could ignore a few transactions and get to mining earlier than others, and hence beat everyone else (assuming we all have the same computational power).

That makes no sense for two reasons:

Ignoring transactions won't save you any time or anything. You are always mining. Why would you wait for transactions that might or might not come in and, if you did, when would you stop waiting? In practice, you always try to include the most profitable transactions you know and never wait for anything because that's how you make the most money.

Even if two miners have the same computational power, they are trying to solve different problems. So which finds a solution first is going to be effectively random. If they aren't coordinating, then miner A is trying to find a solution that pays miner A while miner B is trying to find a solution that pays miner B, so different problems. If they are coordinated, then they definitely won't repeat work -- that's the point of coordinating.

My question also can be read in a different way: How do ensure that all miners are solving the same PoW problem, while big latency times can be involved in the Bitcoin network (because we're mining from around the world)?

They definitely aren't. Again, if they aren't coordinating, then each one is trying to solve the problem of mining a block that pays them. And if they are coordinating, they're carefully assigning different work to the two so that effort isn't wasted.

How do ensure that all miners are solving the same PoW problem

It is impossible. And it is not needed.

Now all nodes have competing miners to create a block
  by receiving all transactions by all nodes

And this is not needed too. You can start mining the block without receiving  transactions from the network.

Thanks for the answer. But then I can keep creating blocks and get money for free, right?

(a) coins are not money (b) PoW means that you are "working", working = spending energy, energy is not free.

What's the incentive for anyone to mine blocks that really have transactions in them? Btw, please don't fixate on the difference between coins and money, because they're exchangeable in exchanges.

so, apples and oranges are also "money" because they are exchangeble on markets? ok. got it. regarding your question: there are at least two reasons: (a) miner gets additional fees from included txs (b) there is a myth that including txs helps the network and raises coin exchange rate to fiat money

@SamMarkus People put transactions in the blocks they mine for two reasons: 1) The miner gets to keep the transaction fees the transactions they mine pay. 2) Miners have to invest in ASICs to mine bitcoin and their miners would quickly turn into very expensive space heaters if the network wasn't usable for transactions.

Regarding your question at the bottom:

How do ensure that all miners are solving the same PoW problem, while big latency times can be involved in the Bitcoin network (because we're mining from around the world)?

Inside the block header, there is the field Timestamp (the approximate creation time of this block - seconds from Unix Epoch). Thus, all the solutions must be valid for that particular block. Part of the solution the miners will find, it is to find the transactions and the Nonce that solve the problem. Not all transactions listed before the block be created will be processed. Thus, if a possible solution is published but it not valid for the current block it will not be accepted. Thus, all the miners are working in the PoW.