How did Bitcoinica get its prices? I'm interested in building a Bitcoinica replacement and wondered how did they get their pricing information.

Was it from Mt.Gox and was it verifiable, I mean could you have gone to a web site and seen a history of prices and therefore know why your position may have been liquidated ?

As far as I know:

Yes, Bitcoinica's prices were based on MtGox ticker
Using the MtGox price, they had an algorithm to build their spread (you will always buy on bitcoinica at a higher price and sell at a lower price than the reference mtgox price, thats where a broker like bitcoinica makes profits).
Yes, Bitcoinica had some charts, where you could see the reference price, and the spread (the graph was called "daily quotes"), so yes you were able to check the price and spread and understand why you had been liquidated.

No guarantee on these answers, I'm not in the Bitcoinica code, this is just how I understand this.


How can I know that a full node has finished the initial synchronization process? I run a full bitcoin node. I launched it several days ago and it has consumed around 300 GB of traffic already which implies that it is about to finish the initial syncronization process.
Except for that implicit sign, is there a more reliable and concrete way of determinining whether or not a full node has finished the initial syncronization process? Is there a special RPC API call that would return "true" for that?

You can check three factors in the getblockchaininfo RPC call:
The result contains a count of the blocks in your chain, and the headers your node has received from peers. For a fully synchronized node, the number of blocks equals the number of headers.
Additionally, there is an initialblockdownload boolean in the response, which will be set to false once the node has caught up with the main chain.


What is correct way to count LN node stats I am running a LN node. Set up monitoring to collect stats. Now i am wondering, how can i get correct conclusions about what collected information actually is.

My question is about forward (transaction?) count. According to my stats i had 14 settled forwards.

There are ~8350 nodes over there, my node according to 1ml.com is ~#450 in channel/capacity rank. so we can assume that i am average active node i think. so then 8350*14=116900 settled forwards over network?. i am not sure what this number mean and can we compare this to 409570 on-chain transactions for last 24 hours.

I had also some 2-3 offchain pay and 1 paid invoice which was my own node made, do i need to add the to calculation above or not?

If this completely incorrect way to count and compare transactions, please describe a correct one.

I would approach this problem a little bit differently as counting in general is pretty difficult and the assumption of being an average node is pretty strong (not to say as I lay down below probably wrong) My approach however uses also a strong (and also probably wrong) assumption though I think it is not as strong / wrong as yours.

In my video in which I lay out the math for optimizing routing fees / earnings on the lightning network I start with a probability distribution to derive an expectation value for my routing fees that I want to optimize to gain maximum routing fees.

Instead of assuming your node is average I would ask about the likelihood of being on a path of a transaction between two arbitrary nodes? As I lay down in the video this boils down to the betweeness centrality of your node on the fee graph of the lightning network. The fee graph is the network you get when adding the routing fees as edgeweights (it is a little tricky as they dynamically depend on the payment amoun. You could start with just using the basefee). Generally your centrality raises with you lowering  your fees and maintaining more channels. In your case after computing your centrality you would divide the number of settled routing attempts by the centrality of your node to get an estimate of the overall payments made by the network.

As a datascientist I would say that even your data points (n=13 settled routing attempts) are statistically probably not sufficient. However larger nodes could probably use their data to make a pretty good guess.

Also as a disclaimer I should say that my result with the betweeness centrality depends on the relativly strong assumptions that the distribution of who pays whom is uniform so it would be equally likely that you pay any other node. This seems to be another very strong assumption but it is extremely hard to get a better a priori distribution for it. If it was available it could easily be weighted into the formula of the betweeness centrality. Also I assumed that payments all have the same amount to compute the betweeness centrality. This is also wrong but could also be modelled to the centrality measure if the amount distribution was known.


How get address from ScriptSig: PUSHDATA(N)? I'm from Ukraine and do not know much English, sorry. I want to parse blockchain, but I have problems. In block 728 will first txs (user-user). But input-script have not public keys. I read this Missing public key in transaction input. And don't understand how work it. For example first input in txs is

3046022100e26d9ff76a07d68369e5782be3f8532d25ecc8add58ee256da6c550b52e8006b022100b4431f5a9a4dcb51cbdcaae935218c0ae4cfc8aa903fe4e5bac4c208290b7d5d01

and explorer say what this address get 50 btc in this txs when confirm this block. But how connected this txs and this txs.

How get address from ScriptSig: PUSHDATA(73)?

EDIT

What you need to do to get an address from such transactions?

In general, you can't.

You need to look at the scriptPubKey of the output that is being spent.


Bitcoin Core 0.13 -- SENDFROM rpc call I want to use sendfrom bitcoind rpc method to transfer funds from my account to some address. Right after calling it, I want to get all the data about this transaction using gettransaction or listsinceblock. Does bitcoind's wallet system process a new transaction before or after responding with a "txid" to sendfrom? Is it safe to call sendfrom and gettransaction right after that from my python code for example?

Yes. It's save.
The current transaction submitting logic (CommitTransaction) do report the transaction ID after adding the tx to the local database and to the mempool.
On top, it holds the cs_main and the cs_wallet lock which makes sure not other thread can manipulate the relevant data-structured during the time of AddToWallet and AcceptToMempool.
https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp#L2557

This means, when you call a send* RPC command, you will get response (the txid) after the transaction was submitted to the mempool and added to your local wallet database.

Immediately calling gettransaction is therefore save.


Why doesn't bitcoin place additional constraints on competing block chain forks, other than length of chain? (e.g., time and confirmation count) In Bitcoin's proof-of-work system, consensus on which chain of blocks should be considered the "true" block chain is based only(?) on which chain is longer.

Accordingly, to quote a nicely written answer by Nate Eldredge, a typical 51% attack would look like this:

  Attacker privately starts mining their own chain, which diverges from the main chain at some block N.
  Attacker deposits coins to your business, sending them from address A. Call this transaction X.
  Attacker inserts in his own chain a transaction X' which conflicts with X; typically X' sends the coins from address A to another address belonging to the attacker.
  Attacker waits for several confirmations of transaction X, in blocks N+1, ..., N+6 (replace 6 with however many confirmations your business wants) of the main chain.
  Once there have been enough confirmations to satisfy you, you deliver goods or services to attacker.
  Attacker releases his own chain, which now has blocks up to, say, N+50. Being longer, this chain is accepted by the network. This chain doesn't contain the transaction X but instead X', so you don't have the coins you thought you did.

  Notice that up until Step 6, everything on the network looks completely normal; only the attacker knows what is going on.

My question then is: why doesn't bitcoin specify a maximum duration of time and/or a maximum number of confirmations, after which a competing/forking block is rejected even if it's backed by a longer chain of (secretly premined) child blocks?

To summarize this idea in pseudocode:

CUTOFF_TIME = 1200 # seconds
CUTOFF_CONFIRMATIONS = 3

is_acceptable_block(new_block, parent_block):
    if not is_valid_block(new_block):
        return false

    if is_first_child(new_block, parent_block):
        return true

    old_block = get_first_child(parent_block)

    if age_difference(new_block, old_block) > CUTOFF_TIME:
        return false

    if child_chain_length(old_block) > CUTOFF_CONFIRMATIONS:
        return false

    return child_chain_length(new_block) > child_chain_length(old_block)

If this would be viable, then the 51% attack scenario described above would become much harder; and as a result, the amount of time/confirmations to wait for before a transaction can be safely believed would decrease, right?

My question then is: why doesn't bitcoin specify a maximum duration of time and/or a maximum number of confirmations, after which a competing/forking block is rejected even if it's backed by a longer chain of (secretly premined) child blocks?

Because you can't prove that to nodes that weren't on the network at the time of the attack. Which means that either:

It's possible for an attacker to create a new chain, and if enough nodes join the network while the new chain is the best one, it will lead to a situation where half of the nodes believe that one chain is the best, and half think the other chain is the best.
If you make new nodes trust old nodes when they say that the best chain isn't the real chain, you're now expanding the circle of people you trust to the people relaying the chain, in addition to the people mining it. Before, if two nodes thought different chains were best, you could download both and say with certainty that one was better than the other. If you implemented this change, you would need to decide which node was more trustworthy.

  If this would be viable, then the 51% attack scenario described above would become much harder; and as a result, the amount of time/confirmations to wait for before a transaction can be safely believed would decrease, right?

A 51% attack can double-spend outputs with any number of confirmations. The oft-quoted 6 confirmations figure comes from the Bitcoin paper, where Satoshi calculates that an attacker with 10% of the network hashpower would have less than a 0.1% chance to catch up.


I've sent a small low priority transaction with insufficient fee with blockchain.info wallet, what will happen next? I've sent a transaction which has a <0.01 BTC output, with zero fee using blockchain.info Android client. It is not being relayed (violating memory pool rules of bitcoind). What can I do to recover the Bitcoins that participated this transaction?

You can do two things

Wait until the transaction gets relayed. Transactions without fees usually get relayed as well, but often a later than those with a fee.
Send a new transaction spending the same outputs, with a fee. It's possible that some miner will accept it eventually. This can be tricky when you use blockchain.info's wallet. It's called double spending, you can probably find some information on that elsewhere, like on bitcointalk. That article suggest that you import the private key from the address you send from to Bitcoin-Qt and try to do the same transaction again from there.


Node doesn't find segwit transactions I had to move around wallets and so on, and when I re-installed Knots (yeah I'm that edgy), it doesn't find the transactions to my segwit addresses. I can probably find the SW addresses somewhere, but probably not the regular ones I used addwitnessaddress with. Is this solvable?

If you are restoring a backup from before you had done addwitnessaddress to your addresses, then it will not know to look for the segwit scripts that correspond to your wallet. You will need to do addwitnessaddress again for all of your addresses and then rescan the blockchain in order for your wallet to find those transactions.


Is an Xcode project for the Mac Bitcoin client available? If someone wants to mod the Mac Bitcoin client for their own purposes (e.g. reskinning or development of a client with extra features), is there somewhere they could download the existing Xcode project for the software to get started quickly? If not, why is it not available?

I don't believe the project itself is distributed, but there is a step-by-step guide to creating an Xcode project for Bitcoin in the answers to "What are the steps in building bitcoind on Mac OS X 10.6?"


