Create simple and secure transaction without checksig? According to my previously asked question (P2SH secure spending. How?) creating transactions without signature checking is probably not secure.

Anyway, I see many transactions

(for ex.:40eee3ae1760e3a8532263678cdf64569e6ad06abc133af64f735e52562bccc8)

with scriptpubkey like:
OP_HASH160 [pubkey] OP_EQUAL

With very similar to

OP_SHA256 [hash] OP_EQUAL (from my prev. question)

And scriptsig doesnt have OP_CHECKSIG

PUSHDATA(72)[3045022100ad0851c69dd756b45190b5a8e97cb4ac3c2b0fa2f2aae23aed6ca97ab33bf88302200b248593abc1259512793e7dea61036c601775ebb23640a0120b0dba2c34b79001]

PUSHDATA(69)[5141042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf51ae]

I can't beleeve this transaction are insecure. But what the difference with this ones?

This transaction actually does have a signature check. Instead of OP_CHECKSIG, it's OP_CHECMULTISIG as the script is a multisignature script. The script in this case is the redeemScript which is provided in the input itself. To see this OP_CHECKMULSITIG, you need to decode the redeemScript.

The redeemScript is:

5141042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf51ae

Decoded, this redeemScript is:

1 042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf 1 OP_CHECKMULTISIG

As you can see, this has an OP_CHECKMULTISIG in it which does do a signature check. OP_CHECKMULTISIG checks that n of the public keys listed provide a signature. n is the number that is at the beginning of the script. In this case, n is 1, and the public key is 042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf. So this script is looking for a signature that corresponds to that public key.


Must a Block contain a coinbase transaction? Must a block contain a coinbase transaction? If so, how is this enforced?

Yes, it must.

Block without coinbase transaction will be rejected by network.

From the Protocol, rule #6:

  First transaction must be coinbase (i.e. only 1 input, with hash=0, n=-1), the rest must not be


With Ripple, what is lsfDisallowXRP? In the spec for the ledger format, there's a flag called "lsfDisallowXRP" in the account root entry. It says: "Indicates that this account does not want to receive XRP." But why wouldn't an account want to receive XRP, given that it's necessary for doing any transactions?

This was created specifically to resolve a problem Bitstamp was having. Though there is absolutely no reason to send XRP to Bitstamp, people were constantly doing that. Bitsamp had to either steal the XRP or refund it. Obviously, they wanted to refund it. But this would drain their hot wallet of XRP.

To resolve this, we're in the process of adding the flag you mentioned, "lsfDisallowXRP". If the flag is set, the client will not let you send XRP to the account that has set it. Bitstamp would then set this flag.

Bitstamp can still put XRP in the account to fund its transactions by simply ignoring the flag. We may also add a way to override the flag in the client, possibly by putting a special marker at the end of the address or possibly with a button.


Cannot compile bitcoind with zmq enabled I need bitcoind with enabled zmq. When I'm building bitocind from source and make ./configure the output is:

Options used to compile and link:
...
  with zmq      = no
...

No matter what i pass to arguments.

My configure command looks like:

$ ./configure --enable-cxx --disable-shared --with-pic --without-gui --with-zmq --enable-zmq --prefix=/home/ubuntu/bitcoin/db4/

This will happen when you try to build with ZMQ support even though the required libraries are not on your system. In this case, configure will silently turn off ZMQ support, and you should see a line like

configure: WARNING: libzmq version 4.x or greater not found, disabling

in the output. When you install the required version of the ZMQ library on your distribution (make sure to pick the DEV version to get the header files as well), it should work.


Raw transactions - SubtractFeeFromAmount flag I'm currently working on a project (I'm a beginner in the world of cryptocurrencies) where we are using Raw Transactions, I want to know if in raw transactions there's a flag similar to subtractFeeFromAmount flag that exists in the sendToAddress method.

When you create a raw transaction, you must specify all inputs and outputs, and any leftover will go towards the fee (to the miner). The raw transaction does not do any fee calculation.

Example Transaction:

input1: .1BTC
input2: .2BTC

output1: .299BTC

The resulting fee would be:

fee: .001BTC

This amount gets added to the coinbase transaction (by the miner) of the block which includes this transaction.


What are the debug categories? In the bitcoin configuration you can set debug logging for the following categories. I can't seem to find an explanation of what each of these categories does. Can someone explain them or point me in the right direction?

debug=category
Output debugging information (default: 0, supplying
 is optional). If  is not supplied or if
 = 1, output all debugging information.  can be:
net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman,
selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej,
libevent, coindb, qt, leveldb.

net: Networking. All messages related to communicating with other nodes on the network, including what P2P messages were sent and received and to whom and other information about the network messages.

tor: TOR. All messages related to using a TOR SOCKS5 proxy and TOR hidden service (used for receiving incoming connections over TOR). This includes messages about the creation and shutdown of the TOR hidden service and messages about the connection to the TOR proxy.

mempool: Memory pool. Messages related to actions done in the memory pool including the acceptance and removal of transactions.

http: HTTP Server. Message related to the HTTP server that is used to handle the RPC requests. These messages will typically be for the startup and shutdown of the server as well as received requests.

bench: Benchmarks. Messages about the performance of various parts of the software that can have performance issues.

zmq: ZeroMQ. Messages about the ZeroMQ notification system, including the startup and shutdown of the service as well as when notifications are issued and new clients connected.

db: Wallet Database. Messages about the status of the Berkeley Database engine used for the wallet database. This will include messages about the database flushes.

rpc: RPC Server. Messages about the RPC server including its startup and shutdown as well as when commands are issued.

estimatefee: Fee Estimation. Messages about the fee estimation algorithm including messages about when fee estimates are requested and information about the status of the fee estimator.

addrman: Address Manager. Messages about the status of the address manager and when addresses are added or removed from the address manager database.

selectcoins: Coin Selection. Messages about the UTXOs that are selected when sending money.

reindex: Reindexing. Messages about the reindexing process, in particular errors about out of order blocks and repeated blocks.

cmpctblock: Compact Blocks. Messages about the Compact Blocks relay protocol including when blocks are partially downloaded or reconstructed.

rand: Randomness. Messages for when randomness is needed by any function.

prune: Pruning. Messages about local blockchain pruning, including the result of a pruning operation.

proxy: Proxy. Messages about using a SOCKS5 proxy and its authentication.

mempoolrej: Memory pool Rejects. Messages about transactions that are rejected from the memory pool.

libevent: Libevent. Messages about the libevent library which is used for the HTTP server.

coindb: Coin Database. Messages about the coin database which contains the UTXO set. Includes messages about database flushes and writes.

qt: Qt. Messages about Qt, the GUI framework.

leveldb: LevelDB. Messages about LevelDB which is used for the block indexes and coin databse.

Note that this is not an exhaustive list of the types of messages you will see for each category. Also some categories have many possible messages whilst others have very few.


Does the Ripple protocol allow listing an account's (address's) past transactions? If yes, is there a web site for this? There are many well known sites that show balance and past transactions for a Bitcoin address, eg. blockchain.info, blockr.io etc. Does something like this exist for Ripple? Is this even possible with the Ripple protocol?

I know about http://rippledb.com/, but this doesn't seem to list this, just ledgers.

Yes, the Ripple protocol does allow you to list all past transactions performed. The most typical way would be to use the account_tx command. You can "page through" the data, retrieving a particular number of transactions per command, until you get to the first transaction.

I am not aware of a website where you can trace through an account's transaction history using GUI-style navigation, although the Ripple Charts Account Explorer will show you an account's transaction stream.


Coinbase balance 0.00089623 BTC help to get it out! I have these satoshis won in Faucets, and I did not know that the commission was so high, it's worth more than all my work, help please !!!

From memory it may be free (or cheaper) to send the bitcoins to another user's Coinbase.com account, so one option may be to get a friend to withdraw them for you when they withdraw their own balance. It's a lot of bother though for what's currently worth only about $5.

An alternative option (a better one, in my view) is to leave them there and hope that they increase in value or that the fees decrease, and instead spend your time on more productive activities.


Why is there no decentralized Bitcoin trading API? Since nobody has answered me the last 30 times when I asked for decentralized Bitcoin trading APIs, I can pretty safely conclude that it just doesn't exist. So that's why I now ask why this is.

Don't you think it's ironic that Bitcoin, the decentralized currency, has no means of trading it with other cryptocurrencies, or with some kind of token, or with fiat, or in any way, without using one of those centralized "exchanges" which all force you to give up privacy completely and send them photo id of government ids and stuff like that?

It should go without saying that such centralized exchanges, with their "KYC/AML" demands, defeat the entire point of Bitcoin -- to not be harassed in this manner. Many of us cannot even do it, even if we wanted, because we simply don't have any "photo ids" from the government and have no interest in getting any.

I know about Bisq. It's the only decentralized "exchange" for Bitcoin-fiat that I know of. It has only a read-only API, meaning you cannot actually trade with it. The progress of their API seems to be zero since years and years when they started talking about it. I'm not holding my breath and believe that it could very well never be released.

For this reason, I ask you: Why is there no such thing as a decentralized Bitcoin API? Bisq apparently can stay around for manual use, so it can't be "illegal".

You'd think with all this money in circulation and all these countless marketplaces for cryptocurrencies, there would at least be one small project which give you the ability to script-trade Bitcoin! It's maddening to me that there is no such thing from the looks of it. I have searched for countless hours but nothing is found in search engines and nobody answers whenever I ask them on IRC or Stack sites.

Please at least give me a good reason why this is. Normally, there is at least some logical explanation for things. In this case, it's just utterly baffling to me.

I'd say that's just because nobody programmed it. Bisq community for example is short on programmers so they concentrate on the essentials. Companies have no interest in the development or shy away from the legal risk, where they are increasingly forced to perform financial police duties similar like banks (KYC/AML). Hopefully the Bisq DAO brings enough funds to have developers paid for this kind of work.
Another concern is security. Successful replay or DOS attacks or any essential coding error might risk the whole Bisq project. Like with Bitcoin it's not easy to force the users to upgrade to latest version in case of malicious code.

Do you know the latest developments at the Bisq API? Have a look at this developer conference. There is as well a slack channel for the Bisq API interested.

Record of Bisq developers API discussion, Sept 2019


