text:
Constantly getting connection interrupted
Recenly I started to mine BTC. I'm doing it just out of curiosity rather then for any profit. I compiled cpuminer on my Debian 9 server. I'm trying to connect to the btc.com pool by execuing:
./minerd -a sha256d --url=stratum+tcp://eu.ss.btc.com:1800 --user=myusername --pass=password

I let it run for few hours and didn't get any accepted or rejected shares (not sure about names). Is it normal (I've got some old dual core cpu) or it's because of connection interupts. I'm constantly getting work resets and those connection interupts. Example:
[2017-11-06 14:04:15] thread 1: 197074856 hashes, 3289 khash/s
[2017-11-06 14:05:15] thread 0: 197233364 hashes, 3285 khash/s
[2017-11-06 14:05:15] thread 1: 197331608 hashes, 3288 khash/s
[2017-11-06 14:06:15] thread 1: 197283568 hashes, 3310 khash/s
[2017-11-06 14:06:15] thread 0: 197093004 hashes, 3264 khash/s
[2017-11-06 14:06:18] Stratum requested work restart
[2017-11-06 14:06:18] thread 0: 8115524 hashes, 3267 khash/s
[2017-11-06 14:06:18] thread 1: 8896012 hashes, 3298 khash/s
[2017-11-06 14:07:17] thread 0: 196031964 hashes, 3278 khash/s
[2017-11-06 14:07:18] thread 1: 197856604 hashes, 3296 khash/s
[2017-11-06 14:08:17] thread 0: 196691096 hashes, 3288 khash/s
[2017-11-06 14:08:18] thread 1: 197740892 hashes, 3286 khash/s
[2017-11-06 14:09:17] thread 0: 197276844 hashes, 3276 khash/s
[2017-11-06 14:09:18] thread 1: 197162844 hashes, 3291 khash/s
[2017-11-06 14:09:37] stratum_recv_line failed
[2017-11-06 14:09:37] Stratum connection interrupted
[2017-11-06 14:09:37] thread 0: 65115504 hashes, 3270 khash/s
[2017-11-06 14:09:37] thread 1: 64935828 hashes, 3307 khash/s
[2017-11-06 14:10:38] thread 1: 198394912 hashes, 3310 khash/s
[2017-11-06 14:10:38] thread 0: 196204988 hashes, 3264 khash/s

I'm doing:
minerd -a scrypt --threads=1 -o stratum+tcp://us.litecoinpool.org:3333 -O ab1jx.4:4

From a script and it works fine.  ab1jx is my username on litecoinpool, worker is 4, password is 4.  Only 1 thread to make it sort of a background process, leave that out to run at full throttle.
I don't get accepted lines often either with cpuminer, I assume because it's so slow.  I do with my ASIC miners.  I see the restarts a lot more often.  Sometimes I get accepted (and a yay) but this is a few orders of magnitude slower than everybody else, so it comes later than everybody else and may get tossed.  Not sure if you still get credited for it.  Check your stats on the pool after an hour or so, that's what counts.
No CPU miner is going to be profitable because it burns more electricity than the coins are worth.  Unless you have free electricity like solar or geothermal.  I do it as a test load on the computer and network.  If it's winter and you heat with electricity anyway it might work out.

Regarding the "stratum_recv_line failed" and "Stratum connection interrupted" errors, this is usually a problem with the pool, not you. Try pointing to a different pool for a few hours and see if that resolves the problem.


text:
Is Bitcoin centralized by mining pools?
Before going to my question, I want to make sure the difference between a full node and a miner. Below definition might be too simple, but it is enough to ask my question.

A full node is to store Blockchain and validate transactions.
There are 10000+ nodes running in Bitcoin network.
A miner is to create a next block.
There are 15+ mining pools create blocks.

Then, here is my question.
UASF is an approach by full nodes to enforce miners(pools?) to trigger the activation of soft forks.
However, if a majority of miners agrees on the activation of soft forks, could they activate it? If so, does it mean that only 15 mining pools could control Bitcoin?

However, if a majority of miners agrees on the activation of soft forks, could they activate it? If so, does it mean that only 15 mining pools could control Bitcoin?

No. Soft forks requires full nodes and users to validate the new consensus rules. Miners can "force" soft forks, but that actually wouldn't do anything if no one uses or follows the soft fork rules. Since soft forks must remain backwards compatible, there is nothing that can really be done in a soft fork that would result in miners being able to steal coins or control what anyone else on the network does. Such forks would be hard forks.
Full nodes are what enforce the consensus rules, and users are the ones who run full nodes and create transactions. If no one is running a full node that enforces the soft forked rules and no one uses the soft forked rules, then it's like the soft forked never happened. Miners can't force people to follow the soft forked rules.

source: Stack Exchange

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

sort: votes


text:
Internet of Money git download error
I tried to download the pdf from the following repository but i get an error
https://github.com/merklebloom/IoMv1
Ive done the following:
$  git clone https://github.com/merklebloom/IoMv1.git
$  cd IoMv1/
$  make pdf
It fails to create the pdf.
And I get this error message:

