What security weaknesses result from using off chain solutions? What type of security weaknesses are potentially created by using off chain solutions (such as the lightning network) for a portion of Bitcoin network traffic?

TL;DR:

The security assumptions of using a LN channel for payments:

The blockchain is functioning well (confirming transactions quickly)
Channel nodes can keep secret data safe
There aren't any significant bugs in the software

With the Lightning network specifically, the security of the off-chain payment always depends on being able to take the transaction onto the real blockchain "if needed". When both parties cooperate, the number of on-chain transactions is minimized, but both parties rely on being able to cash out, using the real blockchain, if the other party stops cooperating or goes offline for an extended period of time. In addition, if the other party acts maliciously, you rely on being able to use the blockchain to punish their malicious actions.

One security risk lies here: if you cannot get transactions confirmed into the blockchain, you won't be able to get your money out of the channel, or to take counter measures when the other party tries to cheat you! So a well-functioning blockchain (confirming transactions quickly) is a definitely one security assumption of using the lightning network. So block crowding is one risk, since there won't be enough room for your transactions. Miners could also be bribed to not mine your transactions, although this is not a severe risk since it is likely that a different miner would confirm your transaction.

To understand some of the other security assumptions used in the lightning network, consider the following example. Suppose Alice has a payment channel open with Bob. First the channel balances read:

Channel Balance 1:
Alice: 0.5 BTC
Bob:   0.5 BTC

Then Alice makes a payment to Bob for 0.1 BTC, and the updated channel balances read:

Channel Balance 2:
Alice: 0.4 BTC
Bob:   0.6 BTC

But Alice decides she wants to try to cheat Bob! She tries to broadcast the transaction for Channel Balance 1, in which she gets 0.5 BTC, which is more favorable to her than her balance in Channel Balance 2, just 0.4 BTC. What's to stop her from doing this?

First, there is a waiting period before she can actually spend the funds from her 0.5 BTC output in Channel Balance 1 (technically the wait period applies to Channel Balance 2 as well). This wait period exists to give Bob sufficient time to notice that Alice has closed out the channel, and possibly take action if Alice has broadcasted an old version of the channel. In this case, since Alice closed out the channel with an older version of the channel state, Bob can actually take all of the funds in Alice's 0.5 BTC output! Hence, Alice is disincentivized from broadcasting old versions of the channel state.

The problem is that if Bob can't get his transaction that took the 0.5 BTC from Alice into the blockchain, then the wait period will end and Alice will have the opportunity to take the 0.5 BTC, successfully stealing 0.1 BTC (because she should only be allowed to take 0.4). So Bob depends on being able to take counter measures against Alice in the real blockchain before a wait period ends if Alice tries to broadcast an older version of the channel state.

(Note that this wait period also applies to Bob if he needs to get funds out of the channel without the help of Alice. Even if he broadcasts the most recent state of the channel, he has to wait. While this wait period may be inconvenient for Bob, Alice also has to abide by the wait period, which is what gives Bob a chance to take all of the funds in the channel if Alice tries to broadcast an old version of the channel. If things go as planned, though, and no one goes offline, then Alice and Bob can agree to make a new transaction to close the channel, where neither one has to wait to spend their funds.)

There is also a data security risk. Proving to the other channel party that you will not try to broadcast previous versions of the channel balance state involves giving the other channel party a bit of secret information, typically the preimage of a hash. Usually you only reveal this data to your channel counter-party when you update the state of the channel and receive a new guarantee of payment (just with a different balance). After you receive the new payment, you can reveal the secret information that invalidates the previous payment by giving them the ability to steal the funds from that old channel state if you try to broadcast it.

But if the secret data associated with the current state of the channel is revealed or stolen before you get a separate payment guarantee transaction, then effectively all of your transactions have been revoked and your channel counter-party can steal all the funds from any channel transaction you broadcast! So, the security of a LN payment channel depends on being able to keep data safe.

Another risk is simply bugs in software. If your software doesn't automatically handle all the edge cases of broadcasting the right transaction at the right time, and your counter party discovers that, they can take advantage of it and steal funds from the channel.


Relation between bitcoin address/private keys size and number of characters? Bitcoin address is 25 bytes long, address = [Version Byte (1)][Hash 160 (20)][Checksum (4)]  whereas number of characters in this string are 34.
Same with private key:  32-byte have almost 52 characters.
I want to know how can I map number of characters to the size(Bytes) of the bitcoin address(P2PKH)?

There are many types of Bitcoin addresses. Your example specifies (legacy) pay-to-pubkey-hash (P2PKH) address defined by Base58 check encoding and Wallet Import Format (WIF) which is also specified by base58 check
Base58 encoding treats the entire input payload as a big-endian big integer. Consider these alternate examples:
Input value: bc in ASCII: 0x62 0x63 (2 bytes) interpreted as a 2-byte int and encoded without leading zeros...
base 2: 110001001100011 (15 characters)
base 10: 25187 (5 characters)
base 16: 6263 (4 characters)
base 58: 8VG (3 characters)
So going forwards we know that for this example it took 3 base58 characters to encode two bytes. Lets run it backwards and try minimum and maximum values:
base 58, maximum value with 3 characters zzz encodes three byte value: 0x02fa27
base 58, minimum value with 3 characters 211 encodes two byte value: 0x0d24
Conclusion:
From this example alone we discover that we can not determine the length in bytes of the original value based just on the length in characters of the encoded string.
Bonus:
Modern addresses are now encoded with bech32 and represent Segregated Witness programs. The bech32 spec is defined in BIP173 and look like this: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
bech32 encoding does not use interpretation as big integers and instead maps input bytes more directly to output characters:

The data-part values:

1 byte: the witness version
A conversion of the 2-to-40-byte witness program (as defined by BIP141) to base32:

Start with the bits of the witness program, most significant bit per byte first.
Re-arrange those bits into groups of 5, and pad with zeroes at the end if needed.
Translate those bits to characters using the table above.

As a result of the previous rules, addresses are always between 14 and
74 characters long, and their length modulo 8 cannot be 0, 3, or 5.
Version 0 witness addresses are always 42 or 62 characters, but
implementations MUST allow the use of any version.

So in summary, with a bech32 address you can determine the length in bytes of the input value based on the length in characters of the encoded string:
In bech32, each character represents 5 bits


What is the numerical definition of a Satoshi relative to a BTC? In previous definitions of a Satoshi, I only saw the decimal place in front of the 0's and the #1 (.0001), but no 0's after the #1 and that's confusing to me. If however you also put the 0's behind the #1 it makes much more sense to me: Ex. .0000100000 BTC = 100,000.00 Satoshis. I can now see the number value of Satoshi based on the number of 0's behind the #1!

1BTC = 100,000,000.00 Satoshi, is this a accurate understanding?

Satoshis are indivisible on the Bitcoin blockchain. Therefore, it doesn't make any sense to add a decimal point or digits after the decimal point to satoshi values.

The conversion is:

100,000,000 satoshi = 1 BTC

or

1 satoshi = 0.00000001 BTC


How the Recipient's public key is used in bitcoin transaction In the second paragraph the white paper by Nakatomo, we have this image:

It says a coin is a set of digital signature. For what I understand the whole process is the following:

Hash together the previous transaction hash plus the recipient public key;
digitally sign the hashing string with the private key of the sender;

The digitally signed result represents the transaction.

I have a couple of questions.

First of all, when the transaction is trasmitted to majority of the nodes, they have to decrypt the signed transactions by applying the public key of the sender to verify his identity.
Well, where the nodes take the public key of the sender? I thought that they can retrieve it by looking at previous transaction (where in the last transaction the actual sender will figure out as a receiver and so his public key is in the input of the hash function), but we cannot do so because the transaction is again encrypted and we need the public key of the last-last owner.

The other question is about the Receiver public key inside the data in the hash function. Does this really matter as a proof that the coin associated to that transaction are held by the new owner? Or they play a role in the user validation? I mean, the arrow with the name "verify" what stands for?

It says a coin is a set of digital signature. For what I understand the whole process is the following:

Hash together the previous transaction hash plus the recipient public key;

digitally sign the hashing string with the private key of the sender;

The thing that is signed is not related to the previous transaction. It is actually the current transaction that is being created (or parts of it), but without the signatures.

The digitally signed result represents the transaction.

No. The result is never transmitted as it can be calculated from the transaction itself. The signature is placed inside of the transaction.

First of all, when the transaction is trasmitted to majority of the nodes, they have to decrypt the signed transactions by applying the public key of the sender to verify his identity.

No. There is no encryption or decryption happening. A digital signature does not produce any encrypted data. Nodes should be verifying that the transaction is signed with the public key.

Well, where the nodes take the public key of the sender?

The public key is either provided in the transaction output that is being spent (so nodes refer back to the previous transaction) or it is provided within the spending transaction itself. In the latter case, typically the previous transaction output will contain the hash of the public key so nodes will check that the public key provided hashes to that hash.
Note that I say typically because there are cases where none of this is true. Since Bitcoin uses a script system, anyone can create a script which does whatever they want, including signing the transaction or not. Transactions are only signed because the commonly used scripts say that the transaction must be signed in order to be spendable, but not all scripts require that.

but we cannot do so because the transaction is again encrypted and we need the public key of the last-last owner.

No. Again, nothing is encrypted. Furthermore, in an encryption scheme, the public key is absolutely useless for attempting to decrypt something. Things can only be decrypted with the private key. All blocks and transactions in Bitcoin are not encrypted and all of their details can be plainly read.

The other question is about the Receiver public key inside the data in the hash function. Does this really matter as a proof that the coin associated to that transaction are held by the new owner? Or they play a role in the user validation? I mean, the arrow with the name "verify" what stands for?

Yes, it does matter. Otherwise anyone could provide a public key which has a valid signature. The point of having the hash of the public key is to prove that the public key provided is the correct one and that the previous transaction committed to that public key (i.e. the previous transaction actually specified that public key).


Stratum + MPOS pool question This is the first pool I have configured so forgive my n00bness.
https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide
I completed the guide and everything appears to fire up correctly though when a client connects, he only receives rejections.

What step am I missing?
I have a suspicion that being on a 'test network' vs the Litecoin network via the 'how to' is a little suspicious, but I am new to the software and not sure how it works yet.