Bitcoin Server won't connect, timeout error I am trying to run/sync bitcoind -server for the first time on linux and it is not connecting

end of Debug log gives me this...

new
Added 14 addresses from ::: 0 tried, 91 new
93 addresses found from DNS seeds
dnsseed thread exit
trying connection 69.64.34.118:8333 lastseen=117.2hrs
connection timeout
trying connection 10.0.0.2:8333 lastseen=354419.7hrs
connect() failed after select(): Connection refused
connection timeout
trying connection 62.245.238.146:8333 lastseen=96.2hrs
connection timeout

Does anyone have any suggestions. Is it perhaps a server firewall issue?

Issue solved. Simple firewall issue, always unblock 8333


Valid public key check in transaction output Let's say I build a P2MS output script using uncompressed public keys, and let's say too that these public keys are not valid, i.e. they do not represent a valid EC Point and they don't start with 0x04.
Will this transaction be broadcasted and included in a block or, among all the validity and standardness checks, a peer also controls that public keys are valid and rejects the transaction if they aren't ?
Thank you very much !

The standardness check will verify a multisig output for valid EC points. If these points do not pass this verification, the output script will be considered non-standard and not propagated by the implementations which I know of.

This can be verified by checking the implementation source.


Coinbase transaction's 100-block cooldown period From the developer guide:

  The UTXO of a coinbase transaction has the special condition that it cannot be spent (used as an input) for at least 100 blocks. This temporarily prevents a miner from spending the transaction fees and block reward from a block that may later be determined to be stale (and therefore the coinbase transaction destroyed) after a block chain fork.