Who is paying for the running costs of Bitcoin? Bitcoin mining will consume around 70TWh for 2020 (~3 nuclear power plants).
As far as I know, electricity is paid using fiat money. If 1 kWh costs 0.1 $, without counting hardware costs, that means that 1 year of mining costs $7 Billion for electricity.
At the moment, the Bitcoin capitalization is around 357 B$.
It follows that 2% (7/357*100) of the capitalization is used by electricity every year!
Who is paying for that (and how can it be sustainable)?

people who invest in Bitcoin using fiat money?
by Bitcoin deflation comparatively to fiat money?
people who lose money when/if Bitcoin goes down?
more generally: Mafia (an expensive laundry is not a problem if it is good)?
or I don't understand enough how Bitcoin works, and that's something else :-) ?

The people operating the mining hardware do. Mining hardware consumes electricity, so people who run the hardware receive an electricity bill from their electricity provider. They pay the bill using the proceeds from mining. Usually miners will sell some portion of the Bitcoin they earn for fiat, and pay for electricity using that fiat.


Why Entropie is divided by 32 (Seed to MNEMONICS) I want to create a Seed-Phrase (mnemonics) from entropy. One aspect of BIP39  is to create the checksum and describes it as follows (Link BIP39):

  The mnemonic must encode entropy in a multiple of 32 bits. With more
  entropy, security is improved but the sentence length increases. We
  refer to the initial entropy length as ENT. The allowed size of ENT is
  128-256 bits First, an initial entropy of ENT bits is generated. A
  checksum is generated by taking the first  ENT / 32