http://bpaste.net/show/z0oOnziLKekXmuW7pEKy/

I have no firewall

http://bpaste.net/show/jssOUYVrMP3ckdaZomfq/

asterisk1 home # ./minerd -o stratum+tcp://domain.com:19334 -O my.my:pass -t 1
[2014-01-26 19:42:40] Starting Stratum on stratum+tcp://digitaldriller.com:19334
[2014-01-26 19:42:40] 1 miner threads started, using 'scrypt' algorithm.
[2014-01-26 19:42:40] stratum_recv_line failed
[2014-01-26 19:42:40] ...retry after 30 seconds
^C
asterisk1 home # ./minerd -o stratum+tcp://domain.com:3333 -O my.my:pass -t 1
[2014-01-26 19:43:21] Starting Stratum on stratum+tcp://digitaldriller.com:3333
[2014-01-26 19:43:21] 1 miner threads started, using 'scrypt' algorithm.
[2014-01-26 19:43:21] Stratum connection failed: Failed connect to digitaldriller.com:3333; Connection refused
[2014-01-26 19:43:21] ...retry after 30 seconds

or at best  http://i.imgur.com/xEl0qVs.png

Did you do these steps to make sure stratum had the correct stuff compiled?

  sudo apt-get install python-twisted python-mysqldb python-dev python-setuptools python-memcache python-simplejson
  easy_install -U distribute
  git clone http://github.com/Tydus/litecoin_scrypt.git
  git clone http://github.com/ahmedbodi/stratum-mining.git
  git clone http://github.com/ahmedbodi/stratum.git
  cd stratum-mining
  git submodule init
  git submodule update
  cd externals/litecoin_scrypt
  sudo python setup.py install
  cd ~
  cd stratum-mining/externals/stratum
  sudo python setup.py install


I used Bitcoin-QT to send BTC and it never confirmed. I used the zap command and resent with maximum fees, still no luck Hello I sent about $300 worth of BTC and it never got confirmed. I then used the --zapwallettxes=1 command to get the BTC back and resend with max amount of fees, but it still didn't confirm on the other end. I tried this several times with different addresses, but nothing has worked. I can provide any details necessary to aid this process. Any help would be greatly appreciated!

EDIT: The transaction ID is a5966f30e0b170e4d1af9b47dea6b8154022ef5917189890eef72e831e5dffab

Also Bitcoin-QT is now telling me that the transaction has 13 confirmations, however it still hasn't showed up in my other wallet. I searched for the transaction ID on blockchain.info, and see that the amount was successfully transferred to the address I intended it to. However, it then shows my BTC being transferred again to another address I didn't create. Does this mean my BTC was stolen?

The fee you sent is 97 satoshi per byte, which is good enough to confirm your transaction with in 1 or 2 hours.

1 or 2 hours because there is a large number of unconfirmed transactions now. And several hundred transactions of them have a fee rate larger than your transaction's fee rate.

Your transaction should be confirmed now, please check it.


Creating a BTC Gateway with ATM Network We have a ATM Network and we want to sell and buy BTC or ETH on our ATMs, using our own switch. How can we do it?

Unless I'm misunderstanding you. You just need to track the multi-currency balances inside your own gateway. There are a number of ways you could do this but without more information its difficult to help.
We recently built a Ripple based solution which keeps track fiat and virtual deposits using Ripple and you might be able to build or purchase something similar.
I hope this helps.


Is there someway to determine the current network fee from the bitcoin network/daemon? Is there some way to programmatically extract the current consensus of the transaction fee from the bitcoin network, either by using the daemon or through some other means?

Check the medium fee of last n blocks? I believe the transaction fee is currently not very variable. The reference implementation "ensures" that all transactions that are smaller than 1000 bytes, have all outputs over 0,01 BTC and have a large enough priority will be processed, regardless of the transaction fee. Otherwise 0.1 mBTC is paid for every 1000 bytes of transaction (rounded up).

The priority of a transaction can be calculated by [1]

priority = sum(input_value_in_base_units * input_age) / size_in_bytes


Is transaction validation in Ripple trust-based or trust-less? In Ripple consensus,

(1) Each validating server maintains a list of trusted servers known as Unique Node List (UNL).

(2) Servers only trust the votes issued by other servers which are contained in their UNL.

(3) Ripple enables different institutions (e.g. banks which run their own servers) to reach a consensus with respect to the fate of financial transactions.

From (1), (2), (3) :

(a) Can we conclude a a bank which runs its own server will reach a consensus on its transactions via only servers trusted by that bank ?

(b) And if so, can we say transaction validation in Ripple is trust-based and not trust-less?

(1) Each validating server maintains a list of trusted servers known as Unique Node List (UNL).

This is correct for the XRP Ledger. Non-validating servers do this too.

  (2) Servers only trust the votes issued by other servers which are contained in their UNL.

These are votes for whether to delay a valid transaction or process it immediately. This is needed to ensure that honest participants agree on the ordering of valid transactions received at about the same time.

  (3) Ripple enables different institutions (e.g. banks which run their own servers) to reach a consensus with respect to the fate of financial transactions.

Right. So if Alice has some XRP, she can send it to Bob or she can send it to Charlie. And every honest participant can tell which transactions are valid and which aren't. The problem is that they need to agree on the order in which the transactions are executed or they may not agree on the results. This is what the XPR Ledger does.

Please don't call it Ripple though. Ripple is a company (with a Trademark on "Ripple") that, among other things, built a payment network (RippleNet) that has different properties and the use of the term"Ripple" to refer to the XRP Ledger risks confusing people.

  (a) Can we conclude a a bank which runs its own server will reach a consensus on its transactions via only servers trusted by that bank ?

No. At least not unless something is horribly wrong. Say there are 100 people in a room trying to agree on a number between 1 and 100 and you can only hear 5 people in that room. If those 5 people can hear everyone in the room, you'll still wind up reaching a consensus with everyone in the room.

  (b) And if so, can we say transaction validation in Ripple is trust-based and not trust-less?

No. First, every server independently determines the validity of every transaction by itself. It doesn't need anyone else to tell it whether a transaction is valid or invalid. The only thing you need really consensus for is to ensure a consistent ordering of transactions across the network. If some people thing Alice's payment to Bob comes first and some think her payment to Charlie comes first, they'll disagree over which is funded and which is unfunded.

The only reason you need a UNL is that malicious people could create millions of apparent network participants that just refuse to agree on which of two valid transactions received at about the same time should be executed first. To prevent this, you need something scarce associated with each participant you wish to listen to.

PoW uses computing power for this. Consensus just has humans decide who they think is unlikely to collude to halt the network. With PoW, if you get it wrong and there's collusion, you get double spends and can't easily fix it. With consensus, you get a stalled network and can fix it just by ignoring the bad actors. You can easily do that because validators provide signed statements to facilitate the consensus process, so you can tell which keys are signing the nonsense and just stop listening to them.

If you want to argue that the XRP Ledger uses a trust-based method to order valid transactions received at about the same time, I guess I won't agree with you. But the advantages are huge:

1) It's millions of dollars a day cheaper than PoW.

2) It doesn't have the problems caused by conflicting interests. If you and I are mining, I'd prefer you not mine because you're getting a cut of the rewards that reduces my cut. That's why selfish mining is a thing. However, if you and I are validating and you are way better at it than me, I'd be perfectly happy just to stop mining.

3) It's much more fair because miners get to choose which transactions to include and nobody gets to choose which transactions go in consensus because it's done by consensus.

4) While incentives may prevent a double spend attack on PoW chains (so there have been some spectacular failures), it's not clear what to do if there is one. Changing the PoW algorithm screws over all the honest miners, and you didn't have enough of those.

5) Irrevocable confirmation is possible very quickly, typically in under ten seconds compared to many minutes with PoW.

So even if you think it's trust based, it's a minimal amount of trust (trust not to halt the network by refusing to agree, revocable at any time) the advantages are huge (much better censorship resistance, lower cost, higher speed, and so on). And, of course, PoW requires you to trust that a majority of computing power isn't in the hands of bad actors.


listunspent bitcoin core command returns the address as String while getrawtransaction addresses are array this answers why vout.scriptPubKey.addresses is an array,

then why the address in listunspent response is a String?

Do you know any transactions in the blockchain have multi addresses in the vout?

This is a historical oddity.

In the past, Bitcoin Core would report the list of participating keys in a multisig addresses by listing the addresses for those keys. This was both confusing (addresses and keys are distinct things), but also unreliable, as the full public keys were not always knowm (when P2Sh was introduced). You can  safely assume you won't see multiple addresses in any output to an address created in modern times.


How to get both confirmed and unconfirmed transaction details of foreign(non-wallet) addresses from bitcoin-node server? How to get both confirmed and unconfirmed transaction details of foreign(non-wallet) addresses from bitcoin-node server?
Actually i have generated the addresses using third party library and sent some btc on it. Now i want to know confirmed and unconfirmed transaction details using my own local bitcoin-core node server. Can Somebody help me? Thanks in advance.

If I understand correctly you can use this command getrawtransaction to get a transaction that is in your node's mempool i.e. an unconfirmed transaction.

However, if you are looking for a transaction that has been confirmed, you'll need to know the blockhash of the block in which that transaction resides.

Example:

> bitcoin-cli getrawtransaction "mytxid" false "myblockhash"

Or if you have enabled -txindex option on your client then you can use getrawtransaction and you don't need to supply the blockhash. Check out this question for details on this option.

Refer to this site for a more detailed explanation of the getrawtransaction command.


How to generate sub addresses belonging to one private key We're creating a platform to buy/sell Bitcoin.
We need to generate a new child address for each customer allowing them to receive Bitcoin. But all incoming Bitcoins should be stored in our main wallet actually.
These are what we have done up to now:

Creating a new wallet using Blockchain.com API using /api/v2/create and receiving an address as 1551SHYQu8CPuRxJagViGkppNZrv2gkfFi
Converting the wallet to HD using /merchant/:guid/enableHD
Receiving the first sub-wallet (xPriv & xPub) if I am not wrong with a new public address 1CLpEvgs9o2mgKN5aS1mPeXGcqXs7fT75F
Send BTC to the address generated in step 3.

