Shares accepted vs hash rates? I recently started mining LTCs, and because Im using a Nvidia card (GTX 650Ti) I have been trying out different settings in order to maximize efficiency with the hash rates.

I have noticed though that different settings result in different shares accepted. For example I can have the card running stable with a 90KHps but only one share accepted every few minutes.

Using different settings I get 50KHps but several shares a minute.

Which results in greater LTCs mined in the same period of times? The greater shares or the higher hash rates?

Im using CudaMiner with the following cmd:

cudaminer.exe -l K8x16 -C 2 -m 1 -i 0 -o stratum+tcp://coinotron.com:3334 -O workername.1:x

Any feedback would be much appreciated!

The pool might be adjusting your share difficulty level. For example, you might be mining at 50 KH/s and the pool is setting your share difficulty at 16. If you then increase your hashrate to 100 KH/s and the pool changes your share difficulty to 64, then you will submit shares half as fast, but receive four times as much credit for a share at difficulty 64 as a share at difficulty 16. Ultimately, you get paid twice as much mining at 100 KH/s as at KH/s, so don't worry about it.


Transaction with expiration time Is it possible to give an expiration time to a Bitcoin transaction so that after a definite time, it can no longer be mined?

No, bitcoin transactions that stop being valid after a certain point in time are not possible


If Bitcoin transactions require ~10 min to clear, how can payments get recognized within seconds? Bitcoin Monitor offers to issue a notification moments after a payment is sent to a Bitcoin address. Yet if Bitcoin transactions require ~10 min to get written into the blockchain and confirmed as official, how can payments get recognized within moments?

On the other hand, Bitcoin.network requires payment via Bitcoin before making the blockchain available for downloading. It publishes a download URL seconds after a payment is made. How can the site be sure the payment is legitimate. How does it know the payment has been made only a few seconds after payment is sent?

When you create a transaction, your Bitcoin wallet broadcasts it to a few full nodes on the Bitcoin peer-to-peer network.  Those full nodes quickly relay it to other full nodes, and it eventually ends up at the full nodes run by the sites you linked to.  That's how those sites know the transaction exists.

The full nodes also relay the transaction to Bitcoin miners.  Each miner may choose to include your transaction in a block of transactions.  (Miners usually choose to include the transactions that pay the highest transaction fees per kilobyte of transaction data.)

Miners have to solve a sort-of random puzzle---whichever miner solves it first can include proof they solved the puzzle in their block of transactions and send that block to full nodes.  Those full nodes relay the block to other full nodes and eventually the block ends up at the full nodes run by the sites you linked to (and to the wallet of the person you paid).

The puzzles are very hard to solve, so a block with proof of a solved puzzle is hard to fake.  This means any transactions in that block are considered hard to undo.  Also, the next block has to point to the previous block, so it would then require solving two very hard puzzles to undo the transactions in the block containing your transactions.  And it keeps getting harder and harder each time a new block is created.

As you may have guessed, it takes an average of about 10 minutes of puzzle-solving by all miners before any particular miner solves a puzzle, so it takes about 10 minutes on average for a transaction to be protected.  Up until that point, you could create a duplicate transaction that steals back the money you spent---so nobody trusts high-value transactions until they appear in at least one block (and more blocks are better).

P.S. Newbie questions are always welcome!


getblocktemplate request that omits transactions? Is there a way to make a getblocktemplate request that returns only the bits/target, or at least omits all of the pending transactions?

I am interested in tracking the coin difficulty in real time. This requires a call to getblocktemplate and looking at the bits or the target. I make the call from a remote machine. This call can become very inefficient if there are a significant number of transactions in the blocktemplate, especially if I make the request every few seconds and there are megabytes of pending transactions.

getmininginfo or getdifficulty are useless as they return the difficulty of the most recently mined block, not the block that is currently being mined.

getmininginfo or getdifficulty are useless as they return the difficulty of the most recently mined block, not the block that is currently being mined.

The network difficulty is adjusted every 2016 blocks (~2 weeks), so to accomplish your goal (track the network difficulty) there is no need to continuously return the difficulty of every new block. It will only change once every 2016 blocks, so getmininginfo should do the trick.


Is the timestamp in the genesis block relevant? Bitcoin's genesis block contains this text published in The Times on January 3rd, 2009:

The Times 03/Jan/2009 Chancellor on brink of second bailout for banks

According to the Bitcoin Wiki, this guarantees that the block was only created after this date.

What would be the problem of using any other random quote?

The newspaper quote proves that Satoshi did not mine a large number of blocks before the public announcement of Bitcoin on January 10. The block chain creator could for example create a chain of 1000 blocks before publishing just the first one. He now has a head start for mining and can invalidate the public block chain at any time by announcing the blocks he kept secret as long as his chain is longer. The block headers contain timestamps but these can be manipulated if no one else is verifying the blocks.


Is there a simple python script for xpub generation from private key I need a python script to verify, in an air gapped system, that my 24-word (or 12-word) mnemonic seed indeed generates the xpub that my wallet is showing me.
Is there a simple script that does that, having minimal dependencies?

Yes, I'd say the simplest way is to use python bip39 implementation of trezor, this one file should be enough with methods:
to_seed - to convert list of the words into seed and
to_hd_master_key - to generate master xpub/xpriv
It doesn't support further derivations (which require a bit more dependencies), for which I'd suggest using bip32 library.


Is there a bitcoin explorer that can visualize where the coins are flowing from one address into another? I remember playing with a bitcoin explorer tool awhile back where one can input a bitcoin address and see all the coins flowing into it in a tree like structure. I want to be able to investigate where the coins are flowing from and to. What is this tool?

Every transaction on blockchain.com has a clickable "View Tree Chart" link, eg:
3414e5f55d89959978575713446072b0d4b3e86b75be5e894b8614c6526d1218 -- this shows bitcoin addresses and even IP address that first broadcast the tx (if known).


Unlocking a Private Key from watch status I received Some mining profits to my Blockchain. However the person who sent them to me send them to me with a private key. They then wanted me to send them money to unlock the private key. Does anyone know of a way that I can get that private key unlocked so I can recoup my profits from them without paying them to do so?

First, confirm that you did indeed receive a private key.  On Bitcoin mainnet, private keys are almost always distributed in a format that starts with either a K or an L (capitalized in either case) and are usually 52 alphanumeric characters long.  Here's an example:

L3SD2fM9hzVJyr4zxoHqXHDqHTVfQpbLuWDVm6b6W7PTCSYpkujd

If you instead received a code starting with a 1, a 3, or bc1, then what you received was an address.  If you received a hexadecimal code that was 130 characters long and started with 04 or 66 characters long and starting with 02 or 03, then what you received was a public key.  None of those are private keys, and there's no way to get the private key from an address or a public key.  Here are some examples of addresses and public keys:

1GWLEdJRaMTQSe7NkPAfBCZaR1XdTz4dct
3DXNLK83EiMsseHTfGySGvDL64CKpRTf6G
bc1q4gtqryu6dhs4vzwqwp9fjxegc4rmxcx6shn3qs
03d8f40442a837693820c4ca35bff30036af4df79c5563375200313462086b6d31

If you have any other type of information, that's probably also not a private key and it may have nothing specific to do with Bitcoin.