This thread describes a lot of details but not why divider 32 (or I don't understand it).
I am not a cryptographer and I did not find any detailed description why the divider 32 has been chosen. My guess is entropy. But why exactly?

BIP39 uses a dictionary of 2048 words. Each word is indexable with 11 bits (2^11).

The combined entropy and checksum is represented as a sequence of words from the dictionary, and therefore must have a length which is evenly divisible by 11.

If you take any integer N where N mod 32 = 0, then (N + N/32) mod 11 = 0.

So ENT/32 simply provides the number of bits which must be used for the checksum.


When you receive a BitCoin what do you actually get? Say someone sends me 0.5 of a BTC to my desktop wallet, is it a digital file or lines of code that they send me which has monetary value? I'm very confused on what you actually RECEIVE with cryptocurrency.

Think of Bitcoin like a ledger. When you (your Bitcoin wallet) receives Bitcoin, instead of receiving an item or file, everyone is updated with an updated ledger including the balance of your Bitcoin address.

Here is an extraordinary explanation on Bitcoin.


Bitcoin database needs to rebuild every time after defrag or reboot I'm running Windows 10 technical preview 10049 and I'm running bitcoin-qt from my data hard drive with 1.17TB available disk space. It is a striped volume and due to much data writing and deleting it needs to be defragmented from time to time. Every time I have done this and I start Bitcoin-QT again it gives an error that the database needs to be rebuild what takes ages.

Shutdown Bitcoin-QT cleanly and no reindexing is needed.

The reindexing of bitcoind database is only needed if the application did not have time to properly shut itself down and write all information in its memory to disk.


Why are fiat Currencies inflationary and Bitcoin deflationary? Why are all fiat currencies inflationary, and lose value with time? Could governments make them deflationary? What are the advantages of inflationary currency compared with deflationary currency?

Why was Bitcoin chosen to be deflationary (limited number of total coins)?

There are many causes for inflation, but the two most often agreed upon, according to Investopedia, are these:

  Demand-Pull Inflation - This theory can be summarized as "too much
  money chasing too few goods". In other words, if demand is growing
  faster than supply, prices will increase. This usually occurs in
  growing economies.

  Cost-Push Inflation - When companies' costs go up, they need to
  increase prices to maintain their profit margins. Increased costs can
  include things such as wages, taxes, or increased costs of imports.

Fiat currency inflation absent these forces can be driven by the creation of money through speculative fractional reserve bank lending practices as well as simple "printing of money" by the central bank responsible for a government's currency. It is in the interest of the government's ability to spend that it be able to freely create money out of nothing, which is the veritable definition of fiat, Latin for "let it be".

Advantages of inflation include:

Steady rise in prices
Steady rise in value of non-liquid assets, e.g. not cash
Supposedly an indicator of growth

Disadvantages of inflation include:

Cost of goods increases because one unit of money does not have as much purchasing power as it did previously
Decrease in the value of stored liquid assets, e.g. cash in a non interest-bearing account
Potential for hyperinflation

Bitcoin's deflationary quality is based on the assertion that a currency must have scarcity in order to be valuable. By limiting what amount can enter the system, it ensures that no individual can increase the supply and inflate the value relative to physical goods.


Convert P2SH to P2PKH I'm using btcrecover to recover a Ledger BIP39 backup seed that I wrote down but seems to be wrong. The tool only accepts P2PKH addresses and my account was created very recently in this kind of format 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy. I'm new to blockchain but I believe that this is a Segwit/P2SH account?

Is there a way I can convert this into a P2PKH address so that I can use the tool?

Converting address formats is not feasible without knowing the public or private key(s) used to generate them.

Without reviewing the source code of btcrecover, I can't advise whether you should use it or not. But if you do trust it and decide to use it, consider first generating a new seed and address to immediately send your bitcoin to.

Consider any seed you may recover with btcrecover compromised and no longer secure.


What is the best way to exchange MTGUSD to USD? Are there any better ways to exchange MTGUSD to real USD with lowest fees and the shortest time?

I had mining some bitcoins and exchange them to MTGUSD at Mt.Gox. But how do I actually use the USD in real life?

I proposed the following solutions but cannot determine which is the best one:

International wire to my local bank, with 15~25 USD as fees. (of course I had more than 50 MTGUSD)
Exchange them to MoneyPak at #bitcoin-otc. Then deposit them to Paypal Dollar.

The first one seems logical, but the fees are so high. If I have only 100 MTDUSD to transfer then the transaction fees will be about 25%.

The second one seems good but it's really complicated. First I have to figure out how bitcoin-otc works, then I'll need to figure out how moneypak -> paypal and calculate the fees (4.5 USD?). Furthermore, I cannot calculate the total fees and the time for transferring.

You can sell MTGUSD directly at bitcoin-otc or at bitcointalk. If you deal with reputable members, the risk of a receiving a chargeback is minimal.
Note that you don't need to register at bitcoin-otc to do this. Just drop by the channel and announce that you are selling.

Bitinstant used to have paypal withdrawals, but they aren't working at the moment.


What are the bitcoin dependencies for red hat linux? Bitcoin fails to compile I'm using CentOS on my server, and when I try to compile bitcoin from the github source using make -f makefile.unix, I get a ton of errors. I'm assuming they're caused by dependency errors?

I've seen a bunch of dependency lists for debian-based linux distros which use apt-get, but I'd like to know what I need for CentOS. Installing the dependencies from the debian lists using yum show the packages as unavailable.

Here's the huge error list, if anyone wants it: http://pastebin.com/1y2wCH5N

If you want to compile Bitcoin on CentOS 6, you will need more than just Bitcoin; several other dependencies are either missing or too old.

The particulars:

Boost is too old. CentOS 6 has version 1.41, but Bitcoin requires features first introduced in Boost 1.47.
Berkeley DB is too old. CentOS 6 has version 4.7, but Bitcoin wants version 4.8 (but see below for more on this).
OpenSSL may be missing some elliptic curve algorithms required for Bitcoin, due to Red Hat's extremely conservative legal stance with respect to ECC. (See bugs 319901 and 1020292, among others.)
The qrencode and miniupnpc libraries, necessary for the Bitcoin GUI to support QR codes and UPnP respectively, are missing entirely. (A server-only build doesn't need them, though.)
Older versions of the Bitcoin codebase did not work with Qt 4.6, the version shipped with CentOS 6, but required Qt 4.7. I fixed this with a one-liner, and it was patched upstream. This probably won't affect you, though, unless you're building old code for some reason.

You also need these packages, which do exist in CentOS 6:

db4-devel
autoconf automake libtool

And you also need this package from EPEL:

protobuf-devel

For a build including the GUI, you also need:

qt-devel desktop-file-utils

Then you need to patch Bitcoin to accept using Berkeley DB 4.7; by default the configure script bails if BDB 4.8 is not present, even if you pass the configure option that is supposed to override this. And be warned that wallets created by this build may or may not work with Bitcoin compiled with BDB 4.8.

Then you need to patch it again to make it compile on the older versions of gcc and glibc shipped with EL6, as the current Bitcoin code assumes a compiler supporting C++11 is being used. It's a one line patch, but it took me half an hour to track down.

As you can see, this is kind of painful, and the missing libraries alone cause most people to give up.

Most of these packages (except miniupnpc) are in CentOS 7, so if you're going down this road, that's probably a better starting point.

I've been maintaining versions of those libraries, along with an SELinux-enhanced Bitcoin build, for a couple of years now. It's much easier to just grab the repo and install the existing RPM packages since I've done all this work for you. But if you really want to cover that ground again, there's your road map.


Script - OP_PUSHDATAs When using OP_PUSHDATAs in different Scripts, how are the next bytes denoting the amount of bytes to be pushed encoded? Are they to be treated as unsigned integer, or signed (like the data that is taken from the stack?)? Are they big endian, or little endian?

OP_PUSHDATA1    76  0x4c    (special)   data    The next byte contains the number of bytes to be pushed onto the stack.
OP_PUSHDATA2    77  0x4d    (special)   data    The next two bytes contain the number of bytes to be pushed onto the stack.
OP_PUSHDATA4    78  0x4e    (special)   data    The next four bytes contain the number of bytes to be pushed onto the stack.

Little endian.

See, for example, the script_PushData unit test in the source tree that pushes one 0x5a byte onto the stack 4 different ways:

// Check that PUSHDATA1, PUSHDATA2, and PUSHDATA4 create the same value on
// the stack as the 1-75 opcodes do.
static const unsigned char direct[] = { 1, 0x5a };
static const unsigned char pushdata1[] = { OP_PUSHDATA1, 1, 0x5a };
static const unsigned char pushdata2[] = { OP_PUSHDATA2, 1, 0, 0x5a };
static const unsigned char pushdata4[] = { OP_PUSHDATA4, 1, 0, 0, 0, 0x5a };


bitcoin.rpc python library problem I am working through Master Bitcoin. I got the bitcoin client up and running. I am now trying to access the client from python. In the example, there is a line that says from bitcoin.rpc import Rawproxy.

I get the error message no module named rpc. When I run pip freeze, I have python-bitcoinrpc==1.0 listed. Why can't this module be found?

in debian =)

sudo apt-get install libssl-dev

pip install python-bitcoinlib
 or
pip3 install python-bitcoinlib


How does Bitcoin use its communication protocol and its database model? In terms of Bitcoin's communication protocol, how does Bitcoin allow nodes to communicate between each other?

Is Bitcoin's communication protocol the same as IPFS(InterPlanetary File System) and if not, is it a great idea to use IPFS for blockchain communication? Since IPFS can transfer large amount of data, then why not sending Blockchain data through it?

Second, I found out on Stack Exchange that Bitcoin uses LevelDB to store data. Does that mean that there is a central server / authority where LevelDB is running the entire chain? If yes, how does that make Bitcoin decentralized? If not, then is LevelDB run on every node?

is it a great idea to use IPFS for blockchain communication?

Bitcoin nodes form a P2P network, using TCP to communicate bitcoin-specific messages between one another. By using a self-defined protocol, the Bitcoin network's communications can be optimized and made robust against attacks, while not having rely on any external dependencies to do so.

  Since IPFS can transfer large amount of data, then why not sending Blockchain data through it?

As far as I understand it, IPFS is designed to work as a distributed file system. In this regard, it may be a suitable choice for a user looking to download the blockchain during the bootstrapping phase of creating a new Bitcoin node, as an alternative to downloading the same files from the Bitcoin network itself. Similarly, there are copies of the blockchain available on the BitTorrent network.

Note that in most cases, it is safest to download the blockchain from the Bitcoin network itself, to ensure you receive an authentic copy, with no malicious files or code inserted into it.

  Bitcoin uses LevelDB to store data. Does that mean that there is a central server / authority where LevelDB is running the entire chain?

No, there is no central server or authority in the Bitcoin network. Each node builds and maintains its own database, so that it can independently validate the current state of the network.


How long does it take to download blockchain My question is how long does it take on average to download whole blockchain and set-up new wallet with standard Bitcoin-QT client.

It depends on your bandwidth and (to a lesser extent) your power of your CPU, because each block requires verification. You can see the latest size at here. Currently it is 10.8GB or so.

One option to speed up the download is to download a bootstrap.dat. The Bitcoin client will look for a "bootstrap.dat" file to pre-seed blocks. You can download on version of bootstrap.dat at bitcoincharts.com. In most cases this will be faster, than the under-resourced bitcoin network.

Alternatively, if you run linux try this batch script:

#!/bin/bash
[ -z "$1" ] && echo "Usage: input=coinname" && exit 1
coin="$1"

while sleep 1; do
blk="$(eval "$coin getblockcount")"
h="$(eval "$coin getblockhash $blk")"
coin_t="$(eval "$coin getblock $h" | grep '"time"' | awk '{print $3}' | sed -e 's/,//g')"

d="$[$(date +%s) - $coin_t]"; dm="$[$d / 60]"; dh="$[$dm / 60 ]"; dd="$[$dh / 24 ]"
echo "Difference from main chain $d s. or $dm m.  or $dh h.  or $dd d."

if [ -z "$first_t" ];then
        first_t="$d"
        start_watch_time="$(date +%s)"
else
        difference=$[$first_t - $d]
        speed="$(echo "$difference / $[$(date +%s) - $start_watch_time ]" | bc -l)"
        remain_seconds="$(echo "$d / $speed" | bc -l)"
        remain_minutes="$(echo "$remain_seconds / 60" | bc -l)"
        remain_hours="$(echo "$remain_minutes / 60" | bc -l)"
        remain_days="$(echo "$remain_hours / 24" | bc -l)"
        # eval "$coin getinfo"
        echo -n "Approximate Time Remaining: $remain_seconds seconds to complete  sync."
        echo "[m: $remain_minutes; h: $remain_hours; d: $remain_days ]"
fi
[ "$LAST_BLK" == "$blk" ] && echo "Alarm! Stuck on block # $blk!"
LAST_BLK="$blk"
done

Save it to "coin_get_diff.sh" and run:

$ bash coin_get_diff.sh bitcoind

Example output:

...
....
Difference from main chain 2528577 s. or 42142 m.  or 702 h.  or 29 d.
Approximate Time Remaining: 2186.83957899106610047826 seconds to complete  sync.[m: 36.44732631651776834130; h: .60745543860862947235; d: .02531064327535956134 ]
Difference from main chain 2526232 s. or 42103 m.  or 701 h.  or 29 d.
Approximate Time Remaining: 2184.21035499949140474011 seconds to complete  sync.[m: 36.40350591665819007900; h: .60672509861096983465; d: .02528021244212374311 ]
Difference from main chain 2524021 s. or 42067 m.  or 701 h.  or 29 d.
Approximate Time Remaining: 2205.15551284291455530316 seconds to complete  sync.[m: 36.75259188071524258838; h: .61254319801192070980; d: .02552263325049669624 ]
...
..


Can the bitcoin network hashrate be used for a 51% attack on other coins? Please correct me if I am wrong.

The difficulty constantly changes according to the current hash rate. It changes to ensure that a block is mined every 10 minutes. If the hash rate was 1000 TH/s and a pool contributed 1000 GH/s, then that pool should theoretically be getting 0.1% of the coins being mined. Now say, hypothetically, that 90% of the network hashrate were actually rerouted to mine another SHA256 coin. If every pool and solo miner was reduced to 10% contribution to bitcoin mining, the payout percentage (and ultimately absolute payout) should remain the same. (100 GH/s)/(100 TH/s) = 0.1%. I am of course assuming that payouts work in this linear manner; I am not sure if they do. Now the other 90% of the network hashrate could be essentially one big pool mining another coin.

Comparing bitcoin and peercoin:
28,780.806 GH/s
151.079 TH/s

(0.90*28781)/(.90*28781+151) = >99%

Why then couldn't bitcoin be rerouted to do 51% attacks on various SHA256 coins until people leave each of those communities and move onto other coins until bitcoin is the only SHA256 coin left? Likewise, this could be done with scrypt coins as well, but each in its respective sector. My first assumption is that this is not possible, or else it would be used already.

You could easy manipulate a pool to wreck havoc on other SHA256 coins if you owned it or managed to gain access. You don't even need to be a large pool, some altcoins are really small and vulnerable. It has affected other coins before, where a pool or a large miner created trouble solely by mining a smaller altcoin.

Feathercoin hit by massive attack

Only thing that prevents this regularly happening is that is isn't profitable to attack small crypto-currencies and in fact devalues whatever you make in the end.


Is it possible to see how much trust a certain wallet/user has extended in Ripple? I can use the Ripple Live Network graph to see the balances of any given wallet on Ripple, but in order to know whether to trust someone (even a close friend), I might want to know how much trust they have extended to others.

If, for example, somebody has a current balance of 30 USD but they have extended trust worth 150 USD, I might not want to trust that person since at any moment they might have sent out IOUs for far more value than they actually possess.

So is it or will it be possible to see how much trust somebody has extended to others in their network? (Or have I misunderstood something here?)

My understanding of trust in ripple is that it is public - Finding the web of trust that links two people needs to be fast, and it also needs to work when the intermediaries aren't connected to the ripple network. However, while you might know that account rWIOWNDKALJOWIOWDKLj trusts rWOIASIOISDKLFJALSKF for 100 dollars, you don't necessarily know their name/location.

Another important point is that you don't have 'Balance' in Ripple, you have somebody who owes you money. So just knowing that this hypothetical person is owed 30 dollars doesn't mean much - they could be deadbeats, or a bunch of accounts operated by the same person. (If you had a list of trusted IOU issuers, you could mitigate this.)

Also, in your example, they might not be overextended; they could have 300 dollars in their mattress, and be entirely capable of paying off IOU's.


Access coins stored at Cryptobridge? I have just discovered, albeit far too late, that Cryptobridge has closed.

Now, there is a lot to say about this particularly dodgy move, but I won't and I'll keep this simple:

How can I access the coins stored in the Cryptobridge wallet?

I saved the .bin file and can access my Bitshares account via OpenLedger, but the only coin listed is Bitshares. Bitcoin is just one of the coins that are/were stored in that wallet.

I've searched around and a few forums say it's possible by logging in to another exchange. Well, that's what I've done and that clearly didn't work.

I am hoping that this simple question has a simple answer, even if that answer is: "You can't."

How can I access the coins stored in the Cryptobridge wallet?

According to Cointelegraph in late 2019:

  [CryptoBridge] announced that all of the firm’s services and servers will be terminated within two weeks. Users will be able to withdraw funds from the exchange until Dec. 15 — the last day of operation.

I'm not familiar with CryptoBridge but it seems like they acted as custodian of Bitcoin and other cyptocurrencies and used their Bitshares blockchain to keep track of their customer's funds. If so you don't have any direct way to recover control over the money that you transferred to CryptoBridge.

Any keys or backups you have might only give you control over their Bridgecoins and those appear to have no value now and are probably not exchangeable into other cryptocurrencies.

  I am hoping that this simple question has a simple answer, even if that answer is: "You can't."

I think that is the simple answer.


bitcoind validateaddress extended info.. somtimes there, somtimes not, why? I have noticed sometimes ./bitcoind validateaddress [addr] produces an extended output, like this:

./bitcoind validateaddress mjYvqa4tC4oEC2ATQrcJh9Ux3CLcszW5J9
{
    "isvalid" : true,
    "address" : "mjYvqa4tC4oEC2ATQrcJh9Ux3CLcszW5J9",
    "ismine" : true,
    "isscript" : false,
    "pubkey" : "03ab4a26a0d577bb4dd5c46b49c1dd19a30a582a5b317f952e490eaac86564fdc0",
    "iscompressed" : true,
    "account" : ""
}

And other times, when I validate and address it looks like this: (why?)

./bitcoind validateaddress n3t74UDtWZtBSVbF5DLxm4ViFiU7rRY5gm
{
    "isvalid" : true,
    "address" : "n3t74UDtWZtBSVbF5DLxm4ViFiU7rRY5gm",
    "ismine" : false
}

Note the difference: one has "ismine" true and in the other it's false.

I haven't specifically checked, but I presume that "ismine" indicates whether or not the address is one belonging to you (and whose key is in your wallet).  If it is your address, then bitcoind is able to report the associated public key, and various other details about how the key is stored and notes associated with it.

If the address is not yours, then since the address is only a hash of a public key, there is no way for bitcoind to know what the public key itself is, nor any other information about how the owner is storing the key, etc; that information is known only to the key's owner.  So you don't see these fields in the output.


Why was the chain with the largest work chosen as the metric of consensus? There seems to be a myriad of ways to find consensus (PoW, PoS, PoD, PoE and various other methods and hybrid approaches).

What was the reasoning behind bitcoin being PoW and treating the chain with the largest amount of work as the correct chain? Is there something about PoW consensus that was inherently appealing to Satoshi or was it merely the default option?

At the time Bitcoin was invented PoS, PoD, PoE, did not yet exist.

Having said that PoW is arguably still the most secure today. The most popular PoW alternative today. PoS will always arguably be vulnerable due to the "Nothing at Stake" problem:

https://download.wpsoftware.net/bitcoin/pos.pdf

"The point is this: even if stakeholders are bonding coins with a large market value, in a way that they will lose the coins if they behave dishonestly, this is only a deterrent to dishonest behaviour until they move their coins, which, being an event in the future (both in realtime and blocktime), is necessarily not something that can be detected at the the current point in blocktime. So cheap histories, or “costless simulation”, are not something that can be prevented while only bonding value defined inside the system"


Are memory pool and transaction pool the same thing? As far I know, unconfirmed transactions are stored in the memory pool. However, in the Bitcoin wiki, I see a data structure called transaction pool. Are they the same thing or not? Also for the orphan transactions, as far as I know they are stored in data structure called orphan pool, right?

That is referring to what is now called the mempool.

The wiki is unmaintained, and contains mostly outdated or incomplete information. I would suggest you use the bitcoin.org documentation instead.


Can I spend from multiple wallets in Electrum (or somehow import/merge them)? Is it possible, in Electrum, to merge wallets, and or do a transfer using multiple wallet keys?  I have some dust in a wallet and would like to get it out. I'm hoping I can easily incorporate it into another payment.
Given the sum of the dust, this is primarily a curiosity. I know it's possible in the protocol, but wondering whether there's a high level way, or even a command-line way.

You could export the private keys from all the wallets you wish to send from, save them to a file. (Wallet->Private keys->Export (to .csv) , open in Excel and copy the private_key column to a new file)
Build a new wallet with imported private keys on Electrum (File->New/Restore->[+] Import Bitcoin Addresses or private keys)
The new wallet would contain all addresses you wish to spend from


Slush's Pool Worker Offline? I am using GUI miner to mine on Slush's Pool.  I have connected with my miner and everything is connected.  I have even had a share accepted.  But it says my worker is offline.  Why is this?

A GPU miner does not have sufficient speed to satisfy the minimum difficulty requirements of pooled mining today (which is why it shows as offline). GPUs have been completely obsoleted since 2013, this is unlikely to change for the better, even if you find valid shares you will have spent several orders of magnitude more in power than it is worth.


Can't see balance after some time I'm trying to use bitcoinj library to receive bitcoin payments and monitor the balance on the address. My implementation is based on DeterministicKey watching public key. The code below is working fine for some time, it prints a message when coins received and print correct balance after it. But if I restart it, the balance becomes zero and the wallet loses all received previously transactions (getTransactionsByTime() is empty list), so it's working only if I send some coins to the static address while the code is running. Also if I start the code again and send new coins to the same address (it's static), I'll see only new transaction, all previous are lost. This is my demo code to check it's working (groovy):