We expected that the transaction happened on on the last address as a derived child from the first address should be stored and visible in the main wallet, but by using explorers, we found out that there is not any event on the main address, whereas the transaction on the second one is confirmed.
We may did something wrong, or we might have a misunderstanding about the correct behavior in this purpose.
Your assistant is much appreciated.

Addresses derived by an HD wallet are intentionally not publicly linkable to one-another (that would be obviously terrible for privacy). Your wallet software will know the addresses are related (ie, it derived them all from the same seed), but a casual observer will not.

Accordingly, when you pay some bitcoin to a child address, there is no associated activity involving the parent addresses.

  How to generate sub addresses belonging to one private key in blockchain.com API

You cannot. Each address derived by an HD wallet will have a corresponding, unique private key related to it. The master private key for the wallet will not be able to sign and spend any funds stored at child addresses - you need the child private keys to do that.


How do I import private keys from Bitcoin-qt to Multibit client? Question says it. I spent 20 mins Googling. Saw several links on bitcointalk.com but amazingly found no solution to this. Am I the first one trying to do this?
Note the following are not the solutions I am looking for:

Transfer the BTC from Bitcoin-qt to Multibit by making a transaction
Some commandline geeky stuff

Manual Steps

Copy your public receiving addresses from Bitcoin-Qt.
Go to the Bitcoin-Qt console: click Help/Debug Window and then select the Console tab.
Run walletpassphrase [your password] [timeout in seconds] to unlock your password protected wallet.
Run dumpprivkey [Receiving Bitcoin Address] for each receiving address to be migrated to MultiBit. There may be hidden private change addresses in Bitcoin-Qt which don't show up in the receive tab. Run listaddressgroupings.
Copy the results of dumprivkey for each address (which are the corresponding private keys).
Start the Multibit client and create a new wallet.
Click Tools/Export Private Key after selecting the Do not password protect export file option.
Open the exported file in a text editor.
Below the private key generated by MultiBit, paste the private keys you have copied above. Remember to paste them before the End of private keys line.
After each private key, add a date that is prior to when you created the corresponding wallet. (You can check this date in the Bitcoin-Qt Transactions tab and scrolling to the very bottom.)
Repeat for all addresses you want to move to Multibit Client.
Save the key file and import it to the Multibit client using Tools > Import Private Keys.
In MultiBit, you may not see your total until you click Tools > Reset Blockchain and Transactions
In order to protect yourself from theft, delete the private key files.
Done!


Guides/books on how to start a Bitcoin-accepting online business? Are there any good guides or books on how to start a Bitcoin- and fiat-accepting online business? I'm looking for something that includes going over how to found a company and deal with tax issues and other related human resources issues like payroll.

[...] how to found a company and deal with tax issues and other related human resources issues like payroll.

I don't think such sources are currently available for one simple reason: up to now the bitcoin space is mainly unregulated (including the issue of payroll).

The debate of bitcoin in the legal system is just in the beginning. It's not even that clear (worldwide) whether bitcoin is legally consider money or not. On 2014, Andreas Antonopoulos spoke in front of the Banking, Trade and Commerce committee of the Senate of Canada to address such issues of regulations. I strongly recommend you to watch the full 2hr video.

  Guides/books on how to start a Bitcoin-accepting online business?

Supposing that you are already familiar with the basics of Bitcoin, I guess the next step would be deciding how you are gonna accept Bitcoin payments. There are several ways to accept Bitcoin for small businesses. Probably, the most popular ones are Coinbase and BitPay.

If you are still looking for ideas for businesses with bitcoin, an interesting place to start is the Million Killer Apps series of James D'Angelo (Part 1 and Part 2). You might also find useful to subscribe his channel.


Why can't we fight Bitcoin thieves by not accepting payments from hacked accounts? Why won't we simply stop accepting payments from hacked accounts? We know their public addresses, right? Sure, hackers still will be able to compromise user's accounts, but at last that money won't be spendable, right?

Fungibility. Money needs to be fungible, otherwise it's not money at all.

Blacklists allow censorship and confiscation of wealth by centralized/powerful players (like governments) which will be abused to screw over innocent people Or (hopefully) scare those people away from Bitcoin in the first place: why would you invest in Bitcoin if you know you could end up on a blacklist someday?

It weakens the lesson the victims needed to learn the hard way: if you don't hold the private keys securely yourself, you don't hold the bitcoins.


What are the best practices to close and reopen channels in order to increase capacity I am new in the lightning so I opened a small channel with 50k sats to get started. After some research and try-and-error I would like to increase the capacity of this channel. I know that this is not possible and the only way to do that is to close the channel and open a new one since having a double channel with the same node is not recommended.
In the meanwhile a payment has been routed with this channel, so my local balance is 10k sats and in the remote balance is 30k (10k sats are gone on fees). If I close the channel now I will only get 10k sats minus fees. I will lose more than 80% of my initial amount!
The only thing I can think of is doing a rebalance of the channel so the most of the capacity is on my side and then close the channel. But since it only has 50k sats I cannot do a loop in (minimum 250k sats), or balance of satoshi (minimum 50k sats). Circular rebalance fails all the time. As an alternative I can create an invoice and route it to my self as described here (https://github.com/lightningnetwork/lnd/pull/3736).
But is it ok what I am doing? Is there a cheaper (smarter) way?

Routing a payment will not change your node's balance, it will just change the balance of each specific channel you have open (resulting in a net ~zero change in overall balance). You may have pushed 30k sats to the remote node's balance, but you would have simultaneously had 30k sats pushed to your node's balance in one of your other channels. You haven't lost any of the initial amount, it is just present in a different channel now.
So if you want more capacity, then you should just close that channel, and re-open a new one with the desired liquidity.
To save some money, try to do this while the network isn't busy (ie, the mempool is relatively empty).


Mining Every Last BitCoin? I’m told that their is a total number of bitcoins that can be mined, 21 million bitcoins I’ve heard. I’ve heard that the more bitcoins that are mined there is a direct increases in the level of difficulty and in resources, required to mine more bitcoins.

I’ve heard many estimates from 10 years to 100 years to mine all 21 million bitcoins.

With the unknown variable of future increases in processing power, how could anyone make a educated guess as to how long it will take?

Additionally, if it is true that Moore’s law will be ending as we currently know it due to limitations in our current manufacturing methods of Processors, then this would lend even more weight to my theory that estimating the time of will take to mine all 21 million bitcoins is a guess, at best.

Please explain if I’m wrong and what I’m failing to understand about this, as I’m pretty new to crypto but eager to learn!

Cheers!

I’ve heard that the more bitcoins that are mined there is a direct increases in the level of difficulty and in resources, required to mine more bitcoins.

You have heard incorrectly. That is absolutely incorrect. The difficulty has nothing to do with how many Bitcoin have already been mined; all that matters for the difficulty is the average time between blocks for a sample of 2016 blocks.

  I’ve heard many estimates from 10 years to 100 years to mine all 21 million bitcoins.

It is estimated that the block subsidy (which is what creates new Bitcoin) will reach 0 in 2140. The block subsidy will effectively be 0 long before that. It is impossible for all Bitcoin to be mined within 10 years as the hashrate required for that is too great.

  With the unknown variable of future increases in processing power, how could anyone make a educated guess as to how long it will take?

Blocks are mined at a roughly fixed rate. The rate is fixed by the difficulty which adjusts every 2016 blocks. The difficulty adjusts so that it takes 10 minutes to find a block, on average. So if there is a massive increase in hashrate, the difficulty will increase as well so that blocks are still found 10 minutes apart.

Since we know how long it will take to mine blocks, on average, and we also know how many blocks it takes to mine all Bitcoin into existence (6,930,000 blocks), we can predict, roughly, when all Bitcoins will be mined.


Why does each block store a Merkle root? I understand how a Merkle root is calculated and stored in the block. But how do miners verify a transaction using the Merkle root?

Here are 18 conditions that verify a transaction. None of them uses Merkle root.

Merkle roots do not verify transactions, they verify a set of transactions.  Transaction ID's are hashes of the transaction, and the Merkle tree is constructed from these hashes.  It means that if a single detail in any of the transactions changes, so does the Merkle root.  It also means that if the exact same transactions are listed in a different order, the Merkle root will also change.

So the Merkle root is cryptographic proof of which transactions are in the block, and which order they are in.  It provides a convenient piece of information to be included in the block header which is then hashed and included in the next block header.  Without the Merkle root in the block header, we would have no cryptographic proof of which transactions are included in a block, nor proof that their contents haven't been tampered with.

Using a Merkle tree is preferable over a hash chain or a hash of concatenated transactions because it allows for a much quicker and simpler test of whether a particular transaction is included in the set.  For more details, see the section on Merkle trees in the Developer's Guide.


Can bitcoin system be modded to work without internet Is it possible for bitcoins to manifest itself as  concrete currency so that it can be used as paper money ?

It depends on what you mean by "work without the internet".

There is already at least one vendor who is making physical bitcoins. That is accomplished by exposing the public key on the face of the coin and hiding the private key under a tamper proof sticker. Such a scheme still relies on the internet, however, because the value of the coins is dependent upon the internet based Bitcoin blockchain.

The actual Bitcoin protocol itself could not be modified to exist without the Internet (or some equivalent wide area network). This is because to prevent the double spend problem without a central authority you must have communication between the network to determine if a coin has already been spent. (The physical coins above essentially rely on trusting the "central authority" of the coin maker. For example, that he will not mint duplicate coins, mint coins without valid private keys, and that his tamper proof stickers are truly tamper proof.)


Double spend transactions flag the node as "bad"? I'm playing with raw transactions. It's easy to send two signed valid transactions at the same time from the same output to different addresses (making a double-spend attack). My doubt is: if I make tests like this, will the bitcoin p2p network will flag my node / IP as "bad" or I can do it normally without any consequences? Of course I am not attacking anyone else, I want to make tests with my wallets / system to see the behavior.

Your current peers can ban (for some time, not forever) your IP-address.
Just connect to other nodes in case.
The network itself can not do anything with you because there is no such thing in protocol.
Your peers do not know - are you a double-spender or you just relaying somebody's else packets.

(Sorry, my English is also very poor)


Exporting Private Keys for wallet in Multibit My computer just got formatted, and so did my wallet. I had imported the private keys from my wallet a week back. Can I just load that again into multibit, and get my bitcoins back?

I have also had several transactions after I imported it

Yes, you can. The private keys unlock your wallet, which will be synchronised to the network. You then have access to the wallet, with the bitcoins before and after the back-up of the private keys, just the balance blockchain.info says you have. So no need to have an recent back-up of those keys.


what are BTR points in Bter exchange what are BTR points in Bter exchange? Can we convert BTR into an alt-coin? If so, is there any fees they charge. How many times can I exercise this option for a particular month?

I've read through a few pages and it looks like Bter Points are used to be an incentive for trading.  Bter states that you can only obtain these by trading in CNY, however, I've never traded in CNY and my balance always changes.

I also know that they deduct points from your balance when you withdraw funds, however, reaching 0 Bter Points doesn't seem to stop your ability to withdraw.  It just diminishes your point balance.  After a bit of experimentation today, I did find a use for them and I'm glad that I did "poke" around the site.

From the menu, click on Bonus->My Dividend.  Apparently Bter pays out site dividends if you request them.  From the My Dividend site, you can request a dividend payment in CNY or BTQ.  I'm not fully sure what BTQ is, so I clicked CNY.  When you request CNY, Bter will deduct half of your points and payout a certain rate of points-to-CNY.

After obtaining about 9 CNY, I bought some BTC and used them to purchase another currency.  So... you can use your points to manually cash out a little Chinese fiat.  It's not much but it's nice if you know it's there.


Verifying transactions on a 2013 version of qt In 2013 i bought 25 bit coins and basically forgot about them. I stored my wallet on  external usb's or so i thought, when i went to upgrade block chain on a new computer the wallet on the usb was not there. So i found my old laptop and booted up bit coin, the coins are there but are unverified, i must not have completed the block chain. I have been running the old qt version for a couple days now also have an outdated warning and to upgrade. so my questions are how to verify my coins? on the old qt, do i keep it running or upgrade to new core without verification. thanks for your time.

You should first create additional backups of the wallet.dat from your laptop, as we're now talking about a significant amount of value.

Your old version of Bitcoin-Qt should be able to catch up eventually, but there have been lots of improvements, especially including the speed of synchronization but also security. A newer version of Bitcoin-Qt (now Bitcoin Core) should be at least 10× faster in catching up.

To switch to a new version, simply shut Bitcoin-Qt down, install Bitcoin Core, then copy the wallet.dat to Bitcoin's folder. It'll discover the wallet when you open and continue the synchronization.

You may also want to consider running the program on your newer computer instead, if it's much faster, the last year saw a significant increase in Bitcoin transaction traffic, so the later blocks are significantly slower to verify than earlier ones. If you're not using the computer too much, and can afford to give Bitcoin more RAM (and have enough RAM), you can speed-up the synchronization by increasing it's RAM usage by upping it to e.g. 2GiB with -dbcache=2048.

If you just want to check whether the coins are still untouched, you could look up the address on a blockchain explorer, e.g. https://blockexplorer.com/address/<your-address-here>.

If you want to spend your coins immediately, you may want to look at:

Cannot access my bitcoins because my wallet is still synchronising. What can I do to spend them immediately?

In the long term, you may want to look into hardware wallets or paper wallets to store a large sum of bitcoins safely.


Calculating number of candidate blocks Given a set of transactions, and other parameters required to create a block, how many candidate blocks are possible per second? How many of them are valid?

There is an unlimited number of possible candidate blocks since changing any one detail, either the order in which it is presented within the block or, by one bit difference will make a separate candidate block because the random guess and the hash for that block will be completely different. In practice there is usually only one candidate block in existence at a time, sometimes two. Another name for candidate block is potential tip.

Some people refer to the block that a miner is trying to mine as the candidate block, in which case every miner has their own individual candidate block that they work on until it is either a) mined or, b) replaced because a new tip is received.