Can someone please explain why this constraint is necessary? I mean, how is the output of a coinbase transaction (plus block's transaction fees) different than the outputs of any other transaction?

Or, put differently, if coinbase transactions require a 100-block cooldown period, all other transactions do too, no?

how is the output of a coinbase transaction (plus block's transaction fees) different than the outputs of any other transaction?

Because it's validity is tied to WHICH block it is included in. You can't take a coinbase transaction and include it as if it were a standard transaction in another block, because it creates more bitcoins than it spends, which is not allowed for normal bitcoin transactions.

This issue is called being reorg-safe (reorganization-safe). It is a general principal of the blockchain, and it means that if a fork happens and you have to undo the latest block or two to replace them with different blocks, that shouldn't change which transactions are valid. With normal transactions, it's pretty easy to just add them to block X instead of block Y when a fork happens.

But if you have transactions that depend on a recent coinbase transaction, then you can't take those transactions and put them in another block easily. So the 100 block rule is to keep the blockchain reorg-safe, so nothing bad happens in the case of a small fork.


Is "Dacoinminster's Second Bitcoin Whitepaper" logically/economically consistent? Dacoinmister's "The Second Bitcoin Whitepaper" is a new proposal to create another p2p network over Bitcoin (called MasterCoin), that will fix some of Bitcoin's drawbacks.

Are there any logical inconsistencies in the paper? How about "economic falacies"? The paper talks about manipulating certain coins and shares to maintain certain properties (e.g. a minimal and maximal value of each MasterCoin). Can this be achieved?

Note that MasterCoin is not marketed as a Bitcoin alternative, but rather enhancement - if a value of MasterCoin rises, so will Bitcoin's.

It will fail for the same reason other attempts to stabilize currency values always fail. The first time there's a crisis, the regulator will have to decide whether to permit the crisis or prevent the crisis. If they permit the crisis, people will realize that the promised 'guarantees' are shams. If they try to prevent the crisis, they will run their reserves down to nothing, and the same thing will happen as if they permitted the crisis except they'll be broke.

If you make one small change though, I don't see any major technical flaws. Simply accept that the regulation will be maintained only under normal conditions and that crises may push the ratios out of bounds. The regulator should have a policy for how it detects a crisis, what it does during them, and how and to what extent it compensates people harmed by them afterwards, if at all.

For example, before banks were Federally insured, they would have a policy that the board of directors of the bank could declare a "crisis", suspend withdrawals, but later compensate people with extra interest.


Is there a chance that bitcoin will be use as the Universal Currency around the Universe? I'm fascinated on how bitcoin and blockchain works. So now I'm thinking if this is possible? A universal currency named Bitcoin? Being used by Asians, Blacks, Americans, Atheist, or Aliens?

Steering clear of political and speculatory arguments and roadblocks, I think the following holds:

Aliens: not really. Not with the current 10m block time. A Mars colony would already have problems there. I guess some sort of two-way pegged Marscoin could be possible. For more remote aliens, I'm not sure how far you'd be able to stretch that. Confirmations come with time, but having to wait 10 lightyears before you're safe against double spends doesn't sound all that great.

All the other groups you mentioned: yes possible and already being done.


What is better for Bitcoin mining: More stream processors or faster clock? I'm trying to understand the relationships between components in a video card and how it impacts Bitcoin mining.

What aspect of a video card is used during mining?

For example, I can find a Radeon 7950 or 7870 card with a price ranging from $100 to $700 with mainly these specs differing.  I haven't found any performance metric that track Bitcoin to the underlying hardware with this in mind.

Any links would be appreciated.

Realistically, it's a multiplier of the two. You can make up for a slower clock with more cores and vice versa, but the number of hashes per second is dependent on both.

Sadly, I'm not aware of any specific formula to approximate hashes per second for a given clock speed and number of cores.

It's important to note, by the way, that the one thing that won't buy you more hashes per second is the complexity of the cores. This is why Nvidia may make great cards for gaming purposes, but they suck for mining - games make better use of exotic new instructions than SHA256 does.

Update: Thanks to the table David Schwartz linked to I've been able to estimate that a theoretical AMD GPU core running at 1 MHz can calculate approximately 300 hashes per second. Therefore we can estimate hashes/sec as Cores * Clock * 300. This isn't really all that exact and it seems to over-estimate some cards and under-estimate otheres, even within the same family so I'm guessing ambient temperature and other factors were interfering with test results, but it seems to be an ok estimate in most cases. YMMV. It also fails miserably with older cards, but those get such pathetic hash rates it probably doesn't matter anyway.


Why is segwit support rising so smoothly? I expect to see some noticeable random steps (e. g. when some relatively large pool on miner starts to support segwit). Instead I see almost perfect linear dependency. Why is that? I am afraid that I miss something fundamental about segwit.

I painted in red what (approximately) I expect to see, while blue line is the real one. Graph is taken from https://blockchain.info/charts/bip-9-segwit

because the number of supporting pools is a constant

and the percentage is calculated by last 2016 blocks after the start of signaling


0 confirmations after 3 days. My transaction hasn't confirmed after 3 days , and I have no wallet for it to come back to, because I sent the money straight to the browser. If any miner can help me my code is below:
    1NGrDbtmQkMajCezPx7Mo9jjkQHSo1Xbdu

There is no transaction showing for the wallet you have provided. Do you have txID by any chance or anymore information to check the transaction by?

In the past I have reasonable success with https://www.btcaccelerator.net/transaction-accelerator-viabtc ,but to be able to use it you would also need txID.

Also if transaction is not confirmed it will return to the wallet it was send from automatically, but it take quite a while (not sure exactly).


What were 'high-priority' transactions in Bitcoin Core v0.9? I came across these release notes for Bitcoin Core 0.9 and saw this quote under 'Transaction Fees'. Does this distinction between 'high-priority' and 'highest-fee' transactions still exist? What exactly were 'high-priority' transactions?

  Note that getting a transaction relayed across the network does NOT guarantee
  that the transaction will be accepted by a miner; by default, miners fill
  their blocks with 50 kilobytes of high-priority transactions, and then with
  700 kilobytes of the highest-fee-per-kilobyte transactions.

Historically it was not required to include a fee for every transaction. A large portion of miners would mine transactions with no fee given that they had enough "priority". Today, low priority is mostly used as an indicator for spam transactions and almost all miners expect every transaction to include a fee. Today miners choose which transactions to mine only based on fee-rate.

Transaction priority was calculated as a value-weighted sum of input age, divided by transaction size in bytes:

priority = sum(input_value_in_base_units * input_age)/size_in_bytes

EDIT:

input_value_in_base_units = satoshis to be transferred (e.g 1000 sat).
One Bitcoin is worth 100,000,000 satoshis.

input_age = is how many blocks the input has been present for. An unconfirmed transaction
has an age of 0, and one that has 100 confirmations has an age of 100. An input that
was confirmed 50 block before have input_age of 50

size_in_bytes = size of transaction


What information does a wallet contain? What information does the Bitcoin wallet file used by the Bitcoin.org client contain?

Is the owner's Bitcoin balance written in the wallet.dat file, or does it contain a list of transactions that have been made since the beginning of wallet creation?  Does the wallet's filesize grow bigger as more transactions are made?

From looking at the code, the wallet.dat can contain entries of the following types:

name - an address book name
tx - a transaction
acentry - an accounting entry
key - a pair of public and private keys
mkey - a master key
ckey - an encrypted key
defaultkey - the default receiving address' key
pool - a keypool entry
version - the version of the software that wrote this wallet
minversion - the earliest version of the software that can read this wallet
cscript - a script
bestblock - a pointer to the end of the best blockchain seen
wkey - a private key (no longer used)
setting - used to store user interface settings (no longer used, except to hold an invalid setting to stop pre-0.4.0 versions of the client which don't understand minversion from loading wallets that are too new for them)

See also this answer.


getnewaddress won't generate bech32 or p2sh-segwit addresses We are only able to generate "legacy" addresses that begin with a "1". This is a long standing problem generating new addresses using bitcoind and has persisted through a few recent versions of bitcoin core.

This might be a possible bug in bitcoind 64-bit linux.

We are currently running core 19.1 taken from here: https://bitcoincore.org/bin/bitcoin-core-0.19.1/

And our linux version is: Ubuntu 18.04.3 LTS x86_64

We have "addresstype=bech32" set in our bitcoin.conf.

Has anyone else seen this problem before?

Here is our bitcoin.conf:

addnode=**.***.***.***

server=1

rpcport=****

walletnotify=/btc_notify.sh %s

# OpenSSL settings used when rpcssl=1
rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH
rpcsslcertificatechainfile=server.cert
rpcsslprivatekeyfile=server.pem

gen=0

keypool=100

paytxfee=0.00005000

addresstype=bech32

And here is an example of how the problem manifests itself:

The problem is that your wallet version is extremely old - it predates support for compressed public keys (which was added in v0.6.0, released in March 2012). As segwit addresses require compressed public keys, Bitcoin Core is failing with the keys you have, and defaulting to legacy addresses instead.

The solution is restart with -upgradewallet (just once), which will update the wallet to the latest version but break compatibility with old Bitcoin Core versions. Note that you'll need a new backup after doing so.


How to read each bitcoin block by python I need to read all Bitcoin transactions from the first one until now and extract all Bitcoin addresses for further analyses

Any idea how to do it in Python?

I wrote the Python script that can parse bitcoin raw dumps. There is no need of any modules or APIs, just Puthon 2.7 and blk00*.dat files. I hope it can help.

Blockchain parser


Aren't the Bitcoin receive addresses the public keys? These public keys are easy enough for anyone to obtain from a Bitcoin address.

Source: https://youtu.be/h7baD335hCw?t=598
... What? Aren't the receive addresses in fact the "public keys"?

No. There are multiple kinds of addresses in common use:
A Pay to Public Key Hash (P2PKH) address, beginning with a 1... uses a Hash160 (Sha256 followed by RipeMD160) of the public key. The public key is not revealed until this output is spent, as the spending transaction will include the public key in its scriptSig.
A Pay to Script Hash (P2SH) address, beginning with a 3... uses the Hash160 of the redeemScript, which is not part of the scriptPubKey. The redeemScript is part of the scriptSig which spends the output.
The hashes of the above two are then encoded using Base58Check to generate the address.
There are also Pay to Witness Public Key Hash (P2WPKH) and Pay to Witness Script Hash (P2WSH) versions, which are for post-segwit transactions where the witness is a separate part of the spending transaction. These both begin with bc1..., with the difference between the two being the length of the hash. These are both encoded using the bech32 encoding to give the final address. The publicKey again, is part of the spending transaction, but is instead included in the extra witness field rather than the scriptSig.
There does exist a legacy P2PK (Pay to Public Key) output type, but this is seldom used. In this, the public key was included directly in the scriptPubKey.
In the others besides P2PK, the public key is not revealed until an output is spent. There is no way to know a public key from the hash alone, as the hash is a one-way function.


Why do miners need a nonce if the timestamp changes the hash of the block? As the title says.

If the timestamp is constantly changing with every guess, why does the miner also include the nonce? Is it because they're mining too fast for the timestamp to change?

Is it because they're mining too fast for the timestamp to change?

Precisely - even a relatively slow CPU can hash several hundred headers every second. Modern day ASICs can hit 100+ terahashes per second - ripping through the entire nonce space several times over.

Moreover, the timestamp is also a 4 byte value - miners do use it, in conjunction with the nonce, merkle root, and block version to create a much larger search space. Even so, the majority of combinations of all of these do not result in valid blocks.


How can one sign a message to prove ownership of a BIP47 reusable payment code? Is there a way to sign a message and prove that an entity owns a BIP47 reusable payment code? How can this be done via js if available?

yes, sign with the bip47 notification private key


Change address after payment Presume that I have 1 BTC (the total of my UTXO) and I have to pay Bob With 1 BTC.
I set 0 for fees.

My Input is 1 and my Output is 1 versus Bob or there are always 2 outputs?

one versus Bob

and

one versus my change address with 0 btc?

There will be no change in this scenario on only one output sent to bob's address. Note that 0 fee transactions are unlikely to be mined these days so do include a fee. Usually you let your wallet calculate a reasonable fee for you.


BitcoinJ how to understand receive Address? I need to receive bitcoins from the customers, and then add to theirs virtual account some credits. I use BitcoinJ wallet and I want to give each customer the unique Address created by

walletAppKit.wallet().freshReceiveAddress()

But when I receive coins I can't define customer who send me them.

walletAppKit.wallet().addCoinsReceivedEventListener((w, tx, prevBalance, newBalance) contains all information but I don't see any Address info to define customer.

I'm not very familiar with bitcoinj but it appears to me that you need to do the following.

You're passed the transaction that was received (tx).  Call getOutputs to get a list of the transaction's outputs, and for each one, call getAddressFromP2PKHScript to determine the address credited by that output.

You should account for the possibility that there might be multiple outputs paying the same address, or multiple outputs paying different addresses that are in your wallet.


Broadcasting deprecated block version With the recent addition of Binance to the group of miners who will accept taproot,
I wonder what would happen if despite a total of more than 99% of the network accepting it, a miner still doesn't answer or said he would but does not activate this BIP.
Does the transaction requiring this BIP stay stuck in the mempool waiting for the next block, or would other miners ignore his block?

First of all, let me clarify that this website just collects the sentiment of miners—it is in no way binding for the actual activation for which code isn't even proposed.
Assuming that Taproot will use BIP8 as its activation mechanism, there is only one state in which miners are required to signal. Mining is mandatory in the last difficulty epoch of the signaling period, but only if the activation proposal is using lockinontimeout: true.
In any other circumstances, all miners can freely choose whether to signal readiness. Also, it is not expected that the block version will get updated with Taproot, blocks would only be different in that they include transactions using taproot.
Once the proposal is active, miners are free to include transactions that spend v1 segwit outputs, but they are not required to do so. As always, miners may freely select which valid transactions to include in their blocks. A miner may decide not to include Taproot transactions without any repercussions. Presumably, the next miner that supports Taproot would include such transactions if they are among the transactions with the highest feerates.
For example, a miner that didn't update their fullnode since the Taproot code got added would consider Taproot transactions non-standard. Since nodes don't include non-standard transactions in block templates, the miner would still be able to build blocks that are valid to the network, simply by not including Taproot transactions.


How to tell when bitcoin has really stopped running I would like to take bitcoin block data and send it use it to avoid having to go through the blockchain download again on other computers in my local network. To ensure that no db corruption occurs, I stop bitcoin before the transfer. Running the unix command bitcoind stop will return

Bitcoin has stopped running!

I notice that it does still run in top for a few moments after getting this message. This is not a problem right as it's never more than 15 seconds, however I am looking to automate this process using a simple php script.

Using bitcoin-rpc command such as $status = $bitcoin->stop() would yeild a result of "Bitcoin has stopped running" but it may still be running in top.

How do I make sure that bitcoin really stopped running? Or is it safe to preform data transfer as soon as I get this message (does bitcoin keep writing to db after it notifies you it has stopped)?

On linux:

ps aux | grep bitcoind

Or even:

watch ps aux | grep bitcoind

But to answer your question slightly differently I'd suggest keeping existing bitcoind running.  Then your new node add a connect statement with the local ip of the old node in the bitcoin.conf file (located usually in $HOME/.bitcoin/).

Your new node will then solely connect to the existing node and download, via your local network all the blocks from the existing node.

Also if both PCs are imobile you could leave it that way to avoid duplicate downloads from the internet.  An alternative if the second is a laptop for example is to use -addnode instead. From here:

-addnode=<ip>          Add a node to connect to and attempt to keep the connection open
-connect=<ip>          Connect only to the specified node(s)
-dns                   Allow DNS lookups for -addnode, -seednode and -connect (default: 1)


Besides Bitfinex, which crypto currency exchange(s) have Trailing Stop Loss I was using Bitfinex until they stopped allowing U.S. clients.

They are the only exchange I know that has a Trailing Stop Loss feature.

Are there any others?

It's very dangerous to ones portfolio to trade cryptos without stop loss functionality if you cannot stay glued to your screen all day long. And a normal stop loss is too rigid to work well in the very volatile crypto environment.

Kraken have the real deal, where one can set stop-loss based on %, but their trading platform has been a bit unreliable lately.

Bistamp also have trailing stop-loss, but very low on selection of coins.


my transaction is pending 3 days old ... what to do ? please help I have sent 0.278 bitcoins to someone from my blockchain website and my transaction is in pending now is 3 days passed ...I didn't know I have to pay any fees ....it is first time when I use blockchain website ,what's happens they steal my money ?
this is the transaction https://blockchain.info/address/1C5Crpv7UufcqR2mhHjVE2V2tXr2gfBSky

please someone can help me what to do to cancel the transaction and pay the fees ?or what to do ?

The transaction says it has a fee of 120.32 sat/B.

Check out the following to get an idea of what fees you should pay: https://bitcoinfees.21.co/

As of this writing, it would cost around 300 satoshis/Byte to be probably processed within 30 minutes; and the fee you provided is estimated to take up to 1020 minutes (17 more hours) - with a 90% certainty.

What can happen:

You supplement the transaction with some more miner fee (not sure how to do this using Blockchain's wallet).
The transaction eventually makes it into a block, with its current fee
The transaction "expires", as in, gets "forgotten" if enough miners clear their memory pool before it gets included in a block - highly unlikely.

Edit: The question is a duplicate of Why is my transaction not getting confirmed and what can I do about it?


Estimated Fees in BCOIN I installed a BCOIN full node and I would like to calculate estimated fees for Bitcoin transactions.
This functionality works perfectly in the CLI. For example:

bcoin-cli fee 3

Anyway things go wrong when I use the JS api inside my express client app:

const result = await client.estimateFee(3);

The API doesn't throw any error and no response is given back. This was copied from the official API documentation.

Please note that client and options are properly configured. It works all fine in other express routes where I use the bcoin JS API to get blockchain info, lists of transactions etc.

What's wrong? Perhaps the API changed and documentation is outdated ?

Regards

Evebtually I decide to do it the curl way.

By having my express app to make a simple GET http request to the bitcoin node, I managed to get the job done.
Doing this with the request npm module is súper simple.

It doesn't solve the issue with the JS api, but allows me to properly leverage on the éstimate fee feature of Bcoin.


Is there any complete specification of the transactions? I see the wiki page Script, and the page on Contracts makes some remarks on things like signature numbers and SIGHASH flags, but it seems incomplete and not very friendly to someone not familiar with the protocol. Is there an official specification of the transaction protocol other than the wiki pages? Or do I have to read the source code?

Or do I have to read the source code?

This is the only "official specification". The wiki pages have a lot of good info, but they sometimes contain inaccuracies or important omissions.

There's some info about the SIGHASH flags here:
https://en.bitcoin.it/wiki/OP_CHECKSIG


Distinguishing Lightning channels on-chain Is there a way to tell (probabilistically, maybe) by looking at an on-chain transaction that it is related to Lightning (is [likely to be] a channel opening or closure)?

A lightning funding transaction is a P2WSH transaction, which appears on chain as paying to some random-looking script hash, but the redeemScript which can unlock and spend the money is not revealed on chain until the transaction gets spent (which is when the channel gets closed in Lightning's case).

You can recreate the redeemScript if you know the funding public keys used for it, which are broadcast over Lightning's gossip network as part of a channel_announcement message. If you take the two funding public keys, where the first key is the lexicographically lesser of the two, the redeemScript is simply:

OP_2 <pubKey1> <pubKey2> OP_2 OP_CHECKMULTISIG

By hashing this and comparing it to the hash the unspent P2WSH transaction spends to, you can verify that the transaction is a Lightning channel.

But without knowledge of those funding public keys (private channels or non-lightning txs), you cannot know the content of the redeemScript until the transaction is spent.


Multi-destination transaction from paper wallet As far as I know, I can make a transaction to a single destination by sweeping/importing private key. How can I make a transaction to multiple destinations?

You can do this with Bitcoin Core for example. You can find more details in this
answer. You need to import your private key in to Bitcoin Core first.


Regarding CVE-2018-17144 and test cases Regarding the serious bug found (CVE-2018-17144) I am note sure if I understand the full scope of it correctly.

As far as I understand, any block containing a double-spend of a transaction output that was spend in any block prior to the mined one would not have been catched as an invalid block?

If that is the case I wonder if the test suite of bitcoin core does not have a test case implemented for this situation?

There are tests for that.  The specifically broken pattern was a block containing a single transaction spending the same output, which originated from an earlier block, twice. Testing it without putting it in a block, or splitting up the double spend across multiple transactions weren't sufficient tests.


How to create unsigned tx in a watch-only wallet? UPDATE: The issue is resolved and I have mentioned the steps in Create unsigned tx (PSBT) in a watch-only wallet using bitcoin core, sign it in electrum and broadcast using bitcoin core
Below are the steps that I followed and couldn't create an unsigned tx. I am not even sure what are the inputs that can be used for it in this case and how to add inputs.
create a watch-only wallet

add one address in 'sending addresses'

dont see anything in 'receiving addresses' and no option to add

open console and run the below commands to add one address
importaddress tb1qu2l4n8st9w3hhsxstd8muaxgnu63fql9rkylmd "receivetesting" false
rescan blockchain to update
rescanblockchain 1800000 1834770
can see the address in 'receiving addresses' and balance

How do I create an unsigned tx because I get the below error and dont see anything in available balance or inputs?
Consider the scenario in which I have added an address from my cold storage to watch the balance and now want to create an unsigned transaction that spends from it which I will sign later on a different machine (offline)
Also receiving and sending addresses in a watch-only wallet is confusing. Not sure at this moment how can we make it easier to understand atleast in the GUI.

I found this on reddit related to same issue however didn't understand how was it resolved: https://www.reddit.com/r/Bitcoin/comments/ir308h/watch_only_balance_not_spendable_in_bitcoin_core/g4w3svg/

Hi it's moral_agent from the reddit post.
https://www.reddit.com/r/Bitcoin/comments/ir308h/watch_only_balance_not_spendable_in_bitcoin_core/g5gg33f/
I do not know whether this will help you or not but I will tell you what helped me and what I think I was doing wrong.
In order to create a PSBT that spends a watch-only output, it is not always sufficient to import the address of the output.
For a pay-to-script-hash address you will also need to import the script of the output. This makes sense, since creating a valid P2SH transaction requires that you include (and satisfy) the script. Your cold-signing wallet is only expected to supply the signature, not the script, so the PSBT needs to contain that information, so your hot computer must have it to create a PSBT.
I was able to import the required script by doing importmulti. I actually didn't import the script, I imported the script descriptor sort of like this:
importmulti "[{ "desc": "sh(multi(2,BLAH-BLAH-HEX))" }]
I didn't check that syntax for bugs so you're on your own there. Importmulti takes a bunch of args, most of which are optional.
I got the output descriptor for the address I was trying to spend from by runnning getaddressinfo on the address on the computer where the address was originally generated, and which therefore knew what the script was.
Hope that helps. Let me know if you have success!


Is Bitcoin database cross platform compatible? I want to use my Windows 7 Bitcoin database (the block chain I downloaded + my wallets) on Linux (Debian). I run Debian as VirtualBox guest on Windows 7 host and share the Bitcoin data folder (C:/Users/Username/AppData/Roaming/Bitcoin/) as a folder to Debian.

However bitcoind on Debian with proper -datadir parameter says "Error opening block database. Do you want to rebuild the block database now?" message. This brings me to the question whether the databases are compatible between Windows and Linux at all.

Edit 1:
I am using one Bitcoin instance at a time. I realized I get the same error even when using en empty data directory that is mounted via VirtualBox on the host.

Here is the debug.log (same for empty or full data directory):

2013-12-22 20:49:07 Bitcoin version v0.8.6-dirty-beta (2013-12-05 13:11:26 +0100)
2013-12-22 20:49:07 Using OpenSSL version OpenSSL 1.0.1e 11 Feb 2013
2013-12-22 20:49:07 Default data directory /home/kozuch/.bitcoin
2013-12-22 20:49:07 Using data directory /home/kozuch/vboxshare2
2013-12-22 20:49:07 Using at most 125 connections (1024 file descriptors available)
2013-12-22 20:49:07 init message: Verifying wallet...
2013-12-22 20:49:07 dbenv.open LogDir=/home/kozuch/vboxshare2/database ErrorFile=/home/kozuch/vboxshare2/db.log
2013-12-22 20:49:07 Bound to [::]:8333
2013-12-22 20:49:07 Bound to 0.0.0.0:8333
2013-12-22 20:49:07 init message: Loading block index...
2013-12-22 20:49:07 Opening LevelDB in /home/kozuch/vboxshare2/blocks/index
2013-12-22 20:49:07 : Error opening block database.
Do you want to rebuild the block database now?
2013-12-22 20:49:07 Shutdown : In progress...
2013-12-22 20:49:07 Flush(false)
2013-12-22 20:49:07 DBFlush(false) ended               0ms
2013-12-22 20:49:07 StopNode()
2013-12-22 20:49:07 Flushed 0 addresses to peers.dat  4ms
2013-12-22 20:49:07 Flush(true)
2013-12-22 20:49:07 DBFlush(true) ended               1ms
2013-12-22 20:49:07 Shutdown : done

Seems like the problem might be with following:

ErrorFile=/home/kozuch/vboxshare2/db.log

Edit 2:
There also is a .lock file with 0 size in the datadir after I get the error.

Edit 3:
So "ErrorFile=/home/kozuch/vboxshare2/db.log" was not a problem. I get this error for a working instance locally (without shared data folder).

It should be compatible if your running one instance at a time, BUT I think that the datadir is being locked.
Try to find more details in the logs, it should tell you the reason of the error which could be anything.
if you are running any bitcoin software on windows stop it and try to restart bitcoind from your linux box.

EDIT: Did you install bitcoind and run it as root? if not, can you try to chown -R  ~/.bitcoin as root, not the db folder itself, it still can be a permission issue,


Which impacts has openssl's end of life [2019-12-31 (LTS)] What will happen after openssl 1.0.2 reaches end of life - 2019-12-31 (LTS) (Source: https://www.openssl.org/policies/releasestrat.html)

I remember discussion about it. Openssl does not need to be updated to 1.1.0 and it is not a security threat as not all openssl features are used and there is no security threat by using pre 1.1.0 versions.

Is it now decided that bitcoin will keep using unsupported openssl version after 1.0.2 reaches its end of-life, did something change regarding this question?

If it will be updated, is there arleady a milestone set or anything else where I could look up?

It's not consensus critical, because BIP 66 was accepted. It might matter for SSL encryption of an RPC connection. Ideally, your RPC calls aren't crossing the network anyway, though.


Who should pay the transactions fees? In traditional transactions, the merchants pay the fees. For bitcoins, it seems that the payer is paying the fees. In pratice, what will happen for a real transaction? If the payer does not enough fees, the transaction won't be confirmed. Or should the merchants include the transaction fees in the price?

In Bitcoin it is indeed the sender who pays the fees. Also for "real transactions" (with the marginal case of P2SH where one can say that the receiver pays part of the fees upon spending the proceeds of the P2SH transaction).

Indeed, if fees are too low, the transaction is not confirmed. Therefore, the seller typically waits to see whether the transaction is confirmed before delivering anything.

At present the fee is typically less than USD 0.1.

Because the fee necessary for a transaction depends on the length of this transaction (ie its number of inputs, among other things - something determined by the buyer's history), it is hard for the seller to specify a fee that applies to all the expected transactions.The transaction fee can therefore be seen to be only implicitely and approximately included in the price.


Why is the wtxid considered malleable? Why is the wtxid considered malleable since the transaction is unconfirmed?
How can a third-party modify it?

All transaction data is committed to the WTXID, unlike in the case of TXID's.

Malleability is found in the unlocking script/data of a transaction. It is malleable, because is not committed to the signature (circular dependency).

Sources of TX Malleability:

Signature Malleability
Input Script Malleability

See BIP62 for a great overview of TX malleability sources.

The unlocking script data is found in input scripts (non-witness tx's) and witnesses (witness tx's). For a witness transaction, if the witness is modified in a way that doesn't affect validity, this necessarily changes the resulting WTXID.

The TXID's of witness transactions are not malleable, because the input script is empty and witness data is stripped for its TXID derivation. Transactions are not referenced by WTXID, but by TXID's.


How to access bitcoin client from ruby using Rpc client? I'd like to access local bitcoin node from ruby by using RPC client. The following is my code, and it returns the next code. Could you tell me how to call Bitcoin client on ruby?

#console
NoMethodError (undefined method `getblockcount' for #<BitcoinRpc:0x007fe4e2577050>):

#product_controller.rb
require 'net/http'
require 'uri'
require 'json'
class BitcoinRpc
  def initialize(service_url)
    @uri = URI.parse(service_url)
  end
end

class ProductsController < ApplicationController
  require 'openassets'
  require 'bitcoin'
  include Bitcoin::Util
  include Bitcoin::Builder
  h = BitcoinRpc.new('http://'rpcuser':'rpcpassword'@localhost:8332')
  puts(h.getblockcount)
  ....

I've solved the problem by changing the url as follows.
http://'rpcuser':'rpcpassword'@127.0.0.1:8332'


Can I create my own 24 word system using JavaScript or Ruby? Ledger Nano X has a 24 word system.  So can I create this system on my own computer?
And I can use 3 words, 9 words, 24 words, just by a method like the following?

Say, for simplicity, if it is 3 words, "apple", "pisces", "steve"
Now I sort them, in alphabetically order, but no need to, because they already are sorted
Now use any package to create a Private Key A and Public Key A from them
Now, for the so valuable BitcoinPrivateKey of my "address" that has the bitcoin, use the public key in step 3 to encrypt it.
Now I can email this code to 20 of my friends or post it in my Google Docs or any website
So only the private key A can get back my valuable BitcoinPrivateKey, because that token I emailed to 20 friends, if I use the private key A to encrypt it (to pass through the private key function), then I will get back BitcoinPrivateKey. (that's the property of private key and public key, if f is a function of private key and g is the function of public key, then we know x = f(g(x)) and x = g(f(x)) meaning pass through f and then g, and you get back itself. Likewise for passing through g and then f, you get back itself.
So from now on, I only need to remember "apple", "pisces", "steve", and I can generate Private Key A and Public Key A again. And then I can ask any of my friend what that token is, and use Private Key A to get back your BitcoinPrivateKey, and therefore get back my bitcoin and sell it.

Does it work?  Is there any online system that can do that? But that will mean we need to enter the private key on a webpage and let it go through the Internet once, with HTTPS it is better, but if that online system has some loophole, then the private key could have leaked.

You have reduced the level of security by making it so that an adversary only needs to figure out your three-word phrase rather than your 24-word phrase. Assuming 170,000 English words from which you derive your phrase, your three-word phrase only has 52 bits of entropy. In practice, it will probably be less than this because your set of words may not be sufficiently diverse or your choices may not be sufficiently random.
Of course, the adversary also needs to find the encrypted seed which you have sent to your friends, but that's a different matter, and socially engineering one person is still easier than brute forcing a 128-/256-bit key space, let alone socially engineering 1 of 20. Assuming the probability of the adversary successfully attacking a particular friend and getting the encrypted seed is 0.1%, the probability of them succeeding when you have given 20 friends the encrypted seed is 1.98%.
You're better off just using a BIP-39 seed phrase, writing it down somewhere (not sharing it with your friends) and using "apple pisces steve" or whatever as the BIP-39 optional passphrase, which you either remember or also record somewhere (not as important where, as long as the actual 24-word seed is stored in a safe, offline location). This would effectively result in a 27-word seed.
Consult this video by Andreas Antonopoulous for other reasons why you shouldn't devise your own schemes, and what you should do instead: https://youtu.be/jP7pEgBpaO0


Transfer Bitcoin from between two different wallets In my application i want to received payment from different user. Each user may use different wallets like mycelium, jaxx and many more... My application's wallet is in coinbase, is it possible to transfer coin from mycelium, jaxx to coinbase ?

Just by sharing the receiver wallet address.

thank you for that question and all legitimate wallets work in transfer of bitcoins just by sharing your wallet address,it doesnt matter what kind of wallet your using,what matters is having bitcoins.


What other whitepapers are there for coin distribution models like POW (proof of work) and POS (proof of stake)? I'm looking for other types of distribution models for crypto coins that are like POW (proof of work) and POS (proof of stake). I'm assuming these are a type of distribution model for coins, or is there a better term for it? I mainly want to find other systems that have unique ways of distributing a coin. Is there a list somewhere?

I don't know of any such list yet, but no reason we can't start making one. :) Others should feel free to add their findings via an edit.

Proof of Work
Proof of Stake
Proof of Activity
Proof of Storage
Proof of Knowledge
Proof of Stake Velocity
Proof of Burn
Dual Purpose Proof of Work (Primecoin)
Proof of Lock (Tendermint)
Delegated Proof of Stake (Bitshares)
Stellar Consensus Protocol (Stellar)
Xoken Consensus Protocol (Xoken)


How do I find a "Bitcoin address" for buying Bitcoin? I am very new to Bitcoin and just learning my way around my Bitcoin wallet, etc. Recently, in order to try to find out more about buying Bitcoin, I clicked on "Buy Bitcoin" in my wallet, but was immediately required to "enter Bitcoin address" before I could go any further.  I don't know what to enter here, or how to find out.  Can someone enlighten me, please ?

You have to download a Bitcoin wallet first. I suggest you to download Electrum, it's a lightweight wallet with easy UI. It will generate an address for you.


Can one mine bitcoin without including transactions and get accepted by network? The answer was yes few years ago. Does it still apply as per 2020? If so, why I cannot find any blocks with no transactions recently? Is it not easier to mine blocks with no transactions?
Also, if it still applies, are there any mining software that would allow it? Cgminer and bfgminer are so old, are they still in use and what are you using guys?

The answer was yes few years ago. Does it still apply as per 2020?

Yes, changing that would be a consensus change and require a fork of some kind.

If so, why I cannot find any blocks with no transactions recently?

Because it's more profitable to include transactions. Miners want to make money, and with the diminishing block subsidy, they will want to collect as much in transactions fees as possible, so they have to include transactions in their blocks.

Is it not easier to mine blocks with no transactions?

The amount of transactions in a block has no effect on its difficulty. It may be nominally "harder" because a bit more logic needs to be done to collect and choose the transactions to include, but this is negligible and the fees collected far outweigh any benefit to mining empty blocks.

Also, if it still applies, are there any mining software that would allow it? Cgminer and bfgminer are so old, are they still in use and what are you using guys?

AFAIK, both cgminer and bfgminer are still maintained. Old does not mean bad. They can mine empty blocks if whatever node provider they are connected to gives them empty blocks to mine.


how to configure bitcoin-core (bitcoin-qt) to not use change addresses? Can bitcoin-core wallet be configured to not use change addresses, but just one address?

If yes, how? Thanks

(PS: I know most people will try to convince me that this is not a good thing, but I have perfect valid reasons. I know the privacy implications of this, ok? :)

It's unclear what you want.

Do you want no change addresses, but still have change that goes back to one of the addresses from which coins were taken? That does not have any size/fee benefit. This is possible by using the coin control feature (in the Bitcoin-Core GUI) or the createrawtransaction RPC interface.

Do you want no change at all? That means the amount you are sending must exactly match the sum of the sizes of some of the unspent outputs you have in your wallet. It does result is slightly smaller transactions and thus lower fees, but it is highly constraining. You'll have to construct transactions manually if you need this.


What will happen when bitcoin's popularity multiplies and the number of transactions explodes? As I understand, every transaction in the bitcoin network is stored into one huge "chain". What happens when bitcoin gets more popular and there will be millions of transactions per minute? Doesn't the blockchain grow "too big"?

According to Bitcoin Block Size - What are the rules? each block can be up to 1MB per size and contain roughly 2400 transactions. As transaction blocks are supposed to be found every ten minutes, this would mean that 14400 transactions per hour or 4 transactions per second could be handled.
If there should be more transactions sent they would compete for inclusion into the blocks. Transactions with smaller fees would gain priority by aging and would at some point be included at times of fewer transactions. People that require their transactions to arrive quickly would attach bigger transaction fees for faster inclusion. At some point microtransactions would cost more than the amount of value they transport and/or would have to wait very long. Perhaps some transactions would move off the blockchain,  some e-wallet services already allow their users to transfer balances to other users of the service for free and without wait.

The protocol as it is today would not be able to sustain a transaction volume of millions per minute (although that is too big a number, even VISA only has 150 million transactions per day, which are about 100k per minute). The bitcoin network is currently averaging just above 60000 transactions per day, so this is already about 1/6 of what the network can handle with the current block size limit.

However, apparently a significant amount of transactions are generated by gambling, so I am unsure how pressing the matter really is for the network.

Edit:
Reading more about the scalability of the system I learned that the bitcoin network could scale to more than 40000 tps on today's hardware. The regular users would probably not store the complete blockchain anymore, but only the unspent outputs without the entire history of the transactions.


How can there exist businesses that "specialize in blockchain analysis looking for patterns of usage that reveal how money is being used"? I read this today in a SE comment for an unrelated question:

  there are businesses that specialize in blockchain analysis looking for patterns of usage that reveal how money is being used.

To me, this is downright offensive, since I have spent 20 years trying to come up with something that I can do that will actually generate money.

And now somebody claims that there are entire actual businesses that do nothing but analyze the Bitcoin blockchain looking for patterns, and somehow make money from this?

Can somebody explain to me how this makes them money? And what, more precisely, do they do when they "look for patterns"? Surely this must involve more than just having a Bitcoin Core fullnode on a PC and looking at the blocks locally?

And now somebody claims that there are entire actual businesses that do nothing but analyze the Bitcoin blockchain looking for patterns, and somehow make money from this? .. Can somebody explain to me how this makes them money?

These chain analysis businesses make money by selling data to interested parties, such as regulators, other businesses, police/gov enforcement agencies, etc.

As example, in many jurisdictions, businesses that act as bitcoin exchanges (trading fiat <-> bitcoin) are required to comply with 'anti-money laundering' (AML) and 'know-your-customer' (KYC) rules and regulations. This ultimately means that these businesses will need to catalogue data about who is using their service, and for what reasons. So they will employ the services of a chain analysis firm that can supply data about what is happening on the bitcoin network, in an effort to appease regulators.

  And what, more precisely, do they do when they "look for patterns"?

Chain analysis firms will work to obtain as much information about the economic activity happening on the bitcoin network as possible. This includes:

The structure of transactions (number of inputs/outputs, value of inputs/outputs, address types, etc)
The relation between different transactions / addresses (eg, attempting to group clusters of addresses to outline a user's wallet, etc)
The messages exchanged P2P on the network (eg, where do new blocks/transactions originate from)
Publicly available data (eg, when a user posts an address of theirs to a forum online)
Privately available data (eg, buying or trading data about customers from private businesses)

By combining clues gained through the above methods, a chain analysis business can make guesses about which users own certain UTXOs, as well as the relationships and economic flows that exist between these users. Since this data is of value, these businesses can exist.

For a thorough explanation of these different types of attacks on privacy, the Bitcoin wiki has a great page: https://en.bitcoin.it/wiki/Privacy#Blockchain_attacks_on_privacy (as suggested by MCCCS in a comment)

An important thing to note is that many of the metrics used by chain analysis firms rely on certain heuristics that do not always hold true. This means that in many cases the resulting analysis is false, or perhaps just nonsensical. Bitcoin privacy is a back-and-forth battle, with many developers working on tools and techniques that directly attack the validity of heuristics used by chain analysis (eg, coinjoin, payjoin, etc).

On the other hand, a chain analysis company would be expected to overstate the validity of their results, since their revenue is contingent upon this validity, and they want to convince customers and regulators that the fees they charge are worthwhile.

Ultimately,  a user can interact with the bitcoin network in a way which grants them zero privacy against these businesses, or they can interact in a way which allows them extremely high levels of privacy. It really just depends on the user's habits, and the tools available to them.

So the true effectiveness of chain analysis is hard to discern, but in any case it is an attack on the privacy and security of bitcoin users worldwide. Note that even if the conclusion of a chain analysis firm is false, there is nothing to stop an overzealous regulator from persecuting an individual based on the result anyways. The stakes are apparently high, for everyone involved.

So I do agree that it is offensive, though perhaps for different reasons.


Really I am not understanding the Basic things of BitCoin? -- Layman question Example:

Step 1: Day 1 of bitcoin software got deployed in System A, A created Genesis Block and got awarded 50Coins.  - I understand

Step 2: System B got installed bitcoin but no coins.

Question:

1) So only System A has 50 Coins, then how the transaction going to happen.

2) How come the Coins converted to the value of real money. I mean it is like someone writing "GOLD" on paper and hand it over to you. But it is not real gold, so no one going do any transaction for this paper.

Basically, I want to know about initial bitcoin flow and how it got multiplied. How people converting to real money.

Satoshi Nakamoto mined the genesis block in January 2009 and then he sent 10 bitcoin to Hal Finney who was one of the first to run the bitcoin core software. Finney then started mining hundreds of bitcoins in the days that followed. Satoshi then offered his peers equity in the form of bitcoins in exchange for them to work on the bitcoin core software, both developing and testing. So the original guys did not need to buy bitcoin, they were given it as a form of equity. Only in 2010 did the first bitcoin exchange MT Gox open in Tokyo and this allowed other people to buy and sell bitcoin using Fiat currency.


Mining Profitability My friend's dad recently started mining BTC with his gaming PC while he's not using it. As far as I can see, this kind of mining is not profitable anymore. He gets 40 Mh/s on average and apparently has made about $10 so far. I tried busting out my old Block Erupter USB miner which gets about 250 Mh/s and it hasn't made anywhere near $1. I'm wondering if he's just messing with me or if I'm missing something important. He could be mistaken about what coin he's mining but I'm pretty sure it's BTC.

Mining Bitcoin at 40 MH/s is not profitable.

Unless you get free electricity and consider 4 cents a year profit, there is no point mining Bitcoin with that hash rate.

Does your friend's dad have $10 in Bitcoin from mining with that hash rate? Simply put, no. Your friend's dad could have, however, been mining a different cryptocurrency without knowing. 40 MH/s mining Ethereum produces $3 a day.


How does Alice know she is receiving the correct address? Let's say Alice wants to send Bob some coins. Bob needs to tell Alice where to send them, so he sends his address to Alice. How does Bob send this address so that Alice knows that the address she is receiving is indeed Bob's address and not an Eve's (an eavesdropper) who wants to steal the coins?

The problem itself is not Bitcoin-specific per se. It's a matter of being able to verify the sender of some data. Bitcoin addresses are only designed to be immune to typos (they contain a checksum), but otherwise the protocol does nothing.

One can, however, do a couple things to make sure a proper address is sent and received:

One can use a vanity address that is hard to generate and clearly is related to the situation. Using 1Bob... would not be the best choice, but 1BobEveryman..., or 1ThankYouAlice... can be better (examples chosen for clarity, normally you'd be using base 58 alphabet). Generally, if it takes more than a couple minutes to generate an address you know it either came from the original sender, or someone deliberately wanted to steal Bob's identity (by spending a lot of time beforehand generating the address).
One can try checking the history of the address in the Bitcoin Block Explorer. If the address has been used a couple times, it is less likely it will be fake. Being Eve I probably wouldn't want to use the same address for scamming people more than once, and generating a history of transactions would take some time.
One can ask Bob to provide his Bitcoin address wrapped in Bob's digital signature. The main problem with this is securing Bob's signature in the first place, which is basically the same problem as we are solving right now.
One can look for address received on the internet. A lot of people have a habit of including the Bitcoin address they use in places like forum signatures, their websites and the like.
If Alice knows Bob, they might decide on using some information only they would know to create an ECDSA keypair and use that for transmitting Bitcoins. Such information might be for example be the movie they saw when they first met, some information from the school they attended and so forth. Generally, something that they remember and would be hard to find out. Alice can use that as the private seed of the keypair, generate the public address to send the Bitcoins to, and make the transfer. Bob then would have to repeat the same process and withdraw Bitcoins on their end. The main problem with this approach is whether Bob an Alice know each other beforehand and trust themselves with handling private keys.
When all else fails, one can always meet Bob in person and get their address that way.

All in all, there are many ways to prevent a man in the middle attack in the descried scenario.


How to use Backup .dat? I had a Bitcoin wallet with come coins, backed it up (have the .dat file and a .csv file) but recently had to reinstall my Operating system which sadly wiped all my programs.  Now I have a new wallet but do not know how to access my coins using the .dat...  any hints?

Find where you wallet file is located which will be different depending on which operating system your using. Then replace the new wallat.dat file with your old one. If you haven't downloaded the block chain yet, then just start up Bitcoin-qt and once it downloads your coins will be in your wallet. Otherwise you will need to re-scan the blockchain at which point your wallet will have your bitcoins in it.


How to know balance in Ledger Nano S? Ledger wallets have a single static address where to send BTC to, but when looking at the details of the transactions, it is always recorded as different receiving addresses. Looking up the static address on blockchain.info (the address you send BTC to) will always show a total of 0 BTC.

Is there a way to know the total balance of a Ledger wallet from the
static address?
Is there another way to know the total balance
without actually plugging in the Ledger device?

You may use a blockexplorer e.g. https://blockchain.info/xpub/${xpub} (replace ${xpub} with that string beginning with "xpub") to look up the balance on the web or use a wallet like e.g. mycelium.

You can look up this key as well as the private one with e.g. https://iancoleman.github.io/bip39/ – use a copy offline for your actual backup phrase

Have a look in BIP32 and 43 to learn about xpub and xprv for HD wallets (and later on BIP 39, 44 and 49).


Blockchain and Bitcoin client difference of amount I just made a transfer of 0.06 BTC, you can look it up on Blockchain.info

The problem now is that my receiving client (Multibit) doesn't show those 0.06 BTC, it only shows 0.0001 BTC have been spend (most probably as mining fee).

The 'view at blockchain.info' button takes me to the same Blockchain page as mentioned in the beginning. How should i understand this, and where did my 0.06 BTC go?

You've probably sent TO an address in your wallet. The amount is shown as a net figure. I.e.it is a bit like you have transfered money from your left pocket to your right pocket. MultiBit just shows the fee that you have sent to the miner.


How does a request link work? When I share an request as a link it can look like this:

bitcoin:1474awqSNomvEjS2vPv4Pueq3WkrMaEFfP?amount=1

I've got some basic questions about request link:

Is just my address and the value sent contained?
What software recognizes such links?
When is it displayed as a link?
How to use it without being clickable?

It is the same link protocol as http: or ftp: or mailto: or tel: or magnet:, although very less recognised. Official Bitcoin github MediaWiki Link

Localbitcoins.com offer its registered users to associate itself(site) to bitcoin: protocol, when user is signed in, and thus he clicks a link with bitcoin protocol, localbitcoins.com will automatically fill in the receiving address and amount text boxes with the values from link.

Yes, it just sends what it displays, address(required), amount and/or message (both optional)

On webpages, anytime it is marked down in html as <a href...> tag, it will be a clickable link.

There is no other use of it when it is not clickable, other than that you could see receiving address and amount, same as if you see http://www.example.com or mailto:example@example.com and you could just deduce the website address or email address.


Attack the network by temporarily adding hash power? Could a malicious actor (e.g. government) attack the network by introducing significant compute power into the network, and once the difficulty grows very high, withdraw all resources from the network.

This could dramatically increase the time it takes for transactions to be confirmed, as well as makes it not profitable for other miners. Granted this would only last until the difficulty is readjusted, but perhaps it could be enough to shake public confidence in the network.

Yes it is possible. You already answered your own question:

"This could dramatically increase the time it takes for transactions to be confirmed, as well as makes it not profitable for other miners. Granted this would only last until the difficulty is readjusted, but perhaps it could be enough to shake public confidence in the network."

There are other attack vectors (such as certain Sybil attacks, Finney attacks, 51% attacks or attacks on blockchain immutability such as the ETH hardfork proposal in response to the recent attack on the DAO) that could have a far greater impact on public confidence than a temporary difficulty adjustment.

If the attacker could generate enough hash rate to engage in a double spending attack, that would also have a much larger impact than changing the difficulty as you describe.


What happens if the Exodus company and servers shut down? I am reasonably confident about the security of my Exodus wallet, i.e. no one's going to steal my coins (not easily), however I can't get the following around my head...

What happens if Exodus and its servers cease to exist overnight or get closed down by the FBI or other government institutions? In this case, do we all lose access to our wallets or do we have anything by way of the 12 word key and user password that can enable us to import the wallet into another software/hardware wallet application?

Thanks

exodus allows you to backup your private keys (look here). so if exodus will stop their service and you do not want to use exodus anymore (or maybe you can not) you can import your private keys in an other wallet and will not loose any funds.


Is Bitcoin the first e-cash scheme which solved the double-spend problem? Is Bitcoin the first trustless e-cash scheme which solved the double-spend problem? I'm under the impression it is and that was one if its greatest contributions, but I couldn't really find a source to validate that claim. I know it's silly to ask for proof of something not existing, but I'm writing a thesis.

Yes. Bitcoin is the first trustless e-cash protocol, which solves the double-spend problem. If anyone else needs an academic source to back up this claim, there is at least this one:

Brito, Jerry ja Castillo, Andrea: Bitcoin: A primer for policymakers.
Mercatus Center at George Mason University, 2013

https://www.mercatus.org/publication/bitcoin-primer-policymakers


Standalone Java Bitcoin Miner - Does it Exist? I am a java developer, and currently am looking to create a standalone java class that will let people mine Bitcoin using CPU, but I have no idea if such already exists. I have found one for LiteCoin, but that's all

Does it Exist?

No

This is because a Java app that uses the CPU to attempt to mine Bitcoin will not be able to mine Bitcoin. There is no good incentive for anyone to create such a thing.


Extracting Bitcoin historical ticker data by setting up Bitcoin Node? How do I extract the ticker data (historical values such as day price, day open, day close etc) by setting up a Bitcoin Node?
Bitcoin Node is setup using Bitcore.io

All blocks are syncing right now, but I don't really know how to get data?

Stack I use is Node.js with MongoDB

Thanks in advance!

The Bitcoin Node is part of the blockchain network. It has nothing to do with markets and trading, and has no concept of a price. As far as the node is concerned, 1 Bitcoin = 1 Bitcoin, and that's it.

If you want historical market prices, you will have to either scrape them from various exchanges yourself, or use a service such as this (I have no affiliation with them, and just found them through Google - I cannot vouch for their data, and better options may exist).


What research papers cover Bitcoin's impact on Central Banks, "velocity of money", and reserves? I'm looking for research papers that cover the impact Bitcoin may have on Central Banking, interest rates, velocity of money, and their reserve.

What research papers or information from thought leaders exists w.r.t Bitcoin's impact on economic matters?

I don't have a list or a wiki listing all the relevant documents, but the European Central Bank produced this document which covers several types of money schemes including Bitcoin.

Perhaps some lessons learned, and advice from this document can encourage adoption of Bitcoin.


Here is bash script that auto transfers from hot to cold wallet upon threshhold met. Do you see issues? The idea is to run this via cron job at some interval and have the excess of funds transfered to cold wallet address.
So, I thought it will be easier to open source it so I can give it to the community and have it reviewed at the same time by more eyes.
It hasn't been tested yet. So, any issues you see?

#!/usr/bin/bash
BITCOINCLI="/set/path/to/bitcoin-cli"
MINIMUM_TO_KEEP=0.1
RECEIVERS_ADDRESS=xxxyyyyzzzbitcoinaddress

echo bitcoin-cli executable is: $BITCOINCLI

tempOutput=$(mktemp)
tempOutputErr=$(mktemp)
#echo "$tempOutput"
#echo "$tempOutputErr"
"$BITCOINCLI" getbalance > "$tempOutput" 2> "$tempOutputErr"

#echo "output file:"
#cat "$tempOutput"
#echo "Error file:"
#cat "$tempOutputErr"

outputsize=$(wc -c "$tempOutput" | cut -f 1 -d ' ')
if [ $outputsize -ge 1 ]; then
balance=$(cat ${tempOutput})
else
balance=XYZ
echo "Error: Could not connect to server. Or some other error while tring to find balance. "
rm "$tempOutput" "$tempOutputErr"
exit
fi

echo Balance is "$balance"

sendamount=$(echo "            $balance  $MINIMUM_TO_KEEP  - p" | tr '\n\r' ' ' | dc   )

#echo comp = "$comp"  x
if [ "$sendamount" > 0 ]; then
    echo "Balance is greater than the amount to be kept, which is $MINIMUM_TO_KEEP"
    echo Sending "$sendamount" BTC to the address "$RECEIVERS_ADDRESS"
    "$BITCOINCLI" sendtoaddress $RECEIVERS_ADDRESS $sendamount > "$tempOutput" 2> "$tempOutputErr"
    outputsize=$(wc -c "$tempOutputErr" | cut -f 1 -d ' ')
    if [ $outputsize -ge 1 ]; then
        echo Error while executing sendtoaddress. Could not send the amount. The error is:
        cat "$tempOutputErr"
    fi
else
    echo "Balance is less than $MINIMUM_TO_KEEP"
fi

rm "$tempOutput" "$tempOutputErr"

My thoughts, in no particular order:

Consider if you need a hot wallet at all. If you don't need to send funds, just accept them, you could probably use BIP32 to generate addresses. Downside is that this way is more complicated.
You should probably bail out of your script if bitcoin-cli produces any errors at all. If your Bitcoin node can't figure out its balance, then it won't be able to send a transaction.
It seems like you detect whether bitcoin-cli failed by 1) checking if it produced output, then 2) checking to make sure that it produced no errors. Why not just use its return codes? bitcoin-cli passes on any error codes.
Your script will tell Bitcoin to send to your cold wallet if you have any amount of extra Bitcoin, even a single satoshi. So, if some miscreant sent you an extra satoshi every time your script ran, it would generate a transaction and pay a fee. You should have a higher threshold, like

THRESHOLD=$(echo "$MINIMUM_TO_KEEP 0.01 * p" | dc)

I don't think that Bash can compare non-integers.

if [ "$sendamount" > 0 ]; then

I'm not sure what this will do.

https://stackoverflow.com/questions/11237794/how-to-compare-two-decimal-numbers-in-bash-awk
Include this line before the rest of your script:

"$BITCOINCLI" getblocktemplate || exit

This will cause your script to bail out if your node is still synchronizing.
What's with this whitespace?

sendamount=$(echo "            $balance


Older Clients & Wallets I have about 5 BTC stored in Wallets created under different versions of Bitcoin, all encrypted with multiple backups.
I downloaded latest Client and it doesn't work with the wallets, I've gone back to an earlier client and it works ok.
I assume there have been changes over the past year or so.

I don't have time to figure this all out and try out which Older client works with which backup wallet so I can send my few BTCs to a Brainwallet address and dump the old wallets.

Can I assume that because they are in wallets with backups, encrypted etc that the coins are safe and I just need to go through the trouble of recovering them.
I've heard about pywallet and have tried manually dumping the private keys so I can transfer the coins but so far no luck, it's all Greek to me.

Can I assume the coins are safe (providing the wallets are not iredeemably corrupted, and that one day soon, when I have time I should be able to recover them.

Your coins should be safe.

No need for a brainwallet:

open the new client and create a new address
backup this new wallet
open your old clients and send your coins to that new address

Never delete the old wallets anyway, just in case.


What is the average time for an honest network to find a block when its hash rate is p? let p be the hash rate that belongs to honest network and T be the time a block is found. In the Bitcoin paper it's said "assuming the honest blocks took the average expected time per block...". In another paper it's said this average time is T/p.

Question: What is the average time for an honest network to find a block?

If it's T/p, why?

I think,

if p+q=1, where q is an attacker's hash rate and a block is found with the full hash rate: H, in T time. Then for an honest network, it would take, pT (not T/p).

Am I missing something?

I do not agree with the assumptions.

In the Bitcoin network, the average block time is also a function of the difficulty, approximately:

(P*d)/p = 10 minutes

Where P is the average number of hashes to obtain a new block in 10 minutes (if d=1 and p=1 at base - it wasn't - then P=600), d is the current network difficulty and, p is the current network hash rate per second.


Buying on one exchange then selling on the other I'm curious as to what is keeping the majority of the people from buying on one exchange, where the going USD/BTC rare is cheaper, and selling it on another, where the rate can be USD$50 to USD$100 higher.

There are probably people doing that already. But since opening up accounts in multiple exchanges is no feat, why isn't a much larger portion of active traders doing this?

PS: I understand the answer MAY be speculative, thus not suitable for SE. At the same time, the answer might NOT be speculative - there might be a solid reason behind it. So I'm here to learn. Please vote for closure if you see fit, but do not downvote, given that I am aware of what kind of questions should be asked here.

Well for one, it's almost impossible to get money off of Mt.Gox. (I had a wire transfer pending for 3 months and finally decided to just cancel it and take the loss.) Some bitcoin exchanges refuse to do business with the US (btc-e) and some only do business with the US (coinbase). Bank transfers are not cheep and the exchanges take a somewhat large fee for moving money onto and off of their exchange (~1% each way.)

But some people do make money like this. You will find though, if you actually do the math for all the transfers and fees and what not that you would only be making a small margin and that only sometimes.

It's absolutely doable but you need to be doing it at scale and with good and fast programs managing your assets to really make a profit at it.


Is it possible to find additional key pairs resulting in the same address that I already control? I'm not really well versed in the necessary terminology to get the answer I need from searching.
As I understand, there are 2^160 possible addresses, and 2^256 possible private keys, so each address corresponds to roughly 2^(256-160)=2^96 private keys.
Let's say I generate a key pair and the corresponding address, how would one go about finding other key pairs that correspond to the same address if you already have at least 1 set of keys that generated that address? Is it possible?
Apologies if this has been answered already, I couldn't find the answer I am looking for.

It's not possible, practically speaking.
A P2PKH Bitcoin address is computed as RIPEMD160(SHA256(publickey)). Since public keys are unique, to find another keypair that results in the same address, you're essentially trying to find a hash collision on SHA256 or RIPEMD160, which is extremely difficult.
The most "efficient" way to find such a collision would be to iterate over the entire private key space.


How to create a blockchain snapshot for a hardfork? I've done source forks (altcoins) and I understand how those work. But I'm a little stuck on how forks are activated? I need to know how blockchain snapshots are created and how the wallets know to distribute the initial fork offerings? If anyone could point me to a particular commit and/or PR of Bitcoin Cash or Gold where this logic is, I'd be very grateful.

Hard forks are simply extensions of a blockchain where the new blocks follow different consensus rules that are not compatible with the original blockchain. There is no actual snapshotting in a true hard fork. The hard fork software simply syncs up to a certain point with the original blockchain, and after that point, a new consensus rule is enforced which conflicts with the original chain and thus causes a blockchain fork. This is simply governed by an if statement in the block validation code.

The fork is simply activated by a miner who mines a block after a certain block or point in time that follows different consensus rules from the original chain.

For example, with Bitcoin Cash, their software enforced that the first block created after August 1st at 12:00 UTC must be larger than 1 MB and also follows the Bitcoin Cash consensus rules (larger block size, new signature hashing algorithm, etc.). This is encoded as an if statement in the block validation logic which checked the time of a block before executing different consensus rule checks. There is no actual snapshot that is taken; their blockchain up until that forking block is exactly identical to Bitcoin's and can be synced off a Bitcoin node.


51% attack on New coins I have experienced 51% attack after launching a new altcoin last month.

While i mined only 100 blocks using coin-cli generate 1, i noticed somebody already mined 2000 blocks within minutes attacking my network. I was running 2 nodes (without wallet) and 1 node (with wallet installed) in Ubuntu server.

Why would the attacker target new cryptocurrencies? Is he after coins?
What changes in the code i have to implement to prevent the 51% attack?

My altcoin is based on scrypt (litecoin), Block generation time is 10 minutes/hour, Coin maturity 100 blocks, with parameters almost same as bitcoin.

Why would the attacker target new cryptocurrencies?

Why not? He has the same reasons as you to create blocks

  What changes in the code i have to implement to prevent the 51% attack?

Disable decentralization. Allow mining from one pubkey/address only :)


Send raw transaction (have tx_hex) on litecoin testnet using api or module I have raw data (tx_hex) for raw transaction, but I cant send it to litecoin tesnet using post request to testnet.litecore.api. If I insert tx_hex manually in the browser, the transaction is correctly sent. My code:

request({
    url: 'https://testnet.litecore.io/tx/send',
    method: 'POST',
    data: test_tx
}, ((error, response, body) => {
    if(error) {
        console.log(error);
    } else {
        console.log(body);
    }
}));

I also tried to use another service, but it's failing too.

Code :

postdata = { tx_hex : test_tx };
request.post('https://chain.so/api/v2/send_tx/LTCTEST', postdata, function
             optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log('Upload successful!  Server responded with:', body);
});

Postdata must be String, not Object. ('tx_hex=...')


Creating multiple clients inside a single lnd node I am trying to create hot wallets using the lightning network but I don't want to create a new node for each user. Is there a way to have multiple users be able to use a single lnd node?

Yes absolutely. Many users can use / share one lightning node. You might have to create some accounting sodtware if you want every user to have their own funds. This is a classical custodial wallet solution. I am not aware of open source solutions but I build one on top of the clightning api. This solution should work in a. Very similar way for lnd.

Start by looking at the grpc api and macaroons so that you can create such a software on top of your lightning node


Is mining something specific of Bitcoin? I am very new to the world of cryptocurrencies (I first read deeply about them today) and I've just discovered the concept of mining. Everything that I've read so far applies to Bitcoin but I know that there are a lot of different cryptocurrencies. So I was wondering if mining also exists for other currencies.

Is mining something specific of bitcoin or is it possible to mine different cryptocurrencies? If so, is the process different than the one used to mine bitcoins?

Earlier cryptocurrency systems (which predated Botcoin) relied on a central clearinghouse to prevent fraudulent transactions, such as double-spending.  One of the objectives of Bitcoin was decentralization.  To prevent double-spending without a central clearninghouse, blocks of transactions need to be mined.  The process of mining requires a significant amount of computational effort to be expended by the miner.  Other nodes on the network will not recognize a mined block of transactions without this proof of work.


Missing key on blockchain I created 2 different wallets at block chain. The first one gave me an address for receiving btc. I used that address for a purchase, however, now when I login to my wallet, it no longer shows that address. Luckily, I saved it, and can search for it. It does show the btc I purchased, but requires me to enter the private key before moving them. I thought the entire address I sent for the btc included the private key. I also checked the other wallet I created, and the address I first got is not there either. These are the only 2 wallets I created and I know I received the original address from one of them. I know there are hackers out there, but that is not me. This is MY wallet, and I paid a lot of money for the btc, but clearly I screwed up somewhere. This is the address: 1593pt67xM8KRZ23Akxp2KwCj856fCfWSh

Your Bitcoin address and your private key are not the same.

The private key is a random number. You keep that number a secret, and only having it allows you to spend Bitcoins. It is used to sign transactions.

From the private key you derive a public key. It is used to show that you are using the correct private key. It is used to verify transaction signatures.

From the public key you can derive the Bitcoin address, which is a convenient way of encoding the public key. It is more compact, comes with error detection, and so forth. It is used to let people know where to send their Bitcoins to when sending you money.

From a private key you can derive the public key. From the public key - the Bitcoin address, but in neither of those cases can you do it in reverse. If you have lost your private key, your money is lost forever.

However, from what I can see your address has been successfully used for withdrawals, and its balance is currently zero. If you have gotten it from blockchain.info eWallet, you probably should contact the owner of the site with your issues. In Bitcoin world, it is very hard to prove that you own an address without having a private key.


What strategies can an e-wallet use in order to reduce transaction fees? I noticed that most Bitcoin exchanges (MtGox, TradeHill, ExchangeBitcoins, etc.) do not charge any fees for withdrawing bitcoins. What kind of strategies can they use in order to reduce these costs?

First, transfer out older coins, gathering as few inputs as possible. The client does this automatically, and exchanges will typically have a vast supply of old outputs they can claim.

Second, combine transactions (using 'sendmany'), sending funds to more than one destination at a time. If you have a single, large, old transaction output you can claim, use it to make payments to three or four destinations at once. This will keep your transaction just inside the free relay limit.

Third, configure your client appropriately. Set it to never pay a transaction fee. Set it to specifically connect to other clients known to relay transactions with no fees and known to be linked to miners who are willing to include transactions with no fees. And trade off anonymity for convenience and speed by modifying your client to send new, local transactions to all connected clients immediately.

Note that not all of these strategies will always be appropriate. For example, if fast transactions are important to your customers, it may be worth paying the occasional transaction fee even if you have to eat the cost.


Why is the signature hash different for each input in a multi-input transaction? In pre-BIP143 signature hashes, I know that the signature hash differs because you have to substitute the previous scriptPubKey for each input and thus the serialization changes.

The question is why? If the HASH_TYPE is SIGHASH_ALL, why does the signature hash need to change for each input? Why not sign the same "blanked" transaction or the same transaction with the scriptPubKeys?

Varying the signature per input helps prevents some attacks during multi-party transaction construction.

Consider a coinjoin involving Alice and Bob.  Alice selects one of her UTXOs for the coinjoin.  Bob chooses a UTXO for his input, but he actually selects ones of Alice's other UTXOs that reuse the same address as the one she selected.  Alice does not notice that Bob selected one of her UTXOs and continues with the coinjoin protocol, signing her input.  Now Bob copies her signature, which would be valid for the UTXO of Alice's that he selected if SIGHASH_ALL were constant for all inputs.  Now Bob has procured Alice's funds for himself.

Technically this can be prevented if Alice checks all other inputs to the coinjoin to make sure that they are not controlled by herself, but that is a huge pain, error prone, surprising, and likely means a secure signing module needs to be aware of all UTXOs that use the same public key.


How would Bitcoins crypto change? Let's say, that 20 years ahead, Bitcoins crypto is not considered secure anymore. More precisely the key length is to short for it to be safe. Be it the HASH or private/public key. What would our options be?
Could we simply increase the keylength for the wallets and make it mandatory? Would that be a hard fork?
Or could we just use a soft fork and advise users to switch to a new more secure wallet?

This would be a hard fork, and a difficult one to develop at that.


Is it more profitable to mine non-SegWit blocks The fees for a SegWit address are lower than non-Segwit ones. Is there less fees per block with Segwit blocks? Is it less profitable to mine Segwit blocks?

A "segwit" block does not exclusively contain segwit transactions; it can contain both segwit and non-segwit. "Non-segwit" blocks contain exclusively non-segwit transactions because it does not have the requisite segwit commitments. Since segwit blocks can contain both types of transactions, it is actually less profitable to mine non-segwit blocks as you will be missing transactions that segwit blocks can contain.


Are pools share rewards equivalent to the power/hash rate input of a mining machine I would like to know if I enter a pool and I input a given amount of Hash rate, is my share reward equivalent to my Hash rate input

Yes, it is. This is done by the pool having a much lower difficulty than the network does. If your block meets the pool's difficulty, you earn a share (but the block isn't really used); if it also meets the network's difficulty, then it is released to the network. Finding shares is random, and the payout scheme can mean that you earn more or less coins for a share, but over a little time it averages out so that you are paid proportionally to the hash rate that you bring.

As a simple example, a pool that uses a proportional split scheme would split the mining reward to the miners in the pool based on how many shares they earned in the course of mining that block. (This scheme is not good, because it allows pool hoppers to earn more at the expense of other miners, so other schemes like PPLNS are more common; but that's more complicated so I'll leave out the details.)


Dynamic Transaction Hash Confirmation I am working on a donation based community website (using PHP) where participants register for an account to participate. Each account carries the participant's bitcoin address. A participant makes a commitment to donate say $10 and is paired with another participant (recipient). The donor confirms payment by pasting his/her Transaction hash id on his dashboard to confirm payments. I currently use Blockchain.info API to read the transaction details and check the inputs and outputs of the transaction to ensure that they contain both donor and recipient BTC addresses and the expected amount.
My problem is that most wallet providers generate new BTC address after each transaction making it difficult for my code to confirm transaction as the address will not match if new ones are generated.

How do I confirm transactions for dynamic BTC addresses using PHP OR how would you handle this use case?

Thanks

Submitting transaction ID is not a safe way to verify payments. As you know bitcoin transactions are public and anyone can get see all TXIds. Same reason why even the donor bitcoin address is not a good method to verify. Someone else can see that address on blockexplorer and claim himself to be donor.

I can suggest few options:

Ask the donor to sign a message proving ownership of the source address in TX. Most wallet have this functionality
Ask the participant to submit his xpub (extended public key) instead of address. When donor wants to donate, generate a unique address from this xpub for each attempt. This way you are sure, this donor paid to that address