def net = TestNet3Params.get()
def wlt = Wallet.fromWatchingKey(net, DeterministicKey.deserializeB58('tpubD9xtwS1WLdbdLQKCSiR8kiwBwWzL1C1qq7LTgMq12ugeqyGbDCoFic2zqrNgwthyvq8DUubn6CSev58Ja2o9KgMQxafDd6UZWG9JSZWcdGY', net))
def store = new SPVBlockStore(net, new File("/tmp/spvbstore.blockchain"))
def chain = new BlockChain(net, store)
def peers = new PeerGroup(net, chain)
peers.maxConnections = 5
peers.maxPeersToDiscoverCount = 5
peers.addPeerDiscovery(new DnsDiscovery.DnsSeedDiscovery(net, 'testnet-seed.bitcoin.jonasschnelli.ch'))
chain.addWallet(wlt)
peers.addWallet(wlt)
peers.start()
peers.downloadBlockChain()
wlt.addCoinsReceivedEventListener(
  new WalletCoinsReceivedEventListener() {
    @Override
    void onCoinsReceived(
      final Wallet wallet,
      final Transaction tx, final Coin prevBalance, final Coin newBalance) {
        println("RECEIVED: $tx: $prevBalance -> $newBalance")
    }
  }
)
while (true) {
  println("BALANCE: ${wlt.getBalance(Wallet.BalanceType.ESTIMATED)}")
  println("transactions:\n$wlt.transactionsByTime")
  Thread.sleep(10000)
}

Sounds like a watching wallet, but you need to save the wallet file as well as you're saving spv file. As per documentation


bitcoind replies 500 error I'm trying to setup pushpool + bitcoind.  However, when I connect to pushpool with cpuminer I receive this error:

[2013-04-21 12:47:47] json_rpc_call failed, retry after 30 seconds
[2013-04-21 12:48:17] JSON-RPC call failed: {
   "code": -2,
   "message": "upstream RPC error"
}
[2013-04-21 12:48:17] json_rpc_call failed, retry after 30 seconds

I see this error in the pushpool server log:

root@ip-10-28-79-184:/usr/local/sbin# ./pushpoold --debug=2 --stderr --  foreground --config=/usr/local/sbin/server.json
[2013-04-21 13:26:28.319949] Debug output enabled
[2013-04-21 13:26:28.333064] Forcing local hostname to localhost
[2013-04-21 13:26:28.456350] Listening on host :: port 8336
[2013-04-21 13:26:28.456477] Listening on host 10.28.79.184 port 8334
[2013-04-21 13:26:28.485367] initialized
JSON protocol request:
{"method": "getwork", "params": [], "id":1}