What happens to bitcoins that are in a ponzi scheme wallet? I bought bitcoins that are stored in Cloud Token wallet. I found out later on that this crypto currency was part of a Ponzi scheme (shame on me). Currently I've had difficulty withdrawing my coins, and no doubt their support has vanished.

I would like to know, is there any way for those coins to be retrieved, or will they just disappear? And is this also the case for all phony crypto currencies?

If you send BTC to a custodial wallet (ie, one which you do not control the private keys for), then you no longer have control of your bitcoin (whoever has the private keys is now in control). If you send coins to a website (to buy some tokens, or whatever), then it is the website operators who now have control of your coins.

This is a well-known saying in bitcoin: not your keys, not your coins.

  I would like to know, is there any way for those coins to be retrieved, or will they just disappear?

You can ask for the coins back, but if it is a scam, then chances are the scammers will not send you anything. You could report the scam/theft to local authorities, but chances are they will not be able to do much at all.

The coins will not 'disappear', they are just owned by the scammers now.

If you buy a token / cryptocurrency that is created and maintained by some central authority, then you are implicitly trusting that the central authority will not act maliciously. This is quite the opposite of Bitcoin, in which the user can trustlessly interact with the network, depending on no third party to receive/hold/send funds.


Tracking the wallet owner of stolen bitcoins Hello Recently my bitcoin wallet was hacked and the money was transferred out into another bitcoin wallet. Is it possible to track and find out the owner of this wallet

Every Bitcoin transaction is traceable, but... unfortunately, it is not possible to determine who owns the address. Unless somebody admit to having a particular address.


Why would Nicehash payout not change while BTC doubled I am new to mining and about a month and a half ago I picked up a 1080Ti GPU and started mining with NicheHash. At that time Bitcoin was around 5800 and my daily payout was around $3.80. Now Bitcoin more than doubled and other coins followed the suit and my daily payout is still around $3.80
I am failing to understand why - any ideas?

When your mining pool finds a block, each miner is paid out according to the share of work they contributed to the pool's total work. The amount of hashrate you 'own' on Nicehash is unchanging, so if other people add more hashpower to the pool over time, you will own a smaller share of the total. Historically, the network hashrate has consistently increased over time, meaning btc returns are almost guaranteed to decrease over time for any miner.

A smaller share will pay out a smaller amount of bitcoin. So over time, you should expect to see a diminishing return (measured in btc).

At the same time, the price has increased, so a smaller amount of btc is now worth more. In your case it is just a coincidence that your payout has remained steady at $3.80.


Adding proxy to Antminer S3 Is it possible to add a proxy to an Antmner S3? I want to place the Antminer at work, but there is a proxy I have to go through. I can see where to put the DNS information, but not where to put a proxy name. Any help would be great.

I want to place the Antminer at work

Using your employer's electricity for personal gain is likely to get you into some trouble. If you have a legitimate reason to consider such a setup (for example, if your employer pays a lower, business electricity rate than you do), you can ask your employer for permission.

  I can see where to put the DNS information, but not where to put a proxy name

If you need to go through a restrictive firewall, you can try a project such as the OnionPi (Adafruit), which uses a Raspberry Pi (35$) to tunnel all incoming connections through Tor. You will need to change the Wi-Fi antenna in the original project with a USB to Ethernet adapter, as the Antminer needs to connect via Ethernet, and besides, running a Wi-Fi router inside your company's network will get you into trouble.

Tor itself can connect through a proxy with the HTTPProxy and HTTPProxyAuthenticator configuration directives. If entry nodes are on the firewall's blacklist, you can use the BridgeDB to get some circumvention servers that use encryption and obfuscation to evade blacklisting.


How to find Z value of multisig transaction? for example this transaction: http://2coin.org/txinfo.aspx?txid=6c3dc603da32bba3f56f2b33053aaf0f0f17322386c0c6846786bffe49f6ef22&cur=BTC

Script not of right size to be a scriptSig, expecting 2 but got 4

What you're asking for is how to figure out what to sign for a multisig transaction.

Multisig is actually very close to this answer. There are a few subtle differences, however, so let me try to summarize step-by-step using the transaction as seen  on the blockchain

Note that for each input, the actual hash to be signed is going to be different. Namely, you will need to fill in the redeem script for that input only and nulls for every other input. To illustrate, let's figure out what you need to sign for the very first input.

Transaction version: 01000000
Number of inputs: 03
Tx input #1 hash: fdb1fe0b4506f8d412f8498a0d747701bc5ed8c009e779ee670c82361c1d1dd5
Tx input #1 index: 01000000
Tx input #1 redeem script length: 47 (71 bytes)
Tx input #1 redeem script: 522102cebf6ab580948d146b7cc771d8e646974349d3d7b11f3e03287d0997a477d3b921037ba651485b7a2cb222191eb64a55926e62bbabfe9b5ed2a9488aad547b20428252ae
Tx input #1 sequence: ffffffff
Tx input #2 hash: a614d26f1878078a00a3c296085576cd7e6361234ea82c865681041fcfdacea8
Tx input #2 index: 01000000
Tx input #2 redeem script length: 00 (nothing)
Tx input #2 sequence: ffffffff
Tx input #3 hash: d064d2f9cf9e5196a9d81dd87718c9cfbec97f3ccac7164946d956421597c7f1
Tx input #3 index: 01000000
Tx input #3 redeem script length: 00 (nothing)
Tx input #3 sequence: ffffffff
Number of outputs: 01000000
Amount being sent to the first (and only) output: e068704600000000
Output script length: 19
Output script: 76a9142c76e6fdd1a81c902afa62e78ec71435708d9d9d88ac
Lock time field: 00000000
SIGHASH_ALL: 01000000

Now, if you double-sha256 these bytes you get:

9c4b551f37f4b383af9216045d80b2fcd4ed57bddca8df388ec29601cbd2a4f1

And indeed when you check against the embedded signature of that transaction, you can see that that is indeed the hash that was signed. Here's a code sample to verify using the excellent btcd library written in go:

package main

import (
    "encoding/hex"
    "fmt"
    "hash"

    "github.com/btcsuite/btcec"
    "github.com/btcsuite/fastsha256"
)

// Calculate the hash of hasher over buf.
func calcHash(buf []byte, hasher hash.Hash) []byte {
    hasher.Write(buf)
    return hasher.Sum(nil)
}