If you do indeed have a private key, you can import it into most Bitcoin wallets.  See the documentation for your specific wallet for instructions (if you can't find the documentation for importing private keys, feel free to ask a separate question).

You don't need any special information to "unlock a private key".  In addition, the normal way to receive mining profits is by a normal Bitcoin payment to one of your addresses; I've never before heard of any mining pool paying profits by distributing private keys as that has all the same costs plus a large additional security risk.  It seems likely to me that the person you're communicating with is attempting to steal money from you, so be careful in your dealings with them.


Running two bitcoind instances for different nets Is it possible to run two separate bitcoind instances on one system at the same time, one for mainnet, other for testnet?

Yes, you can. Just be sure to specify different data directories and configure them to use different ports.


Am I scamed? FA exchange trading company is fraud? They are requesting taxes Are those thieves? https://www.faexchange.com/
I have created a balance of BTC with them and they now request to pay taxes in order to be able to withdraw my profit so I am worried about and wonder why they do no keep the taxes from my earnings?

Additionally to report that they do not allow any withdrawal until they receive the taxes however I have found out that they are included at "bad list" https://badbitcoin.org/thebadlist/index.htm
I do not have a bitcoin wallet; but FA exchange never advised me to open one.
Should I create one and request from them to transfer the bitcoins there? What about the taxes in this case, should be deducted?

Any kind of advice on how to continue further on to cash/ redeem my Bitcoin would be usable.

It is certainly not 'normal' for an exchange to demand 'taxes' in order to withdraw. If you have a positive balance on your account, and they are requesting that you send additional, new money to them, then I would say without a doubt this is a scam. Think about it: why would they not just deduct any 'taxes' as a fee from your total balance when you withdraw?

My advice would be to not send them any more money ($$, BTC, etc). I am sorry to say, but you may have to cut your losses, and just move on. If the amount lost was substantial you could try reporting the scam/theft to your local law enforcement, but there may be little they can do to help.

You can try making a wallet of your own to withdraw the BTC balance to, but I would guess they will not allow this withdrawal either.

As an individual, you may be liable to pay taxes on your cryptocurrency trading, but this liability would be to your local tax authority.

Sorry for your losses :(


Restore from 24 words seed I have used bitcoinj for createting wallet. I made some changes and try to generate 24 words seed instead of 12 words seed.

When I try to restore from 24 words seed, at that time I am using 3 method as mentioned in bitcoinj documentation.

Fast catchup.
Checkpointing.
Bloom filtering.

According to documentation, by using these methods you can easily decrease restore time.

But it takes maximum 20 to 25 minutes to complete restore.

Please help me who knows this process.

bitcoinj uses a date of birth of the wallet. With this you avoid reading the entire blockchain to restore the wallet


How to get an address's balance with the bitcoin client? I want to see the balance of some address using bitcoind.

I set txindex=1 and did a -reindex to get all transactions indexed.

But still, there doesn't seem to be a way to get balances of an address. getreceivedbyaddress doesn't work with addresses out of your own wallet (I hoped it would after a -txindex=1 -reindex, but it didn't).

I'm wondering why blockexplorer.com's getreceivedbyaddress can do this for any address but the default client cannot. If you download and sync the whole blockchain, you should be able to query it for any information, right?

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

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

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

The -txindex option you mention, adds one more thing that is maintained by the validation engine:

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

This was added to make the getrawtransaction command work with historical transactions, but again, this has nothing to do with addresses. A database that indexes the UTXO set by address, or even the entire block chain history by address would be possible, but it would be relatively expensive to maintain, and shouldn't be necessary for normal operations (though it is quite useful for debugging...).

Where such things do belong, is in the wallet. The wallet as presented by the reference client does not use "balance of an address" - it rather sees addresses as entry points into the wallet, but manages the coins in the entire wallet together, regardless of what address they were last sent to. This also confuses people who are used to look at blockexplorer-like websites, when they realize that for example change is always sent to a fresh address.

So, to give a real answer: if you really want to track a balance, you need the wallet interface. Right now, this is quite unflexible, but there are plans to improve this situation soon. We'll hopefully soon get support for multiple wallets, and watch-only wallets, where you can just add addresses you'd like to track, without having their keys.


Should I increase my mempool size to accomodate temporary crisis? I am seeing 68k unconfirmed transactions on blockchain.info. My own bitcoind (v0.13.0) node has 49k transactions in its mempool with memory usage currently at 230mb. Knowing that the memory cap is currently at 300mb, I fear that very soon my node will not be able to keep all unconfirmed transactions. Should I increase this cap as a temporary measure until things get better? if so, how do I do that?

You can increase the mempool size, if you have an interest in seeing transactions that likely won't confirm for a very long time, but you certainly don't have to. The mempool is sorted by feerate, and when the limiter kicks in, it removes the lowest feerate transactions. Since miners sort by feerate, and can include only a limited number of transactions per block, the mempool effectively works as a queue.

By design, you will not always be able to store all unconfirmed transactions. If your goal would be to have all, and crank up your memory pool to accomodate this, someone could just start creating an infinite stream of transactions sending back and forth, until your node goes out of memory. This is the reason why the mempool size is limited in the first place: protection against a denial of service on the network.


Would it be possible to dictate a bech32 address as a list of English words? One of the reason for bech32 address is: "it'easier to dictate it over the phone".

Is there an algorithm to convert a bech32 address into a list of English words that would make it even easier?

Something like BIP39 but inverted (address to words instead of words to seed).

The dictionary used in BIP39 would be enough?
How many words would be necessary at best to express an address?

Probably it is better to dictate the address than 50 words but what about 25 or so?.

The NATO phonetic alphabet is designed for this purpose and is very widely recognized by a number of people in communication critical industries. The words are clearly recognizable even to the unfamiliar and is intended to not be able to be mistaken. Due to bech32 encoding there’s no need for communication of capital letters as you would need for p2pkh addresses.

bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq

becomes

  Bravo Charlie One Quebec Alpha Romeo Zero Sierra Romeo Romeo Romeo Seven X-ray Foxtrot Kilo Victor Yankee Five Lima Six Four Three Lima Yankee Delta November Whiskey Nine Romeo Echo Five Nine Golf Tango Zulu Zulu Whiskey Foxtrot Five Mike Delta Quebec


How chaining the blocks protect against altering data? I am confused with the block chaining, as i know a block header contains a reference to the previous block header hash with the merkle root and other fields. This header hash is related (computed) to the header and not including the block of transactions, so if the header is tampered the chain will fail. I understood that, but if the transactions in the block are edited, it will not change the header hash only if the merkle root is re-calculated.

My question is when a node receive a block, how it verifies it (just rehashing the header, or recalculating merkle root first then rehashing the header)?

Merkle root is a part of the block header and is calculated based on the transactions included in the block. If transactions in the block are changed, it would change the merkle root in the header. If the merkle root is changed, the block header will change and the header hash which was calculated initially will no longer be valid.

  When a node receive a block, how it verifies it (just rehashing the header, or recalculating merkle root first then rehashing the header)?

When a full node receives a block it performs various checks to ensure the block conforms to the consensus rules. This includes checking that all the transactions in the block are valid. If any particular transaction is not valid, then the entire block will be rejected by the full node. After verification of the transactions, the full node would verify the merkle hash. Then full node will look at the block header and verify the timestamp rule, previous block hash, and other components and then calculate the block header hash and check if it is less than the target. If one of the verification rules fail, the node will reject the block. You can find a complete list of block verification rules here.


Bitcoin (and other coin) mining seems very inefficient No, this is not a post about the Proof of Work algorithm being a huge waste of electricity, although of course it is.

My point here is that it seems like it's just inefficient in terms of how coins are mined.  Each Pool or Solo miner has the same block, and they each work diligently to find a golden hash.. but they're duplicating each others work.  I'm sure the hashing is somewhat randomized, otherwise the fastest pool/miner would always win if it were a sequential brute force.

Still, even if every pool/miner works from a different, random set of nonces, there must be a lot of duplication of effort.

Consider a mechanism where blocks of nonces are doled out to pools and miners (like a super-pool).  These are like "claims" in the mining sense, in that a pool can "stake out" a "claim" (block of nonces) to work on, so that other miners aren't duplicating the work, and the mining is more efficient and coordinated.

My understanding is that this is how it was originally done via getwork command, and that in 2012 they moved to the getblocktemplate method that was supposed to make things less centralized.  So, I understand that having a single centralized authority to hand out work would be problematic.

So how about a system where each pools/miners broadcasts the work they are currently doing, so that other miners know not to start working on those blocks?  If all stakes have been broadcast, and no block yet found, you would fall back to the current system.

Of course workers would be free to ignore these "claims" because they're really just hints.  Nothing would require them to either listen or send updates.  However, utilizing them could be advantageous to all cooperating miners.  There's nothing inherently "wrong" with jumping another miners "claim" in this sense.

Sure, there are potential problems with this approach.  A bad actor could just randomly broadcast "claims" and cause disruption, but the worst case scenario would be to fall back to the current system.  At worst, it would be no worse than we currently do it, at best it could greatly improve the efficiency of finding a valid hash.

Another possibility is that some pools/miners will listen to these broadcasts, but not broadcast their own work.  This could, in theory, give them an advantage while causing others to do double-work... But this is disincentivized by the fact that miners would overall be better off by cooperating.. enough people cheating the system and you are, essentially, back to the current system.

Just a thought...

So how about a system where each pools/miners broadcasts the work they are currently doing, so that other miners know not to start working on those blocks?

There is no need for that; there is never any duplicated work. Since every block has at least the pool's/miner's payout address, which is:

hashed into the coinbase txid,
hashed through the Merkle tree,
hashed into the Merkle root,
hashed into the block header

all pools are always searching non-overlapping sets of block candidates already.


Pruning the branches in Merkle Tree In Merkle tree, leaves are actual transactions and internal nodes are hash of their childrens. In the Bitcoin paper, Satoshi talks about pruning branches in the Merkle tree to save storage space.

Under what conditions can be the branches pruned? I understand that the Merkle root is used in finding POF for the block. Are there any situations where all nodes in the Merkle tree are pruned except the root?

Sure:

A leaf (transaction) can be pruned when all of its outputs have been spent.
A node can be pruned when both of its children have been pruned.

However, Bitcoin Core doesn't implement this kind of pruning. It was built on the assumption that you download and validate all blocks. Because of this, it operates in one of two modes:

No pruning (the default)
Don't keep old blocks or old merkle trees at all, and only track unspent outputs and their scriptPubKeys. This mode doesn't allow you to help new nodes synchronize.


Negative Dogecoin Balances? Through dogecoin-cli, I sent half the dogecoins I own to an external address. Now, when I call the listaccounts function, I get this:

[root@web ~]# ./dogecoin-cli listaccounts
{
    "" : -25001.00000000,
    "doge" : 48136.85072100
}

Notice how the "" has -25001.00000000. I am using a query from php to get the balance of "doge" and display it to users. That returns 48136.85072100, which is a problem, because I only have 23135.85072100 doge. How can I fix this problem? Thanks!

Problem

  rricci2009 commented:

  After few transaction by sendtoaddress command, balance in "" became negative. I solved with the "move" command from another account to "". [...]

Cause

  sipa commented:

  That is expected behavior, if your incoming transactions credit accounts other than "", but outgoing transactions debit account "" (the default if you're not using sendfrom), the "" account will go negative. [...]

Mitigation

  Tectract commented:

  [...] So, is there a way to do something like a sendtoaddress command that won't leave me with odd negative balances?

  gavinandresen commented:

  Use the sendfrom RPC command.

  And you can use the move RPC command to reset account balances to what you expect (and listaccounts to see all accounts / balances)

Source.


How do APIs like Blockchain.info and BlockExplorer work? When I query an address using either service, are they simply querying the latest block that has been mined?

Or do those services have nodes in the network that collect data that has not yet been codified in a block?

Sometimes, my queries return the "correct" information nearly instantly, but sometimes it takes a long time for the most recent transactions to be reflected- wondering why that's the case. Seems strange that I could send btc, have a query on the receive address return the up-to-date balance within 3 seconds, and then immediately make another transaction and make a successful query, whereas at other times the API query won't reflect the latest transaction for a long time. Insights appreciated.

Public Bitcoin inspection services like BlockExplorer and BlockChain.info work almost exactly like the regular Bitcoin client.

They operate as a node in the Bitcoin network and so, like all other nodes, store the complete block chain. This block chain consists of all transactions ever made and are used to calculate the balance of an address.

Just like other nodes, they as well receive transactions from other nodes and will likely also show them before they are confirmed (of course explicitly indicating they aren't). The time it takes for a transaction to reach all nodes varies. Not all nodes know about all other nodes so it can take a few seconds for a transaction to get noticed by all nodes.

Depending on whether or not the service caches information, some time can be between the arrival of the transaction of the node and the time it shows up on the website. You will probably understand that when you query 10 times shortly after each other for the same data, it is very costly to do the same lookup in the block chain index multiple times. Because of this, I think it's likely that most of these clients do some sort of caching, but not too extensive. Probably a minute maximum, because they know that in Bitcoin transaction processing, much can happen in that time.

Besides that, the loading time can also depend on the load of the server. When multiple users try to access the balance for their address at the same time, some of them will likely have to wait.


Double Counting SigOps to Prevent CPU Exhaustion Attacks In the bitcoin v0.9.3 source: https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/main.cpp

ConnectBlock() calls CheckBlock() as one of the first things it does. https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/main.cpp#L1756. And CheckBlock() does a count of the signature operations that doesn't include counting P2SH sig ops in the inputs.

But then ConnectBlock() goes on to do it's own nSigOps count, this time including the P2SH sig ops (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/main.cpp#L1810).

Why doesn't CheckBlock() just include the P2SH sig op count to avoid code duplication between the two methods? Is it for efficiency? Or maybe backwards compatibility?

Thanks!

There's something unintuitive about Bitcoin transaction SigOp counting. Normally, the signature count of a block is calculated by looking at the scriptPubKey of each transaction and counting how many OP_CHECKSIG operations it contains. In other words, the SigOp count is gotten by looking at how many outputs you create, not how many inputs you redeem.

However, you obviously can't see how many operations a P2SH script does by looking at its hash. Instead, the transaction that spends the P2SH script "pays" for it.

The somewhat awkward thing is that you can't tell if a scriptSig is spending a P2SH output unless you look up the outpoint it's spending.

  Why doesn't CheckBlock() just include the P2SH sig op count to avoid code duplication between the two methods?

I don't think it's for backwards compatibility. While ConnectBlock doesn't count P2SH SigOps for transactions that appear to be P2SH but aren't, that logic could be implemented in CheckBlock instead.

I don't think it's for efficiency. Rejecting blocks with too many SigOps isn't very common, since it takes about seven thousand dollars of electricity to make a block. I suspect that you could remove the SigOp check from CheckBlock for a very minor performance increase.

I think it's partially because it would be irritating to change. Getting the P2SH SigOp count requires access to the CCoinViewCache object, which isn't passed to CheckBlock.


Miner's pool and Mempool relationship I am wondering why we need Mempool (central and aggregated pool) while each miner has its own pool?
If we need the Mempool as an architectural design, how we can make sure that miners are sending their transactions to Mempool?
Is that possible for a miner to confirm a transaction on its own(Privately) but not send it to the Mempool(Shared-Public Pool?
Please correct me if my understanding from Miner pool as a private and the Mempool as a public area is not correct.
Thank you

The mempool is not a central or shared pool, every node has its own separate mempool (though a node does not have to keep a mempool, it will still function fine without one).

Addendum
Solo miners do not now share mempools and never have.  A solo miner can mine without any specific communication or coordination with other miners. Obviously nowadays a solo miner needs an enormous amount of hashpower to have any prospect of profit.
There is nothing in the original and current core network protocols for Bitcoin that explicitly coordinates, synchronises or shares mempools. It is likely, particularly when the network is less busy that all nodes have mostly the same set of transactions in their mempool. This is simply because the time for data to diffuse across the network is typically much less than the block interval.
Nowadays, because of the huge increase in mining and the consequent huge increase in mining target difficulty (to keep block interval roughly constant) - Mining has become very expensive and so most miners pool resources rather than mine separately.
Miners who are members of mining pools exchange information using one of several completely separate network protocols (e.g. Stratum) that are different and separate from the core network protocols of Bitcoin. I don't know these mining pool protocols or whether block templates are centrally chosen or selected in some egalitarian distributed method but, in principle, I don't see it is essential for them to share or synchronise mempools either.


Convert bech32 Bitcoin address to legacy I know that similar tools exist for BCH (e.g. https://cashaddr.bitcoincash.org/). Is there a way to convert a native segwit bech32 Bitcoin address to a legacy format?

As Anonymous says, you simply cannot.

I'll try to highlight the important part of MCCCS's answer:

In Bitcoin Cash, cashaddr ("bitcoincash:...", similar to, but not quite bech32) and legacy addresses ("1..." and "3...", base58) are two different ways of representing the same onchain output in a human-readable way. One can be converted into the other because the resulting transaction will be identical, and the recipient can't tell which address you used.
In Bitcoin, native segwit addresses ("bc1...", bech32) and legacy addresses ("1..." and "3...", base58) are addresses for distinct on-chain outputs. The first are used for BIP141 segwit outputs, while the second are not. The fact that one can be technically converted into the other is irrelevant. If the recipient gave you a native segwit address, it means he expects a transaction that pays to such an output, and he might not recognize a transaction that does anything else. In certain cases, he may be literally unable to access coins sent elsewhere (e.g. because he uses an HSM that can only sign certain transactions).

Short answer: if you're given a native segwit address, and are unable to send to that, there is only one course of action: ask the recipient for legacy address instead.


My Bitcoin Core Sent Bitcoins Without My Authorisation I am running Bitcoin Core version v0.19.0.1 (64-bit) on Windows 7, and on 27 February I noticed that it sent 0.0045 bitcoins on its own.

The wallet is encrypted at all times and I enter the passphrase to send as required.

I did NOT initiate the Send.

I am greatly concerned. The PC is regularly checked for virus and malware.

The transaction details are:-

Status: 320 confirmations
Date: 27/02/2020 16:37
To: bc1qz944eascuflps4nmsc0w5cpz9p3cxdyqjmmqw7
Debit: -0.00447194 BTC
Transaction fee: -0.00002806 BTC
Net amount: -0.00450000 BTC
Transaction ID: 3c138afea7d634ce5e8b608e1a751122d6d33ba9bd8e00a02de02cb57aad039d
Transaction total size: 214 bytes
Transaction virtual size: 133 bytes
Output index: 0

The previous transaction:-

Status: 455 confirmations
Date: 26/02/2020 18:27
From: unknown
To: 3Hb61TTkbxPTUCA6EvUStb8PPMZUjPASfd (own address, label: coinfloor)
Credit: x.xxxxxxxx BTC
Net amount: +x.xxxxxxxx BTC
Transaction ID: 5697d9b298647c216a727f95dbdecfc658a9f8da3c45f98bc8c8a2439c8f1cfc
Transaction total size: 404 bytes
Transaction virtual size: 214 bytes
Output index: 1

The last time I sent was with this:-

Status: 43126 confirmations
Date: 17/05/2019 07:25
To: Coinfloor 5 10 13vk63282b4FkhyyV9mmgQTxpao9ECnnmB
Debit: -x.xxxxxxxx BTC
Transaction fee: -x.xxxxxxxx BTC
Net amount: -x.xxxxxxxx BTC
Transaction ID: d23b6c3f42339ace670d0ebdca4eabcfe45c34b0ccab44c9767a519682e415ba
Transaction total size: 932 bytes
Transaction virtual size: 530 bytes
Output index: 1

I would like to know how this could have happened, because I definitely did NOT initiate this send.

Any suggestions about how to diagnose this? I expect there's no way to recover the 0.0045 coins.

You do not explain why you believe your bitcoin core process sent the bitcoins. It is perfectly possible (from looking at your logs) that it was not sent from your bitcoin core, but from elsewhere on the bitcoin network. It may be possible to track down where the tx was sent from if enough nodes log the IP address of where the transaction was initiated, but there is nothing in your logs to suggest it was initiated from your node. In fact, your logs suggest that it was not initiated from your node.

Therefore, at some point the private keys for your bitcoin address were obtained. This could have been done if your computer contains malware, perhaps a key-logger, which was able to capture your wallet password, in combination with the wallet file.

The output that was spent was populated on 2018-12-28 19:12, but the private key associated with the address could have been created years earlier, as Bitcoin Core by default creates 100 addresses when it is first started, so the private key to this address could have been stored on a computer of yours for some time, perhaps even in an wallet with no password, if you initially didn't enable the password until later. So the time of intercept (of the private key) is theoretically any time between when you first ran Bitcoin Core and when the theft occurred.


Bitcoin and Merkle Tree - is in Bitcoin the Merkle Tree actually a List (which of course is a special form of a tree)? When I get it right, each block in Bitcoins block chain contains a prev hash and a new block hash that includes this prev hash. So the genesis block only has itself and from there on each hash of the prev block is hashed again together with some transactions etc.
So the Merkle tree is in this case a List?

@Edit:
Found out that the Merkle Tree seems not to work globally, it seems to hash all transactions included in a block separately and use them as leaves and then build a binary tree upon them. Where each hash is created over the hash of their children.

So it seems it isn't a special kind of tree and instead a simple binary tree.

Is this all or did I miss something important?

The edit is completely correct. However, there are two known quirks you might be interested:

This quirk happens if the number of transaction is not 2^n. You can read more about it here. This was known by the creator of Bitcoin.
This attack (may) happen in the case where a transaction with length 64 bytes is an element of a Merkle tree. Details can be found here.


Sent bitcoin with no fee, waited and bitcoins disappeared I sent about $425 to an adress from my bitcoin-qt wallet and forgot to include a fee. So I googled and googled and waited around for 4 or 5 days for it to stop broadcasting but I get on my computer today to check my transaction on blockchain and its not found anymore. My bitcoin wallet is empty and on the transaction log its status is still "0/unconfirmed". What do I do to get my coins back?!

Export the private key of the address with the stuck transaction, import the PK into something like Electrum, and transfer the entire balance to another of your addresses.


Who mined the infamous block 364422? Block 364422 contains a transaction that takes a long time to verify. This transaction design demonstrates a way a denial of service attack could be executed. This prompted Gavin Andresen to propose additional limits to the protocol.

Gavin talks about this issue in this video.

Is it known who mined this particular block? What was their intention? Did they collude with the person who generated the transaction?

Disclaimer: I proposed a partial solution myself to this problem (BIP 143, see below).

  Did the miner collude with the creator of the transaction?

Yes, because they are the same person.

It's a transaction that consumes a ton of dust outputs, and converts them to fees, which the miner claimed.

I doubt that the intention was to cause problems; it may just have been an attempt to clean up a lot of dust at once.

However, it did make it more obvious that the theoretical problem of quadratic hashing time for verification of blocks was real. The cause is that every signature requires computing a different hash, and that that hash is computed using the entirety of the transaction as input. Thus, if the number of signature checks in a transaction grows, both the number of hashes to compute as the amount of data each of them needs to hash increases.

Several solutions have been proposed:

Limiting the maximum size of transactions.
Limiting the total amount of data hashed by a transaction.
Changing the way hashes are computed.

1 (and to a lesser extent 2) would harm potentially useful large transactions in the future, depending on what the limits are. In particular, scaling solutions that rely on collapsing multiple payments into a single transaction may get hurt.

Deploying 3 for existing transaction outputs would require a hard fork, and a change to every piece of wallet software. Additionally, it would invalidate any pre-signed but unbroadcast transaction.

However, 3 can be deployed for a new type of transaction output. BIP 143 describes a new signature hashing mechanism that is at worst linear in the size of blocks, but only applies to transaction inputs that spend segregated witness outputs (see BIP 141).


Am trying to start mining litecoin with litecoin-qt I have downloaded the litecoin-qt, since I read on a forum, with that I could start mining directly.
But in my screen, there is not a button for mining.

Have downloaded the cpuminer and have placed the file 'minerd' next to the litecon-qt programm in applications. They are together in one folder.

Not sure I have understood it well.

Is there someone that could give some ligth on this matter?
Would be very much appreciated.

thnx Adithya!

At some point they removed the GUI for mining from the litecoin-qt client. So you have to run minerd from the command-line or terminal.  The actual command syntax seems to be loosely documented, however.

Two reasons for this:

cpu mining simply is relatively too slow and unprofitable to warrant much further development.
Nevertheless the general consensus (at least according to the wiki and other available info) is that pooler/cpuminer is by far a better client in terms of speed, compatibility, usability, etc.

Also you can pick up a USB ASIC miner for ~$15 (usd) that will far surpass what a CPU can do today.

As far as the command syntax goes for CPUminer check out
https://bitcointalk.org/index.php?topic=55038.0

And scroll down to basic usage examples. Also may want to register at a pool first and have your login details ready.


Does Dojima (trading platform) have access to my funds? I would like to use Dojima to trade bitcoins on Bitstamp.net. However, I would like to know about security.

Does Dojima have the ability to send bitcoins to addresses, or is it only able to submit trade orders?

Yes it could do that. Luckily, it is open source, so people can check the code to ensure Dojima will not secretly send funds away.

If Dojima connects to Bitstamp for you, it will use the username and password of your account on Bitstamp. This will allow all functionality offered by the Bitstamp API, which includes sending bitcoins to an address.

You will receive an email to verify the transaction, before it is initiated by Bitstamp. This is a security setting you can adjust in your account:
https://www.bitstamp.net/account/security/email-confirmations/

Let's hope Bitstamp will issue API keys shortly, which you can set to "trade only" for example. That would prevent you from having to enter your password in third party applications.

Update 2013-09-23: Bitstamp added API keys https://bitcointalk.org/index.php?topic=38711.msg3218202#msg3218202


Can I claim Segwit2X with a blockchain.info wallet? I have a blockchain.info wallet, but I am not sure whether I would be able to claim segwit2x?

Thanks in advance.

You just need the private key. A wallet (irrelevant which wallet) stores your private keys. You will probably not be able to send segwit2x with the blockchain.info-wallet, but you will be able export your private keys of your blockchain.info-wallet and then you can import them into a new segwit2x-wallet.


What are segwit txs? Which one is a segwit tx? A Tx that send outputs to a segwit address or A Tx that create inputs along with witness part? Which one?

should segwit tx necessarily produce outputs of type witness_v0_keyhash.

What about a Tx that has witness and send outputs of type pay-to-pubkey or pubkeyhash

Generally the definitions are as follows:

A Segwit transaction is any transaction which contains witnesses. This means that the transaction has at least one input which spends from a segwit output (P2WPKH, P2WSH, P2SH wrapped versions of those two).

A Segwit transaction does not have to produce any segwit outputs.

A transaction which produces segwit outputs but spends non-segwit outputs as inputs (so it does not have any witnesses) is not considered a segwit transaction.


How to measure TX confirmation latency Blockchaininfo has datahere on the confirmation times for transactions. Unfortunately it is unclear how  they collect the data, nor if one could get similar data from say Namecoin.

I'd like to include that data in a research paper or collect similar data myself. However,  without their methodology, I cannot use their data or  nor can I duplicate the techniques.The trivially obvious solution of sending test transactions and measuring how long they take to be confirmed would seem to offer a rather incomplete picture.


How to send payment through a predefined route? Attempting a payment through a predefined route using:

lncli -network=testnet queryroutes 02e34c1b4c5f8e7419cf4d10e3bc9651d46dc1af68df6a7b81a24951a9192aa9c4 25000 | lncli -network=testnet sendtoroute -pay_hash=45b9255c8648c6c1f60e394e555f745af31ed7fab385d0cf9e82b62ce8e8dfba -

Always give me back:

{
    "payment_error": "FinalExpiryTooSoon",
    "payment_preimage": "",
    "payment_route": null
}

Regardless the expiry I set in the addinvoice command.
Can someone clarify Why?
Moreover, how is it possible to use the sendtoroute command using the routes.json obtained before from the queryroutes command?

TL;DR. You need to specify --final_cltv_delta=144 option in the lncli queryroutes command.

Longer answer... When payment is routed through Lightning Network, each intermediate node has a potential ability to steal the funds being transferred. To prevent this from happening, intermediate nodes cannot move the money immediately, but only after a certain period of time. And within this period the funds can be claimed back by a legitimate owner.

final_cltv_delta option specifies this period of time (measured in the number of blocks) for the last node in the chain of hops. When you query routes, the default value is small (I believe it was 9 at some point). But this value is not accepted by most lnd nodes, which require a longer period of 144 by default.


Bitcoin ABC, When Fed Bitcoin Core Chain Syncs to Aug 1 6:23AM 2017, Then Freezes I've installed Bitcoin ABC, set bitcoin.conf to point at a copy of my directory from Bitcoin Core, and let it sync with the network.  All was well until it froze at the fork (Aug 1, 2017, 6:23AM).  The client is responsive, but my progress doesn't budge and the "Estimated time left until synced" stays at "calculating..."  At first I thought I had some kind of network error, but that doesn't appear to be the case.  I have 8 active connections.  Why won't it move beyond this point, downloading the post-fork transactions?

Bitcoin ABC, v0.16.2.0-unk on Ubuntu 17.10 (Mate).

You copied the entire chainstate too, which will confuse the node and cause it to be unable to continue syncing because the chainstate says the Bitcoin Cash chain is invalid and the node things that the chain it is currently using is also invalid. You can fix this by removing the chainstate, in which case it will begin reindexing.

However this may not fix all of your problems because the Bitcoin chain is still on disk and it will still index and verify that. So you may need to delete some of the blk*.dat and rev*.dat files (the higher numbered ones) in order to get it to revert to a state before the fork and then sync Bitcoin Cash from that point onwards.

Details are that we copy the .bitcoin directory, but remove the .bitcoin/chainstate directory.  If you run the client now, it will freeze again when it gets to the blk*.dat files that are beyond the fork.  By running it while also running:

watch -n 1 'sudo lsof -c bitcoin | egrep -o "bitcoin/blocks/(blk|rev).*dat" | uniq | sed -E "s/^.+$/&   `date`/" | tee -a recent.blk'

and

watch tail recent.blk,

I was able find that the files that need to be deleted are .bitcoin/blocks/{blk,rev}00953.dat and above.  That is, keep 00000 to 00952.  Then when I ran the client again, it worked.  After the fork, it synced with the network.  You can save yourself running it twice by just going ahead and deleting both the chainstate/ directory and the relevant files in blocks/.  When you run the client, it will say, "Error loading the block database, do you want to rebuild now?"  Respond, "Yes", and then  it will say "Reindexing the blocks on disk", followed by "Syncing the Headers (478436)".  That last number is the number of blocks in blk00000.dat through blk00952.dat, and just preceeds the fork at 478558.


Were all funds stolen from Mt. Gox finally returned to all users? Mt. Gox was hacked in June 2011, and some funds were stolen. There was a long winded account reclaim process.

At the end of this process, were all funds really returned to the satisfaction of all (legitimate) users? Is there a public statement / forum post that testifies to this?

All the funds that were frozen have been returned. There are two types of funds that were not returned:

Some people claim funds of theirs were transferred out well before the freeze. They claim it must have been by the same person who got the account/password list, but before the big attack. They claim these funds have not been returned.
People who profited unfairly during the flash crash had their transactions undone. Some of them claim they are entitled to their profits. (Some people bought thousands of bitcoins at absurdly low rates.)

I think that people in the second category don't deserve to profit from the theft. As for the people in the first category, there are only two people that I know of who claim this and the amounts involved are quite small. So I think the true answer to your question is most probably "yes".


Hello, got bitcoin core and am confused I recently got a new bitcoin wallet from bitcoin core and it is taking fort to sync, during the sync it gave me an address I sent bitcoin to however due to complications syncing, the address is no longer in my recieving addresses, will it still be saved with the wall.dat file with the bitcoin core files automatically? If not how do I add a custom address to s new wallet to receive the bitcoin if not
Thanks

All addresses Bitcoin Core generates will be permanently stored in your wallet.dat. It now depends on what your "complication" was. If you just pressed "receive" again and generated another address, you've got nothing to worry about, your money will show up once Bitcoin Core is fully synchronized.

If your "complication" included that you've removed Bitcoin Core in between and also deleted your wallet.dat, your money would probably be lost.


Is Bitcoin stateless? Do miners keep track of current 'state' of bitcoin blockchain? In Ethereum or EOS, concept of Accounts make it important to keep track of 'current state'. (e.g.) current balance of Account A is 300 EOS.
Especially in Ethereum, roothash of state tree is stored in every block.

Bitcoin, on the other hand, doesn't care nor store information of current state. I know wallet applications gather block data and derive current balance of the user.

But my question is, do Bitcoin miners keep track of current 'state' of bitcoin blockchain?

Bitcoin certainly does have state. The blockchain itself is a representation of the state of Bitcoin at various points in time. Each new block is an update and  commitment to the current state in Bitcoin.

The state that blocks updates is really the Unspent Transaction Output Set. The UTXO set is what determines everyone's "balances". Only outputs that are in the UTXO set can be validly spent by in a new transaction. If a wallet has an incorrect UTXO set, it could create invalid transactions. If a node has an incorrect UTXO set, it could think a transaction is valid when it is actually invalid.

In addition to the UTXO set, nodes also have to know the hash of the most recent block. This too is state. If nodes or miners do not keep track of this, they could create invalid blocks are mark invalid blocks as valid.

So yes, Bitcoin does have state, and all participants in the network must track it in order to actually be using Bitcoin.


Will the fee for "bitcoin.it" decrease as the value of BTC increases? I'm interested in contributing technical information to the Wiki page located on https://en.bitcoin.it  however they require editors to donate   0.01 BTC at the following page.

https://en.bitcoin.it/wiki/Special:BitcoinPayment

I'm not interested in spending $2 just to share research that I've worked hard on... and I think it has been this value was less than $1 when the feature was first implemented.

Will the donation value of 0.01 BTC decrease in time?

That may full depend on owners of the site, however you can still send them email containing your research, and thay may accept it to that site without payment.


I seem to have too many unspent outputs for my given balance. What am I missing? I have an address on the testnet. I started out with 1.3 btc. I then sent 0.5 btc to another address. My balance is now 0.8. OK, that makes sense.

I expect now to have one UTXO which was the 0.8 in change from the previous transaction. But when I run listunspent, I see I have two UTXOs. The balance is correct, but it seems I have two outputs.

[
  {
    "txid":
   "321dab633022a33c3a49b4aab4b13d3c431771ae9402746dbb6dcc21be5fd603",
    "vout": 1,
    "address": "2N4wJG7gs1mVXeMkX2MCuyekZUCSzrW7CjT",
    "redeemScript": "0014221f8d76c5b85e979055e54ac97a0cada38bc4e9",
    "scriptPubKey": "a914803d96c7e19e4a568764f9912fa54499f814cd8e87",
    "amount": 0.79999834,
    "confirmations": 119,
    "spendable": true,
    "solvable": true,
    "safe": true
  }
]

When I run gettxout with the txid and vout 0, the first transaction UTXO is 0.5.

{
  "bestblock":
  "0000000000000043a1abc3cf9c778d3adeb417488019a507da871db9df74ffad",
  "confirmations": 119,
  "value": 0.50000000,
  "scriptPubKey": {
     "asm": "OP_HASH160 a43f8a90f292b6be0b487556ac357709a5e86480 OP_EQUAL",
     "hex": "a914a43f8a90f292b6be0b487556ac357709a5e8648087",
     "reqSigs": 1,
     "type": "scripthash",
     "addresses": [
       "2N8Dgvfmgs4fNCi7QatLZJR8ArvhPpMPW8P"
     ]
  },
  "coinbase": false
}

And when I run gettxout with vout 1, the second transaction UTXO is 0.799 (0.8) which is the balance.

{
  "bestblock":
  "0000000000000043a1abc3cf9c778d3adeb417488019a507da871db9df74ffad",
  "confirmations": 119,
  "value": 0.79999834,
  "scriptPubKey": {
    "asm": "OP_HASH160 803d96c7e19e4a568764f9912fa54499f814cd8e OP_EQUAL",
    "hex": "a914803d96c7e19e4a568764f9912fa54499f814cd8e87",
    "reqSigs": 1,
    "type": "scripthash",
    "addresses": [
      "2N4wJG7gs1mVXeMkX2MCuyekZUCSzrW7CjT"
  ]
},
"coinbase": false

}

And according to this: How to check if an output has been spent?

If gettxout returns something, then the output is unspent.

Why do I have two unspent outputs with the first one in the same amount that I sent to another address?

As per the comments on OP’s question

Since you made a copy of the wallet.dat file (which is an HD format), both addresses will be under the control of (both copies of) your wallet. Hence, both UTXOs will be listed when calling the listunspent command, as each wallet is able to spend both UTXOs.

If you used a new wallet to generate a new address, and send some funds to it, then the listunspent command should function as you originally expected, as your bitcoin core wallet would not control the address you spent coins too (it would only control the change address).


Transaction fee of 8.44 mBTC for 1.22 mBTC? I made a transaction of 1.22242 mBTC with the electrum client and, I don't know why, it looks like it transferred all the remaining BTC from my account to myself which made a 13063 bytes transaction and costs me 8.43769 mBTC...
Do you know what happened?

https://www.blockchain.com/btc/tx/24c9a54cd4686ef4e0f51298d3fb3862c03ba126fc78cbe382c9094397913314

This is a process known as consolidation - If your wallet has several small inputs, many wallets will often try to combine them into a single change input during regular transactions, especially ones made with a low sat/byte feerate. This allows you to spend the coins in a smaller transaction during possibly high traffic times, when the feerate may be much higher.

These days, many wallets only perform such consolidation if there are many outputs to a single address, as combining outputs from multiple addresses unnecessarily can lead to a loss of privacy. Unfortunately for you, it seems like in your case all the outputs do belong to a single address.

In the case of electrum, this doesn't appear to be a configurable option, although you could notice it is happening prior to submitting the transaction by using the "Preview" option - if you notice that the total fee or size or number of inputs consumed it too large, you can force electrum to build a transaction using only specific inputs by selecting them in your transaction history, then right clicking and selecting the spend from option.


Missing Checksum error when importing multisig wallet via descriptor I'm trying to import a multisig wallet on regtest, but getting a strange error. What am I doing wrong? I've tried it with xpubs, tpubs, and Vpubs (converted here) and get the same error for all.

Command:

bitcoin-cli -regtest importmulti '[{"desc": "wsh(multi(2,tpubDDgGUQsV9M7N5DD3WQmkqkq9UXkSvfHvyefNDx2b7KwmukE6FfuFk3JfncmjCNnG9scWcdz6MEeNPZXHArkGFuTXTsZNr4288ULxuTDjB6u/0/0/*,tpubDCDw2UcGohVP3rK8kPW8g9hwBojpwzYdjLxQ6AnnuRvThH7q1vwGneGAUkfZYqJo9eKFGzuP4WwaKsQkEqqnwLd1eT2CtpAKQispgxadHWB/0/0/*))", "range": [0,10], "watchonly":true, "timestamp":"now"}]'

Error:

[
  {
    "success": false,
    "error": {
      "code": -5,
      "message": "Missing checksum"
    }
  }
]

According to the documentation, some RPCs need a checksum. importmulti is one of those.

You can use getdescriptorinfo to add a checksum to an existing checksum-less one.


Broadcast a Transaction I have a:

Wallet public/private key pair with X BTC
Wallet Address I want to sent Y BTC to

I'm developing an app in NodeJS and trying to initiate payments automatically. I'm very confused how I'm supposed to do this.

From my research it seems like I have to generate some "raw" transaction hash, then encrypt that again with my private key, then I'm supposed to broadcast that encrypted data.

Is there some library/some simple API that can help me do this? I don't want to have to run a bitcoin server if I don't have to...

Follow this example: https://github.com/OutCast3k/coinbin/
This app does everything you need


Is Bitcoin mining pools safe to invest with? I happened to follow a few Bitcoin related profiles on Instagram today and within a few hours received about a dozen  messages from ppl asking if i wanted s fast secure return up to 5x my investment.  Of course i immediately assumed it was a scam then I did a Google search on.mining pools.  I haven't read where it's a scam or even a high risk move?

Can anyone give me advice on if I should even entertain the idea.  Or is it something that is just too good to be true.

In general, get rich quick schemes are a scam.

Mining pools themselves are safe to mine with, but I do not know of any official investment schemes. Do not send your money.


What does setting up a Trezor actually do? About a month ago, I set up my Trezor device: set the device label, wrote down the recovery seed, set the PIN, and added a passphrase. But, I never sent any money to it.

What did I do? Did I basically just use my Trezor to generate a random number?

I'm asking because I lost my PIN, and I left my recovery seed in plain view, so I'm concerned someone may have seen it.

Is it OK if I just wipe my Trezor; shred my recovery seed, PIN, and passphrase; and start over? Or, will I lose more (from the initial setup) than just a random number (and the device label)?

Trezor does two main things.

It generates a wallet based on your recovery seed. The seed is your most important data as it be used to access your funds, even without a Trezor.
It signs transactions using signatures based on your recovery seed, without the need to expose the recovery seed to any people or software.

The seed represents your wallet, so if you're concerned it may have been compromised and never used it, you should definitely generate a new one. The Trezor provides no security if your seed has been compromised, because somebody can just load it into a different device.

Everything Trezor does is based on the seed, so as long as you never used it and are willing to generate a new one, you should be fine.


solving subset sum for two sets Some bitcoin transactions (especially CoinJoin transactions) include two or more sub-transactions. for example, consider a transaction with
Inputs = [2, 3, 4] and
Outputs = [4, 5].

In this example, we have two sub-transactions:
(2+3 = 5) & (4 = 4)
so it is a kind of subset sum problem but for 2 sets, inputs and outputs.

I want to know how to solve subset sum for this specific problem. I know it needs a brute force, but don't how to optimize it? I don't know how to run a brute force either.

Resources

Anonymous CoinJoin Transactions with Arbitrary Values
 discusses the optimized and non-optimized version of it. In this reply I will discuss the non-optimized version of it.
CoinJoin Sudoku may also be something to look up.

Tooling

I wrote a small command line tool in .NET Core that anyone can play around with. You can either provide an input and output list to it or a real txid. In case of txid, it will fetch the transaction from SmartBit and analyze that.

Provide inputs or transaction ID! Example: 21,12,36,28.1 or 0f9f3b68f369b3b95779284d4d0607cb8f5051055c2e1b1813848370496e95aa
21,12,36,28.1
Provide outputs! Example: 25,8,50,14.1
25,8,50,14.1

Given 21,12,36,28.1 input list, and 25,8,50,14.1 output list the tool will output 2 sub mappings:

Sub mappings:
21,12,36,28.1 -> 25,8,50,14.1
21,12 -> 25,8 | 36,28.1 -> 50,14.1

The first sub mapping (21,12,36,28.1 -> 25,8,50,14.1) is the transaction as it appears in the blockchain, it is called the non-derived mapping. This is the case if the transaction wasn't a coinjoin to begin with.

The second is a derived mapping (21,12 -> 25,8 | 36,28.1 -> 50,14.1). In this case it was a coinjoin with 2 participants, as 2 sub transaction has been identified.

However there is another important analysis that can be done on this coinjoin. We can tell what is the probability of two inputs or outputs are in the same transaction:

Input match probabilities:
21 - inputs: 12(1) 36(0.5) 28.1(0.5) | outputs: 25(1) 8(1) 50(0.5) 14.1(0.5)
12 - inputs: 21(1) 36(0.5) 28.1(0.5) | outputs: 25(1) 8(1) 50(0.5) 14.1(0.5)
36 - inputs: 21(0.5) 12(0.5) 28.1(1) | outputs: 25(0.5) 8(0.5) 50(1) 14.1(1)
28.1 - inputs: 21(0.5) 12(0.5) 36(1) | outputs: 25(0.5) 8(0.5) 50(1) 14.1(1)

Output match probabilities:
25 - inputs: 8(1) 50(0.5) 14.1(0.5) | outputs: 21(1) 12(1) 36(0.5) 28.1(0.5)
8 - inputs: 25(1) 50(0.5) 14.1(0.5) | outputs: 21(1) 12(1) 36(0.5) 28.1(0.5)
50 - inputs: 25(0.5) 8(0.5) 14.1(1) | outputs: 21(0.5) 12(0.5) 36(1) 28.1(1)
14.1 - inputs: 25(0.5) 8(0.5) 50(1) | outputs: 21(0.5) 12(0.5) 36(1) 28.1(1)

For example input with value 21 and input with value 12, there's 100% chance they are in the same sub-transaction, however input 21 with output 50, there's only 50% chance that they are in the same sub-transaction.

Example 2: Output for 2,3,4->4,5

For completeness here's the output for the numbers that were present in the question.

Sub mappings:
2,3,4 -> 4,5
2,3 -> 5 | 4 -> 4

Input match probabilities:
2 - inputs: 3(1) 4(0.5) | outputs: 4(0.5) 5(1)
3 - inputs: 2(1) 4(0.5) | outputs: 4(0.5) 5(1)
4 - inputs: 2(0.5) 3(0.5) | outputs: 4(1) 5(0.5)

Output match probabilities:
4 - inputs: 5(0.5) | outputs: 2(0.5) 3(0.5) 4(1)
5 - inputs: 4(0.5) | outputs: 2(1) 3(1) 4(0.5)

Background

Our basic building block is partitioning, so in order to understand the algorithm you must understand partitioning first.
While understanding what the Bell Number is, not essential to understand the algorithm, it is essential to understand the limitations of this algorithm.

Definition of Bell Number

The Bell Number is the number of partitions of a set.

Examples

Empty Set

Set:

Partitions:

Bell Number: 1

Set with 1 element

Set:

a

Partitions:

a

Bell Number: 1

Set with 2 elements

Set:

ab

Partitions:

ab
a b

Bell Number: 2

Set with 3 elements

Set:

abc

Partitions:

abc
ab c
ac b
bc a
a b c

Bell Number: 5

All Bell Numbers

1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, 678570, 4213597, 27644437, 190899322, 1382958545, 10480142147, 82864869804, 682076806159, 5832742205057, ...

Application to CoinJoin

Given a transaction with 100 inputs, assuming brute forcing, one would need to iterate through Bell Number of 100 elements number of partitions in order to find valid partitions. The Bell Number of 100 elements is 47585391276764833658790768841387207826363669686825611466616334637559114497892442622672724044217756306953557882560751.

Non-Optimized Algorithm

First we need to iterate through all the input and output partitions.

foreach (var inputPartition in inputPartitions)
{
    foreach (var outputPartition in outputPartitions)
    {

Then we need to iterate through all parts of the input partition and find out if we have corresponding output partition part:

foreach (var inputPartitionPart in inputPartition)
{
    var foundValidOutputPartitionPart = remainingOutputPartition.FirstOrDefault(x => x.Sum() == inputPartitionPart.Sum());

If we find such valid output partition part, and we also only find valid parts when comparing the remaining parts, then we found a valid mapping.

The Code

For reference the relevant codeblock looks like this. You may notice I made some optimizations to make it less painfully stupid.

var outputPartitions = Partitioning.GetAllPartitions(outputs.ToArray());
var inputPartitions = Partitioning.GetAllPartitions(inputs.ToArray());

foreach (var inputPartition in inputPartitions)
{
    foreach (var outputPartition in outputPartitions.Where(x => x.Length == inputPartition.Length))
    {
        var remainingOutputPartition = outputPartition;
        var validPartition = true;
        var subSetsBuilder = new List<(IEnumerable<decimal> inputs, IEnumerable<decimal> outputs)>();
        foreach (var inputPartitionPart in inputPartition)
        {
            var foundValidOutputPartitionPart = remainingOutputPartition.FirstOrDefault(x => x.Sum().Almost(inputPartitionPart.Sum(), Precision));
            // https://www.comsys.rwth-aachen.de/fileadmin/papers/2017/2017-maurer-trustcom-coinjoin.pdf
            // input partitions that include a set
            // with a sum that is not a sub sum of the outputs cannot
            // be part of a mapping
            if (foundValidOutputPartitionPart is null)
            {
                validPartition = false;
                break;
            }
            else
            {
                subSetsBuilder.Add((inputPartitionPart, foundValidOutputPartitionPart));
            }
        }

        if (validPartition)
        {
            var mapping = new Mapping(subSetsBuilder, Precision);
            mappings.Add(mapping);
            yield return mapping;
        }
    }
}

Discussion

Notice this approach has a benefit compared to the optimized version, that it does not use recursion.


How do I post in BitcoinTalk? I created an account with Bitcoin talk, logged in, and don't see any option to reply to existing threads or create new ones.

I have the ability to "watch", "notify", etc. but I don't see an option that allows me to reply.

I also checked the "My Profile" tab to see if there is any validation I need to do to authorize my account.

In addition, I've also logged out and logged back into the forum using different browsers.

What am I missing?

Newbie restrictions - you need to be logged in for 4 hours and post 5 posts to the Newbie section in order to be allowed elsewhere.


Is there a wallet like Multibit for Litecoin? Is there a lightweight client like Multibit available for Litecoin? If not, is one in development?

For a desktop computer, no, there's no lightweight client yet. There is talk of developing one, but it's not released yet. The LTC blockchain isn't as large as BTC's, so it's not as necessary on PCs.

For Android, there's a Litecoin Wallet that is a lightweight client.


Bitcoin QT computer time Bitcoin qt says my computer time needs to be correct for it to work properly. My time is right to the minute, but not the second.

Will this cause a problem?

Bitcoin-Qt/bitcoind will reject new blocks whose timestamp is more than a couple hours  ahead of the previous block.  This means you could be nearly two hours behind and your node would still accept most new blocks.


What is Wrapped Bitcoin WBTC? I have read on twitter that WBTC has solved bitcoin scaling issues. Is it true? I want to know more about WBTC

Disclaimer: I worked at BitGo when WBTC was kicked off, but I didn't work on the WBTC project.
Wrapped Bitcoin (WBTC) is an ERC20 token fully backed by bitcoins held in BitGo's custody. BitGo mints new WBTC when bitcoins are deposited into custody and WBTC is burned when bitcoins are withdrawn from custody. WBTC is a means to get an IOU for hard money into the ETH ecosystem.
As a "scaling solution", it fits somewhere between a sidechain and payments between two user accounts on a custodial service:

There is no "BTC on ETH", all bitcoins are held by BitGo (or other custodian if another gets added). WBTC is a promissory note for the assets held by BitGo.
Payments using WBTC do not interact with the Bitcoin blockchain, they happen on the ETH network
WBTC can be freely sent and received on ETH
The WBTC token cannot be trustlessly redeemed for bitcoin, entering and exiting WBTC requires actions by BitGo

As ETH is still figuring out its monetary policy, the ETH ecosystem lacks a hard money. WBTC is frequently used to represent Bitcoin's value in the ETH ecosystem. Under the assumption that WBTC is a faithful representation of Bitcoin balances and since WBTC payments do not consume Bitcoin on-chain resources, one could consider them a scaling technique. Representing WBTC as "the scaling solution" for Bitcoin is a silly misrepresentation.


How to count the provably unspendable UTXO in the blockchain? As far as I understand, one can count the UTXOs by iterating through the blockchain starting at block height 0 and counting the number of outputs and subtracting the number of inputs for each block and summing up the result. In addition to this, subtract any provably unspendable transactions such as OP_RETURNs. I believe the list of provably unspendable transactions is something a long the lines of:

transaction outputs that start with OP_RETURNS
transaction outputs that are greater than the transaction size limit

Are there any knowledge gaps above?
If not, how do you count the list of provably unspendable transactions.

OP_RETURNS: Is it just count the TX that has OP_RETURN in their TX? Is there anything else to do here?
TX size restriction: How does one go about counting this?

When you say "transactions", I assume you mean "transaction output".
It is literally not possible to have a transaction output that is larger than the transaction size limit. Otherwise the transaction containing that output would not be in the blockchain.
Rather I think what you are looking for is that the output script is larger than the maximum script size. Such scripts are provably unspendable and can be excluded from the UTXO set.
Bitcoin Core has a function to determine whether outputs are unspendable. It is not an exhaustive list and is just the two that you mention: Scripts beginning with OP_RETURN, and scripts larger than the max script size.
However there are other scripts that are provably unspendable, just that they require a little more work to prove. For example scripts that use invalid or disabled opcodes are provably unspendable. The script interpreter will fail if any such opcode is found in the script when it is verifying the spend.
But even that has a catch. Unknown opcodes that are not executed (e.g. in an unexecuted IF branch), the script can still pass validation. However if the script contains any of the disabled opcodes anywhere (there are a few exceptions to this as some "disabled" opcodes were actually just outright removed), it is invalid.
There are also potentially scripts that require something larger than the maximum stack item size to be pushed to the stack. Or something that manipulates a stack item so that it becomes a negative locktime when used with OP_CHECKLOCKTIMEVERIFY or OP_CHECKSEQUENCEVERIFY.
Then there are output scripts that are programmed invalidly such as having just an OP_ELSE or OP_ENDIF with no OP_IF/OP_NOTIF coming before it.
All of these things are hard to determine and really require inspecting the individual scripts. They also require having a consensus conforming script interpreter, which itself is hard to do because the exact semantics of scripts are actually unclear.


In what ways could Bitcoin prevent "deficit financing of wars"? At a recent NYC Bitcoin meetup, a morally-pacifist, outspoken supporter of Bitcoin said that

  "Bitcoin would prevent the deficit financing of wars"

...alluding to his perceived notion that a Bitcoin economy would prevent wars from being funded and started.

Is this a prevailing thought in the Bitcoin community?
What way of thinking makes this statement appear true?
What aspects of this quote has merit?

There are two meanings to "deficit financing":

Funding something by minting new currency.
Funding something by borrowing.

Obviously, you can't change how fast you mint Bitcoins. Perhaps that's what he meant. It tends to not be very useful, though.

However, it's very possible to have debts denominated in Bitcoin, just as you can have debts denominated in silver or gold. In the Seven Year's War, which lasted from 1754 to 1763, France ran up quite a lot of debt, and they didn't need any of your fancy financial institutions to do it.


Unique Identifier/Credit Newb, apologies if this is a dumb question. If a bitcoin is sent to my wallet is there a way the sender can use any part of the blockchain/transaction as a unique identifier so they can claim a credit in the future for the amount sent, that is, without assigning them any additional identifying information to them? (e.g. You send me a bitcoin, I treat it as a credit.  You can claim the credit by using some combination of the numbers used in the transaction, so I can credit you the amount sent, without assigning any additional information to you, and no one else could be privy to that identifying information.  Thank you for the help!

This is possible, but your customers will have to use a wallet that supports the functionality of signing messages using the wallet’s private keys. For example, bitcoind has the signmessage command. The user could input a message such as ”todays date is ____, and I control bitcoin address ____, which sent coins to ____ service” in order to prove their identity.

Using any identifying info from the transaction itself will not be a good way to prove user identity, since all transaction details are a matter of public record.

Note: By utilizing this functionality, you will be restricting your potential user-base to only more knowledgeable users. Not all wallets have this functionality, in fact most do not. If a user happens to sends bitcoin from a wallet that cannot sign messages, they can prove their identities by importing the private key into some other software that is capable and then using it to sign a message— but again this is a more ‘advanced user’ sort of operation.

Another note: DO NOT build a service which requires users to communicate their private key to you. This would be an irresponsible thing to do.


Cryptomining in Games Following the press last months, you could read articles about cryptomining via javascript. Basically, you open a web page, and a villiant person/company/organisation put some code in website which uses your computers or mobile phone cpu to mine various crypto currency. At the first look, this doesn't look very effective, but the one using this approach is

distributing the (possible small) processor load over many clients, and
does not need to pay the energy needed for mining

The problem with this approach is, that the user could detect this cpu-hijacking pretty easily, either by a high cpu load or a rapidly fast decreasing battery. Plus, many users tend to use an adblocker or similar things to avoid this.

Thinking the whole thing one step furter: How to keep people from recognizing this? Assume you play the newest 3D shooter, you expect your cpu to be at high load. So what would prevent a software studio from putting some mining algorithm into the game's source code? No one would ever notice.

So the question is: Is there a theoretical or even pratical way to prevent this? Are there any games which are known doing this?

This would be illegal if you didn't inform the user. Things like this also already exist, e.g. https://forum.unity.com/threads/uminer-ethereum-cryptocurrency-miner-inside-unity.499917/


how can i get blockchain private key using just my wallet address Please i can get a  private key using the 12 phrases of my wallet using Bip32 but how can i get my wallet private key without the phrases and just having the wallet address

This is exactly what is supposed to not be possible and gives value to the blockchain. So, unless you have an advanced quantum computer at your disposal I'm afraid you will not be able to do it.


Detecting fork using bitcoind What's the most efficient way to detect a fork in the blockchain?

My app polls for changes to user deposit addresses on each new block.

Deposits are credited to user accounts with a record in a database then the funds are transfered to cold storage.

When users get refunds those refunds come from the cold storage and a record is added to the database.

My concern is the following happening:

User deposits Btc and the database record is created.
Chain is forked from 51% attack or software incompatability.
User gets refund from cold storage but I no longer have access to the funds they sent so its out of my pocket.

It seems that everything but rechecking every deposit is marginally risky.

If I rely on height plus hash that can be manufactured by the attacker so the new chain looks like the old chain.

Maybe you can arrange it such that a refund always uses the TxOut of the transaction with which it came into the cold storage? Basically giving the user the same bitcoins back.

If a fork causes the funds not to go into cold storage they will not be going out either.


What are the special Ripple accounts ACCOUNT_ZERO, ACCOUNT_ONE, and root account? What are the special accounts ACCOUNT_ZERO, ACCOUNT_ONE, and root account? It's not clear from the Ripple wiki what they are meant for. A little explanation would be nice.

What makes these accounts "special?"

The root account is the account that owns the XRP in the initial ledger.

ACCOUNT_ZERO is an account whose 160-bit identifier is zero. When dealing with a currency/issuer pair, ACCOUNT_ZERO is used as both the currency and the issuer to indicate XRP.

ACCOUNT_ONE is an account whose 160-bit identifier is one. ACCOUNT_ONE is used in cases where no account is applicable but the currency is not XRP. For example, in a ripple balance node between two accounts, the "balance" belongs equally to both accounts and is really a property of the two of them. It has an issuer of ACCOUNT_ONE.

ACCOUNT_ONE is also sometimes used as a flag in internal arithmetic operations to indicate that non-XRP semantics are desired. XRP amounts are stored as integer drops (millionths of an XRP) while other currency's amounts are stored in exponential notation. Sometimes an amount isn't in any particular currency (for example, when outputs and inputs are divided to compute an offer's quality). To indicate non-XRP semantics without having a valid currency, ACCOUNT_ONE is used. It essentially means "not XRP".


Can miner pay transaction fee with coinbase (if maturity is disabled)? If I understand correctly,

the first transaction in a block may collect transaction fees (difference between inputs and outputs) from the following transactions in the same block; and
subsequent transactions may use outputs from previous transactions in the same block.

If the block maturity check is disabled, so that newly minted coins may be utilized immediately, can a circular dependency of transactions arise, i.e., a miner uses coins generated from the coinbase to pay for transaction fee of a transaction in the same block, but the fee is then returned back to themselves (collected by the coinbase)?

If your altcoin removes the maturity check, I don't see why not. The only prerequisite would be that the fee for the transaction spending the coinbase input must be decided before building the tx, which isn't very hard.


How does Bitcoin have an intrinsic value? I have read several articles about how Bitcoin have an intrinsic value. Aside from the fact that some of those articles confuse "intrinsic value" with "benefits of adoption", I found that none of them could prove that Bitcoin is actually money and not a currency.

Take this example, if I take my Bitcoin from the US to Yemen, it would be the equivalent of taking absolutely nothing to Yemen. Why is that, you ask?

Because Yemen has no Bitcoin bank/supplier/merchants, no one cares about Bitcoin. Now, if I take Gold to anywhere on Earth, people will take that. In the case of Gold, the supply is limited but the demand is unlimited (everyone accepts it) for two reasons. One reason is that Gold is money in itself (if the country uses Gold standard, which I don't recall any that does), and two, is because even if Gold is not money in the country, it's still a commodity to be sold to get money!

So Gold indeed has a value just for being Gold! Bitcoin is a supply and demand currency, which Bitcoin.org clearly states ("The price of a bitcoin is determined by supply and demand"), yet they also say "Much of the trust in Bitcoin comes from the fact that it requires no trust at all", that's illogical as it's dependent on the demand of people which varies by location, i.e. you need to trust that that place has a Bitcoin bank!

If people of that country don't have Bitcoin bank, then that immediately means that Bitcoin value is almost 0 in that country. If Bitcoin's value is zero, no bank would want to spend money to build a branch there. So it's more like fiat currency!

I wouldn't go very far with a Dollar in the country that doesn't have its currency tied to Dollar (even though I don't recall any that doesn't, except the Islamic State, which recently announced Gold and Silver money). This proves several things, that Bitcoin is a currency, that it's dependent on the demand (specifically the location of the market), and thus, that, very much, takes the "universality" it's so much praised for when people talk about how you can make international transfers so easily. You really can; but the problem is that you probably wouldn't do so to most countries that actually need that capability; due to the nature of those countries and the lack of a Bitcoin bank. The only reason why one might want to get Bitcoin in countries where no Bitcoin bank exists, is to buy stuff online. But then again, this has never been the main problem. Credit Cards have solved this for a long time.

So I guess the question is, does Bitcoin have an intrinsic value (is it money) or does Bitcoin have "location value"/trust value (is it a currency)?

Talking about intrinsic value is always a difficult discussion. What gives Gold or really anything intrinsic value?

It is of limited quantity. Bitcoin also has a limit to the total
amount in circulation, and so has an element of digital scarcity
built into its design to mimic physical scarcity.

You can't counterfeit it. (Actually you can create gold, it just costs way more than just buying it) Bitcoin can't be copied through
any known process. You can't transmute lead to gold, nor simply
convert a random collection of bits into Bitcoin.
People accept it for Barter You can use Bitcoin with merchants all over the world, as well as person to person payments. The number
of people accepting and transacting in Bitcoin is growing every day.
You can build physical products with it While not a direct correlation the Bitcoin network is a highly secure trust network.
Nothing like it has existed before on its scale, and it seems clear
that quite a bit can be built on top of it. That gives the network
real value for companies emerging in various new sectors, and how do
you get access to this network? Bitcoin.

If people believe it has value, trade in it, and it lets you do things that were previously impossible it seems like it has intrinsic value by any definition.


bitcoin core RPC vs bitcoin libraries What is the main difference between using one of the bitcoin libraries to create a project and using bitcoin core json RPC API directly by connecting to your node for everything?
If the library has no full node support, which part exactly requires you to use a fullnode and which part can be done without full node?
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Java The link mentioned for library doesn't work here but I found BitcoinJ and it mentioned that you don't need local copy of bitcoin core so how does everything happen without node?

In simplified terms...
Libraries work more like a calculator that simply process the data you feed it.
The JSON-RPC API can not only process the data you feed it, but also gives you access to the data you need.


Is it possible to create more ripples? Currently there are only 100 billion ripples (XRP), which are slowly being distributed, and a fraction of a ripple is destroyed with each transaction.

In the future if we run out of ripples, or if the developers decide that they need to have more ripples for some reason (to pay their bills?), then would it be possible to create more? If yes, what is the exact process of doing this? Does it require consensus? Or is it just an edit-compile-deploy?

No. The amount of Ripples is fixed and, unlike with Bitcoin, available from the day it was created. The amount is fixed to 100 billion.

However, this amount is for the main "Ledger" which is currently used by everyone using Ripple. You can see a ledger as similar to a Bitcoin block chain. Everyone can, if he would like, create a new Ledger, just like everyone can start a new block chain.
Currently, though, there is only one Ledger really used and that's the one the Ripple founders started together with Coinbase and consists of 100 billion Ripples.

These 100 billion Ripples or XRP are dividable into "drops", which are 1 millionth of a Ripple. This means that 100 million billion drops exist.

With the transaction fee for Ripple currently on 10 drops, this means that even with thousand transactions per second, they will only run out in 634,195 years.

(Disclosure: Since Ripple is fairly young, I'm also new to it. I did some reading and tried to understand it's foundations, taking the Ripple wiki as primary reference. It's very much possible that I misunderstood some aspects of the system or that the wiki is not fully correct.)


mining difficulty is not changed on regtest I want to see the automated mining difficulty change on regtest but it did not change even I generated 2016 blocks. How can I see it?

// initial difficulty
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getmininginfo
{
  "blocks": 0,
  "currentblockweight": 0,
  "currentblocktx": 0,
  "difficulty": 4.656542373906925e-10,
  "networkhashps": 0,
  "pooledtx": 0,
  "chain": "regtest",
  "warnings": ""
}

// generate 2016 blocks
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest generate 2016

// show the difficulty
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getmininginfo
{
  "blocks": 2016,
  "currentblockweight": 4000,
  "currentblocktx": 0,
  "difficulty": 4.656542373906925e-10,
  "networkhashps": 12,
  "pooledtx": 0,
  "chain": "regtest",
  "warnings": ""
}

// generate 2016 blocks again
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest generate 2016

// the difficulty was not changed
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getmininginfo
{
  "blocks": 4032,
  "currentblockweight": 4000,
  "currentblocktx": 0,
  "difficulty": 4.656542373906925e-10,
  "networkhashps": 12,
  "pooledtx": 0,
  "chain": "regtest",
  "warnings": ""
}

It worked. I needed to change some configurations.

change source code

// src/chainparams.cpp
consensus.nPowTargetTimespan = 14 * 24 * 60;
consensus.nPowTargetSpacing = 10; // 14 * 24 * 60 / 10 = 2016
consensus.fPowNoRetargeting = false;

https://github.com/bitcoin/bitcoin/blob/0.17/src/chainparams.cpp#L291

check the difficulty change

// initial difficulty
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getmininginfo
{
  "blocks": 0,
  "currentblockweight": 0,
  "currentblocktx": 0,
  "difficulty": 4.656542373906925e-10,
  "networkhashps": 0,
  "pooledtx": 0,
  "chain": "regtest",
  "warnings": ""
}

// generate 2016 blocks
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest generate 2016

// check the difficulty
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getmininginfo
{
  "blocks": 2016,
  "currentblockweight": 4000,
  "currentblocktx": 0,
  "difficulty": 4.716464207201856e-06,
  "networkhashps": 1024.75,
  "pooledtx": 0,
  "chain": "regtest",
  "warnings": ""
}


Is there some website that aggregates all the Bitcoin exchange prices so small businesses can find out the current market rate and react accordingly? I have a small business in doing repairs and I'm willing to take bitcoin, but i was wondering if there is a site that aggregates all the bitcoin exchange prices so I can get an idea of what price to charge in bitcoins to avoid the day to day volatility. Yes i know i can use bitpay, but I want to be able to just take bitcoin myself and come up with my own merchant rate that i choose and feel comfortable with.

bitcoincharts.com is one of the more popular ones:

http://bitcoincharts.com/


How to learn to query the block chain? I want to find out how many addresses have had x transactions over time.

I want to find out the average bitcoin transaction size for  over time...I want to do a bunch of different queries like that on a regular basis.

Big picture: I want to do fundamental research on block chain activity and publish it. I have worked a decent bit with databases in the past. How can I learn to interact proficiently with the bitcoin blockchain?

One could extract the Blockchain and import it to your own database for analysis.  For example, see project: bitcoin-to-neo4j.


Getting bx to create a private key from known chain code and a private EC WIF key? I was trying to get strong feedback that I really understood a portion of the Mastering Bitcoin Book concerning HD wallets. The picture below is the reference for the question.

I checked out the functionality exposed by a Javascript Brain Wallet. By entering "123" (is a very poor secret) into a field for a HD brainwallet and the following extended private key emerged: xprv9s21ZrQH143K2hYgcmBxsUfRw3Kbu3eEGXFJrM8Cqtewuqa6Y6nXbB7tv9HnrBajqjptPsRjL9FmnwLa317jHWJ5dpwTc99C2AiPztPRaxk.

Clicking the button to the right of the private key got me to another page indicating the master private chain code is 40675733fc35303c1c75bc598716f24af225528da686192ceb567c88313f8885 and the master private key is L4h3ZSQ3yfFNbovQjTGumvUGEfB1a7oFAhbkhMMFGsdDKoTSwwU8.

Given these last two pieces of information and an index of 0, is it possible to issue a number a number of bx commands and concatenate their output results to feed a HMAC-SHA512 hash to arrive at private WIF key of KwMsDozFYQG7SZFwfvFRwWDhfuMJjkE669WxP6SqrpDPsCBrPV4p public address 15jbcT7wE81s8n2dbEGRFGf65zp7PHrjxh?  If so, how is this accomplished or does bx need to be complemented by some other command that renders HMAC-SHA512 functionality?

No need for an external program at all:

$ KEY=xprv9s21ZrQH143K2hYgcmBxsUfRw3Kbu3eEGXFJrM8Cqtewuqa6Y6nXbB7tv9HnrBajqjptPsRjL9FmnwLa317jHWJ5dpwTc99C2AiPztPRaxk
$ echo $KEY | bx hd-public -i 0 | bx hd-to-address
15jbcT7wE81s8n2dbEGRFGf65zp7PHrjxh

Or, because this is non-hardened, you can use the extended public key:

$ KEY=xpub661MyMwAqRbcFBd9iniyEccAV5A6JWN5dkAuejXpQEBvnduF5e6n8ySNmP8uWeqNbwFXLHEQkV1shXbNtBV8YCUJPMSuE7bGCvDaZJfUBuP
$ echo $KEY | bx hd-public -i 0 | bx hd-to-address
15jbcT7wE81s8n2dbEGRFGf65zp7PHrjxh


Why do pools get so often DDoS attacked? In other words: who has incentives for attacking pools?

Do you think it's the government?

There are several groups of people that could have incentives to DDoS mining pools:

Owners of other mining pools. Mining pools make profit from the blocks mined by their miners. So it would make perfect sense for them to attack other pools to encourage users to abandon the pool and perhaps find a new home at theirs.
People mining at other pools, including their owners. When a miner is mining for a pool that has issues, chances are high their shares get lost. This means that chances exist that the pool under attack will no longer be able to find blocks and so the hash power of its users is lost, causing new blocks to be found less frequently. This can be advantageous to people mining at other pools because this will result in the difficulty being lowered, giving them a higher chance of finding blocks. (And again, as more blocks are found by another pool, the pool owner makes more profit.)
Opposers of Bitcoin. This doesn't only need to be governments, but can also include banks and payment processors like PayPal, Visa or MasterCard. Bitcoin is very innovative as a payment option and has the potential to take over a significant part of the online payment industry. Also, Bitcoin abolishes the centralized concept of money, from which banks make profit. So they all have reasons not wanting to see Bitcoin succeed as a successful currency and payment method.


I formated my hard drive with bitcoin core on it First timer here

...I downloaded bitcoin core a few weeks ago until last week where it still had not synced so i started all over...I was originally waiting for BTC CORE to synchronize(I missed the part in the installation that stated I needed 220+ gb of free space)...I had to format BOOT ssd(256gb..also where I originally tried to save BTC CORE)...thats why it was taking so long and I purchased 1tb samsung evo. I'm  wondering if my BTC address will be the same(since I never actually synced with the servers and since I am not using the same SSD where BTC CORE is being saved. However, it is the same SSD that windows is booting from but I had to reinstall windows.

I have now downloaded BTC CORE on my new SSD and it is synced. Unfortunately, I cant find my BTC and when I use a block explorer the funds are not there(I checked with a BE last week and the BTC was there... but pending or waiting to sync...now its not)

...did my BTC address change? will it ever sync with the older one so I can get my funds?

hope someone can help

Addresses are not magically tied to the hardware you use. If you delete the file that contains the private keys for your addresses, you will lose them and thus lose access to your Bitcoin.

Since it seems that you formatted your hard drive without making a backup of your wallet file, your private keys and thus your Bitcoin are lost. You may be able to recover the file using file recovery software such as Recuva.


ECDSA - why not using the cyclic additive group As I understand things so far, the ECDSA scheme used by Bitcoin uses a group G generated by a point on the elliptic curve y^2 = x^2 + 7.

Now G is a cyclic group of finite order n and is, hence, isomorphic to the additive group Z/nZ.

My question is: why not work within Z/nZ directly then? I am assuming there are certain security benefits of using G but I am lacking the general overview to understand why.

(Disclaimer: this is not my field.)

Let g be the chosen generator and n its (prime) order.  In the ECDSA algorithm, these are publicly known.  It is true that g generates a cyclic (abelian) group isomorphic to Z/nZ.

Now a private key consists of an integer k, and the corresponding public key is the group element h = kg. (I use additive notation since we are in an abelian group, so kg = g+g+...+g (k times)).  If we were actually working in Z/nZ, it would be trivial to recover k from h: just divide h by g (mod n) using the Euclidean algorithm.  Then we would have no security at all.

The point, as I understand it, is that in the elliptic curve group, there is no known efficient way to "divide".  And while there certainly exist isomorphisms from <g> to Z/nZ (map g to any element of Z/nZ you like), the inverse of such an isomorphism is not trivial to compute.


Is 165aBmgtQJFDLkSYPU5C8jq5gpnAtHdKBh a scam Bitcoin address? Is this bitcoin address authentic: 165aBmgtQJFDLkSYPU5C8jq5gpnAtHdKBh

I sent BTC to the address for Paypal funding but no response from them since yesterday.

There is no way to know.  Bitcoin addresses are designed to be used only once.  As you can see here, nobody except you has ever sent coins to that address, and in all likelihood nobody else ever will.  And Bitcoin addresses are anonymous, so it is likely to be difficult to trace the address to its owner.


cgminer works just fine for BTC but LTC mining won't get temps over 50C These are the screenshots. Temp on LTC won't go over 50C although I set it to intensity 12 on my 6770. I get 200Mh/s on BTC and I shouuld be getting 200Kh/s, instead I'm getting 80Kh/s.

http://i.stack.imgur.com/LyUea.jpg

http://i.stack.imgur.com/jCgsA.jpg

What's going on?

Here's the cgminer.conf for HD6770M I use:

"temp-cutoff" : "105",
"temp-target" : "65",
"intensity" : "13",
"vectors" : "1",
"worksize" : "256",
"kernel" : "scrypt",
"scrypt" : true,
"lookup-gap" : "2",
"thread-concurrency" : "3200",
"shaders" : "480",
"gpu-engine" : "815",
"gpu-fan" : "100",
"gpu-memclock" : "919",
"gpu-vddc" : "1.055",
"temp-overheat" : "100",
"gpu-threads" : "1",
"kernel-path" : "C:\\path\\where\\cgminer\\is" (double "\")

Hope that helps!


What is the function to get the object of a NXT asset in javascript? I want to get an object and its variables of a NXT asset. What is the function to retrieve an object of an nxt asset?

You can get most of the nxt objects using NRS.sendRequest(""

The following code gets the asset object of whats in question.

NRS.sendRequest("getAsset", {"asset": asset}, function(response) { //do stuff with response}, false)

NRS.sendRequest("getAsset", {
  "asset": <*Your Asset ID here*>
}, function(response) {
  if (response && response.asset) {
    console.log(response);
  }, false
});

You would get the following response from chrome's console log like this:

http://prntscr.com/7zm5fh