if [ ! -d "_build" ]; then \  mkdir _build; \     cp -R -L
  /etc/asciidoc/images _build; \    cp images/* _build; \   cp
  chapters/en/* _build; \   cp conf/* _build; \ fi; \
export
  XML_CATALOG_FILES=/usr/share/xml/docbook/schema/dtd/catalog.xml; \ cd
  _build; \ a2x --format=pdf --conf-file=a2x.conf --fop --xsl-file=custom-docbook-styles.xsl -k --verbose master.asciidoc; \
/bin/sh: 3: a2x: not found Makefile:65: recipe for target 'create_pdf'
  failed make: *** [create_pdf] Error 127

Same goes for creating any other file such as pdf, html, epub, kindle.

This isn't a problem with git.  The problem is that the program 'a2x' is not found.  Either you don't have it installed, or it can't be found in your path.

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


text:
how do i send to another from multibit bec it says "synchronizing" but it doesn't do anything WTH?
I downloaded this wallet app so im transferring coins from my multibit wallet. It says wait for the program to sync but it's taking so long.

I downvoted because of the poor questioning and overly panicky, non-researching attitude. Beside that welcome to BSE, make sure you read up on the philosophy of the SE network. Could you check if there is any bandwidth usage, or check if the files storing the blockchain are increasing in size.

yeah whatever. but thanks for the reminder though

It could be that port 8333 is being firewalled.
There is some more about this in the MultiBit help here:
https://multibit.org/en/help/v0.5/help_support_network.html


text:
creating our own coin - connection refused error
We are trying to create our own currency.

We first started with testnet.

The aim is to generate a genesis block and testnet did it very well. However, although we had connection between two computers and we have "hashespersecond" value more than 0, the balance stays 0.

Then, instead of using a testnet, we used mainnet(we read some topics about testnet which claim that balance never increases in testnet)

In mainnet, we saw that a connection is established(by using getinfo). However, in our log file, we always see the error:

connect() failed after `select(): Connection refused

We inspected the code and found out a variable called nRet. The value of the nRet is changed in getsockopt built-in function. We don't know why the value of nRet has changed(any value except 0 means an error in socket).

We changed the port numbers, even the port numbers we used in testnet. But it didn't work.

We don't have any idea about how to establish a connection between these 2 computers. Both testnet and mainnet didn't work and we are struggling with this issue. We are using SmallChange, a faster version of Litecoin.

Any help will be appreciated.

Use netstat -tan on the machine you are having trouble connecting to and see if it has a correct listening socket.


text:
How is Coinbase any different than Mt Gox?
Apparently Coinbase handles the private keys for your wallet which allows them to easily handle buying and selling.

As Coinbase is a hosted wallet, we do not provide users with their private keys; doing so would prevent us from taking advantage of our secure cold-storage technology to protect your bitcoin funds.

Isn't this exactly what Mt Gox did before it was compromised?

Maybe you should just ask: 'How does coinbase handle private keys?' Coinbase and MtGox provide different services.

You're right that in this regard, Coinbase and Mt.Gox are similar: they control the private keys, and incompetence or malice on their part could result in the loss of your coins. One difference is that Coinbase doesn't keep a balance of USD (or other fiat) in your account, only bitcoins. The other major difference is that Coinbase has not (AFAIK) shown any signs of incompetence or malice jeopardizing your bitcoins stored there (these signs, I hear, were around for a long time before Mt.Gox finally died).
Cold storage is a good thing when done correctly: it improves security and doesn't prevent instant bitcoin withdrawals (except in exceptional circumstances).
Still, personally, I will (long-term) store my bitcoins in a local client or my own cold storage, not an exchange or online wallet. There's still a real (maybe even higher!) chance of loss this way, but it'd be due to my incompetence, not someone else's.


text:
unconfirmed transaction more than 1 month 17 days?
someone please help, unconfirmed transaction for more than 1 month 17 days - https://blockchain.info/tx/3d314e7ffc03fdefba99ce02a33552e0479e1af7cc32cdf70483f4b0405f9f94

Accelerated using confirmtx.com

Your transaction does not contain commission.
The value of inputs equal to the output values.
May be that's why nobody confirm your TX for a long time.


text:
What command can i use instead of `ListAccounts`
In documentation said: "listaccounts will be removed in a later version of Bitcoin Core"
https://bitcoin.org/en/developer-reference#listaccounts

In "See Also" section:
GetAccount - Not return list accounts
  GetAddressesByAccount [deprecated]
  ListReceivedByAccount [deprecated]

Are we have a alternative command ?

listunspent??

listaddressgroupings Returns all addresses in the wallet and info used
  for coincontrol

it basically  returns output as a list contaning address and corresponding balance
[
  "2NCX68pyD9Hcp4FVtpoGYqG8GegDEiYBvNp",
  1.99939120
],
[
  "2NE6ee6nVjsmqTVy8WUqR9Krk84PH82KqV1",
  0.00000000
],
[
  "2NEPfREuzAZbVJNMfPR9gr8jfKCGZE24Xjw",
  42.99996200
]

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


text:
Where in the source code of the Core Client is the GetBlockValue() function?
I was reading Antonopoulos' book and there is a piece of code in chapter 8 in the part about Coinbase Reward and Fees and the code is a GetBlockValue() function. I was looking for it on github but didn't find it. I found something about a function called GetBlockSubsidy() that works in a similar way and is apparently a newer version but I can't find this one either. Also all the links I found linking to main.cpp in the repository don't work. Where is this part of the code now or what am I missing?

GetBlockValue was renamed to GetBlockSubsidy, and main.cpp was renamed to validation.cpp.  So you should now look at GetBlockSubsidy in src/validation.cpp.
You can search on Github for GetBlockValue; you won't find any hits in code but you will find some in commits.  That's how I found this.


text:
bitcoin core 0.13.1: Inconsistent getbalance result from RPC
I have a node which is giving inconsistent results from RPC:
$ bitcoin-cli getbalance
0.01647763
$ bitcoin-cli getbalance "*" 1
1.90937153
$ bitcoin-cli getbalance "" 1
1.90937153
$ bitcoin-cli getbalance * 1
0.00000000
$ bitcoin-cli listaccounts
{
  "": 1.90937153
}

Not sure how can I interpret this. Does my wallet have 0, 0.01647763 or 1.90937153? Documentation for getbalance says that if you don't pass any arguments, the defaults are * (all accounts) and 1, but when I specify those arguments, the result is not the same.
What are the real defaults when not specifying arguments to getbalance?

Is your shell replacing * with something else? What happens if you run echo getbalance * 1 ?

I think I've hit a bitcoin-core bug that may happen in weird circumstances (such as when trying to send a transaction which the node refuses to send, by returning a "rejected" error code). After I restarted the server, the transaction showed up in the bitcoin network, and the getbalance RPC calls started to be consistent again.


text:
NXT ARDOR wallet change over
I just bought ARDR and NXT on bittrex. I downloaded the wallet from nxt.org on to my laptop.
Can I send both Ardor and NXT from bittrex to this wallet? Has the Ign news happened?

I'm voting to close this question as off-topic because it is not about Bitcoin.

Ignis is still distributing until mid Nov-2017. You can send your nxt and ardor to you NXT wallet. Make sure you are NOT using the "Ardor client", as that is still in testing phase.
You send you nxt and ardor to you NXT address.


text:
Are minimal bitcoin fees nowadays enforced in bitcoin-core?
I read some resources like http://bitcoinfees.com/ and Are Bitcoin fees optional?, and I still don't get this:
Does bitcoin-core nowadays enforce (regulates) minimal bitcoin fee or is it completely left to the market?
For example if I put a fee of 10 satoshi and there are not much unconfirmed transactions will bitcoin-core always confirm this transaction (no matter of how old new inputs are, or anything else).

What does minimum fees mean?

Basically any fee that is enforced with some reason other than just regulated by pure market.

Bitcoin core does not anymore use the notion of priority, where a part of the block was reserved for transactions spending old UTXOs.
Further there is something called a "relayfee", which is simply a policy and default setting that you can check in your node when calling "getinfo". Any transaction with a fee/kb under that one is not propagated by the node. The default value currently 1000 satoshis per kilobyte.
But a miner can still choose to add any (valid) transaction to a block, irregardless of the fees it pays or amount it spends. But rational miners will always try to create blocks that maximize their profits, hence pays them the most in transaction fees.

"Any transaction with a fee under that one is not propagated by the node. The default value currently 1 satoshi per byte." - this is very very low fee, so it is just to prevent spamming with transactions?

Exactly, it is to prevent the network from being spammed. Although the default value has changed with time.


text:
Please explain CFeeRate::GetFee(size_t nBytes)
Referring to the function CAmount CFeeRate::GetFee(size_t nBytes_) in feerate.cpp:
If I pass in say 2000 as the nBytes argument, what will this function return as the fee nFee? I don't understand how nSatoshisPerK is defined. Also, curious as to why this is used instead of letting miners determine this fee through selective mining.
CAmount CFeeRate::GetFee(size_t nBytes_) const
{
    assert(nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max()));
    int64_t nSize = int64_t(nBytes_);

    CAmount nFee = nSatoshisPerK * nSize / 1000;

    if (nFee == 0 && nSize != 0) {
        if (nSatoshisPerK > 0)
            nFee = CAmount(1);
        if (nSatoshisPerK < 0)
            nFee = CAmount(-1);
    }

    return nFee;
}

If I pass in say 2000 as the nBytes argument, what will this function return as the fee nFee?

It depends on the fee rate that the CFeeRate object represents. The fee rate is denoted in Bitcoin per Kilobyte. So you pass in the number of bytes into GetFee and and calculates the amount in Bitcoin for the fee to be paid for something of size nBytes_.
If, for example, your CFeeRate object represents 0.00020000 Bitcoin per Kilobyte (or 20 satoshis per byte), giving 2000 as nBytes means that your fee will be 2000 * 0.0002 / 1000 = 0.0004 BTC.

I don't understand how nSatoshisPerK is defined.

It is defined at the creation of the object. Whatever created the object specifies the fee rate to use.

Also, curious as to why this is used instead of letting miners determine this fee through selective mining.

This is just an implementation detail, not an actual network thing that specifies the fee rate for everyone to use. CFeeRate is internal to Bitcoin Core and is simply just how fee rates are representing in internal logic. The fee rates themselves are constructed by the fee estimator which calculates fees based upon mined transactions.

Ok so this definition CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) in feerate.h looks like the one being used in validation.cpp here: CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);, which would set nSatoshisPerK to DEFAULT_MIN_RELAY_TX_FEE. Is that what you're saying?  Also, it seems that this is enforced in validation.cpp I thought these validations were run on all incoming blocks.

There are multiple fee rates used for different purposes. One of them is the minimum relay fee (which is what you are looking at) which is the minimum fee that a transaction must pay in order for it to be accepted to the node's mempool and relayed. Yes. that particular fee rate in validation.cpp sets nSatoshisPerK for that fee rate object to the DEFAULT_MIN_RELAY_TX_FEE.

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


text:
Do Miners get a reward for re-confirming blocks?
As far as I know, to ensure double-spending didn't happened and also for other security reasons, there is minimum number of confirmations that a transaction should have to be accepted. That value is around 4-6 blocks I think, but merchants can put their own threshold.
My question is if with the sub-sequent confirmations after the first one, the miners get the mining reward, or a share of it.
Or maybe a transaction is included in different blocks per each confirmation? But how the mining fees are paid then?
If there is no reward for re-confirmations, I'm wondering what would happen after the Bitcoin limit is reached and the only reward for the miners will be the transaction fees. Will transaction get more than 1 confirmation then?

Yes, miners get a reward for "re-confirming" blocks; no, it's not a direct reward.
Each block must reference the preceding block by including a hash of the preceding block's header in its own header.  That means each block confirms the block before it, which confirms the block before it, etc..., all the ways back to block 0 (the genesis block).

When we say a transaction has 1 confirmation, that means it's included in a block.

When we say a transaction has 2 confirmations, that means it's included in a block which is followed by one block.

When we say a transaction has 3 confirmations, that means it's included in a block which is followed by two blocks.  Etc...

When the block subsidy stops (or becomes so low it's mostly irrelevant), miners will create blocks only for their transaction fees.  So miners will attempt to mine block A for its fees (giving its transactions one confirmation); after it's mined, miners will attempt to mine block B for its transaction fees---and block B will confirm the transactions in block A, raising their confirmation score to two.  So transactions will still get more than one transaction then.
There is some concern that Bitcoin with transaction fees only will encourage miners to fork the chain and "re-mine" recent blocks with high transaction fees.  Some people call this "fee sniping", and if it's a legitimate concern, it still probably won't manifest for several years---and developers are already talking about ways to make it harder and less potentially profitable.


text:
Missing Bitcoin Transaction
Earlier this month I requested 2 payouts from BTCGuild for .25 each.

Neither one ever showed up in my wallet, and I just figured I messed up somehow and lost it.  But today I started sniffing around after requesting another payout (which I have received) and found this:

With the "Request Payment" button, is this still something I can retrieve?
And if so, how do I do it?
Thanks in advance for any and all info, good or bad.  Either way it will be a lesson learned.

I don't think scribbling out your address will do anything for your anonymity considering that theres a QR code, transaction timestamp, and that past used addresses can be searched for and found using only the last 4-7 characters.

"Request Payment" is just a nifty little tool that generates a QR code that points to the address on the page, so it won't help you unless you want a QR code for the address.
Check to see if the address you've sent to is in a wallet you own. If you have lost the private keys to the address, the only thing you can do is try to find them. It's nearly impossible to regain control of addresses you've lost or forgotten.

authors: วันนั้นอ่อนแอ แต่วันนี้ไม่ใช่


text:
Specifics on "Race Double Spending Attacks"?
Hi guys I am doing some research on double spending in the bitcoin network several ideas have been confusing me:
In prevention of Race attacks, merchants are advised to "connect to a large random sample nodes in the network".
First of all, What do they mean by this? How is it done?
Secondly, how do attackers initiate the attack? All I know is they make 2 transactions of same reference, one to themselves the other to the merchant who recognizes only the latter and surrenders his goods.
In an article on prevention, it states "We assume that the attacker may connect to an arbitrary number of nodes in the network to broadcast any number of transactions claiming outputs to its possession."
What exactly does this mean?
Thank you guys, I know this question is very condensed but I appreciate any help.
EDIT: Does it mean that I can go out and send X amount of bitcoins to myself and immediately spend the same amount, X on a merchant to defraud him?
Isn't that just too easy?


text:
Ws2tcpip.h and winsock2.h on Window QT Wallet
Been trying for the past few days but couldn't get it working, I already download the latest cryptopp library but its seems that maxcoin got some issue compiling
If I qmake "USE_UPNP=-" maxcoin-qt.pro
then i make -f Makefile.Release
I will get the error below, I tried replace the content of ws2tcpip.h with winsock2.h and I get another error with getaddrinfo at netbase.cpp which most probably need ws2tcpip.h , for this scenario where I need ws2tcpip for netbase.cpp yet if I don't fix this winsock2.h and ws2tcpip.h I can't get pass this, what should I do.
Thanks for helping
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/ws2tcpip.h:38:2: error
: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instea
d."
In file included from src\/schnorr.h:11:0,
                 from src\/hash.h:17,
                 from src\/net.h:22,
                 from src\rpcnet.cpp:6:
src\/cryptopp/osrng.h:43:0: warning: ignoring #pragma comment  [-Wunknown-pragma
s]
In file included from src\/compat.h:17:0,
                 from src\/netbase.h:11,
                 from src\/net.h:19,
                 from src\rpcnet.cpp:6:
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/ws2tcpip.h:147:8: erro
r: redefinition of 'struct ip_mreq'
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/winsock.h:315:8: error
: previous definition of 'struct ip_mreq'
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/ws2tcpip.h:390:13: err
or: expected initializer before 'freeaddrinfo'
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/ws2tcpip.h:391:12: err
or: expected initializer before 'getaddrinfo'
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/ws2tcpip.h:393:12: err
or: expected initializer before 'getnameinfo'
In file included from src\/cryptopp/pubkey.h:35:0,
                 from src\/cryptopp/eccrypto.h:7,
                 from src\/schnorr.h:12,
                 from src\/hash.h:17,
                 from src\/net.h:22,
                 from src\rpcnet.cpp:6:
src\/cryptopp/modarith.h: In copy constructor 'CryptoPP::ModularArithmetic::Modu
larArithmetic(const CryptoPP::ModularArithmetic&)':
src\/cryptopp/modarith.h:29:2: warning: base class 'class CryptoPP::AbstractRing
<CryptoPP::Integer>' should be explicitly initialized in the copy constructor [-
Wextra]
In file included from src\/cryptopp/simple.h:10:0,
                 from src\/cryptopp/filters.h:6,
                 from src\/cryptopp/randpool.h:5,
                 from src\/cryptopp/osrng.h:10,
                 from src\/schnorr.h:11,
                 from src\/hash.h:17,
                 from src\/net.h:22,
                 from src\rpcnet.cpp:6:
src\/cryptopp/misc.h: In function 'std::string CryptoPP::IntToString(T, unsigned
 int) [with T = unsigned int, std::string = std::basic_string<char>]':
src\/cryptopp/simple.h:35:128:   instantiated from here
src\/cryptopp/misc.h:414:2: warning: comparison of unsigned expression < 0 is al
ways false [-Wtype-limits]
Makefile.Release:3231: recipe for target 'build/rpcnet.o' failed
mingw32-make: *** [build/rpcnet.o] Error 1

I tried replace the content of ws2tcpip.h with winsock2.h - That's almost definitely the wrong thing to do, those files are not interchangeable. If you've modified the system header files, then your build system is now broken. You will need to fix your build system first, before you can build software with it.


text:
How does the 12 keyword back phrase works and how does it allow the creation of infinite number wallet address across multiple cryptocoins?
I wonder how crypto wallet like BitPay works?
They claim to be an offline wallet that you can back up with simply a 12 words phrase. Yet, they allow you to create an infinite number of wallets across multiple coins like BTC, BCH, ETH, XRP ...
How does such wallet keep track of the created addresses without relying on an external 3rd party server and how it uses to the 12-word phrase to access the private key of each and all of these created wallets?

There's a specification that defines a common algorithm to derive private keys (BIP 32). It's used with (BIP 44 which specifies the "derivation path" for different accounts.)

Per BIP39 the original entropy in form of mnemonic can be translated to master seed per BIP32.

This document describes hierarchical deterministic wallets (or "HD
  Wallets"): wallets which can be shared partially or entirely with
  different systems, each with or without the ability to spend coins.
The specification is intended to set a standard for deterministic
  wallets that can be interchanged between different clients. Although
  the wallets described here have many features, not all are required by
  supporting clients.

Using BIP44 one can use different coin_type codes for different currencies and standard derivation is m / 44' / 0' / 0'
BIP44:

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

As far as I know BitPay/Copay use this derivation type.


text:
How to create a brainwallet with bitcoinjs?
This is how to create a brainwallet with bitcore
const Bitcore = require("bitcore-lib");
// const Mnemonic = require("bitcore-mnemonic");
// https://bitcore.io/api/lib/crypto
let brainsrc= 'satoshi'
let input = new Buffer(brainsrc)
let hash = Bitcore.crypto.Hash.sha256(input)
let bn = Bitcore.crypto.BN.fromBuffer(hash)
let pk = new Bitcore.PrivateKey(bn).toWIF()
let addy = new Bitcore.PrivateKey(bn).toAddress();
console.log('The brain wallet of '+brainsrc+' \nAddress: '+addy,' Private key:'+pk)

For bitcoinjs, I only know how to create random address:
// https://github.com/bitcoinjs/bitcoinjs-lib/blob/v3.3.2/test/integration/addresses.js

const bitcoin = require('bitcoinjs-lib')
var keyPair = bitcoin.ECPair.makeRandom()
var secret = (keyPair.toWIF())
var addr = (keyPair.getAddress())

console.log('The brain wallet of '+brainsrc+' \nAddress: '+addr,' Private key:'+secret)

How to do it?

First of all, don't use 1 word seeds, that will be too easy to brute force...
index.js
const bitcoin = require('bitcoinjs-lib')

const brainsrc = 'satoshi'
const hash = bitcoin.crypto.sha256(Buffer.from(brainsrc))
const keyPair = bitcoin.ECPair.fromPrivateKey(hash)
const addr = bitcoin.payments.p2pkh({ pubkey: keyPair.publicKey }).address
const secret = keyPair.toWIF()

console.log('The brain wallet of '+brainsrc+' \nAddress: '+addr,' Private key:'+secret)

output:
$ node index.js
The brain wallet of satoshi
Address: 1xm4vFerV3pSgvBFkyzLgT1Ew3HQYrS1V  Private key:L4XnHhvLC1b4ag9L2PM9kRicQxUoYT1Q36PQ21YtLNkrAdWZNos6

Examples can be found on the git repo: https://github.com/bitcoinjs/bitcoinjs-lib#examples

TypeError: bitcoin.ECPair.fromPrivateKey is not a function

what version of bitcoinjs-lib and node are you using?

Yes node. I upgraded to  4.0.0 and it works.

It would be a plus if you can provide a link to the documentation

Good idea, just edited the answer, Bitcoinjs-lib doesn't have formal docs, but there are examples.


text:
How can i check which date BIP gets `final`
I want to sort BIP with respect to date they became final, but for some proposals on github there is no date specified, i think refereed as flag day.
From where i can get final date of proposals?


text:
Stateless vs Stateful wallets
Stateless wallet are wallets that do not store any information locally on the device.
Stateful wallets are wallets that store  information such as index of unused address.
According to my understanding

Stateful wallets are more efficent as compared to stateless. As stateful wallet store unused address index locally, whenver a user request to generate a new address. They know right unused index, whereas stateless wallet generates addresses from very first index and queries full node whether a address is used or not.
If stateful wallet lose all his locally stored data, it needs to work from very begining. It is acceptable in case of blockchain that keeps history from very first transaction. But in case of cryptocurrency like iota that prunes history, if stateful wallet lose stored information, it is going to be big problem.
Stateless wallet needs to do too much computational cost. As if user last unused address is at index = 1000, it needs to generate all address from index 0 until 1001.

My questions are

Which wallets are better stateless or stateful?
Which wallets are currently common stateless or stateful?
Example of stateless and stateful wallet?
If stateless wallet generates address from index 0 until unspent address index is found, and queires from full node, is it compromise privacy of user. As full node came to know what address a user own?

Note that here i am mainly concern about information of unused index.


text:
What would a new exchange need to be better than the rest?
If a new crypto v crypto exchange were to be built and launched. What would tempt you to use it rather than what you currently use? Or what improvements would you like to see from the way things work now.

I was considering to close this as "primarily opinion based", but came to the conclusion that it can be a good question, in that it's questions like this one that will move Bitcoin ahead. Let's keep it constructive: In any answer, please explain why and how, and back your opinion up with facts and references.

FDIC insurance for all customer coins/fiat they hold would be an advantage, though probably not that realistic to achieve.

A popular opinion in the Bitcoin space is that transparency is key for Bitcoin businesses. Bitcoin and it's pseudonymous nature make it very suitable for scams and corruption.
Competitive fees or additional payment options are no longer the key to the success of an exchange. There are so many exchanges that you can almost certainly find what you need feature-wise. However the important question that remains is whether the exchange you found can be trusted with your money.
Proof of Reserve
Fortunately, the nature if Bitcoin's technology also has a positive side with regard to transparency: the Bitcoin block chain is public and everyone can verify it.
This allows for the possibility of exchanges to verifiably proof that they hold all the money of their customers. CoinDesk explains this here. Some exchanges like Kraken have recently published such proof of reserve.
An ideal situation would be for an exchange to provide a method that allows users to constantly verify of their money is still there. F.e. by keeping every customer's coins at a fixed address (this could be quite costly) or publishing a proof of reserve on a weekly or daily basis (this could be done automatically).

Proof of reserve is a good thing but solve the problem of trust at the time is produced and not for the future. Mark Kerpeles (mtgox) gave proof of reserve in the past, we all know what's happened next.

You are right, mtgox history with such proof of reserve  could not happen. It's great. Maybe enough. But explicit volunteer fraudolent activity by the exchange owner that just after the last proof take it all and fly to "Puerto Escondido" it's not covered.

In my humble opinion the ideal exchange works without needing to be trusted.
I mean that this exchange must find a way to work without having direct control on customer funds, this controls (private key) remain in the hands of the customers.
If this is not possible for the trade to occur, limiting as much as possible the funds controlled by the exchange is the most desiderable feature to me.
This is needed to avoid what happens to mtgox
I think (not sure) "smart contracts" of new cryptos like Mastercoin, Counterparty, BitShares, Ethereum could technically address this solution

there is such a thing as too much decentralization. By decentralizing exchange mechanisms, we could theoretically set off an irreversible change in the global economy. The most obvious effect of decentralization is conversion to and from fiat. The least obvious effect, is how that can relate to our global economy. I'm talking about taxes. Without taxes, we allow for a system that marginalizes the already marginilized 51%(ie, the poorest people around the globe) while enabling the rich to become richer. [continuing in next]

Without a feasible means for taxation, the governmental bodies around the globe collapse. at this time, we see total anarchy. Things like this start as a small action, like Bush repealing the Homestead act... Use your noodle. crypto is not ready for a decentralized exchange, because markets need a centralized control mechanism to prevent total anarchy. A decentralized exchange will be subject to the same attack mechanisms of the proof of work block chain. gain 51% of the network it is highly probable you could double spend such a system.

I personally completely disagree. I don't think decentralization means taxes evasion, it's about "old fiat high commission and fee" evasion. This is where the richest get richer.

@r3wt You never heard of http://en.wikipedia.org/wiki/Henry_George right? The single rate, single tax on pure land area (without regard to what you build over it) that George proposed is actually the most efficient tax model of all - according to the theoretical analysis Joseph Stiglitz did on it. Plus, it's the one that harms the poors the less whilst reducing the disparity between the rich and the poor in a society.

What i was proposing is a "decentralized exchange" See http://bitcoin.stackexchange.com/questions/21513/how-would-a-decentralised-exchange-work/23824#23824 for more info

@pyramids the block time of BitsharesX will be around 30 seconds using the new (deligated) Transactions as Proof of Stake

1) An ideal exchange, in my opinion, should implement a form of the Tobin tax.
Plenty of times I've been burned trying to take advantage of a large price gap in a coin that apparently does see movement. I may place a buy/sell offer just to see, some seconds later, my offer being surpassed by another by just some satoshis. Should I try to pass it again, the offer gets passed again, and again and again - until one of 2 things happens: someone fulfills my order once the price gap has all but disappeared or I cancel all my orders just to see, some seconds later, all the successive orders that continuously passed mine disappear as well, seemingly leaving the market at a wide price gap again.
Other times, I've seen some participants "compete" for the price of a coin until the price does move in a direction and, once a high enough number of other participants try to ride the wave, a dump - at that point it becomes obvious it was really 2 members of the same team attempting to manipulate the market.
2) Another improvement I wish existed in exchanges is to place a limit in the number of orders/cancels per time period per market, so that participants with very fast Internet connections and trading with bots don't have too big an advantage over humans with less than ideal bandwidths. Plenty of times I've seen traders putting an offer and cancelling it after just some seconds, again and again several times per minute. Obviously it's a trap for humans with slow connections who might be tempted to trade at the price they see unaware that such price is no longer the best.
A hard limit of orders/cancels per second and a system that executes trades every 10 seconds (so to say) would ensure most participants have the same view of the market.
Post Edit Addition:
3) Something else an ideal exchange should have: the ability for a trade to go thru different coins if doing so allows the customer to get more coins for what they already have.
At some exchanges there's a BTC/DOGE market, and there's also a LTC/DOGE market. But then there's a BTC/LTC market, so should there be a sudden increase in the value of LTC vs. BTC , for some time it'll become cheaper to buy dogecoins in BTC, and more profitable to sell them in LTC. Some coins can also be bought with Primecoins, adding the markets XPM/BTC, XPM/LTC and XPM/DOGE to the mix and lots of potential inefficiencies.
The markets eventually reach very similar levels of mutual coin worth after some minutes but never exactly the same, have seen it a number of times. If I were allowed to indicate in which coins I'd like to pay/be payed, I could get a better deal when I want to get, say, 42coins in exchange of my potcoins. Having the exchange look at the potential exchange paths available at a moment and choosing the one that benefits me the most.
At this point, I believe such an exchange would basically mimic the Ripple network.

Of course, a useful comment or feedback criticism is much preferred to a negative vote just because

Yes, exactly: I meant not just on completed trades but also on cancelling orders; that way there's a penalty for placing orders as "bait" then cancelling after a few seconds. A bit more of sand into the financial markets' gears, to reduce the positive feedback gains in the system.

Established financial markets have the benefit of volume, likewise in the crypto world, there's so much volume in markets for LTC, DOGE and a few others that prices are usually a few satoshis off and manipulating them is nigh impossible. With less traded coins, automated front-runners impose a big penalty on humans and on people with high-latency connections (bandwidth's really irrelevant). Due to latency in propagation of TCPIP packages, a period of some seconds might be desirable so all traders are fully aware of prices in the last trading period.

I think with the latest set of IRS rules, the best exchange would allow for autotracking and calculation of transactions and capital gains.  One can imagine at tax time have a push button system that autogenerates all the information needed by the IRS. I can image this could become a rather large document, but if a standard format and file could be generated, then it would be a selling point for the exchange.

This and a few other nice features, an industry standard API e.g. FIXML like Atlas uses, and a proper trading client rather than just a webgui e.g. Meta trader which BTC-e offers a screen for.

A new exchange needs to have:
Volume
Top most point - Developing an exchange is not just enough, you need to think on to get volume, the more volume you've on exchange you've better chances to create a place among largest prevailing exchanges.
Functional capabilities
The functional which can stand among the largest available exchange that the way to attract end user to trade on an exchange.
Platform Infrastructure
Exchange infrastructure must be robust to handle high volatile market in peak trading session, it should not hang or stuck.
Order Matching Engine
A proper unit test of order matching engine is important because its all about to fulfill the supply and demand the various users from different location dealing with different crypto coins. Order matching engine is the main part and you need to make sure that its algorithm should have enough capabilities to handle millions of transaction in fraction of time.
Coin Pairs
A trader always looks for comfortability on an trading platform, they want to trade with easy. Most of traders want to trade using BTC but someone choose to trade in ethereum or usdt pair. So you need to make sure that you've atleast btc, eth and usdt pair on your exchange. you can also create your own coin pair to offer something good to end users.
Security
The most important things is that your exchange is secured or not, you need to make sure that end users funds are secured in your exchange wallet. You need to make sure that your system should not have any low pools in deposits/withdraw of coins also the verification method are important to work properly.
Many more that needs attention to launch crypto exchange in competitive market

It's time to reach the mass with all media attention so Safe, Secured, and Easy to trade should do it. Now you're looking at the average Joe not innovators or early adopters!


text:
Is mining hardware particular to specific mining algorithm(s)?
In particular, I was pool-mining with scrypt algorithm, using my GPU (was not bitcoin, but another coin named gamecredits, at gmc.acidpool.com).
I would like to purchase cheap mining hawdware (which would be useless with bitcoin but perhaps good with relatively "new" coins). Should I care whether a hardware supports "scrypt" in this case? Or does hardware care about a more "primitive" level without caring about the algorithm?

A GPU is general purpose and can do many types of computation.  An Application Specific Integrated Circuits is completely specific to one application, they don't have any ability to do any computation which they aren't not designed for. A mining ASIC made to perform scrypt hashing for example can't do any other type of hash.

Different currencies have different mining algorithms. What you should do is to use coinwarz.com to calculate the most profitable one, by filling in the details of the mining hardware's specs of the miners you're thinking about buying.
Be sure to put cryptocurrencies' future values (predict them!) and when the next miner may be released (predict!) into account (which coinwarz can't)


text:
Is there a way to predict somehow the required storage for a specific blockchain?
I'd like to store a blockchain or two in my computer. Blockchains are pretty heavy (I took over 3hs to download GameCredits blockchain, and is one of the smallest blockchains, I guess). My main fear is to not be able to keep using my pc to store the blockchain (e.g. this applies for others like Litecoin).
Is there a way to track current blockchain storage sizes and predict how much space will I need the next one or two years?

This depends on a number of factors,
1) The amount of transactions
2) How the blockchain will be compressed in the near future.
Now as i'm not quite familiar with the altcoins you stated, I can't go in depth about their compression development, but it would be fairly easy to find out what the MAXIMUM size of the blockchain could be.
Simply calculate every block as if it would be filled up with transactions ( maximum size), and multiply that by the amount of blocks  for/until the next year.


text:
Blockchain sizes, and external devices
This question is rather technical.
Blockchains tend to grow. Specially well-known blockchains like Bitcoin. I would like to store a certain blockchain on an external device (e.g. 1TB disk space), but some day the chain will grow enough to use all the space.
How do you manage this? Is there a way to partition the blockchain storage (to use many devices) or stuff like that instead of buying a larger device and moving 1TB of data there?

This is an interesting question from a blockchain perspective. Will the transaction block data ever outstrip the ability to store it ?  Or at least put it beyond all but the largest corporation's budget? It seems like storage capacities are still growing at a very fast pace, so I don't think this is an immediate problem.
But from a device standpoint, there are many schemes to create meta-volumes to the which physical devices may be added without affecting the ongoing operation of the system. Linux's Logical Volume Manager (LVM) is just one of these.
There are also any number of disk-array schemes and commercial network attached storage (NAS) units. The Drobo name is just one that comes to mind.
To specifically answer your question: if the external 1TB storage unit you are using is approaching its capacity, it would be time to upgrade. Acquire a larger unit, or move to a different system (perhaps one with the ability to add hardware storage on-the-fly, such as server able to operate an array of multiple storage units.)
Briefly stop your coinservers, attach the new, larger storage, copy the original blockchain data to the new storage unit, reconfigure the coinserver to operate from the new unit, and voilà.
You would add a line similar to this in your ~/.bitcoin/bitcoin.conf file:
datadir=/new_array/bitcoin-data

Multiple disks can be arrayed in different ways depending on the competing priorities of redundancy vs. data access speed. SSD's are plenty fast, and even rotational hard disks with enough cache memory are sufficiently fast. I would suggest a mirrored array (RAID-1) of rotational HD's as the best option.


text:
Automated transactions to addresses from database
I want to create a website where people can submit their altcoin address and they receive some for free.
The addresses are saved in a MySQL database and the transactions are send from just one address.
How do I have to connect the database with the altcoin client so the transactions to the user addresses are processed automatically?
Thank you in advance!

Most altcoin clients provide an API.  So the short answer to your question is "write some code that fetches the addresses from the database and calls the altcoin client API to send the coins".

You need to speak with each wallet through it's JSON RPC API. To speak with the wallet you need to write some code.
If you want to test this api go to your wallet in the menu Help->Debug->Console and write the 'help' command, it will give you the list of all the available commands.
To enable this RPC for external applications you need to create a .conf file. Try to run the wallet from the command line and it should complain that you must create this file. This file contains the credentials that external applications use to access the json-rpc api of the wallet. This is different than the password that you need in order to send the coins.
There are some security considerations that you need to keep in mind:

by default the JSON RPC calls are transmitted in plain text so you need to enable encryption explicitly
minimize the amount of coins you have in the server hot wallet. Instead use one external script to replenish the wallet as needed (also it could compare the addresses in the database with the amount spent)
set the credentials for the wallet access in a secure way


text:
What if old blocks invalidate with soft fork?
Making a soft fork means making consensus rules stricter.
Therefore there is a risk that some old blocks mined long down the blockchain get invalidated.
How was this handled in bitcoin soft forks? Did the developers of the fork have to make sure that all previously mined blocks up to current head validate?

The fix is in deciding when the change takes effect, and only validating with the stricter rule from that point onwards.
The easiest way is to decide upon a block height, say: 695,837 and all the blocks before that one are validated with the old rules, and blocks 695,837 and onward are validated with stricter rules.
Something a bit more sophisticated was used for SegWit. Every 2016 blocks, the difficulty gets modified to make sure we get a block once per 10m on average. These 2016 block intervals were used to gage support for the softfork, through signalling in the version bits of each block. Miners get to set these when they find a block, and only when 95%+ of the blocks in a 2016 timespan contained a certain flag would SegWit activate. This way, there was no fixed block height dictated in code, but instead, the miners together were able to dictate the lock in of the soft fork.


text:
How do bitcoin nodes sync with the INV mechanism?
In When and how does bitcoin node sync itself? it is described that there are a number of ways for nodes to synchronize on the blockchain state.
How does (legacy) INV mechanism works?

If I understood correctly it goes like this:

I get the announcement from a peer that he found a new tip in his blockchain. (so called INV message)
I send him the block locator message with last 10 hashes from the tip of my blockchain.
Me and him could be on different branches so he has to detect which hash do we have in common (the hash where fork happened). Or we are on the same branch and he just advanced the branch by one hash. NOTE: If he does not find the common hash he will ask me to send hashes further back my chain (fork happened somewhere earlier).
When he detects the common hash, he will send me the headers from this hash up to the newly found hash. I validate each header, stopping if a header in this process is invalid.
If his chain is now longer than mine (edit: and download the transaction part's of his blocks, verify them then) I switch to new chain.

The headers messages do not work this way.

Feel free to copy my answer and change what is wrong.

@eponymous what is the wrong part of the answer?

@eponymous In what way is it wrong?


text:
Current bitcointalk.org probation period and rules
I see this, but don't understand and is a bit old Can't post on bitcointalk.org.
What are bitcointalk.org current probation rules/period?
Is it true that you have to pay to participate on that forum?
Don't see any restrictions here: https://bitcointalk.org/index.php?topic=1689727.0 but maybe I didn't notice.

What are bitcointalk.org current probation rules/period?

Each rank has certain restrictions that are removed as your rank increases. Newbies have the most restrictions. They can only post once every 360 seconds (6 minutes), can only have plain text in their signatures, PMs will have a warning saying that the person is a newbie and potentially a scammer, and a few other things. The restrictions for each rank are listed here: https://bitcointalk.org/index.php?topic=178608.0
Newbies can post in any part of the forum though. The newbie jail has been removed.

Is it true that you have to pay to participate on that forum?

For the majority of users, no, you do not have to pay to participate on Bitcointalk. The only people who have to pay are those who are registering from "evil" IP addresses. "Evil" IP addresses are IP addresses which many "evil" things have been done from. "Evil" things means that multiple accounts were registered from an IP address and were later banned from the forum. Accounts can be banned for many reasons, usually spamming. In order to register a new account from an IP address with evil points, you will need to pay a small fee. This is an anti-spam and anti-DoS mechanism.
Most evil points end up being assigned to proxies, VPNs, and TOR exit nodes as those are what spammers use to register their accounts to hide their identities. If you are not registering using one of those things, then you likely will not need to pay any fee to register.

So why cannot I post my first question in development and technical forum there? It says I already posted but cannot see the question in the forum.

Look at your profile and see where your post is. It is possible that the post was deleted by a moderator or moved to another board. If the post was deleted, you should have received a PM that it was deleted. If it was moved, you will not receive a notification but you will see it in your recent posts.

"Show posts" shows no post.

Do I have to verify my account somehow via e-main cause I didn't receive any verification mail.

You do not need to verify your account. Refresh the new topic page where you make your post or go back to the main board and click new topic again and remake your post. Sometimes the forum has technical issues.


text:
How does number of transactions in the block affect it's mining time?
Does number of transactions in the block affect it's mining time?
How and why?

The number of transaction in a block negligibly effects the mining time. The only effect is that more computations need to be done to calculate the merkle root during block construction, but that is a very small fraction of the number of calculations needed to be done during mining itself. Mining only hashes a fixed amount of data so including more or less transactions does not really make a difference.


text:
How to create a Database on Blockchain and retrieve it after applying some operation and constraints on the data of tables?
I want to create a database on Blockchain which gets input from a HTML form and add a tuple to table on Blockchain on each submission.The Tuples on Blockchain will be sorted by applying some operations on it and constraints of visibility of data for certain period of time. I had tried almost all available on internet but no platform provides such functionality and i can't find any relevant tutorials for the same.

That makes no sense at all. The blockchain is not a database or a place where you store arbitrary data. The few bytes you may try to weasel in will be very expensive, so your application will be useless.
You're following "blockchain" buzzword hype sales talk that does not make sense and is simply a lie. Don't fall for it.
Look to MySQL or PostgresSQL or NoSQL or similar.

The blockchain is not for sorting data or other forms of "functionality." That is a waste of (expensive) block chain resources, and that's why "no platform provides such functionality."
The blockchain can be used for storing a reference to your data using an identifier such as a hash total. That's where the "retrieval" part comes in.
In other words, do your calculations elsewhere, store the results elsewhere, and then it (might) make sense to post a reference on the blockchain to the data. But not the actual data itself.

It is not good approach at all, but you can do so.
Currently good described methods if you use google:

OP return code
P2SH

Both approaches are different and both are well covered.
But as I mentioned before, it is not good approach to store data into blockchain, at least not into blockchains desinged to be digital currency.
Maybe best approach that you could do is to use testnet/regtest for your tests.
You could also fork any blockchain project (of the coin you like) and change it's parameters, like ie. max amount of P2SH addresses. With that you would have your own chain, configured for data storage the way you want to have and you could experiment then, whatever it is, ie. storing to any available blockchain TXID of your chain or whatever you want. If your tests go well and you have something useable, I would suggest you to start separate project with that.
Other users did suggest already some projects that you should look into, as they have the approach to store data using blockchain technology.
Hope it helps.

Try Bigchaindb.com or you will need to use mongo.db with a blockchain layer. I don't know your background but I would guess you will need some top-notch programmers to do this for you.


text:
Is it possible to combine multi-sig and locktime?
Is it possible to create a 1 of 2 multi-sig address in which only one of the keys is time-locked and the other can sign any time?

only one of the keys is time-locked

Keys aren't time-locked. Transactions are. However, Bitcoin now has an opcode for this purpose: OP_CHECKLOCKTIMEVERIFY.
Essentially, it forces the transaction to have a lock time further in the future than its argument, otherwise the transaction is invalid.
In your case, the script would look like this:
OP_IF <this pubkey can spend at any time> OP_CHECKSIG OP_ELSE <block number> OP_CHECKLOCKTIMEVERIFY OP_DROP <this pubkey must wait until block number> OP_CHECKSIG OP_ENDIF

The spend-anytime key can redeem the transaction with
<Sig> 1 <above script>

The other key can redeem with
<Sig> 0 <above script>

but only after the given block number.

No, not the way you are describing. The lock is placed on transaction outputs, not the private key(s). When the lock expires the outputs can be spent but it doesnt matter which of the M of N signatures are used, just as long as they are valid and that there are at least M of N.

Using OP_CHECKLOCKTIMEVERIFY the output being spent can require the locktime of the spending transaction to be a certain value in case one of the signers doesn't sign.

@PieterWuille this sounds like it achieves the same effect as the question implies, but I can't quite grasp how to do it. Could you elaborate or give an example? Thank you!


text:
Who owns the bitcoin mining servers
I mean there must be some program that determines the level of math equations. and there must be a physical server. So who pays for those servers and determines the equations.

You should probably take a look at https://en.wikipedia.org/wiki/Peer-to-peer and https://en.bitcoin.it/wiki/Mining.

There is no central authority that "determines the equations". Instead, every Bitcoin node (whether run by a big mining operation or your computer in your basement) is responsible for verifying all the work done by others. Every Bitcoin node knows and agrees upon the rules for determining what the difficulty level should be.


text:
"Invalid address" when trying solo mine with bfgminer
I am trying to mine solo.
I have installed BitCoin Core on my Windows box, set up incoming connections

and wrote in config file <BitCoinStore>/bitcoin.conf
server=1
rpcuser=myusername
rpcpassword=mypassword

Then on Linux box I ran
bfgminer -o http://mywindowsaddress:8333 -u myusername -p mypassword --generate-to myincomingaddress

and got
[2020-11-13 12:23:23] bfgminer: --generate-to: Invalid address

Why? What is invalid?
Should I run bitcoind instead of thus GUI on Windows?

Did you replace "myincomingaddress" with your actual address?

Yes, I took this address from BitcoinCore in section "receive". But I noticed, that it looks different than in examples: all characters are lowercase in mine, while in examples uppercase and lowercase mixed.

It's an old thread but it might be helpful to someone else.
If you are using a bech32 address (staring with bc1) it does not work, try generating a base58 segwit address (starts with 3).


text:
Best way to get the entire bitcoin transaction history
From my understanding that the entire bitcoin transaction history is stored in every client. I'm looking into ways to get this information out and get them into databases or simply csv files.
I have checked out this repository on github:
https://github.com/bitcoin-abe/bitcoin-abe
But it seems it has not been updated for a while, and it mentions

Prior to Bitcoin v0.8, this assumption seemed safe. Abe may need some fixes to >avoid skipping blocks while current and future Bitcoin versions run.

I'm wondering if there is other tools for getting the entire transaction history out?
Thanks in advance!

There are two ways of doing that.
You can read blocks directly from the disk and process them or you can ask a Bitcoin client (like Bitcoin Core, for example) for the info via RPC calls.
The second way is easier but it may be slower.
For each block get all the hashes
 For each hash get details and write to your choice of storage

There are RPC call for each of the actions.
Just type help into the console in a Bitcoin client and you can see them all.


text:
How will node handle two branches of same length?
Let's say node is on a chain of length N+4, and receives a block from the chain of the same length N+4, but diverged by 4 blocks.

Is the information of the length and accumulated difficulty broadcasted along with mined block?
How will the recipient node handle this situation?

This phenomenon is known as a chain-split (i.e. the bitcoin network can no longer agree which chain is the canonical chain).
Nodes will be network-partitioned until one chain becomes dominant.
Therefore:

Is the information of the length and accumulated difficulty broadcasted along with mined block?

No.

How will the recipient node handle this situation?

Nodes will handle equal branches on a First Come, First Serve basis, so there will be a network partition where some nodes agree chain A with length N+4 is the canonical chain and the other set of nodes will assume chain B with length N+4 is the canonical chain. In the event of such a chain-split, the race is on for miners to produce a new block-tip and broadcast it across the bitcoin network ASAP to achieve convergence. When the contention is resolved, the node can switch to longer branch and obsolete the old branch.

But then, if I recieve a block that is not for the tip of my blockchain, I will reject it immediately if along I don't recieve the information that it is for the tip of some other heavier chain. I will then never switch to another chain.

Sure, but say you have adopted chain A with length N+4, and suddenly you receive a block-tip of length N+5 that mines on top of chain B, your node will immediately recognise that the block-tip you just received may belong to a longer & heavier chain, so your node will probe the peer that has sent your that block tip for all the relevant blocks.

How will my node immediately recognise it was a block for the heavier chain, and not some erroneous block for example?

But I dont know if proof of work is correct as it was made with different inputs (unknown to me).

So I looked the bitcoin core implementation and it looks like all blocks are stored so as long as they obey consensus rules. And there's a function in src/validation.cpp that activates the best chain.

So all the blocks from all the branches from entire history of blockchain are stored? You can also join the chat: https://chat.stackexchange.com/rooms/67464/discussion-between-croraf-and-tushar


text:
Does bitcoin give users credit/debit card. If yes, how do you request the card
I am a new user at bitcoin so things are a little difficult for me since the website isn't specific. I wanted to know how to request a credit or debit card from bitcoin(that's if it is possible). I also have a little trouble on the site while trying to enter my full residential address.

Can you list which site?

You should probably take a look at an introduction to bitcoin first. There is generally no need to state any personal information about you to use bitcoin and credit cards aren't needed. If you use such a service, stating which one you use is necessary for anyone to help you.

"the website" sounds scary. Please make sure you get your information from bitcoin.org , not from scam sites like bitcoin.com. To answer your question: bitcoin will definitely not give you a credit/debit card because"bitcoin" is not an entity. However some companies might provide cards that handle bitcoin accounts..

Check Bitcoin Debit Card Comparison


text:
bitcoin core code
I am a c++ developer, I am trying to understand the bitcoin core code, I would like to know if there is any documentation (except the //comments in codes) and if there is any descritpion of the arborescence files (global description about each file). Thank you


text:
What is 999999999999ULL
I am building an altcoin based on bitcoin 0.12, in chainparams we find :
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
    consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL;
    consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
    consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 0;
    consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 999999999999ULL;

what is 999999999999ULL?
should I use it in mainnet parameters instead this old dates ?
   consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
    consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
    consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008

// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1456790400; // March 1st, 2016
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017

Thanks

These values appear for the regtest chain only.
It looks like these values are supposed to state the time window during which deployment of a particular protocol change is allowed to happen. For regtest that window is set to be from times 0 to 999999999999, maybe so that you can do it whenever you want.
For your coin, you presumably either want these features active from day 1, or not at all. In either case you'll probably want to remove the time-deployment code altogether.


text:
Can ASIC miners easily be used to guess brainwallet passphrases?
After reading the Bitcoin wiki page for brainwallets it seems to me that mining equipment can be used to brute force brainwallet passphrases. Is this correct?

"...so hackers can collectively try multiple trillions of passwords every second in the privacy of their own homes with the very same equipment they use for mining bitcoins (in the usual sense)."

How would one use an ASIC miner to brute force the blockchain with a dictionary attack?
What would the application logic look like?
Can a standalone(The Antminer S1 for instance) miner be "tricked" into believing it is doing normal work for a pool when actually just hashing random strings or would it need custom drivers?

No. Most brainwallets (assuming a more conventional brainwallet like one from brainwallet.org and not a seed-based one) are made by passing a passphrase through one round of SHA256. ASICs are designed to do two rounds.

Yeah, that's what I thought. So we can conclude the quote from the bitcoin.it wiki is actually incorrect?

Assuming what I have said is correct, they are probably talking about GPU/CPU mining. According to bitcoin.it, the article was last updated in August 2012. I don't think ASICs were even thought about much back then.

All Bitcoin mining ASCIs that I am aware of are incapable of hashing arbitrary data even with double-SHA256 - they have bitcoin block hashing hardwired in so they can brute force the nonce on-chip.

I was thinking you might be able to make it work for strings that are as long as a block header but then technically, an optimal ASIC chip takes only as input a partial block header (difficulty is encoded) and will only output an arbitrary hash (maybe even only the nonce) of something guaranteed to be different from the input so yeah...you couldn't even get the double-SHA256 of string of the right length even.

What follows is an educated guess, not certain statements, and is based on Electrum's brainwallet phrases (just figured it'd be a good example), not other schemes or human-generated ones.
No, a miner can't easily be tricked into doing it (e.g. solely by a rogue pool), but can be programmed to try to crack brainwallet phrases. This is because ordinary hashing involves totally different inputs (a block header and nonce, hashed twice) than brainwallet cracking (a random 128 bit seed, hashed 100,000 times).
You'd do this by trying random 128-bit seeds, through Electrum's algorithm, which involves taking the seed and running 100,000 SHA256 hashes on it (maybe some other stuff I'm missing would make it more difficult). You can then do a few more calculations to come up with the addresses that the key generates, and check the blockchain to see if any of these match.
The current network hashrate is ~50,000,000 GH/s. If all of that were instead put towards breaking everybody's Electrum keys, and all it takes is the 100K hashes, there'd be 5*10^11 out of 2^128 checked every second. You could check all of the keys in about 2*10^19 years, or 1.6*10^9 times the age of the universe. While you'd probably get collisions long before this (dependent on how many Electrum-generated addresses are in use), I think this gives you an idea of the infeasibility of this sort of attack.

Thanks you for the good answer - good to know we're safe with Electrum.

In the Bitcoin.it Brainwallet wiki the example seems to be just one SHA256("Passphrase") to generate one private key though - does this make sense? Does the "using the same equipment" quote make sense? (As in running billions of SHA256(dictionary[eg "correct horse battery staple"])-like private key generations?)

Yes, I think that you'd be able to give your miner different common phrases/word combinations to try with that scheme as well. You'd have to guess what phrases and schemes (e.g. single SHA256, double, or anything else to come up with a 256 bit number/private key) people are likely to come up with for it to be most effective.


text:
what are the future projections for fees per byte in satoshis if BTC becomes the global settlement layer?
What are the future projections for fees per byte in satoshis if the BTC becomes the global settlement layer?
and is this number increasing over time as the block subsidies are decreasing and what are the future projections, taking into account block space limitations.
Put in another way: what is the minimum BTC value that will be cost effective as a transaction if the block space limits transcation on the Bitcoin network to around 200 million transaction per year?

Nobody can answer this question accurately. Even forgoing the problem of being able to predict the state of an economy years into the future, there is a question of what portion of those transactions are on L1 vs L2. If 100% of them are on lightning, there would be no change in L1 fees.
The minimum BTC value is the minimum miners will accept. Nobody knows that answer except those mining. What is cost effective for a user? A miner? These are not questions with definitive answers.

Thanks. I listerned to a guy called Bob burnett, who is I gather a computer expert. He said it could become cost prohibited to send 0.1 BTC over the network in the future because of block space constraints causing high fees. This answer did not seem right to me so I wanted help in finding some future projections for fees. In an idea scenario there must be a good estimation to answer this question. It does not have to be accurate, just take in some of the many factors and considerations.

Idk who Bob Burnett is but anybody who says they can make any sort of even ballpark accurate estimate of this is selling a pipe dream at best. Lightning transactions are free or extremely low fee. This is where the vast majority of transactions will live in the future. The Bitcoin L1 will provide security but not storage of transaction history (whereas a classic L1 transaction has both) except one transaction to open a channel and one to close it. Inside that channel an infinite number of transactions can occur. This opens up more space in the L1 chain to store that security information.


text:
Does Taproot allow CoinJoin-style transactions without revealing all signers?
Taproot allows to hide a script behind a transaction and only release the relevant information when the output is being spent. Would this allow for a construction of a script with N participants + initiator to generate a script where all N participants have to sign it and the initiator finally signs? Would the MAST reveal all other signers or just the initiator who finally signs the script and can proof that he followed its rules?

The question is a bit confusing. CoinJoin refers to having a transaction with multiple inputs where each input comes from a different participant. The rest of your question seems to be about a single input that multiple parties need to sign for. Which of the two is it? (in case of the first the answer is no, in case of the second the answer is yes with some caveats).

@PieterWuille Thanks for your answer! It's kind of both, is it possible to collaborate for N participants to create a decentralised, trustless mixing of coins to increase privacy?

Possibly, but that's completely unrelated to Taproot/MAST, as those are things inside an individual output (and inputs that spend them), not across inputs.

Thank you for clarification, @PieterWuille! I will have to look deeper into Schnorr & Taproot, but there is not much understandable literature out there yet...

As per my understanding what you are proposing can be achieved with Schnorr signatures, which will be implemented with Taproot. Since Schnorr signatures permit key aggregation, you can construct a single public key (threshold public key) from multiple participant public keys, which in your case is N + initiator. When spending you can just combine the signature from all the parties together (threshold signature) and spend it. The threshold public key and threshold signature are indistinguishable from their single-party equivalents. So for an outsider, it might be as though a single person signed it.
MAST is used to reveal only one spending condition while hiding others. For example, say you have a transactio which states that for first 100 days, you require N and initiator. From 100 to 200 days you require M of N and the initiator and after 200 days you only need the initiator. Currently when spending such transaction you need to reveal the entire spending script. With MAST you can consider each spending condition as a branch of the Merkle tree. When spending that output you just need to reveal the branch that you are spending thus allowing you to conceal the other branches from the public.


text:
Is there any way to revoke or update private key?
Suppose my private key corresponding to an address is stolen.
Is there any way to revoke private key or update the private key?

Generate a new private key, calculate its public key, derive an address from the pubKeyScript and forward your funds protected with your old,  compromised private key to the new address protected by your new private key.
--
Simplified:
Send your funds to a new address generated in a secure environment (HWW, cold storage, etc.)


text:
Is bitcoin actually some sort of private key?
I read about bitcoins, block chain etc, but i am confused in one basic element.
What actually a bitcoin, is bitcoin actually a pseudo-random private key that is assigned to miner as a reward when he solves computational puzzle?
When person A sends bitcoin transaction to person B, actually means he gives private key of those bitcoins to person B?

Really there are no bitcoins, just transactions. A transaction will have outputs of specific amounts, and if you have the key to spend a certain output but haven't spent it yet, it is known as your unspent transaction output (UTXO), and the amount of all your UTXOs is known as your balance. The private key is what allows you to spend a transaction output, it provides the proof you own it. And you don't send your private key when you make a new transaction, you simply sign a new transaction with your key to spend the UTXO you 'own', and create new outputs owned by the recipient, usually by assigning the outputs of the new transaction to their public key / bitcoin address.
The miners are also given bitcoins through special transactions known as coinbase transactions, which don't have inputs because they are creating brand new coins, but still have outputs to be spent by the miner.

Technically, coinbase transactions have a unique, special, input that isn't valid in any transaction but a coinbase transactions.

Yes but it's not an input from another transaction output so that's irrelevant details that don't help explain the question.

True, it was more of a pedantic remark :)


text:
How do I transfer my paxful bitcoin to litecoin and do I need a litecoin address
How do I transfer my bitcoin to litecoin?

Bitcoin and Litecoin are two separate currencies, so you can't just transfer a value from one to the other.
What you are looking for is someone who will accept your bitcoin as a means of purchasing litecoin.  This is what exchanges are for.  And yes, once you have purchased litecoin, you will need to store it in a wallet, and will therefore have many litecoin addresses.


text:
Multibit HD: how much fee for cheap way to transfer bitcoin to other wallet?
I have 0.015161 BTC in my Multibit HD wallet and now I want to move them all to Electrum wallet. So, how much fee to set for this transaction as a cheap way?
And how long I must wait?
The default value I see in Multibit HD is 0.0005 BTC/kb

https://bitcoinfees.21.co can give you an estimate of transaction fees based on the current network activity. It's recommended rate at the moment is 0.0026 BTC/kB to have a good chance of being included in the next block, but this changes often. Lower fees will take longer to confirm typically, but it's hard to be sure how long. At the rate multibit suggests, the website estimates it will take 4-28 blocks to be included, it estimates it could take up to 6 hours in the worst case.


text:
Version prefix used for Bech32 addresses
I was compiling a table for Version prefix (hex)  and Base-58 result's prefix for different types of Bitcoin addresses.
I came across the content here: https://en.bitcoin.it/wiki/List_of_address_prefixes, which does not contain information about Decimal, prefix Hex for Bech32 addresses (I guess they also called SegWit address, right?)
So, I checked this chart here:
https://en.bitcoin.it/w/images/en/4/48/Address_map.jpg but, I don't understand the meaning of "x03x03x00x02x03".

If x00 equal 0x00 in hex and x80 equal 0x80 in hex, how should I interpret x03x03x00x02x03?
What is the version prefix for Bech32 addresses (bc1 addresses)?

Those bytes (x03x03x00x02x03 or better shown as 0x0303000203) are the expanded human readable part. You can find the code on BIP-173.
def bech32_hrp_expand(s):
  return [ord(x) >> 5 for x in s] + [0] + [ord(x) & 31 for x in s]

The problem however is that unlike Base58 encoding, those bytes are only used in calculation of checksum not as the starting bytes. Which makes the picture misleading in my opinion.
Bech32 encoding is very different from Base58 encoding as there is no "version prefix". There is an Hrp, a witness version, a data (hash) and a checksum. Witness version | hash are the data being encoded and expanded_hrp | data is used in checksum calculation (| is concatination).

thanks for the response. I doubted the same. Upvoting and accepting the answer.


text:
How exactly do I run the -rescan command for bitcoin-qt from console on a Mac?
I downloaded the blockchain from a torrent, but when I imported my old wallet.dat file, the balance is not showing.  I am unfamiliar with console operation, so please be as specific as possible.  Thank You!

Method 1
Open "Finder".
Press Cmd + Shift + G
Paste this:
~/Library/Application Support/Bitcoin

Edit bitcoin.conf with TextEdit
Add this line:
rescan=1

Save it, then run Bitcoin-qt.
After you the rescan ends and you quit don't forget to revert the bitcoin.conf
Method 2
Right click Bitcoin-qt
Choose "Show package contents"
Go to  Contents/MacOS/Bitcoin-Qt
Run Terminal.
Drag the file to terminal
Type -rescan
Press Enter.
Don't quit Terminal before the rescan ends and you quit Bitcoin-qt
It's done.

@ToddAC I assume that even though you have downloaded the blockchain from a torrent you will want your node online so that it can validate you are on the correct fork and download any additional blocks.


text:
Is there any address monitoring application with support for multiple cryptocurrencies?
This would be beneficial for all long-term investors who have many different cryptocurrencies in their portfolio and don't usually perform any transactions. Simply just to check whether your money are still there. No need to login into all your wallets, entering passwords etc. With support for many different cryptocurrencies.
I have just decided to develop such an application for my own use (it is open source, you can check it here - Cryptocheck ), but maybe there is already a good solution for this.

The best option for monitoring your accounts without logging into your wallets is to use block explorers. Blockchain data is public and block explorers are made to explore this public data: blocks, transactions, accounts, account balances.
Here are a few:
Bitcoin, Litecoin, Dogecoin:
https://live.blockcypher.com/
Ether, ERC20 tokens:
https://etherscan.io/
WAVES, Waves assets:
https://wavesexplorer.com/
ZCash:
https://explorer.zcha.in/
Most of these block explorers also have API solutions.
I have created a playlist showing how to use the zChain ZCash block explorer API here: Zchain ZCash block explorer API - INTRO

I was more thinking about application integrating all the most common cryptocurrencies, not just 2 or 3 of them. Cryptocheck can currently work with 13 diferent common cryptocurrencies: Bitcoin, Bitcoin Cash, BitConnect, Dash, Dogecoin, Ethereum, Ethereum Classic, IOTA, Litecoin, NEM, NEO (Antshares), Ripple, Zcash.

Cryptocheck is probably the best option at the moment (I haven't found better so far).
Currently it works with 13 diferent common cryptocurrencies: Bitcoin, Bitcoin Cash, BitConnect, Dash, Dogecoin, Ethereum, Ethereum Classic, IOTA, Litecoin, NEM, NEO (Antshares), Ripple, Zcash.

I've been using Cryptocurrency Alerting for monitoring my bitcoin and ethereum wallets. Cryptocheck seems pretty useful though.


text:
Bitcoin Cash Multibit HD/Electrum
If I had my BTC in a multibit HD wallet prior to the fork, and I exported my wallet to Electrum after the fork, will the BCH still be tied to the multibit HD wallet?
And if so, how can I access the BCH stored in the multibit HD wallet?

Here is what you need to do. Make sure you have the seed from multibit.

Download http://www.electroncash.org/
You create a new wallet, select I already have seed, when you type seed you need to click the "options" button and select BIP39 seed.
It will ask for a derivation path... you need to use: m/0' (note the ' it is important... m/0')
4.Suggest you do research as there are some issues with it not connecting to BCC chain sometimes.

http://reddit.com/r/btc/comments/6qyn18/electroncash_notice_how_to_select_bitcoincash/

Ah I'll give it a try when I get back from work!

Hi, I used this method and it works. The problem is that I did not export my multibit HD wallet before doing this process, and now I can not access to my multibit HD wallet, not even can recover with my seed. What happens? How can I get my Bitcoins back?

You should be able to access your BTC using electrum wallet https://electrum.org Use the seed from multibit HD.

The default derivation seems m/44'/145'/0' so I will change it to m/0'

If you have exported your Multibit HD wallet into Electrum, then your Electrum wallet is sharing the Private Keys with your Multibit wallet. In a less technical language: You have one account (your wallet) and 2 interfaces to access your funds (Multibit and Electrum).
The BCH are tied to your account not the interface. So forget about Multibit and redeem your bitcoin cash with the help of Electrum. Follow the official Electrum Recommendation on how to redeem Bitcoin Cash. Short version below:

Secure your bitcoin funds by withdrawing them to another bitcoin
wallet.
Export your seed or private key from Electrum.
Install Electron Cash.
Import your MB seed into Electron Cash.
Enjoy your coins.

If you do not have your seed, extracting your bitcoin cash without your wallet words works, but requires knowing how to edit and compile java code: https://bitcoin.stackexchange.com/a/51297/64842
Because installing maven, java, modifying and compiling the JAR, and using the private keys is a bit beyond most non-developers, I've created a comprehensive guide, along with a pre-built JAR file to walk you through it:
https://github.com/josephduchesne/multibit-hd/blob/develop/README.md
The summary is:

Get a patched version of MultiBit-HD based on redee's answer linked above
Get your wallet addresses
Extract your private keys
Import into electron


text:
How do I clear a stuck Bitcoin transaction.The other answers did not help my situation
How do I clear a stuck Bitcoin transaction without being in control of the senders wallet?
I have a #number to go on and my wallet address.
The sender does not know how to help me.

related: Replace-by-Fee vs Child-pays-for-Parent?, see the "Child-pays-for-parent" part. ;)

Clear as in settle or clear as in erase?

if the transaction did not use the optional replace-by-fee scheme, then after 14 days it should be dropped from all mempools and the sender would have the coins back.
if the sender is unavilable or uncooperative and you need the transaction to go through, look for miner priority services; they allow you to pay a fee to get the transaction prioritized.

I think that the easiest option for super-technical users is to use Transaction Accelerators:
https://en.bitcoin.it/wiki/Transaction_accelerator

Transactions with too low a fee can take hours or even days to confirm, and sometimes never confirm at all.

Never done testing in real-life if they actually work / are reliable.
Much easier to set a correct fee - or allow software do this automatically.


text:
What prevents a pool miner from stealing the block if they find the solution?
I'm learning about BC mining from a developmental level and I'm reading about how a pool delegates shares based on work, but it doesn't explain why the miner who finally finds the correct hash can't steal it from the pool - "turn it in" so to speak (I haven't learned how turning it in works yet, I should mention)
What prevents a pool miner from stealing the block if they find the solution?

I found the answer:

[7] You might wonder why a miner doesn't cheat. If they successfully mine a block, why not submit it themselves so they can claim the full mining reward, rather than splitting it? The main reason is the coinbase transaction has the pool's address, not the miner's address. If the miner submits the block bypassing the pool, the reward still goes to the pool. And if the miner changes the address, the hash is no longer valid. - righto.com


text:
Can I download the blockchain blocks from torrent and paste them?
Currently my Bitcoin Core client was stopped syncing at 40.73%.  It was not progressing any more.  I've downloaded the Blockchain from https://getbitcoinblockchain.com/ .  Can I just copy these blocks and paste these downloaded blocks to my Bitcoin > Blocks ?  Will everything be fine ?  Will the Bitcoin Core client accepts the downloaded blockchain ?

You can certainly download the blockchain and copy the blocks. Keep in mind though that the process of blockchain synchronization involves downloading and validating blocks. By downloading a torrent you are not validating the blocks so there may be additional risks.

Yes you can download the blockchain from other sources then paste it inside the your main bitcoin folder.
You will need two folders:
- blocks
- chainstate
Then open bitcoin-qt for synchronization.

There's no point though as letting bitcoind do the downloading should be strictly faster and more efficient. If something's wrong there it might be better to fix the underlying problem.


text:
How is the Leaf node weakness in Merkle Trees exploitable?
Recently a weakness in leaf nodes of merkle trees was disclosed and it is claimed that this issue is exploitable to trick SPV nodes. How does the weakness make SPV nodes vulnerable to attack? What would an attacker do to exploit this attack?

In Bitcoin, inner nodes of the merkle tree are constructed by concatenating two 32 byte SHA256d hashes together. The resulting 64 byte value is hashed to get the next node in the tree. The leaf nodes are the transactions themselves. Merkle trees are used to prove that a transaction is part of a block as the merkle root is placed in the block header for the proof of work.
However, given just a merkle branch to prove a transaction's existence in a block (as SPV wallets need), it is impossible to distinguish which node in the branch is an inner node and which is a leaf node. Thus a special 64 byte transaction can be constructed which tricks SPV nodes into thinking it is actually an inner node of the tree and not a leaf node.
The last 32 bytes of that special transaction are constructed in such a way that it is also a valid hash of another fake transaction. Both the fake transaction and the last 32 bytes of the special transaction can be modified in order to brute force a transaction hash that is also valid as the last 32 bytes of the special transaction.
Once the special transaction is included in a block, the attacker can provide a fake proof to an SPV node that "proves" the fake transaction is part of the blockchain. This fake proof would be the legititmate merkle branch to the special transaction, but also includes the special transaction as if it were an inner node of the merkle tree and the fake transaction becomes the leaf node.
To protect against this attack, SPV nodes can simply verify that no inner nodes of a merkle branch are also valid transactions. Such an event is extremely unlikely, and such transactions are also non-standard so unlikely to be included in a block unless this specific attack were being performed.


text:
What is the difference between Compact Blocks, Thin Blocks, Xthin and Graphene Compression?
What is the difference between these block propagation techniques in terms of size / bandwidth & computation requirements and also compatibility & reliability?
All the above techniques try to prevent syncing data which is already available on other clients instead of just syncing the full block mined. However, in my understanding both sender and receiver have to follow some additional logic to result in the same block. Is there any statistic what impact every of the mentioned techniques has, especially when the Mempool is not yet fully synced?


text:
What is a workaround to fundrawtransaction for watchonly addresses
I have imported watchonly addresses in Bitcoin and trying to createrawtransaction with input watchonly listunspend which has spendable=false, scriptSig=empty.
after that, I'm getting an error on fundrawtransaction with message "Signing transaction failed"
I know it's unsigned and can't calculate fee but if I put in order
createrawtransaction
signrawtransaction
fundrawtransaction
sendrawtransaction
still, it gives me an error "Signing transaction failed"?

I'm confused - what results do you expect to be able to achieve here?  Of course you can't sign the transaction because you don't have any private keys.

fundrawtransaction does not sign, and does not need the private key. The error message is confusing. I'll write an answer later.

A bitcoin address, watchonly or not, represents a public key.  This public key has a corresponding private key.
If you import a watch only address the corresponding private key is not imported.  So you cannot spend any unspent outputs from those addresses.
If you want to send bitcoin to the watch only address, you have to make sure you know the corresponding private key or your bitcoin will be lost.
Choose an unspent output from another address where you know the private key.  Take this output when you run 'createrawtransaction'.  Sign the transaction with this private key then 'sendrawtransaction'.
Optionally before you 'sendrawtransaction', decode your hex string with 'decoderawtransaction' and make sure everything is correct.

This does not explain why fundrawtransaction doesn't work (which does not need the private key).

thanks I didn't know about fundrawtransaction and wrongly assumed user2224893 was mixing up api calls with the english language. Sorry user2224893! I ran the call fundrawtransaction on my node but got an error 'Method not found' I run a node with wallet disabled so I checked https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list and could not see it either.  Meanwhile I can see on github it does exist, my bad.

Don't use that wiki, it's outdated by many years.

Thanks it is even mentioned on the wiki but I didn't see it, the new version has fundrawtransaction covered:  https://bitcoin.org/en/developer-reference#fundrawtransaction


text:
What's the easiest way to hook into multiple BTC exchanges?
If you want to compare prices of BTC across multiple exchanges, is there a central mechanism or place to do so? I have been unable to find such a thing from my research

Yes, there are such services.
bitcoincharts.com offers such an overview, though you may get confused from the many fiat currencies.
CoinDesk's chart is much cleaner, only uses USD, and you can easily choose which exchanges to regard. However, CoinDesk lists far fewer exchanges than bitcoincharts.com.
There are several services – for example BitcoinAverage – which attempt to plot the average price.
If you want to, you can use the APIs of the exchanges you're interested in, and write a script or small program which shows the current prices.

Thanks UTF-8. The main concernI have is would I need separate accounts to access and trade on each exchange?

Would I (for example) have an account on bitcoincharts.com, log in with my API and be able to trade on each offered exchange?

log in via the API with my account**

I of course don't know this for every exchange but I think there probably are very few (if any) which let you trade without being logged into an account at that exchange. BitcoinCharts' API isn't for trading, it's only for querying the trading data they collected using the APIs of exchanges. BitcoinCharts isn't an exchange or some kind of meta exchange. PS: You can edit your comments within the first 5 minutes so you don't have to post 3 comments.

Yes that frustrated me, thanks for the tip. So does my description in the second comment describe any services you know? One account that to an exchange or service that interfaces with other exchanges?

No, I don't know one. But I just googled it and there seems to have been one: https://metaexchange.info However, they're closing down. You should probably google this yourself and ask a separate question if you can't find anything because these comments are drifting away from the original topic and may be deleted.


text:
Can a single wallet have multiple addresses, that can be used to distinguish payments?
If I have a single Dogecoin wallet, can I create multiple addresses for that wallet such that I can identify which payments were sent to which address?
For example:
1 Dogecoin Wallet with balance 0
3 addresses
A payment of 5 Doge is sent to address 1
A payment of 10 Doge is sent to address 2
A payment of 15 Doge is sent to address 3
The Dogecoin wallet now has a balance of 30 Doge
When I look at the Wallet, I know the payment of 5 Doge was made to address 1

Use software that supports BIP32 hierarchical deterministic wallets like Electrum.  You will then be able to have one seed with unlimited addresses.  You should only use an address once, so give a different address out each time you want to receive a payment.  This will improve privacy too as people who pay you wont be able to see other transactions you received.

Thanks - but will I know who made a payment to what address?

By giving out each address only to one counterparty, you can use them as invoices to identify who paid you: the party that you gave the address to.

You can also label each address to make the invoicing easier.  You can give your friend one address for item #1 and a second one for item #2.  You will then be able to keep track of what has been repaid by checking if funds have been sent to that address yet

Thanks @Brandon and Murch - this is exactly what I wanted to know, and the labelling will make this a lot easier.

Okay so having a look and I'm not having much looking finding something that clearly meets my reqs. I need a command-line Dogecoin BIP32 wallet (I can find a lot of Bitcoin ones)? Any recommendations?

@cardycakes, Doge is kinda a meme.  You won't find good support for it, but I think the reference implementation can do what you want. https://github.com/dogecoin/dogecoin


text:
Can you use bitcoin seed phrase to create/restore lightning wallet?
Lets say I already have a hardware wallet or existing Bitcoin wallet with seed phrase.
I want to now create a lightning wallet on a new device.
Rather than starting a whole new Bitcoin wallet via some lightning wallet app, is it possible to restore my existing Bitcoin wallet via seed phrase on the lighting wallet app?
Is this a bad idea?

Your lightning wallet will use addresses from a different HD derivation path, so chances are if you input the same seed phrase, you won't see your bitcoin-wallet funds available in your lightning-wallet anyways.
Pro:
You only have to store one seed phrase, perhaps simplifying offline storage considerations.
Con:
Lightning wallets are hot wallets, so your private keys will be stored on an online device. Any security breach could compromise not only your lightning wallet, but also the rest of your funds.
Personally, I would not use the same seed phrase for both. I think it is MUCH smarter to compartmentalize the security of each wallet, especially considering the nature of lightning wallets.

What chytrik said above, but would add that the security problem gets less serious if you use a long passphrase as a "25th word" for your main (cold) wallet. In that case, an attacker who retrieves the private key from your lightning node still has a significant barrier to overcome in order to access the funds in your cold storage.