// Hash160 calculates the hash ripemd160(sha256(b)).
func Hash256(buf []byte) []byte {
    return calcHash(calcHash(buf, fastsha256.New()), fastsha256.New())
}

func main() {
    x := "0100000003fdb1fe0b4506f8d412f8498a0d747701bc5ed8c009e779ee670c82361c1d1dd50100000047522102cebf6ab580948d146b7cc771d8e646974349d3d7b11f3e03287d0997a477d3b921037ba651485b7a2cb222191eb64a55926e62bbabfe9b5ed2a9488aad547b20428252aeffffffffa614d26f1878078a00a3c296085576cd7e6361234ea82c865681041fcfdacea80100000000ffffffffd064d2f9cf9e5196a9d81dd87718c9cfbec97f3ccac7164946d956421597c7f10100000000ffffffff01e0687046000000001976a9142c76e6fdd1a81c902afa62e78ec71435708d9d9d88ac0000000001000000"

    b, _ := hex.DecodeString(x)

    hash := Hash256(b)
    fmt.Printf("hash of thing to sign: %x\n", hash)

    pubkeyStr := "02cebf6ab580948d146b7cc771d8e646974349d3d7b11f3e03287d0997a477d3b9"
    pubkeyStr2 := "037ba651485b7a2cb222191eb64a55926e62bbabfe9b5ed2a9488aad547b204282"
    pubkeyBytes, _ := hex.DecodeString(pubkeyStr)
    pubkeyBytes2, _ := hex.DecodeString(pubkeyStr2)

    p, _ := btcec.ParsePubKey(pubkeyBytes, btcec.S256())
    p2, _ := btcec.ParsePubKey(pubkeyBytes2, btcec.S256())

    fmt.Printf("pubkeys: %s, %s\n", p, p2)

    sigStr := "3044022025332b6dabf11e493fbc62c93e7302c48666512e1cf88157c26176f4af6d064702201ee7ec25d0917244e514c402e8751f112dfd1bef2b22ec5e496fbafabb52bf010148"

    sigStr2 := "3045022100fa1f17bf59bee0ac33ae5f682711c5471c73a4aeb898aee218478289a4c7aa6e02207b40dfeae3fa4a50dc147bd42be40370d76a35d72c0b27b27c4ba2439a565fb901"

    sigBytes, _ := hex.DecodeString(sigStr)
    sigBytes2, _ := hex.DecodeString(sigStr2)

    s, _ := btcec.ParseDERSignature(sigBytes, btcec.S256())
    s2, _ := btcec.ParseDERSignature(sigBytes2, btcec.S256())

    fmt.Printf("sig: %s\n", s)

    fmt.Printf("signature valid: %v\n", s.Verify(hash, p))
    fmt.Printf("signature valid: %v\n", s2.Verify(hash, p2))

}

You can do the same thing with input #2 and input #3 to get the hash that gets signed by changing #5 and #6 (combined) to be 00 and #10 or #14 in the steps above to be 47522102cebf6ab580948d146b7cc771d8e646974349d3d7b11f3e03287d0997a477d3b921037ba651485b7a2cb222191eb64a55926e62bbabfe9b5ed2a9488aad547b20428252ae


Why are mining pools not removing the 250 kb block size soft cap? I might have misunderstood what is happening, but looking at the block sizes it seems that most mining pools are sticking to the 250 kb soft cap, with BTC Guild being the notable exception. There are many blocks that are just under 250 kb, so I assume that pools are excluding certain fee-paying transactions to stay below the limit.

My question is, why are they doing so? Is the marginal cost of including those extra transactions indeed greater than the fee being paid? If not, what is their reasoning for acting in a non-profit maximizing manner?

The whole idea of Bitcoin is based on the assumption that participants behave rationally - i.e. profit maximizing. So what is going on here?

Some pools may still use the 250 KB cap for faster block propagation and reduced chance of orphaned blocks. If one block is orphaned you probably have to mine for 10 years to recover that loss with the extra transaction fees from mining larger blocks.

However I think many pools use a max size above 250 KB. The reason most of the blocks are smaller, even when there are more transactions available, is that they set a max size for how many KB of free or minimum-fee transactions they will include. There aren't enough above-minimum-fee transactions to fill up the blocks.


Check number of active peers a node has I saw here that you can run bitcoin-cli getinfo to see the total number of connections that a node you're running is connected to.  Is there a way to get this information remotely?  For example, say I know that IP X.X.X.X is a bitcoin node, is there a way for me to ask it what nodes it is currently connected to?  Similar to how I can getaddr it?

No, by design.

Being able to infer connection information of remote nodes would be a leak of network graph information, which is considered private.


Where does Coinify get its Bitcoins, and can I track their exchange rate somewhere? I have not found anything in their FAQ. As I understand, you can buy BTC from BTC exchanges, a place where buyers and sellers meet and agree on some price.

If I buy BTC through Coinify, where do they get them? They only list a BTC price on their front page but no source whatsoever.
Provided there is some exchange they use, where can I track the Euro/BTC exchange rate?
Do I have to make multiple accounts for each exchange with the entire verification stuff each time I want to get my BTC somewhere else?

I asked them in an email and they provided me with the following response:

  ... we use a Volume-Weighted Average Price (VWAP) over multiple
  exchanges (not CoinJar though as the Wikipedia article said) to get an
  average rate that reflects most of the BTC exchange rate market.
  https://en.wikipedia.org/wiki/Volume-weighted_average_price

and

  ...each order you make will be processed with the best exchange rate we
  can find at the moment.


Why did the core developers choose base64 for PSBT encoding? Why does bitcoind use baase64 to encode PSBT's? Just out of curiosity.

Since PSBTs can be fairly large, I wanted to use an encoding that compressed better than hex and was already in use and implemented by many clients. Base64 was already in use by other clients as signed messages also uses Base64. It also works well with command line without escaping or quoting so it seemed like a good choice.


Help! I Synced an empty JAXX wallet over one that had funds in it I got a new phone and tried to snyc my Jaxx Wallet with my old phone, because they were both Samsung S5's I downloaded the Jaxx wallet on my new phone and tried to sync it with the old one, the problem is somehow i synced the wallet that had $0 in it over the one that had my funds in it. It gave me the warning about make sure you have your 12 word key so I wrote it down but realised it was the key for the new wallet and I don't have the key for the old wallet. Is there absolutely anyway to get back to my old wallet, I wish it was easy as deleting or undoing what I had done to uncover my old wallet. I know most say it is impossible but I have heard of people recovering lost coins and I fell because I still have the device the wallet was on surely there is someway to access it.

Without the 12 word phrase, there is no way to recover your coins. So you must do everything you can to try to recover those 12 words.

It sounds like your new phone created a new wallet upon startup, so the 12 word phrase will not be recoverable from there: you'll need to work with your old phone.

If the old wallet file is still on your old phone, then its no problem. Just open up the settings, and copy the phrase from there.

If the old wallet file was overwritten on your old phone, then you'll want to explore options to 'revert to a previous state', if you have a cloud backup service enabled this may be possible. If no option exists like this, you could explore professional data recovery options, but these will likely be expensive.

Best of luck


When should an individual or business file a SAR with FinCen? In the United States, both Individuals and Businesses are required to file a Suspicious Activity Report (SAR) with FinCen when:

Individuals who transport more than $10,000 into or out of the United States1
Shippers and receivers involved in the transfer of $10,000 into or out of the United States.
Businesses that receive more than $10,000 in a transaction or in related transactions1
People who have control over more than $10,000 in financial accounts outside of the U.S. during a calendar year

Question

How could these rules be interpreted when dealing with Bitcoin? (please contrast conservative and non-conservative viewpoints)
Since Bitcoin's value varies, does that mean that a declaration is required when the price exceeds a certain amount?
What is considered as "transporting" into and out of the United States?
Is simply running a Bitcoin QT client considered a "money services business" and is subject to FinCEN requirements?  If my wallet is hosted, does that mean they are responsible?

While bitcoin may seem to be useful as an offshore bank account, it likely won't be subject to the FBAR reporting requirements.

Now if you have fiat (e.g., USD) funds at an exchange that is not in your own country (e.g., Mt. Gox) and those funds exceed $10,000 worth then possibly that could be something where an FBAR filing might be required.

So having $10K or more at an exchange might be reportable but having $10K worth of bitcoins may or may not.

An excerpt from someone who studies this topic:

  The critical issue is whether a wallet constitutes a financial account
  and if a wallet constitutes a financial account then what constitutes
  signature authority?


Sent Bitcoin to Bitcoin Core Wallet before it finished "syncing with network" So I bought some bitcoins and sent it to my Bitcoin core wallet before it finished syncing with network, will the transactions come through once it finishing syncing or have I lost them?

Yes everything will be normal, the bitcoin will reach your wallet once it downloaded the block your transactions was included in :).
Just wait patiently .


Where could I sell micro BTC and is it possible? I would like to know if is it ok to sell micro BTC? Like a few decimal places like 0.01 BTC? And where would I sell it to exchange for other currencies? And how do I get the exchange safely?

The smallest part of a bitcoin is (currently) called 1 satoshi, and it is equal to 0.00000001 BTC. So selling 0.01 BTC is no problem on any exchange, you only have to take into account the fees which are asked by the exchange. If it's a percentage (as it usually is) you're fine.

If you want to sell you can use big sites like bitstamp, coinbase etc.
To trade for other cryptocurrencies you can use btc-e, kraken, cryptsy, ...


Can a 2 of 3 multisig transaction signature be revoked before it gets confirmed by the miners? The reason I'm asking is because I want to know if 2-of-3 can be used by two parties as a way for one party to pre-commit to purchasing something before they actually do. For example, suppose Alice is selling her old car for 2 BTC, and Bob has said over the phone that he'd like to buy it. When Bob shows up and pays, naturally Alice wants to wait for at least 1 confirmation just to make sure Bob's not pulling a fast one on her and trying to double-spend the coins back to himself.

It's inconvenient to have Bob wait around for 10 minutes (and possibly an hour or more if mining luck is really low, or if Alice wants more than 1 confirm). So instead Alice creates a multisig address that Bob sends money to, and the transaction to the multisig addresses gets 1+ confirmations before he shows up, then Alice signs it. Once Bob arrives to inspect the car, possibly changing his mind but otherwise deciding to go through with it, he broadcasts his signature and drives away.