About to connect() to 127.0.0.1 port 8332 (#0)
   Trying 127.0.0.1... * TCP_NODELAY set
 connected
 Connected to 127.0.0.1 (127.0.0.1) port 8332 (#0)
 Server auth using Basic with user 'username'
 POST / HTTP/1.1
Authorization: Basic dXNlcm5hbWV2YXN5YTpwYXNzd29yZHZhc3lhMTQ=
Host: 127.0.0.1:8332
Accept: */*
Accept-Encoding: deflate, gzip
Content-type: application/json
Content-Length: 45

 The requested URL returned error: 500
 Closing connection #0
[2013-04-21 13:26:31.743119] HTTP request failed: The requested URL returned error: 500

bitcoind config:

testnet=0
server=1
rpcuser=username
rpcpassword=password
rpctimeout=30
rpcallowip=*
rpcport=8332
rpcconnect=127.0.0.1
gen=0
keypool=256
paytxfee=0.00

pushpool config:

{
    "listen": [
        {
            "port": 8336
        },
        {
            "host" : "server_ip",
            "port" : 8334,
            "protocol" : "http-json"
        }
    ],
    "database": {
        "engine": "mysql",
        "host": "localhost",
        "port": 3306,
        "name": "bitcoin",
        "username": "mysql_username",
        "password": "mysql_password",
        "sharelog": true,
        "stmt.pwdb": "SELECT `password` FROM `pool_worker` WHERE `username` = ?",
        "stmt.sharelog" :  "INSERT INTO shares (rem_host, username, our_result, upstream_result, reason, solution) VALUES (?, ?, ?, ?, ?, ?)"
    },

"pid": "/tmp/pushpool/pushpoold.pid",
"forcehost": "localhost",
    "log.requests": "/tmp/pushpool/request.log",
    "log.shares": "/tmp/pushpool/shares.log",
    "auth.cred_cache.expire": 75,
    "rpc.url": "http:// 127.0.0.1:8332/",
    "rpc.user": "username",
    "rpc.pass": "password",
    "rpc.target.rewrite": true
}

I have tried to change ports, and even rebooted the server,  nothing helps.

It's due to miss-sync of bitcoind in my case.

Just wait the bitcoind sync with the bitcoin network (9GB actually), and after you can use it.

du -ksh ~/.bitcoin/ will give the size.


Blockchain.info has buggy system which does not validate OP_RETURN outputs properly. Your transaction was pushed successfully using competent software.

71c3da4e13f5b61c2cf05e9b5a22f3be989142b870c1cf7779a1d7b3f139d422


A different way to create coinbase transaction AFAIK when a miner succeeds in creating a block, he puts a special transaction (coinbase) in it which spends no input and sends a fixed amount of BTC to an address he can arbitrarily specify.

Instead of doing so, can we do the following: Miner simply puts an address in the block header. When he succeeds in creating the block, all nodes that receive this block create the coinbase transaction -which spends no input and sends the fixed amount to the address in header- in their UTXO pool.

Would that work?

Sure, the protocol could have been designed that way.

The benefit would be that a block would be slightly smaller, since it only needs to contain a single address, rather than a full coinbase transaction.

However, a benefit of the current system is that miners have the flexibility to pay out their coinbase transaction in some other way than sending it all to a single address.  For example, a pool can distribute the coinbase transaction directly to its members in proportion to the amount of work they have done.  This removes the need for the pool manager to hold those funds, even temporarily, and gives the members some additional assurance against fraud by the manager.  It also lets miners take advantage of more sophisticated transaction types, such as multisig, segwit, etc.

The current system also means that coinbase transactions are handled the same as other transactions, using the same code; the only difference is that the inputs need not be checked.  Under your proposal, there would need to be special code to create the transaction, which would be another possible source of bugs and increase the "attack surface".

On balance, I think the current way is better.


bitcoin block size and etherenum gas limit I understand that bitcoin has a fixed block size (1MB).

On the other hand, Etherenum does not seem to have a fixed gas limit.

(https://ethereum.stackexchange.com/questions/1106/is-there-a-limit-for-transaction-size/1110#1110)

What is the rationale that bitcoin block size is fixed unlike Etherenum?

What is the rationale that bitcoin block size is fixed unlike Etherenum?

The block size limit serves two purposes: to keep node operation costs low, and to create a fee market.

With a limited block size, there are only a limited number of transactions that can fit in a block and thus the blockchain grows linearly. This allows for blocks to have a limit on how much network bandwidth and disk space they take up, and also sets a limit on the computational work required to verify a block. Without these limits, blocks could be maliciously produced which are extremely large which take up large amounts of network bandwidth and disk space, and more importantly, potentially take down a node due to a large computational cost.

The limit not only helps with block relay, but also with syncing a new node for the same reasons as above. Comparing Bitcoin to Ethereum, you can sync a fully validating archival Bitcoin node in several hours on standard consumer hardware. It only takes up ~200 GB of disk space. Conversely, you cannot sync a fully validating archival Ethereum node on consumer hardware. Syncing one requires high end hardware (e.g. PCIe SSD) and the Ethereum blockchain also takes up over 1 TB of disk space.

The other reason for the block size limit is to create a fee market. Currently Bitcoin miners are paid through the block subsidy. However the block subsidy halves every 4 years and will quickly reach negligible amounts. In order to keep miners mining, we need to pay them in some other way, namely transaction fees. By having a block size limit, we can build a healthy fee market which organically grows over time so that by the time the block subsidy is negligible, there will be enough in transaction fees to cover the costs of mining.


How to setup Masternode from Beginners? I need a guide for single masternode, on an Ubuntu 16.04 64bit server (VPS) running headless and will be controlled from the wallet on your local computer (the Control wallet).

Thanks

Here is an example of how to set up a Masternode
https://medium.com/geekcash/how-to-setup-masternode-from-beginners-ea5f60686790


Why doesn't bitcoin have a dns server? For example, can a person pay to say "somewebsite.com" as opposed to "1MVY1e2vta5bA6BFEGnpqJeHUC5YaV5dsb"

There's no way the general public would use the latter.

p.s dns was an example, doesn't have to be a ".com", I meant some unique word as opposed to long randomized string.

Bitcoin addresses aren't meant to be reused as this significantly reduces privacy.  This was known to Nakamoto before the initial release of Bitcoin (see section 10 of his Bitcoin paper) and his original software was specifically designed not to reuse addresses.  That means any mechanism that turns easily-understandable string X into address Y should only be used once, which is not what most people want from a recognizable code word.

There have been a few described ways to work around this problem.  The first is simply having the easily-understandable and reusable x be a program somewhere (e.g. myaddress.example.com) that returns a different address each time it's used.  The problem with this is that it requires the receiver run a server, which most people don't want to do.

An alternative mechanism is called Stealth Addresses, which allows the receiver to create a static public key which the spender combines with a random number they select to create a secondary public key that nobody but the spender knows about but which only the receiver can spend from because it uses the same private key as before (basically).  The problem with this mechanism is that the spender needs to communicate the random number they used to the receiver in order for the receiver to recognize and be able to spend the payment, which adds extra data to the block chain and costs the spender more money in transaction fees.

Both of the systems above have been tried but neither has caught on and so when people have put in work into creating decentralized persistent registries (e.g. Namecoin or Blockstack), they've not really ended up being used to facilitate payments.


Why does Zcash show a circulating supply of only 4 million? On coinmarketcap Zcash is showing 4 million circulating supply: https://coinmarketcap.com/currencies/zcash/

But they say total supply is 21 million. So does that mean only 4 million has been mined so far?

Yes, that's correct. The details can be found here: https://bitcointalk.org/index.php?topic=1664832.msg16714736#msg16714736

And in 2050, only approximately 23% of the total supply will have been mined, according to this


Importing 24 word mnemonic to bitcoin-qt How can I import my 24 word mnemonic seed into bitcoin-qt?
I think that I will have to convert it to some other format but I don't know how to do that nor what format to use. BIP 39 does not work.

You can't. Bitcoin Core does not currently allow the importing of seeds or mnemonics.


Where is the exact code part of the walletnotify function? I'm new on the BTC project, so please spare me if I asked something newbies.

I downloaded the latest 0.92 BTC source code and trying to make a customize to the walletnotify function for myself while running the bitcoind. But when I search into the code, that triggered runCommand() at util.cpp and pew "End of the road".

I googled about this walletnotify function, but all I seemed are only the usage infos. So I think it's time to ask the question here but thinking the dead-end by myself.

I don't know exactly what you are asking, but

wallet.cpp (from line 591)

    // notify an external script when a wallet transaction comes in or is updated
    std::string strCmd = GetArg("-walletnotify", "");

    if ( !strCmd.empty())
    {
        boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
        boost::thread t(runCommand, strCmd); // thread runs free
    }

runs a thread that executes the runCommand() function in util.cpp

wallet.cpp (from line 1335)

void runCommand(std::string strCommand)
{
    int nErr = ::system(strCommand.c_str());
    if (nErr)
        LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr);
}

and I think that is all code you need.


Signature digital algorithm in bitcoin, to what will it change in the future? in follow-up to the question: 85202
There, @Ugam Kamat wrote ""ECDSA is the first thing that can get vulnerable with quantum computer. signature will need to move to post quantum world much before quantum PoW.""

My follow-up to that:
to which signature concept are experts thinking on moving to in the future, any ideas circulating right now?

thx

There's no consensus about the best post-quantum crypto encryption/authentication algorithms, but NIST has a competition to choose the best post-quantum crypto algorithms that are asymmetric (where public key and private key different). Surely there's enough time to wait for the competition to end before spending any effort on post-quantum cryptocurrency (Exceptions: qBitcoin, which is impractical, and Bitcoin Candy, which has no progress)


Why is there a higher fee for re-used receiving addresses? Say I want to get lots of small bitcoin deposits and sell them off soon thereafter.  Say I get bitcoin in $5 chunks.  If I take the standard advice and never reuse an address, I have to pay a transaction fee every time I sell one of those chunks.  As of this writing, the average fee is over $2.  This puts the overall fee for this endeavor at 40%.  On the other hand, it seems like I could collect all of the deposits in one address and sell when I've reached some acceptable threshold, say $100.  It seems like this would cost me a mere 2%.

On the other hand, I have read the following at https://en.bitcoin.it/wiki/Address_reuse#High_Fees

  A single invoice payment using P2PKH can be redeemed and spent with a predictable fee because the transaction should have a predictable size. Software that determines payment and available funds based on "address balance" can cause loss through high fees. If you are paid to an address in many small increments, you will pay a much higher transaction fee when redeeming those payments. It is much more useful for a client to display transaction outputs spendable than address balances for this reason.

My understanding was that transaction fees are per byte, and that my transaction would be a standard sized one of the form "MyAddress is sending x many Satoshi to YourAddress".  Why would I have to pay more?

When you have an address with multiple inputs (you have sent bitcoin to the same address multiple times) and you want to send all of those bitcoins to another address, all of those inputs must be included in the transaction, and recording each input takes up space. If you have only sent bitcoin to an address once, it only has one input, therefore the transaction only needs to contain one input, which takes up less space.


What does -keypool=1 do? I am doing some test, and am getting weird behavior with keypool.

In the 0.4.0rc1 bitcoin client:

If I set keypool=1, how many times should I be able to do getnewaddress?

Are there any resources where I can read about keypool, and how it works?

You can do getnewaddress as many times as you want. The keypool parameter just sets how many extra keys the client creates when it needs to create keys. With keypool set to 1, the client will create one extra key every time it needs to create a key.

Setting keypool low will keep your wallet smaller. But it will mean you have to backup your wallet more often to avoid losing the keys to newly-created addresses.


Is altering Blockchain Wallet possible even after all the securities? A man named James Bryan posted an investment plan and took BTC from me. On the day of payout, he asked me to simply fund my Blockchain wallet to receive the money. The minute I fund the wallet, he took all the money out even after all the securities on my wallet. How is this possible?

Is altering Blockchain Wallet possible even after all the securities?

The key thing to learn is that a scammer doesn't need to alter your wallet. They don't even need your wallet to exist, they can access money that was in a wallet that has even been deleted.

  The minute I fund the wallet, he took all the money out even after all the securities on my wallet. How is this possible?

Bitcoin wallets don't contain any Bitcoin really. What they contain is a private-key that gives you the right to spend any Bitcoins that have been sent to a Bitcoin-address that is derived from that private-key.

The money is effectively stored in the blockchain, every "full-node" bitcoin wallet has their own full copy of the blockchain. Any wallet can spend money if they can prove they have the private-key for the bitcoin-address associated with the Bitcoin.

You can prove you own a private-key without disclosing it. That's the mathematical feature that makes Bitcoin possible.

The wallet-password or two-factor authentication only protects access to your copy of a wallet. By earlier giving someone temporary access to your wallet, they can copy from the wallet the private keys (or seed-phrase/recovery-phrase) that they can use to create another copy of the wallet.

Even if you change the password on your wallet, that doesn't affect other copies of the wallet.

If you put money into your copy of the wallet, that money appears in all copies of the wallet which contain the same private key. It doen't even matter if the copy was created before or after you put the money into your wallet.

Any of those wallets can spend the money you put in there. Once one wallet has spent the money, it disappears from all other wallets too.

You may think that calling this thing a "wallet" is misleading since it really contains no money. I'd agree. The inventors of Bitcoin needed a familiar name for a thing that controls access to money, that was the best they could come up with.

Maybe it is best to think of a wallet as a combined key-holder and accounting-ledger viewer.

So never share access to your wallet, even if it is empty at the time.


Calculate the amount of Primecoin(XPM) mined/created so far According to Wikipedia:

http://en.wikipedia.org/wiki/Primecoin

the reward given for finding a block is 999*(difficulty**2). So does that mean that you need historic data on the difficulty in order to calculate how many coins there are?

Yes, unlike Bitcoin you can't deduce the total number of coins in circulation from the current block height, you need historic difficulty data. Of course, there should be services that have already computed this and present it publicly.


Which wallet applications implement BIP38 - Private Key password encryption I just learned about bip38 as it has to do with bitcoin private key encryption by putting a password to the key on the QR code. My question is which wallet apps support this decryption feature?

The paper wallet generator from Bitaddress lets you encrypt with BIP38.


How does the mining process support the currency? Why is mining Bitcoins necessary? Is it essentially a distribution mechanism to ensure Bitcoins are not held by a few (wealthy) individuals from the get-go who might just hoard Bitcoins rather than be encouraged to spend them?

Isn't the (growing) expense of mining Bitcoins going to have this effect in any case - specialist Bitcoin mining companies (with racks of expensive hardware) could effectively make it impossible for anyone else to mine Bitcoins - meaning the currency cannot filter down evenly through the network but ends up congealing around power users...

Mining is not just a way to ensure the initial distribution of bitcoins. It happens that coins have been distributed through mining, because it was easy and useful to do it this way, so this might be a bit misleading, but mining will remain essential even after all the bitcoins (~21MBTC) have been distributed.

Mining has not been designed to distribute coins. It's exactly the opposite: coins are distributed to attract miners. The network needs them.

Mining is the core mechanism that makes Bitcoin possible.
The bitcoin block chain (i.e. transaction history) needs to be updated continuously. In effect, one block is added to the chain about every 10 minutes. Mining is the little miracle that allows trust in the network as a whole, without trusting any single participant¹. The idea is to add some artificial difficulty to block creation, so that only a few blocks are presented to the network for consideration (and for validity checking). This way, the network can choose which block will be accepted as the next reference, while nobody has full control on block creation.

The hard work of miners that build those blocks must be compensated (hardware equipment and electricity are not cheap). A reward has therefore been included in newly created blocks. For now, the reward is constituted mostly by newly minted coins. But given that the mining process is essential to the bitcoin ecosystem, that reward must (and “hopefully” will) be replaced by fees, paid by transactors, when coin creation is going stop completely, in about 130 years.

—

1. Assuming no one has access to more than 50% of the total computation power of the network.


Is mining an instant process or it generates fraction of coins constantly? There are hashing calculators in the internet that tells the average amount of bitcoin you'll make in a period of time. I know that when you generate a block you gain 25 BTC (I guess it is still the reward). How is this possible? It's saying you gain ~10000 dollars when you generate a block? The only way to mine bitcoin is either by generating an entire block, which they say will reward you with 25BTC. But the calculators say something like $200/month. How is this possible? For me, the only way to gain is by winning 25BTC + fees of the block, or not gaining anything.

You are correct, bitcoin mining is a very binary thing. Either you find the hash and you get rewarded bitcoins (currently 25 BTC) or somebody else finds it and you get nothing and have to try your luck on the next block. But because solo mining is such a crapshoot, people tend to join their miners together into what is known as a "mining pool". In this way, because a pool of miners has much more processing power than a solo machine, there is a much better chance that it will find a block and get the reward. When this happens, the reward is split amongst everyone who contributed to the pool based on the amount of processing power they contributed. You get much less BTC than if you had found the block yourself, but the rewards are more consistent. Those hashing calculators are never exact because bitcoin mining is, by design, meant to be random. All they can do is make an assumption, probabilistically, of the average amount of BTC you might make based on your hashrate.


No transactions are showing on my Blockchain page I'm new to this but I know how to use the request button on BlockChain to receive money? The Bitcoin was sent  to the address I provided and I didn't get it. I've received money before and sent money and none of this is showing. Transactions aren't even showing on my blockchain home page. I've always used the same email address. There is always change in my Blockchain account and that not there is either. I done this over may 7times probably and never had an issue. Was I hacked? The day I requested the money I thought it was odd that no change was in there because there is always 95 cent to 50 cents in the blockchain. Because the money was sent 10 days ago. The company sent me all the information and I've never had any issue before with blockchain. Can somebody help? NO TRANSACTIONS are showing up in my whole time using blockchain and I find that odd.

If you had money in the wallet, and it was sent out of the wallet (not by you), then it sounds like the wallet is compromised. Do not use it anymore. You can easily create a new one, but be mindful of security.

Receiving a payment is as simple as sharing one of your wallet's addresses with the person paying you. Once they send a transaction it will automatically show in your wallet, you don't need to do anything else for it to work.


Payment processor question Let's say I have this scenario:

a customer has a bitcoin wallet. He/she shares the public key with a website. The website is a payment processor which lets the customer accept bitcoin payments.

The website generates a new address (based on the customer public key and a nonce) and watches the address for incoming transactions. Is this sufficient for the customer to see a balance increase on his/her wallet?

The customer wallet never sees the nonce so probably something is wrong in my reasoning.

What am I missing here?

Public key is point on ECDSA curve

Public key + nonce != new public key

And if the above equation works, how can you calculate its private key !

Payment processors accept payment on their addresses, and send funds to users instantly, monthly, or send an equal amount of $ to their bank accounts.

I think you're looking for BIP32 wallets, in which addresses (public key hash) can be derived from other extended public keys (xPubs)


cryptography book or resource I am trying to write a multiple currency hd wallet.
I am using javascript libraries but I feel unsafe as I am new to most cryptography concepts and terms like elliptic curve, seeds, entropy etc.

I can not be a cryptography expert but I want to learn terms and concepts at least to know what it is doing when I am using third party libraries.

Can you recommend any books or online resources?

Mastering Bitcoin is an amazing book that'll definitely get you started. It's freely available online here: http://chimera.labs.oreilly.com/books/1234000001802/index.html


How would tax and government revenue be enforced in a bitcoin run society? If we say, hypothetically, the future has a society that runs solely on Bitcoin as its currency. Because of its anonymity how would tax and government revenue be enforced in this society? At this point, naturally, Bitcoin will no longer be considered a commodity but rather a currency. I know that this may be speculative but it must be on a lot of minds with regard to the future of Bitcoin.

It is a PUBLIC LEDGER - anyone can follow an address trail, and the governments of the world already know how to do that - and that is why so many are looking to adopt Bitcoin and make their own digital currencies.  See especially https://secure.caseyresearch.com/chain?cid=MKT336710&eid=MKT337276&encryptedSnaid=&snaid=&step=start


Why does Bitcoin Core keep saying "X days left" every single day? I turn my PC on every day. I don't sleep more than 8 hours. Yet Bitcoin Core, after I verify that it has fully synced every day, keeps saying "7 days remaining" for example, as if it deletes the last week's data every time I shut down the computer and starts over from that point every time I turn it back on again.
What gives? This has started happening only recently. 0.20.1.

As Pieter pointed out, it sounds like your Bitcoin Core is not shutting down cleanly when you turn off your computer. This could happen for example if the shutdown process does not wait for Bitcoin Core to shut down cleanly before killing it, or if the computer is just powered off immediately.
Bitcoin Core caches progress to the chainstate¹. The chainstate is only written to disk on (clean) shutdown or after running for 24 hours. If Bitcoin Core is shut down forcefully before that, it falls back to the chainstate it had at startup, losing all synchronization progress since starting.
Since block data gets written to disk as received, it will not have to retrieve the blocks again. Bitcoin Core will recreate the chainstate from the blocks on disk on next startup, and continue synchronization from that point.
Whether this is a case of unclean shutdowns could be verified by inspecting the debug.log in your Bitcoin directory. If it is, you could manually close Bitcoin Core before shutting down your computer, or configure your computer to give programs more time to shut down to ensure that your synchronization progress is saved.

¹ A lot of the data that Bitcoin Core creates during synchronization is only written and read once before being discarding. While Bitcoin Core is running, caching this data and never writing the discarded data to disk translates to quicker validation.


What happens when a transaction script for mining is used for fund transfer? So, through an odd bug in hacking some stuff onto Bitcoin, I encountered a peculiar thing.

Basically, I managed to generate an transaction with 2 outputs. The first output was a typical  txout

DUP HASH160 20:905a...a998 EQUALVERIFY CHECKSIG

However, a bug caused the second output (the change output, to send it back to myself) to be a mining generate transaction script:

33:025c...6718 CHECKSIG

This was not considered a non-standard TX, and as far as I can tell, was interpreted as a valid transaction for sending coins and block explorers see it as being sent to the proper address.

What exactly is the difference between these two scripts? What is the significance of using a mining script for a transaction?

One is a pay-to-pubkey-hash script (the typical script represented by normal addresses), the other is a pay-to-pubkey script. Both are perfectly valid and standard.

The reason for using direct pay-to-pubkey in coinbases is because they are older. For most purposes pay-to-pubkey-hash is superior (you don't need to know the full public key of the recipient, there is a standard address type for them, there is a marginal security benefit, and they require less space in the validation database). However, direct pay-to-pubkey is just as valid, and the mining code was never adapted to use pubkey hashes instead.


Downloading the new BCC Hi people of North Cryptoland. I bought a couple of Bitcoin a few months ago with a long term view for my retirement, just to add to the portfolio. They are stored in a Bitcoin Multibit HD wallet (in brown leather nicely embossed I imagine!) Anyway I am just wondering how does one find the new BCC if I am entitled, and how do I download them into my Wallet or do I need a new Wallet? (you know in black leather - sort of bill fold style I imagine!). Be gentle with me, I'm 54 years old and my level of computer savvy, runs all the way up to being able to start my computer most days, if I've remembered to plug it in to the wall socket that is...

Thanxs in Advance.  Shady @ Australia

For a start multibit is no longer being developed , so i highly advice you move your bitcoins out of it into another wallet. It is not possible to access bitcoin cash using multibit. Which version of the software do you have and how many (ONLY the number) seeds do you have to restore your wallet?

Blog post suggests how you can import it to electrum. And further post on electrum suggest how you can claim BCC. You will need to fiddle a bit here , but this certainly is possible and be very careful where you get the files from as this will potentially put your coins at risk.

Once you have both the balances available , I highly suggest you move to a hardware wallet like ledger nano s or trezor they are dead simple to use and setup.

Disclaimer : I have not used electrum or multibit and the answer above is after a quick research.


How will Ripples be distributed? What is the distribution plan to get Ripples (XRPs) distributed to the general public? How will hoarding / spoofing be tackled?

(E.g. with a faucet based on Google account auth, one could open several google accounts and get "too many" XRPs).

The "ideal" distribution strategy for OpenCoin, is to give away the 50 billion XRP in such a way that spurs adoption but does not create a surplus which will depress prices. Adoption is spurred by handing out generous helpings of XRP to a small audience. This is what they are doing by handing out 50,000 XRP to every Bitcointalk.org user that has a sufficiently aged forum account. Every week they have been reducing the amount given out.

Very soon they will give out just enough XRP to fund the reserve requirement for an account, plus a couple of trust lines and a couple of order book offers (About 400 XRP at the current requirements).

They want to make sure that each individual can only receive a free serving of XRPs once, or else they will have a surplus of XRP that can be sold, depressing the price. I would expect they would leverage existing identification services such as OpenID, Facebook, Google+ type of systems by creating apps.

They could also leverage the gateways, which already collect personal information on every user as part of "Know Your Customer" and "U.S. PATRIOT Act." By hashing this information according to some standard method, it would be possible to filter duplicates across gateways.


What does the Accepted/Rejected mean? I'm using a Bitcoin Miner on Btc Guild. It's showing 12 Accepted, 0 Rejected. What does that mean?

This means the pool has accepted 12 shares from your miner.  It indicates that you have configured the application correctly and the pool is accepting your workers shares.


Is it possible to run two nodes with the same public key? Is it possible to run two nodes with the same public key on the Lightning network? The reason is reliability -- two different servers run different instances of node software with the same setup (incl keys) -- if one fails -- the other one continue serving. Possible?

thank you.

With reliability, I assume you mean protecting channel balances against server failure (Not being able to close the channel correctly following an error).

You can reproduce the wallet in both nodes, but that doesn't contribute to securing a payment channel's balance in the case of a failure. It simply just means both node instances have identical wallet keys.

In other words, the two node instances may be signing with the same wallet keys, but they cannot be operating as a single peer for a given channel.

Since it is the individual payment channel balance (unbroadcasted, signed commitment transactions) which is at risk, it would be necessary to secure the commitment transaction data of a single node instance to protect your balance in case of a server failure.


ELI5: What's the difference between a child-key and a hardened child-key in BIP32 I've read BIP32, and I do understand it more or less.

Could someone please explain to me like I'm 5 years old what the difference between a child-key and a hardened child-key is?

I'm trying to add HD wallet generation to a service I'm building. I need to be completely informed about this before I dabble in it. Fret not, I'll be using Bitcore, so I won't be dabbling with the crypto directly.

Essentially, a hardened child key is is computed with hash(parent private key + index), whereas a non-hardened child key is computed with hash(parent public key + index).

So what practical consequences does this have?

With an extended public key, you can derive non-hardened child public keys. This is useful in situations where you want to accept payments without immediately being able to spend them. For example, if you had a website selling alpaca socks, your server could use an extended public key to accept payments without losing all of your money if it got hacked. So that's a reason why you might use non-hardened derivation.

With an extended private key, you can also derive hardened keys.

However, non-hardened public keys are weaker when an attacker has 1) the extended public key and 2) one of the non-hardened private keys that was derived from it. In that circumstance, the attacker can work out the private key of the extended public key, and therefore get every key that can be derived from that, hardened and non-hardened.

So what should your app use by default?

You should use non-hardened keys, and disable the ability to export private keys when that would allow an attacker to compromise other keys in the wallet. Even if an attacker gets ahold of one of the private keys, in situations where the attacker doesn't have access to the extended public key, non-hardened is equivalent to hardened security. In my mind, the features of non-hardened keys outweigh the added security of hardened keys.

However, if you don't need the features of non-hardened keys, then you should use hardened keys, because they're more secure.


Refund a transaction send twice By mistake, I have send second time 0.09923 BTC
to bitcoin address: 15qMMPEa4M26XX4KqXxrvD5yjNwfETg3Hx via transaction id:0a5c7ea12bd84b1dfeea4972d6415c28d6846d83c5fb00f56cf4f6d20c05f4da

I did the transaction twice. How to refund it ?

You cant do basically nothing from your end, as you have lost the control of those bitcoins.

One thing that you can do is to ask the recipient of the transaction to refund. If he refunds you will get back the bitcoins.


Is it actually possible to pay ONE fee but make many transactions? I heard that apparently, exchanges and similar "load up" and then "batch-send" many Bitcoin transactions at once, with just one fee, instead of sending each one with a separate fee.
Is this actually possible? Is it easy to do? Should I be doing it for all my "withdrawals"? Will it save me lots of money versus making separate Bitcoin transactions for each customer? (I'm not running or planning on running an exchange, but a Bitcoin-based service where people will get sent Bitcoin.)

Is this actually possible?

Yes. Transactions may have arbitrarily many inputs and outputs (subject to them fitting inside a block, of course). The inputs must be UTXOs that you can provide signatures for (coins you own), and the outputs will be new UTXOs, each of which can be associated with any address(es) you like (that is, the coins you own can be sent to as many addresses as you like).

Is it easy to do?

The reference implementation (Bitcoin Core / bitcoind) allows you to do this on the command line (that is, with bitcoin-cli) using its sendmany command. You can see an example usage of that command in this answer to a similar question.
I'm not aware of any wallets or solutions that make this easy to do via a GUI. Bitcoin Core and Samourai have easy ways to do batch spends. In Bitcoin Core, there is an [Add Recipient] button at the bottom of the "Send" tab. In Samourai, when at the "Send" screen where you would enter the destination address and amount, you can tap the three dots in the upper-right, and then tap [Batch spend].
There must be automated business solutions out there that companies such as exchanges and large merchants are using.

Will it save me lots of money versus making separate Bitcoin transactions for each customer?

That depends on the frequency at which you receive orders and the frequency at which you wish to fulfill those orders. If, say, you're receiving 10 orders per minute, then you could batch 50 orders into one transaction, allowing you to fulfill orders within 5 minutes. If you're only receiving 1 order per minute, then you could only batch 5 orders into one trasaction whilst still fulfilling orders within 5 minutes; to batch 50 transactions, you'd have to wait until you'd received 50 orders, meaning your customers would have to wait up to 50 minutes before you fulfill their particular order.
The average BTC transaction that contains one input (your funds) and two P2PKH outputs (recipient and change) is around 250 bytes. Each additional P2PKH output requires 34 bytes. In this way, assuming a transaction fee of 90 sats/byte:

50 individual transactions with 1 output each would in total cost 1,125,000 sats ≈ 0.011 BTC (≈ 486 USD at time of writing).

1 batch transaction with 50 outputs would only cost 172,440 sats ≈ 0.0017 BTC (≈ 74.50 USD at time of writing).

You can see how this becomes very economical at scale!

Having said all that, in practice this is much less of an issue nowadays because of Layer 2 networks like the Lightning Network. With Lightning, fees average no more than 20 sats per off-chain transaction, and then the resulting balance after many, many Lightning transactions will ultimately be settled on-chain by paying a single BTC transaction fee. Let's say you fund a Lightning channel, perform 50 transactions, and then settle the channel. That's:

One on-chain transaction of 250 bytes, paying 90 sats/byte, so 22,500 sats.
50 Lightning transactions at no more than 20 sats each, so no more than 1,000 sats.
Another on-chain transaction with another 22,500 sat fee.

So in total, that's 46,000 sats = 0.00046 BTC (≈ 20 USD at time of writing).
In practice, you can expect to perform many more than just 50 transactions with a single Lightning channel, further reducing the effective cost per transaction.


How can a light client be certain he got all relevant transactions? With merkle trees, a light client can be sure some transactions he receives are correct with a minimal amount of the blockchain data. How can such a client, though, be sure he received all the relevant transactions from/to his address, in order to know his full balance? What if his peer censured some transactions for some reason?

It can't. However, it is sufficient to request the information from a single honest peer, as the proof does work in the other direction.

This is one of the major drawbacks of using BIP37 for learning about transactions (other downsides include terrible privacy and high load on the servers you're fetching from).

Several proposals exist to improve this, including Committed Bloom Filter and committed adress-indexed UTXO sets. None of them have been implemented, however.


Where does this pattern in the feerate distribution per block originate from? While building a tool/visualization that displays the feerate of a transaction according to it's position in a given block I came across a patter in some blocks.

I expect a typical block to start with the highest fee per byte ratio (feerate) transactions and then continue with transactions where the feerate slowly decreases. Often there are some CPFP transactions where a lower feerate is followed by a higher feerate.

However, what I'm seeing is, that in some blocks (from different miners) are mixed 9 sat/B transactions with 5 sat/B transactions in between. At a later position in the block there are 5 sat/B transactions again. This happens over multiple blocks and different miners. I guess it originates from getblocktemplate or something similar.

I've forked a version of my tool an highlight 5 sat/B transactions in blue (Can be found here, feel free to explore). Since this is still under active development, I'll include screenshots of some blocks in case the links stop working. I deliberately selected a set of blocks where I think it's clear what I mean.

Sample Blocks:

Block #517361 mined by ViaBTC (?)

Block #517363 mined by BTC.TOP (?)

Block #517357 mined by BTC.com (?)

and here is one from Slush too.

Questions:

1) Is this known behavior of an algorithm that creates block templates?

2) What motivation is there behind this feature. Is it a bug?

3) Are there commonly used getblocktemplate alternatives?

1) Is this known behavior of an algorithm that creates block templates?

Yes. This is behavior that is present in Bitcoin Core.

Bitcoin Core bundles transactions into "packages" of one or more transactions. Each package consists of an unconfirmed transaction and its children (if any) to cover the case of Child-Pays-For-Parent. The transaction fee rate is calculated for the entire package (total fees paid by the transactions in the package divided by size of the package).

When transactions are selected, it's really the packages that are selected. Because the packages are put inside the block in the order of package fee rate, you will sometimes get a few low fee rate transactions followed by a really high fee rate transaction because they were all part of the same transaction and the high fee rate transaction was a child that paid for it's parent(s).

This is called "ancestor fee rate ordering".

  2) What motivation is there behind this feature. Is it a bug?

It is neither a feature nor a bug, it is just a quirk of how the transaction selection works.

See also: https://bitcointalk.org/index.php?topic=2058831.0


Fast bitcoin load service I'm freelancer and I'm willing to get paid with bitcoins. Hence I need to find some service which allows to top up bitcoin wallet with minimum efforts (even without registration). Something similar to: https://paynow.payoneer.com/ (but for bitcoins). Simplicity is really important.

May anyone suggest some?

There was a great service back in the day called https://www.moneypacket.org/. You can send bitcoin with email. I think it still works so it seems like a great solution to your problem.


How many block chains exist? I´m beginner and I understood there is an unique huge common block chain to be used by world wide and there a several different crypto currencies types by  running on that . Am I correct?  Thank you to all

@Davide's answer is correct but I expand the explanation a bit particularly regarding the blockchain.

  I´m beginner and I understood there is an unique huge common block chain to be used by world wide

A crypto-currency like bitcoin requires people to run the bitcoin software that makes the whole system work; it is a Peer-to-Peer (P2P) network and each machine running the software is called a node.** The primary incentive for people to run nodes is that they are getting rewarded with bitcoins via a process called mining explained here and here.

A blockchain (aka ledger) is a data structure (think of it as a file in your computer) that stores a history of all the transactions (actually groupings of transactions, called blocks, i.e. forming a chain of blocks) that took place in the network. Currently, it is around 65 GBs big and it is getting bigger with time as new blocks (of transactions) are added. Each node has a copy of the blockchain which is the same in all nodes via a consensus process enforced by computer algorithms.

Thus, in bitcoin, there is one common blockchain with copies in each node.

  and there a several different crypto currencies types by running on that . Am I correct? Thank you to all

No, other crypto-currencies make use of different software, form their own P2P network and have their own blockchains. Similarly, those networks will have a common blockchain and each node will have a copy.

This is a simplified/high-level view but I hope it clarifies things a bit.

** Users that just want to use bitcoin do not need to run a node.


CryptoCompare API gives wrong historical daily OHLC data I am trying to use CryptoCompare to get historical daily OHLC data, but the data I get seems to be wrong. For example, the following query (timestamp=1507248000) will give you data where 'open' (66.43 USD) is less than 'low' (68.88 USD):
https://min-api.cryptocompare.com/data/histoday?fsym=MLN&tsym=USD&limit=1&aggregate=1&toTs=1507248000

Am I missing something or is CryptoCompare really unreliable?

CryptoCompare has been known to sometimes present inaccurate data in US dollars when complex conversions happen.

For instance, if during the date you queried the BTC to some other reference coin price oscillated, the Bitcoin to altcoin price may have had a low price in Satoshis but the Dollar quote to one of the coins (BTC or the reference altcoin) could've been higher at that particular moment. So the Satoshi price could've been the daily low but the Dollar price could've been a bit higher. Note that in late 2017 there were wild intraday USD price oscillations.

The 2nd data item, where you spotted the bug, happened on 10/06/2017 @ 12:00am (UTC) when Bitcoin prices were at around U$ 4324, which doesn't match anywhere close to the quote you got there. So there's some conversion going on indicated by ...

"ConversionType":{"type":"multiply" ...

...in the JSON data, which you didn't specify in your question. That applied conversion and its relation to the US dollar are the keys to fixing the bug in your program.


Why do Lightning packets include channel ids if forwarding is non-strict? The onion packets in Lightning, as described in BOLT 4, include short_channel_id's of the channels along the route constructed by the sender. But according to the same spec, the forwarding is non-strict, meaning that if the payment is meant to be forwarded from an intermediary node X to an intermediary node Y, X is free to choose any of the channels between itself and Y (a pair of nodes may have multiple channels).

Isn't the short_channel_id's in onion packets excessive? Could we just specify a list of nodes along the suggested route and let each node choose the best channel to the next one?

I guess this has historical reasons. The short channel ids where there first in the onion format. C Lightning even today does not support multiple channels between 2 nodes. Lnd on the other hand does. That is why lnd developers started to switch the channel if a second channel with enough balance between the nodes existed. Later on it was agreed to add the statement about non strict forwarding - which you referenced - to the spec.

While working with node ids would work it has some drawbacks.

We would have to make a backward compatible change to the onion format
Short channel ids consume less space I think 8 byte in comparison to 33byte of nodeids (remember the onions only have 65 byte per hop payload)
Short channel ids can be verified in case of private channels. I can check the blockchain for an unspent funding transaction.


How to know my ip address in network With getpeerinfo command I can get all directly connected peers ip addresses, how to know mine in the bitcoin network?

getnetworkinfo will tell you the IP address of your node if it knows what it actually is (or thinks it knows). It will be in the localaddresses field. Note that it may not contain your IP address or have the right IP addresses as it is difficult to know what your IP address is unless someone external tells you what it is.


Will blockchain.info change my BTC adress each time after i SEND my BTC? I would like to know a way to send BTC from 1 wallet but different adress each time. (because of transaction fees i dont want to use few different wallets for this)

Blockchain.info changes your BTC adress after you recieve transaction. Will it do the same after you send a transaction?

It is recommended that a new bitcoin address is used for every transaction, this is best for your privacy. So each time you receive a transaction, you should use a new address. Each time you send a transaction, your wallet should generate a brand new change address for you.

I think you are confusing the terms ‘address’ and ‘wallet’. An address is the string of random-looking characters that you can send bitcoin to, it will usually look something like this: 19STQThjmUqf2veMCWNb7JhErguiCBdy3r.

A wallet is a collection of addresses, controlled by some software that allows to to send/receive transactions.

I’m general, each time you publish a transaction you will need to include a transaction fee if you want it confirmed in the blockchain. I recommend doing some research into how transaction fees work and are calculated so you can learn how to transact most efficiently.


Sending very big amount with sendtoaddress RPC call I am working with Infinitecoin (another bitcoin fork).
This is my first attempt to make a crypto currency based website.
I use PHP with JSON RPC calls.
In this particular case, I want to use

$payment_tx = $ifc->sendtoaddress($account['address'], $to_send);

($ifc is the object returned by the jsonRPcclient() connection)

sendtoaddress() description states :

$amount is a real and is rounded to 8 decimal places.
So I formatted "$to_send" as precised in the description, but i'm still getting  :

*Stack trace: #0 /opt/lampp/htdocs/site/process_payment.php(30): jsonRPCClient->__call('sendtoaddress', Array) #1 /opt/lampp/htdocs/site/process_payment.php(30): jsonRPCClient->sendtoaddress('iKCBBVAfacVuabG...', '10920.00000000') #2 {main} thrown in /opt/lampp/htdocs/site/jsonRPCClient.php on line 140*

I really don't understand why, because I intend to send exactly 10920 Infinitecoins to the address starting with iKCBBVAfacVuabG ... and this is formatted the right way, right?
I also want to be able to send IFC amounts up to several millions. How ?

Here's how I do the formatting :

$to_send = sprintf("%.8f", floatval($amount));

$amount is retrieved from a database.

Please can somebody enlighten me with what am I doing wrong ?

I can offer some IFC as a thank for your help, if someone want some. :-)

you are trying to send amount as string. Sprintf returns string.
You need to send amount as double (in PHP double == float).
Try this way:

$payment_tx = $ifc->sendtoaddress($account['address'], (double)$to_send);

If it doesn't work, use move at first, because sending can fail under many circumstances, while move always works.

Once you are done with that, please read my question about further problems with precision: Can I force json_encode in PHP to output 8 digits after dot for RPC?


What is the 6a[...] hash in OP_RETURN transactions? I've been looking up OP_RETURN transactions on http://coinsecrets.org/ and I noticed that they all contain hashes that start with 6a, for instance:

6a28f7377a2065897e429287682bd2ed67ed7d0f5ebfc35cf4b1575756c3bebf0000b84002004b4d4400

Followed by their actual data:

÷7z e~Bh+Òígí}^¿Ã\ô±WWVÃ¾¿¸@KMD

Is that hash the encoded data?
If not, what is it?

6A is the hex representation of OP_RETURN:  https://en.bitcoin.it/wiki/Script

That is not a hash at all, but rather the raw encumbrance script.  You are looking at the code that actually contains the OP_RETURN.  You can decode these scripts here:  https://chainquery.com/bitcoin-api/decodescript


What's the easiest way for a user to create a transaction with 2 receiving addresses? What's the easiest way for a user to create a transaction with 2 receiving addresses?

I'm not talking about "change".  Suppose I want to send 1 BTC to two addresses:
Alice 1KMkHaogstQ33Ea9k1rQuT5uduPPPQunT4 and
Bob 123uibcSV7mTDSkzHi8pVaM4grLXxLfKre

Alice is supposed to get 0.9 BTC and Bob 0.1 BTC.
How can I do this in one transaction?

Is there a convenient way to make this happen from current (August 2013) Bitcoin client software?

It's a built in feature of the reference Bitcoin-QT client. Make a transaction as normal, and click the [+] button to add a second recipient.


Public Bitcoin Nodes? [No API] i've been searching for hours now. Also on StackExchange here. Are there any public nodes that i can connect to using jsonrpc? I want to lookup stuff (im not into generating priv keys or anything) but I dont want to use any api. So are there any public nodes that I can connect to?

Running public nodes for others to consume the JSONRPC API is not something that is widespread in the Bitcoin community. For a number of reasons, but the main one is probably that it's very low effort to run your own (you can get away with 10G of disk space and a few days of bootstrap time on a mid-range laptop).
That said, this website (hosted by @janoside) exposes some RPC commands publicly.


Wallets that trade all Cryptocurrencies? Been looking around, basically just learning...so much to learn lol. One thing I cant find but...is there a wallet/s that allows trading across all cryptocurrencies? They all seem to be quite restricted in one way or another??

Every currency is different, so it would be impossible to support every currency, and infeasible even to support many due to the sheer number of coins out there. The closest you can get is keeping the coins in an exchange wallet, which is not super safe long term, but at least convenient for quick trading between the types of coin.


Can someone find out how much bitcoin do I have using my public key? Im pretty new to bitcoins, so I may have a silly question.
Imagine that someone has my public key. Can he find out how much bitcoin do I have? only using my public key?

Can he find out how much bitcoin do I have?

Yes, Bitcoin addresses are derived from public keys.

If someone has your public key, they can obtain your BTC address and therefore search the blockchain for transactions involving your wallet address. On the other hand, if you use a separate private/public key pair (separate address) per transaction and someone only has one of your public keys, they will not have enough information to obtain the address from the other keys unless you are transacting between them and it is somehow obvious that they all belong to you (analysis).