Does Alice need to wait for 1+ confirmations of Bob's signature to be sure she'll get the funds before letting him leave? She may want to verify that blockchain.info sees the transaction just to make sure it has been broadcast (as Bob's phone or whatever might be conveniently offline when he 'broadcasts' his signature), but having done that, is there any danger left?

The problem is that you can't broadcast just a signature. You can only broadcast a complete transaction with enough signatures to make it valid. Likewise, there is no way to revoke a signature. The only way to "cancel" a transaction is to broadcast another transaction which spends the same input as the original transaction. After that, there is a chance that the new transaction will be confirmed instead of the old one.

There is no point in having 2-of-3 address if there is one person who has 2 keys. That person can spend any money from such address, and the person who has the third key can't spend anything without the other person's assistance. In your scenario, Bob can double-spend his payment before it is confirmed by using both of his keys.

To solve the problem, you need to use such an address that Alice's signature is required to spend from it. For example, 2-of-2 address will work. To make sure that Bob can have his money back if the deal doesn't go through, you can use the approach described here.


What user data has been leaked from MtGox's database during June 2011 hack? What user data has been leaked from MtGox's database during the June 2011 hack? Is the database still available for download anywhere, like it was almost a year ago?

It was details of 61016 user accounts as a CSV file with fields UserID,Username,Email,Password.  The passwords are hashed, and most of them salted too, but some (the oldest) are simple md5 hashes.

I just tried searching google for it and was unsuccessful.

I have a copy, and could make it available for download but don't know if that would be legal.  I'm guessing not.


How are Electrum addresses connected to my private key? I've started using Electrum and created my first wallet. I saved the private key seed on a piece of paper.
I also created a new address by going to the Receive tab and clicking "New Address". I successfully used that address to transfer my coins from my exchange, and they show up in Electrum under the Coins tab. I did this twice successfully with 2 different addresses on the same wallet.
What confuses me is this: how did Electrum create a new address? How is that address related to my private key/seed? When I go to Wallet Information the Master Public Key is completely different from the public keys of the addresses I used in the transactions. If I use a different computer, and I enter my seed phrase into Electrum, will it find my coins? If so, how does it do that based on just my private key?
Thanks.

how did Electrum create a new address?

Electrum, and most modern wallets are Hierarchical Deterministic (HD) Wallets. They derive a series of private-keys from the "master private-key".
If you always start with the same seed phrase you get the same master private-key. Electrum uses its own unique method for seed phrases. Most wallets with seed-phrases use a different method described in BIP-39
If you use the same "derivation path", your wallet will always generate the same sequences of private-keys (that is the "deterministic" part) from the master private key.
Different wallet developers sometimes use different derivations-paths. But many of the wallets these developers produce allow the user to specify the derivation-path as part of initial configuration - this allows for compatibility between wallets.
For each private-key there is a public-key. Each public-key corresponds to a Bitcoin-address (in the commonest types of Bitcoin transactions).

References

Electrum Seed Phrases

Bitcoin Improvement Proposal 39

Deterministic Wallets

Bitcoin Improvement Proposal 32

Extended keys


block explorer, just a parser and database query? I am thinking about the 'science' of block explorers

When I go to a block explorer and view an address, I see a list of transactions in that address and current balance

Is this technically just the contents of each block being stored as they are created (or retroactively parsed) and assigning a database entry for each new element found in that block?

Or even storing every unconfirmed transaction's data as well?

Writing this out, I think I answered my own question, but maybe there is some more efficient or clever thing going on here

Yeah, that's how they work. For example, blockexplorer.com gets blocks from Bitcoin Core via JSON-RPC, gathers interesting chunks of data, and puts this data into a SQL database for easy access later. The code for this is only ~300 lines long (though it's very messy). Other block explorers work similarly. In fact, Bitcoin Core itself works something like this, though it uses a key-value database instead of a relational database, and it doesn't store any info about addresses.


How can I mine dogecoins on debian? How can I mine dogecoins on debian? I have tried to compile cudaminer but I can't find out how to install nvcc.

Definetly! Dogecoin uses the Scrypt algorithm so that means any Litecoin tutorial can be used as a drop-in replacement tutorial. Just be sure to use the proper pool address and port.

A google search brings me this nice looking guide:

Debian 6.0.7 - GPU Miner install guide


Can I import wallet words more than once? I am trying to transfer my electrum wallet, which was imported from
MultiBitHD. I just found out that Electrum is not compatible with other wallets since it doesn't use a BIP39 seed. Can I use my old MultiBitHD wallet words although they have been used for recovery once?

If you are sure the old wallet has not been compromised, you can use the old BIP39 seed again. The seed represents the private key that stores your coins so using it once does not make it invalid since the point is to be able to recover your coins with just the seed.

On the other hand, it shouldn't be too hard to generate a new BIP39 seed that you can use and be sure isn't compromised.


Miners selling bitcoins I would like to know if Miners can sell their bitcoins only on the exchange markets and privately or they have other preferred channel to add them in the "market"?

Their bitcoins are no different from any other. Most miners mine in pools where the pool operator initially gets the new bitcoins. Effectively the first thing he does is split them up among the (thousands of) pool participants. They do with them whatever they like.


in the white paper you have 2 sides : attacker and honest node What does it mean that there is either the attacker or honest node.
This means that within 10 minutes either attacker or honest node mines a block but what about neither OR another side ? How could this be interpreted ?

Does it make sense or what is interpretation of neither attacker nor honest node succeed in finding a block ? What would that mean for the consensus rule that there is a third side ?

This is open to interpretation, but this is how I see it.

Honest Nodes

Accept the blockchain history and do not try to retroactively modify it.

Attacker Nodes

Nodes that try to change data in past blocks and recalculate the proof of work. Note:

  To modify a past block, an attacker would have to redo the
  proof-of-work of the block and all blocks after it and then catch up
  with and surpass the work of the honest nodes. See Bitcoin Whitepaper pg. 3

51% Attack

The reason this is important is because, theoretically if more than half of the nodes on the network are trying to attack the blockchain, they might succeed and effectively gain control because collectively, they can compute the proof of work faster.

  Does it make sense or what is interpretation of neither attacker nor
  honest node succeed in finding a block ? What would that mean for the
  consensus rule that there is a third side ?

I'm not sure what exactly you would define as a "third side", but if, for example, there was a third group that was not "honest" it would be considered another attacker. Now, if the third group is not attacking the blockchain in the same way as the other attacker group, that could split the chain into 3 different forks: 1 "honest" chain, and 2 different "compromised" chains.


Sending transaction with Python + raw protocol Two days ago I've found a few articles, about using raw bitcoin protocol, and now I'm still trying to send a transaction.

My code is based on this class, and
if I understand all of this bitcoin magic right, I need to sign my raw input transaction with the private key for address 1LwPhYQi4BRBuuyWSGVeb6kPrTqpSVmoYz and add my public key right after it - and it will be a valid unlocking script?

Here's a part of my code, which I have completely copied from the previous link:

tx_in_count = struct.pack("<B", 1)
tx_in = {}                                                                                tx_in["outpoint_hash"] = flip_byte_order(previous_output_hash).decode("hex")
tx_in["outpoint_index"] = struct.pack("<L", 1)
tx_in["script"] = ("76a914%s88ac" % private_key).decode("hex")
tx_in["script_bytes"] = struct.pack("<B", (len(tx_in["script"])))
tx_in["sequence"] = "ffffffff".decode("hex")

I'm not sure about tx_in["script"] line, because there is nothing about signing transaction or public keys, so probably it's the reason for my failures.

Thanks for any answers :)

First, if you want to learn how to construct a raw transaction, you should really go to this question: Redeeming a raw transaction step by step example required

Second, the tx_in needs an outpoint_hash, which is the hash of the previous transaction you're spending from.

Third, you should never, ever encode your private key to any part of the transaction as you did in tx_in["script"]. That should stay on a secure device and you need that in order to generate the signature.

Fourth, tx_in["script"] should be the same script from the oupoint (hash, index). The specifics of the script language which is encoded in hex (76a914...88ac) are OP codes you should study (see link above).

Fifth, this library does the signing elsewhere as script_bytes needs to be the actual public key and signature.

I think you'd find it easier to understand using a slightly more standard python library like pycoin (https://github.com/richardkiss/pycoin) or pybitcoin (https://github.com/blockstack/pybitcoin)


when does an address shows on blockchain? I have a ledger wallet which generates several public keys/addresses. Without having used any of them, some of them are shown in blockchain.info whereas other produce an "Unrecognized search pattern" error. Why does that happen? All these addresses come from the same master key.

Are you sure that you are checking Bitcoin addresses with blockchain.info (a Bitcoin address from a Ledger Wallet starts with a "1")?

If there has not been sent any bitcoins to an address, then blockchain.info will show it without any transactions and a balance of zero. It should never say "unrecognized search pattern".


On a shared wallet, if one of the recipients deleted their wallets off their phone, is there a way to rejoin? We only had one 12 word backup for the main holder on their phone. The second person, on their phone didn’t get one(me). That I know of, I guess. But I deleted the wallet by accident. Now, is there a way to get back in there as I am the second co-signer and kind of need to have access to the wallet. The first person is trying to send me wallet invites, etc, but I really don’t get it. It’s not working nor do I have the knowledge of this app. I just know for sure he had set it up so both of us needed to agree to use it or spend it. Now, I don’t even have access to the wallet and we can’t figure out how to get that back. Are we out of luck?

Any money sent to a 2-of-2 multisignature address will be forever inacessible if one of the private keys is deleted (e.g. by uninstalling the phone app that holds them) and no backup was made and no recovery phrase was recorded.

There's a common aphorism that circulates in the bitcoin world in various forms, sometimes described as Bitcoin Rule 0

No private keys -- no Bitcoin
Not your private keys -- not your Bitcoin

The latter refers to web-wallets where the wallet-provider business holds the private-keys and their customers do not, or where an online "friend" creates a watch-only wallet for you. The first form of the aphorism is apt here.

One fifth of Bitcoin is permanently lost


Chain with most proof of work - hash target or block header hash? What is calculated towards the sum of PoW of the chain? Is it the target difficulty that has been met or is it the actual block header hash?

Say the target is 000000ABC00000000... and I mine block with hash 00000012300000000... - do I count 000000ABC00000000... amount of work for my block or do I count 00000012300000000... ?

In other words: if someone else mines a block at the same time, extending the same chain as my block (i.e. natural fork) and his hash is 00000002300000000... is his chain's cumulative PoW greater than mine or are we same?

It's the sum of difficulty targets, not the individual difficulty scores. Therefore, two blocks at the same blockchain height are always the same cumulative difficulty¹.
If it were individual difficulty scores, it would make chaintips more gameable, e.g. a block with a particularly low hash might prompt a selfish mining attack because the attacker could expect that their chaintip will outdo another even when they reveal the block later, or miners might continue mining at the same height because an already discovered block barely met the difficulty statement. In other words, the blockchain would converge less reliably if it was based on individual block scores.

¹ Unless we're in a longer blockchain fork across a difficulty reset which changed the difficulty by different amounts for the two chaintips.


How to generate a bitcoin address from a hexadecimal private key using openssl in swift I have an iOS app which can generate Bitcoin private keys in either a hexadecimal or base64 output.  I'd like take the resulting private key and generate the Bitcoin address from it.  I've included the openssl library in my project but am confused as to which methods I should use and how to reference opaque pointers that come along with openssL methods when using them in swift.

I wanted to put this as a short comment, but it get’s unreadable. I also don’t go into segwit.
I am not clear on your question: are you looking how to use the OpenSSL library for iOS (then this might not be the right forum - review of parameters to an OpenSSL library is not bitcoin specific...), or more at the conceptual steps to come to an address? Then read on:-)
Searching for OpenSSL and keys in the forum reveals lots of hints on how to use OpenSSL at the command line. I put here some links, that I find useful for creation and conversion of keys:
Bitcoin Address generation
What are steps 4-9 in bitcoin address generation for?
Then you‘ll have to go some additional steps, as described in bitcoin wiki.
And finally, if you want to check the addresses, this is a useful page:
http://gobittest.appspot.com/Address
Let us know how it goes, and see where we can bring you to your goal!


Less bitcoin recived in zebpay My friend transferred 0.00369135 BTC from coinbase to my zebpay , but i received only 0.0028 BTC . Why the difference in numbers ?

Please let me know

Thanks

That can be the transaction fee charged. Do the calculation according to the Zebpay guide and validate the received amount.

E.g when you sell/transfer bitcoin to a different address, a transaction fee is charged.

Quoted from zebpay.
Zebpay transaction fees on selling bitcoins

"You will be charged a bitcoin network fee when you send bitcoins to a bitcoin address depending on the number of bitcoins you send. Fees are dynamic and updated on daily basis. Please check your app for latest fees.


How to configure bitcoind to wait for X confirmations to make the payment submitted I'm using bitcoind for an ecommerce website. Walletnotify setting in bitcoin.conf only fires twice (once the payment appears on the network and then when the payment is confimed the first time by a block).
The issue is that i need to set the number of confirmations before the payment is submitted. Could you please give me some help on how to proceed?

You could use the listunspent RPC command. It takes a parameter which allows you to filter out UTXOs which have less than X confirmations.
Example (from the manpage):
bitcoin-cli listunspent 6 9999999 "[\"bc1INVALIDq09vm5lfy0j5reeulh4x5752q25uqqvz34hufd\",\"bc1INVALIDq02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"


Get private key from BigInteger I have a BigInteger that represents a private key. How can I get that private key as a base58 encoded string? The following pseudo code does not work properly:

base58.encode(bigInt.toByteArray)
// yields a string that differs from given bigInt's private key

UPDATE

def fullDoubleSha(bytes: ArrayOfByte) = {
  val digestSha = MessageDigest getInstance "SHA-256"
  digestSha digest digestSha.digest(bytes)
}

def getPrivBytes(key: BigInteger) = key.toByteArray match { case keyBytes =>
  val res = if (keyBytes.head == 0) keyBytes drop 1 else keyBytes
  new Array(32 - res.length) ++ res
}

def privBytesToWif(vs: ArrayOfByte) = {
  val rawPrivKey = Array(0x80.toByte) ++ vs
  rawPrivKey ++ fullDoubleSha(rawPrivKey).take(4)
}

The base58 private key format includes an SHA256-based checksum.  See this answer for details (disregard the part of the question where the private key itself is the SHA256 hash of some other data).


How to run QBitNinja Server locally? I have written a simple program that determines the available balance of a Bitcoin wallet, but it used the public API for QBitNinja at http://tapi.qbit.ninja, and everything is working fine, but I wish to run the QBitNinja server locally on my PC. I have Bitcoin-QT / bitcoind installed and fully updated with the latest blockchain data, NBitcoin installed in my project, as well as the QBitNinja client libraries. However, try as I may, I cannot seem to figure out the steps needed to get the QBitNinja server running locally, connecting to bitcoind / Bitcoin-QT. Any assistance would be greatly appreciated. I am running Windows 10 Pro, and IIS Server that comes with Windows 10.

No, it is not possible. QBitNinja is too tightly coupled with Azure, that means vendor-locked. See this issue for a recent attempt to decouple it.


Why is my phone app wallet showing true balance and my web wallet showing 0 balance I downloaded my wallet app to my phone my online wallet shows 0 balance my phone app shows true balance why isnt my online wallet showing same balance as phone

I had to send him a fee of 1300.00 in order for him to proceed...he hasnt been back in touch since.

You are the victim of a scam.

  My account Mgr ... got me to download the blockchain app on my phone

I suspect he may have got you to import an address also.

Can you tell whether the app on your phone has a "watch-only" address? If so, your crooked "account manager" will probably tell you to pay him some large sum for a private-key. If so, this also is typical of a scam.

  My Account Manager is James Patrick from kryptosmart247

The domain name kryptosmart247.com was only registered a month ago using NameCheap. Inc. Their webpage contains spelling mistakes like "Mointor Your Trade". Their website looks exactly like that of 24cryptostar.com. Same "Seth Trevor" etc photographs. I suspect one or both websites are just quickly set up copies of something generic.

In other words, to me this does not look trustworthy.

  You can find me on FB I will let you take the lead on this one

Unfortunately, this is the kind of thinking that lost you your money. You don't need to trust random strangers who approach you on the Internet. I expect chytrik is a decent person but you just advertised to any crooks reading this that they can get money out of you by impersonating him.

I think you should report your kryptosmart247 experience to the police but should not expect to get any of your money back.

See

How can I safely store and trade Bitcoin and other crypto currencies?
I am new to Bitcoin, how can I get started?
Getting started with Bitcoin


Is it a bad idea to use a bitcoin wallet address in a domain name or URL? Aside from it forever being public and kind of marrying a business to a wallet.

If you mean as part of a URL or domain name, then yes, I think it's a bad idea. If your private key is somehow compromised (eg through a stolen or hacked PC) you may no longer want to use that address, but your users may have it in their bookmarks for years afterwards.

However, as long as it didn't have any particular meaning (such as being accompanied by an instruction to donate to that address), it may not cause any harm. Secondly, it's easy to redirect a user's browser to a new page if you need to.

Usually URLs are best kept short unless it's a sub-section of a site used for sharing or bookmarking. Keeping them looking like words (as much as possible) helps with usability, so unless your vanity address is the longest ever generated and you want to show off, I can't see a good reason to include it there.


To use Dwolla with Mt. Gox I need to become Verified. Do I need Apostille? Mt. Gox now requires at least Level 1 Verified in order to deposit or withdraw Dwolla funds.

Level 1 says Government Photo ID + utility bill

http://en.bitcoin.it/wiki/MtGox#AML
https://support.mtgox.com/entries/20919111-aml-account-statuses

But then I see an update saying an apostille is needed.  Is that just for a Level 2 (Trusted) account?

http://support.mtgox.com/entries/20861901-changes-to-aml-policies

An apostille is only required for level 2. Their original announcement of the change was confusing, but they have since clarified it on the forum - https://bitcointalk.org/index.php?topic=60074.msg716245#msg716245.

Edit: You also need a bank account linked to your Dwolla account that has been verified over 30 days.


Is possible to send transactions with blockstream satellite? Noob question here. Is it possible to send bitcoin transactions using Blockstream Satellite node or is it used only for receiving blocks?

No, communication is unidirectional, you can only receive the data which is broadcast by the system. The satellites being used are TV relays, the uplink essentially being amplified and re-broadcast without any knowledge of the content.Transaction broadcast needs to happen by terrestrial services like a cellphone network, dialup modem, or just the regular internet.


What exactly does the scary option "Allow incoming connections" do in Bitcoin Core? Software authors seem to enjoy consciously freaking me out by having vaguely or entirely uncommented options in their software with very ominous labels.
In Bitcoin Core's settings, it says "[X] Allow incoming connections", which has an entirely meaningless "elaborate description" on hover which just repeats what it already said with a couple more words: "Accept connections from outside."
What does this actually do? My first thought is that this enabled-by-default option somehow allows people from all over the world to connect to my computer and freely grab Bitcoins from my wallet.dat and look through and download files from my computer. Naturally, it doesn't mean that, but the way it's so vaguely described does not make me feel good, to put it that way.
My serious guess is that it has some kind of hard to understand technical explanation, but why is it an option to begin with if it's crucial for Bitcoin to function? Is there some privacy/security benefit to me unchecking it? Does leaving it on pose some sort of privacy/security threat*? Why is it an option?
(* Usually when you ask that kind of question, people will lie to you and claim that there is no security/privacy issue, when in fact there actually is. For example, PHP developers told me that there's nothing lost by keeping the expose_php and other configuration options on, but to me, there definitely is as it sneakily lets the world know that you use PHP and even which version. It seems that, whenever something is bad for users, but good for the authors of something, they claim that it doesn't pose a security/privacy threat.)
Would appreciate some clarification.

There are two ways by which bitcoind connects to peers.
The default is purely outbound connections - the node will use DNS seeds, as well as its own database of previously seen peers, and attempt to establish connections to them as needed (upon startup, or when existing connections are closed).
Allow incoming connections allows you to return this favour - it lets other peers initiate the connection to your node, instead of all your connections only being with peers where your node initiates it (of course, on the other side of those connections, is a node with Allow incoming connections enabled).
These peer connections are used for syncing network state, such as blocks, transactions, and information on other peers.
Barring a catastrophic flaw in bitcoind's implementation, this is not a security risk.
Depending on your network setup, you may need to enable port forwarding in your router and/or local machine's firewall before enabling this option has any effect.


What is "Rate" on crypto exchange? I use bittrex api and python for trading.

I am interesting about lowest Ask and highest Bid prices on the pair.

In this example:

I want to sell XRP on 0.00008215 price and on 0.00008245

What RATE I would pass? 1.0, or 1.1 or different? And what for lower prices?

What is this number exactly mean?

The rate (of exchange) is just the price for your order.

According to their documentation, when you create a buy or sell order, you need to specify the market, the quantity, and the rate. The market specifies the currency pair. For example the market BTC-XRP specifies BTC as the "quote currency" and XRP as the "base currency". The quantity specifies how much of the base currency you want to exchange. The rate specifies the quote price at which you want to exchange.


How to estimate the amount of transactions that belong to exchanges? Can we estimate how many transactions (both incoming and out) belong to exchanges?

This can either transactions per time unit (block, day, month ...) or transactions/total

Not easily nor with any guarantee of accuracy. Since exchanges use unique addresses for each deposit, it is very difficult to know what addresses are under their control until they actually move the coins. Without knowing what transactions belong to exchanges, we can't know how many transactions are being made and how much is being transacted.


How can one know which way mining pools will vote for P2SH? Is there a list somewhere showing how each mining pool will vote on the P2SH question?

and

If a pool says that it is voting one way, is it possible to independently verify that they are indeed voting that way with their mining power?

You should check out this page:

http://blockchain.info/p2sh

If you want to verify if a given pool operator has indeed mined the blocks for the votes, he or she can sign some message with the private keys corresponding to the public addresses that were the recipients of the block reward.


I didn't receive a Bitcoin Payment. What does it mean when the Client is synchronizing? Bitcoin newbie here. I recently installed the Bitcoin client, and purchased some bitcoins from Mt.Gox. My problem is that my client is constantly synchronizing. I've checked charts and seen that my Bitcoins were successfully purchased, but my client seems to be stuck "Synchronizing with network". I've just got a constant loading icon in the bottom right, and when I hover over it it says it's "catching up". As I said, I'm new. Is this normal? Can someone explain what's happening? Thanks!

This is probably normal. "Synchronizing with network" really means "downloading the block chain", and it can take a few hours to a day.

Following the "catching up" you should see the number of blocks already downloaded. At the time of this writing there are 220,000 blocks, when it reaches that you are fully synchronized. If the number keeps increasing you're probably on the right track.

You can speed it up a bit by forwarding port 8333 on your router (not very important, if you don't know how you don't need to bother).


can I use elements of the blockchain to protect the integrity of a leaderboard without central servers? For a World of Warcraft community feature conception contest I've come up with something that involves a leaderboard. However, World of Warcraft addons are purely individual, so a centralize platform where a leaderboard is usually saved is not possible. Because of this, it would be trivial to fake the sending of leaderboard updates to the community.

I've been reading about the blockchain recently, and it seems like this might be a way to fix this. The blockchain can protect the integrity of Bitcoin transactions, so it seems like it might protect this. However, I'm not 100% sure.

My main concern is to avoid people abusing the leaderboard by giving themselves extra points. However, Bitcoin transactions are usually between 2 parties. Could the blockchain work with only positive transactions that only involve a single party?

Technical explanation: The general concept is that users can get points for completing certain challenges and compete with each other on a constantly updated leaderboard, similar to how some multiplayer games have a list of best players (cfr. Diablo 2). There are no rewards linked with the leaderboard beyond bragging rights.

The problem, however, is that leaderboards are susceptible to manipulation by malicious players unless they have enough verification that people actually achieved what they said they did. Most games fix this by having the leaderboard being hosted on a remote server where the game tells the server what happened and the server checks if the client could have done that.

However, in World of Warcraft, addons are local-only: you cannot configure an addon as a server to receive messages and do central validation. You can send messages from one addon client to other clients via a central addon message channel, but you cannot say "only send messages to this client", because the channel is not secured and any addon can register to listen to a channel. In addition, addons are written in human-readable LUA code and may not be obfuscated.

Because of this, it's easy for a malicious user to manipulate his addon and just spoof the messages. Or even write an addon that will send an autocomplete for every newly generated challenge. This is the problem with distributed leaderboards, they are easily manipulated because there is no verification of integrity.

However, from what I understand, Bitcoin has managed to fix this issue through the blockchain. Transactions are publicly logged, community consensus is required for transactions to be completed and the final state can by verified by anyone. However, the Bitcoin blockchain handles transactions between 2 parties, so there is always 2 sources for each transaction. Because of this, it's unlikely for any single user to be able to manipulate the blockchain.

However, with leaderboards, there are no multiple parties in a transaction. Each transaction is just a player receiving challenge points locally based on something that happens on their machine. So there is no second party that helps against manipulation. This is one of the reasons why I'm concerned the blockchain might not work for this.

Is there an aspect of the blockchain that can help defend against this? And if not, (although somewhat off-topic) is there a different method that could help defend against forgery?

In general, as mentioned in the comments. Your problem in these games resemble a Byzantine Generals Problem where you may experience non-compliant/malicious actors in the network. To achieve consensus in this context, there are multiple avenues.

Firstly, there's Bitcoin's approach. Bitcoin enables every full node to perform independent verification of the Blockchain. The Blockchain is simply a store of a series of past events leading to the current state. Where "past events" (i.e. transactions) are stored in Blocks and the "chain" refers to the hard requirement that each subsequent block is required to be dependent on the previous block based on a set of requirements. Access to the write permissions to the Blockchain is governed by means of Proof-of-Work, where you must burn CPU cycles to create a new block which implicitly grants you a write permission to append to the Blockchain. A key difference here is that the Proof-of-Work need not be done in a collaborative manner as it is a Poisson Process, meaning my chances are just as good as anyone else's, assuming that everyone has the same hash power. In other election algorithms, you may have to negotiate collaboratively and it is not necessarily fully byzantine-failure tolerant.

So how can some elements of this be applied in your gaming context is left for you to decide. But in principle, yes, elements of Bitcoins are applicable in the context you've described, but again I'd reiterate, it is somewhat "overkill". Maybe in the context of the game, you'd set the leaderboard to have some condition that requires some proof of some action that proves that the player has actually done something to mutate the leaderboard? Otherwise, it'd probably be simpler to do it in Lockstep as in RTS games.


Hedging against the bubble popping - where's the leverage? My friend has a rather large store of bitcoins that he bought about a month ago. I think it makes sense for him to hedge his recent gains, since the price run up looks like a bubble.

What is a high leverage way of doing this?

I looked at ICBIT but the counter-party risk in the face of a market blowup is large.

I was thinking Intrade, but they are apparently blowing up. Settlement in fiat preferred. My friend lives in the US.

Like @David Ogren suggested, you are just supposed to sell part of those coins.

Dunno why are you trying to make it so much more complicated.


How can I find out the address my payment will come from? Can I find out the address I am going send from before making a payment? And could this be useful for merchants that want to identify my transaction?

There is a patch for the client available to let you choose specifically which addresses to use when spending.
 - http://github.com/bitcoin/bitcoin/pull/415


What encryption does Electrum use for private keys in wallets? Electrum can encrypt the private keys in wallets with a user entered password. But what encryption algorithm is used? I'd hope it is reasonably strong crypto. I've looked at the Electrum docs and can't find specifics.

Electrum uses AES-256-CBC to encrypt wallets.  The key is sha256(sha256("your password")).

Electrum wallet source:
https://github.com/spesmilo/electrum/blob/master/lib/wallet.py

slowaes library:
https://code.google.com/p/slowaes/source/browse/trunk/python/aes.py


Can I update my channel state with another node signing offline in person? I create a channel with someone I know in person.  We both lose internet connection.

Can we transact in person with one another signing each others transactions and maintaining our channel states that way?

Yes that is possible. The channel updates are following BOLT 02 (peer protocol) and parts of BOLT 03 (transactions) and BOLT 05 (on chain). All of these things are solely negotiated between you and your peer / channel partner and could happen in an offline world or even on a sheet of paper. (not saying this would be particularly useful) I am also neglecting the regular protocol mates here that are send via the transport layer and noise protocol framework ( BOLT 08 and 01)

Generally as long as you don't have a (force) close the exact channel state is a private matter between you and your peer. This is a design principle within lightning.

Keep in mind that what you asked and my answer is only of theoretical nature. I don't think it would be very practical to actually do that in a way so that it is compatible with actual software state.


why is BnB coin selection algorithm not enabled by default? BnB is one of the best coin selection algorithms existing and its implementation is in the Bitcoin source code. But as seen from this line: https://github.com/bitcoin/bitcoin/blob/f72d80b07af8ecbb2f9df1e87344eb465186f19d/src/wallet/wallet.cpp#L2403 it is not enabled by default. Why is that or have I been mistaken?

You're misunderstanding the code. That variable tracks whether BnB was used. Not whether we attempt to use it.
BnB does not always yield an acceptable result, as it requires a solution with no change to exist. It is attempted, but if no such solution can be found, Bitcoin Core's coin selection falls back to other algorithms. The bnb_used variable remembers whether that was the case.


How can I consume my whole bitcoin balance in a single transction? Is it possible to use multiples UTXOs in a single transaction? I want to make use of a single bitcoin address for payment. I'm using bitcoinjs library's transction builder for creating my own transaction. Can anyone help with a proper code to use multiple UTXO's in a single transaction? Is there any function which can automatically select the no. of UTXO's to be consumed depending on the output transaction value to be sent?
Thank you.

Of course, you can add as many UTXO's as will fit in a block. In fact, you usually have to because you don't always have a UTXO for the exact amount you are trying to spend. Note that more UTXO will result in a higher transaction fee because the fee is based on the current market fee rate (satoshi/kB) and more UTXO increases the kB.

For example, check out this transaction, it uses 7 UTXO as inputs.

See Bitcoin Wiki - Transactions