text:
Is there a way to determine whether a specific point on the secp256k1 curve is a valid Bitcoin public key?
Let's first define a valid Bitcoin private key as a number in the range of [1, 115792089237316195423570985008687907852837564279074904382605163141518161494336], and a valid Bitcoin public key as a public key derived from a valid Bitcoin private key.
Then my question is: Is there a way to determine whether a specific point on the secp256k1 curve is a valid Bitcoin public key?

The secp256k1 curve has cofactor one, so every point on the curve can be written as a multiple of the generator. As a result, there are exactly as many points on the curve (excluding the point at infinity) as there are valid (nonzero) private keys.
In short: yes, every point on the curve is a valid public key.

The point K = (9166C289B9F905E55F9E3DF9F69D7F356B4A22095F894F4715714AA4B56606AF, F181EB966BE4ACB5CFF9E16B66D809BE94E214F06C93FD091099AF98499255E7) is part of the secp256k1 curve, but it's derived from an invalid private key (FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF), such that according to the definition in my question, the point is not a valid Bitcoin public key. Question that remains: is there a non-brute-force way to determine such validity of a public key?

@drogos86 That point also has corresponding (valid) private key 0x000000000000000000000000000000014551231950b75fc4402da1732fc9bebe. The restriction for private keys to be in range 1 to 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 is simply to make sure there is exactly one private key for every public key, but beyond that, private keys act "modulo" the size of the curve.


text:
Can secp256k1 have different parameters and still be called secp256k1?
The secp256k1 standard (as defined in https://www.secg.org/sec2-v2.pdf, section 2.4.1) has a set of recommended parameters.

Is there a particular reason why these parameters are just 'recommended', and not 'required'?
Are we still talking about 'secp256k1' if different parameters are used?

The SEC2 document recommends the use of a number of curves. One of these curves is called secp256k1.
The recommendation doesn't refer to the parameters. What is recommended is the use of the secp256k1 curve and the parameters are integral to how the curve is defined. If you use any other parameters, you can't call it secp256k1.

source: Stack Exchange

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

sort: votes


text:
What is the different between CompactSize and VarInt encoding?
Pieter Wuille's definition of CompactSize encoding seems to match Greg Walker's definition of VarInt encoding, yet the BitcoinWiki claims that CompactSize is not to be confused with VarInt.
What, if any, are the differences between the two encodings?
Or are they simply the same thing?

There are two distinct variable-length integer encodings implemented in Bitcoin Core's serialization framework:

The encoding used in the P2P protocol for the lengths of vectors (number of transactions in blocks, number of inputs/outputs in transactions, number of entries in inv/addr messages, ...) is known inside the Bitcoin Core codebase as the "CompactSize" encoding, though it has historically been referred to in external protocol documentation as "VarInt".
Another encoding which is only used internally in Bitcoin Core, in e.g. its UTXO database on disk, but isn't used anywhere in the P2P protocol. This is referred to inside the Bitcoin Core codebase as "VarInt".

For reference, the two encodings are:

The "CompactSize" encoding (also known as "VarInt" outside Bitcoin Core):

0..0xfc: 1 byte (the value itself)
0xfd..0xffff: 3 bytes (0xfd + 2 byte little endian encoding)
0x10000..0xffffffff: 5 bytes (0xfe + 4 byte little endian encoding)
0x100000000..0xffffffffffffffff: 9 bytes (0xff + 8 byte little endian encoding)

The "VarInt" encoding (not used outside Bitcoin Core) is described inside the codebase as follows:

Variable-length integers: bytes are a MSB base-128 encoding of the number.
The high bit in each byte signifies whether another digit follows. To make
sure the encoding is one-to-one, one is subtracted from all but the last digit.
Thus, the byte sequence a[] with length len, where all but the last byte
has bit 128 set, encodes the number:
(a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1))

It results in the following sizes:

0..0x7f: 1 byte
0x80..0x407f: 2 bytes
0x4080..0x20407f: 3 bytes
0x204080..0x1020407f: 4 bytes
0x10204080..0x81020407f: 5 bytes
...

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


text:
Can a receive transaction be 0 in a bitcoind’s rpc call listsinceblock transaction returned json?
Suppose that I want to check all the valid deposits of the results of bitcoind’s rpc call listsinceblock transactions, can I found a ‘receive’ transactions with ‘amount’ as 0? Should I consider that as a valid deposit?
https://developer.bitcoin.org/reference/rpc/listsinceblock.html

I think creating zero value UTXOs would be an attack, attempting to clog Bitoin nodes.
See

What is meant by Bitcoin dust?
Questions about dust

ok thank you! Is there a minimum amount of bitcoin that should considered as valid (non attack)? I mean, if I have 1 E-10, can I consider it valid? And how much decimal can have?

I have added a link to my answer which explains the lower limit

oh, fine! Another question: is it true to consider just "receive" transactions to check only deposits?

Hi, please use the Ask Question button at top of page to ask a new question.

done; https://bitcoin.stackexchange.com/questions/113647/consider-only-deposits-in-a-bitcoind-s-rpc-call-listsinceblock-transaction-retur

Actually I don’t understand which relayfee I have to consider to calculate Dust. It seems that there is not a standard value

Different nodes can set different values. The effect is that some nodes might relay a small unconfirmed transaction and others might not. If enough nodes will relay it, it might reach a miner, the miner might include it in a block that all nodes would then accept.

Then, if a transaction is close to 0, but have more than 6 confirms, do I need to consider it?

You must choose the level of risk you are comfortable with. For very small value transactions that might be 0 (high risk) for buying a house that might be 6 (low risk)

ok thank you. For example now I'm managing a list of testnet/regtest transactions, because address start with "2" and "m" I think I could say this. In this case, I also need to avoid dust transactions?

Maybe take the [tour]? Note what it says about the purpose of comments.

but of course I'm asking clarification about your answer! I would like to clarify if dust need to be considered also for testnet transactions


text:
Same blockhash that appears more times in a bitcoind’s rpc call listsinceblock transaction returned json
Let's suppose that listsinceblocks return a json like this:
{
"transactions": [
    {
        "involvesWatchonly": true,
        "account": "",
        "address": "mzzg8fvHXydKs8j9D2a8t7KpSXpGgAnk4n",
        "category": "receive",
        "amount": 7.44,
        "label": "",
        "confirmations": 1,
        "blockhash": "f40bdab26258ff30055f90214a24fc6dcea57462535077f3c5789406e0e30072",
        "blockindex": 16,
        "blocktime": 1627657948873,
        "txid": "084752097be80c9291d554601670dc2fc265ac36ef1023519ceb8ff0b4e4995f",
        "vout": 17,
        "walletconflicts": [],
        "time": 1627657911993,
        "timereceived": 1627657911993,
        "bip125-replaceable": "no"
    },
    {
        "involvesWatchonly": true,
        "account": "",
        "address": "mzzg8fvHXydKs8j9D2a8t7KpSXpGgAnk4n",
        "category": "receive",
        "amount": 7.13,
        "label": "",
        "confirmations": 1,
        "blockhash": "f40bdab26258ff30055f90214a24fc6dcea57462535077f3c5789406e0e30072",
        "blockindex": 44,
        "blocktime": 1627657948873,
        "txid": "993c802d705255ebfc08f4642f6f676b64a4864700d7a00d15d89ca61c5333a9",
        "vout": 58,
        "walletconflicts": [],
        "time": 1627657929474,
        "timereceived": 1627657929474,
        "bip125-replaceable": "no"
    }]}

Having two transactions with the same blockhash and same address. What this means? Are those two separate deposits with 7.44 and 7.13 btc, ore it is considered like a one deposit of 7.44+7.13 btc?

Since the txid differs it represents two different transactions in the same block.

Even if the txids were identical, you could say think of it as two separate payments. In the end, this distinction shouldn't matter - what matters is how much you've received on which address.


text:
What is the reason for unusual stuck bitcoin transaction?
I have my bitcoin wallet and there is the following situation:

There is a strange transaction with 200+ inputs to the wallet A which I don't know (with low amount and very low fee). These transactions are staying unconfirmed in the network.
There is then transaction from this wallet A with 70+ outputs and one of them is the address of my wallet. These transaction is small as well with low commission. They are unconfirmed by network as well.
After these unconfirmed transactions appeared I tried to send transaction from my wallet with reasonable amount and reasonable commission (around 50 satoshi) and this transaction has been staying unconfirmed for the last 24+ hours. Can the root cause be these weird small (with low commission) transactions to my walled? I tried to send another reasonable transaction from totally another wallet with the same 50 satoshi commission - it worked.

Could you please help me to understand what is going on and how to unblock my stuck transaction?

What is the value of the output sent to you from wallet A? If it is extremely small (ie, near the dust limit), you may be experiencing a dust attack. See: https://bitcoin.stackexchange.com/questions/81508/deanonymizing-dust-attack . Your wallet may have used the dust-attack-UTXO as part of the unconfirmed tx you tried to send (and would thus require a higher fee-rate, due to it being a child-pays-for-parent type of situation).

Thanks @chytrik! From address A it was sent about 0.000863 BTC to 70+ addresses, one of them was mine and amount for it is around 0.000007 BTC - very small one. Does it look like a dust attack?
Though I though BTC transactions are confirmed independently. Why are these transactions to my wallet blocking outgoing transactions I sent after?

Can you confirm whether or not the unconfirmed transaction you are trying to send includes the dust UTXO as an input? Some wallets will use unconfirmed inputs when crafting txs, some will not. (& good wallets can simply ignore and lock all inputs below a certain value limit, to guard against such privacy-invading attacks). It is really just a UX decision made by the wallet developers. If the tx is using the unconfirmed dust input, then the unconfirmed transaction that sent the dust to you will need to confirm in order for your transaction to confirm.

@chytrik, thank you! Will take a look at the details you mentioned. One more question if you don't mind - in btc network all transactions are public anyway, as far as I know. If so, what is the additional information I can get with dust as anyway I can track addresses and normal transactions to understand how different accounts are connected?


text:
Probability of mining maximum of 3 block in next 20 minute
I know that block interval in bitcoin blockchain is exponential distribution. Now I want to know what is the probability that maximum of 3 block will be mined in the next 20 minute?

Assuming block finding is a Poisson process with rate 1 per 10 minutes.
In that case, the number of blocks found per given finite time interval would be described by a Poisson distribution. For 20 minutes, a Poisson distribution with lambda = 20 minutes / 10 minutes = 2.

No blocks in 20 minutes: ~13.53%
1 block in 20 minutes: ~27.07%
2 blocks in 20 minutes: ~27.07%
3 blocks in 20 minutes: ~18.04%
4 or more blocks in 20 minutes: ~14.29%

Due the memorylessness of the Poisson process, it doesn't matter when you start the clock for your 20 minutes. These hold for whatever window of 20 minutes you look at.


text:
How does blockchain decide the complexity of proof-of-work
I heard that the complexity of proof of work in blockchain can vary. On what factors does it depend? Is it possible that that proof of work i.e. the required hash starting with certain number of zeros can't be found? What happens then? Do the transaction wait in the queue until the hash is found

Generally speaking, the difficulty is increased if the “mean time between two succesful mined block” diminishes. It is a so called “closed loop” control system. As a result, the time between two blocks tends to remain stable. The solution having a certain number of zeros is not guaranteed existing, but any solution lower than it is ok for the system, and is accepted, so definitely it exists a set “lower than” where a suitable solution can be found.

This answer seems to imply that the difficulty adjusts after every block, however the difficulty only adjusts only every 2016 blocks.

You are right, but how many blocks between two adjustments depends on the algorithm and there exists many possible choices. Specifically  speaking, the control target variable is the “mean time between two blocks”, the number of samples taken to calculate it is, obviously, “more than one”, from 2 to whatever. If 2016 has been chosen for Bitcoin, it’s ok. Adjusted the answer, thank you.


text:
Can you know the final destination of a BOLT12 offer?
It is said that a BOLT12 offer does hide the final destination, and therefore protects privacy of receiver.
However, I just generated an offer, decoded it, and in the value node_id, it had my node's public key without the first byte prefix, which is sufficient to have myself traced. Is there something that I haven't understood correctly?

Using BOLT 12 offer encodes the data necessary to reach a node to request an invoice to make a payment, either a node_id, or a blinded path (the last few hops in an onion route, pre-computed and encrypted) to that node using onion messages.

See here: https://thebitcoinmanual.com/articles/lightning-offers-bolt12/
I guess the answer is that you have those two options and you only get the privacy advantage if the blinded path feature is used.

In many cases, you're a public node and want to commit to the invoice publicly.  The difference is, now a node doesn't have to!
In Core Lightning, our implementation doesn't yet support this use of aliases, but it's pretty trivial. If course we can pay someone using an alias...

Paying someone using an alias... like? Are blinded paths used in this process?


text:
Monitor multiple bitcoin addresses
I would like to know if I could monitor new transactions on several addresses that I do not have access to personally and see if the transactions were validated by the network with an API, and if possible to use WebSockets which is very interesting compared to REST APIs.
I have seen the API offer of blockcypher and blockchain.com that meets my request but I wanted to know if there was simpler.
Thanks for your future answers

Endpoint
wss://mempool.space/api/v1/ws
Description:
Default push: { action: 'want', data: ['blocks', ...] } to express what you want pushed. Available: blocks, mempool-blocks, live-2h-chart, and stats.
Push transactions related to address:
{ 'track-address': '3PbJ...bF9B' } to receive all new transactions containing that address as input or output. Returns an array of transactions. address-transactions for new mempool transactions, and block-transactions for new block confirmed transactions.
Common JS

Code Example
GitHub Repo
<!DOCTYPE html>

Blocks

Waiting for data

Mempool Info

Waiting for data

Transactions

Waiting for data

Mempool Blocks

Waiting for data

Or ES Module
Install Package
GitHub RepoNPM Package
# npm
npm install @mempool/mempool.js --save

# yarn
yarn add @mempool/mempool.js

Code Example
import mempoolJS from "@mempool/mempool.js";

const init = async () => {

const { bitcoin: { websocket } } = mempoolJS({
    hostname: 'mempool.space'
  });

const ws = websocket.initServer({
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
});

ws.on("message", function incoming(data) {
const res = JSON.parse(data.toString());
if (res.block) {
console.log(res.block);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res["mempool-blocks"]) {
console.log(res["mempool-blocks"]);
}
});

};
init();


text:
c-lightning - Failed to replicate query: database disk image is malformed
When I start up lightningd with sudo systemctl start lightningd, no error is returned.
When I run sudo journalctl -f -u lightningd, I get this:
$ sudo journalctl -f -u lightningd
-- Journal begins at Tue 2023-01-31 10:49:40 EET. --
Feb 11 14:24:44 raspibolt systemd[1]: Started Core Lightning daemon.
Feb 11 14:25:54 raspibolt sh[184030]: Failed to replicate query: database disk image is malformed: database disk image is malformed: DELETE FROM blocks WHERE height > 775495
Feb 11 14:25:54 raspibolt systemd[1]: lightningd.service: Main process exited, code=exited, status=1/FAILURE
Feb 11 14:25:54 raspibolt systemd[1]: lightningd.service: Killing process 184047 (node) with signal SIGKILL.
Feb 11 14:25:54 raspibolt systemd[1]: lightningd.service: Failed with result 'exit-code'.
Feb 11 14:25:54 raspibolt systemd[1]: lightningd.service: Consumed 3.860s CPU time.
Feb 11 14:26:24 raspibolt systemd[1]: lightningd.service: Scheduled restart job, restart counter is at 3417.
Feb 11 14:26:24 raspibolt systemd[1]: Stopped Core Lightning daemon.
Feb 11 14:26:24 raspibolt systemd[1]: lightningd.service: Consumed 3.860s CPU time.
Feb 11 14:26:24 raspibolt systemd[1]: Started Core Lightning daemon.

Lightning daemon isn't running:
$ lightning-cli getinfo
lightning-cli: Connecting to 'lightning-rpc': Connection refused

Do you know what's the fault?
Extra information that might be helpful: Verification progress is 99.9993% in my Bitcoin node.

Looks like your database is malformed and it has some corrupted data inside the database, it is not directly related to the bitcoin node!
However, I think it is good to report the issue to https://github.com/ElementsProject/lightning/issues


text:
Is there locktime but in the other way around? (valid until block x)
Locktime defines the earliest block number that the transaction can be added to the blockchain. Is there any way to define the latest block number that a transaction can be mined? For example, transaction cannot be mined with block height > 840000.

Bitcoin does not yet have such a built-in capability. However, such things can actually be regulated indirectly through fee (although this is a rather "rough" approach based on fee estimation).
A lower fee will cause the transaction to be mined later, while a higher fee will cause it to be mined earlier. However, as I said, this is a rather rough approach, because nothing guarantees you that the transaction will actually be mined at the moment (block) you estimated, in the end it's all up to the miner.


text:
Bitcoin hash rates/difficulty
i read that some ASIC cards can produce upto 100 TH/s (= 100,000 bn hashes/s = 100 tn hashes/s)
Further, lets say network difficulty at the moment is 30tn (i understand this to mean that on average it will take 30tn hashes to come out with a solution per block). If the block time is roughly 10 mins => 30tn/600 = 0.05tn hashes/s (=50 bn TH/s) would get me the block solution.
i must be missing something - as if the net work is currently outputting 200 EH/s (200 bn TH/s) (by estimate) => it seems like we should get a solution to the problem pretty quickly (i.e. not the 10 mins as per the protocol).
i am sure my logic is flawed somewhere or i am being daft - can some one please point out the flaw?
thanks

Difficulty is defined relatively: it is how much more difficult it is to mine a block compared to a fixed "maximum target", which corresponds to roughly 232 hashes.
In more detail, a Bitcoin block is PoW-valid when its hash (interpreted as a 256-bit integer) is less or equal to that block's "target". Difficulty does not exist at the protocol level; internally, everything uses targets.
The rules for target adjustment are as follows:

Blocks whose height n is not a multiple of 2016 have the same target as their parent block.
Blocks whose height n is a multiple of 2016:

Take the parent's target
Multiply that target by the number of seconds in two weeks.
Divide the result by the difference (in seconds) between the timestamp of block n-2016 and that of block n-1.
If the result is more than 4 times the parent target, or less than 1/4th of the parent target, clamp it.
If the result is above the maximum target, use the maximum target instead.
Round the target down to fit in Bitcoin's custom 32-bit floating point format (called the "nBits" encoding).

The expected number of hashes at a given target T is 2256 / (T+1). The higher the target, the easier it is to mine a block. The maximum target is thus a limit on how easy mining can get, and is the fixed constant (2224 - 2208) in Bitcoin. The expected number of hashes at this target is 248 / (216-1), or just over 232.
The difficulty is now a purely human representation of the target value: it is the maximum target divided by the actual target, and is at least 1 (at maximum target).

thanks - that makes sense. so I guess a natural conclusion to draw from this would be, if blocks are on average created faster than 10 mins:
a). The network hash rate is probably greater than the difficulty for the last 2016 blocks and,
b). difficulty at the next epoch will be revised upwards or the target revised downward.


text:
suppose if I derived a public key from another algorithm instead of elliptical curve will the node reject my tx?
Or I changed the value of G in EC (K=k*G) what will happen

suppose I invent an algorithm that maps my private key to your public key, should I be able to spend your coins?

@MikeD: It's even worse: "suppose I create a private key but then send money to a completely unrelated public key".

Sounds like a complicated way to lose money.
Since most output types are based on hashes, it's likely that a sender would not be able to tell that your public key is not on secp256k1. Your transaction would succeed and your funds would be associated with the public key you communicated.
Then when you try to spend them, you'd be out of luck, since you only know the private key to that public key on a different curve and do not know the necessary private key to make a secp256k1 valid signature—you would be unable to spend the funds.


text:
How does the wallet know that this seed phrase is generated before?
When I tried login using a random mnemonic phrase the wallet shows incorrect word? How does the wallet know that it is not previously generated?

Seed phrases usually include a checksum. For example, a 12-word BIP39 seed phrase has 4 checksum bits, which means only about 1 in 16 randomly typed seed phrases will be considered valid.


text:
How the extended key in wallet is 512 bits?
For extended private key it is 512 bits but for extended public key how it is 512? It will be 264+256 right? And why in the book mastering bitcoin they said extended key is either 512 bits or 513 bits

Why do you think the extended pubkey is 512 bits?

it's mentioned in the book mastering bitcoin

Recommend reading BIP-0032, and specifically serialization format.
The private key is a scalar value of 32 bytes (256 bits).
The public key is a point on the elliptic curve, a point is an XY value. This is called an uncompressed public key. It is prefixed with 0x04. An uncompressed public key is 65 bytes.
For efficiency we simply represent the public key as an X value since the Y value can be derived easily. This is called a compressed public key. However for any X value there could be two Y values, as such we need to store a value to represent the sign of Y (or evenness). For even Y value we prefix 0x02, for odd Y value we prefix 0x03. A compressed public key is 33 bytes (see Chapter 4 in Mastering Bitcoin).
For HD, we have a private HD key and a public HD key. The serialization format from BIP-32 is as follows.

4 byte: version bytes (mainnet: 0x0488B21E public, 0x0488ADE4 private; testnet: 0x043587CF public, 0x04358394 private)
1 byte: depth: 0x00 for master nodes, 0x01 for level-1 derived keys, ....
4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
4 bytes: child number. This is ser32(i) for i in xi = xpar/i, with xi the key being serialized. (0x00000000 if master key)
32 bytes: the chain code
33 bytes: the public key or private key data (serP(K) for public keys, 0x00 || ser256(k) for private keys)

Typically the important part (for recovery purposes and generating other keys) is the chain code (32 bytes = 256 bits) and the public / private key (33 bytes).
The book says 512 or 513 bits because the extended private key is 256 chain code bits || 256 private key bits (512), and the extended public key is 256 chain code bits || 1 evenness bit || 256 public key bits (513).
Since computers storage works in bytes, the 1 bit for evenness is represented as a whole byte.

But the wallet uses compressed public key which is 264bits?

@athul 8 bits for evenness + 256 Y coordinate bits = 264 compressed public key bits.


text:
The left-half 256 bits of the hash are added to the parent key to produce the child private key
So in mastering bitcoin it mentioned that to generate child key,The left-half 256 bits of the hash are added to the parent key so if we add that it will be 512 bits.But we need 256 bit so do we hash that string (parent key + left hash) with SHA256 and get the 256 bit child private key?

There is concatenation where 256 bits placed next to another 256 bits makes 512 bits. However, what you are referring to (generating a child key) uses scalar addition. A 256 bit number (256 bit parent private key) is added to another 256 bit number (left 256 bits of the SHA512) and the result modulo p (p = 2^256-2^32-977) is another 256 bit number.

So we will hash  that 512 bits using SHA256 to get the private key?

@AthulA: No as I say in the answer you add the 256 bit parent private key to the left 256 bits of the SHA512 modulo p. The result is 256 bits. If you need an explanation of modular arithmetic this might be helpful https://github.com/jimmysong/programmingbitcoin/blob/master/ch01.asciidoc#modulo-arithmetic

@MichaelFolkson Hi Michael, are you sure that concatenation should be used and not regular addition? Here they say that the + operation is performed between the left side of the hash and the parent's private key. However, nowhere is it indicated that this is a special type of addition. The only thing indicated is that if you work with coordinates, then the + indicates a "special operation" (Addition (+) of two coordinate pair is defined as application of the EC group operation.).

@Filip: I explain the difference between concatenation and scalar addition in the answer. And yes the question asker was mistaken in assuming concatenation should be used here. So me and you are in agreement (maybe the answer could be worded a little better)

@MichaelFolkson My fault then. I misinterpreted your answer. All the best!


text:
What is Stablesats?
What is Stable sats and how actually the entire process happens behind the scenes without fiat integration or without stablecoins?

Where did you read about such thing?

They have a prominent three minute video in their site, have you watched that one?

@Mercedes Yes I did, but how can we short Lightning Channel's BTC. We can't take that BTC out of channel and then Hedge that BTC right?

I don't know LN in depth, but I think funds in channel are locked for payments once opened until closed. If you want to earn interest on tokens, it might be wiser to find some other token with uncapped emission maybe?


text:
How does Lightning payment service Works?
Let's say A merchant is using lightning payment service to accept BTC as payment for his shop. How does existing lightning payment service were able to manage to provide merchant's BTC in form of fiat considering BTC price volatility rate , because at the end of the day merchant needs fiat currency to spend his daily living.

How does existing lightning payment service were able to manage to provide merchant's BTC in form of fiat

It doesn't.
Hedging currencies is something that must be performed outside the Lightning or Bitcoin networks.
Exchanging currencies is something that must be performed outside the Lightning or Bitcoin networks.
Some commercial businesses might offer to provide such hedging and/or exchange services but that is separate from Bitcoin and Lightning.
I expect businesses or individuals who are worried about exchange rate fluctuations will often choose to recalculate the prices they offer at very short intervals (e.g. daily, hourly?) and often will immediately exchange received currency they consider uncomfortably volatile for another they consider more stable. Those who are extremely concerned about a specific currency will perhaps choose to transfer all the risk to the other party by insisting on a transactional currency they are comfortable with.

How can we performing hedging separately, because how can we short Lightning Channel's BTC. We can't take that BTC out of channel and then Hedge that BTC right when channel is not closed?

hedging: "Hedging is accomplished by purchasing an offsetting currency exposure. For example, if a company has a liability to deliver 1 million euros in six months, it can hedge this risk by entering into a contract to purchase 1 million euros on the same date, so that it can buy and sell in the same currency on the same date."

Let's say I am Lightning payment service, I want to instantly convert BTC to receiver's fiat currency. So, I want to hedge  sender & receiver's channel BTC where transaction happened, How can I hedge the channel's BTC which is present in lightning channel without closing channel?


text:
Derive Secp256k1 curve public key starting off from known 32 bytes string
Starting off from a sha256 hash of a threshold pubkey, how can I generate a valid secp256k1 public key?
The challenge is that the 32 bytes of the hash does not always fall within secp256k1 range, so I suspect I'd need some additional elliptic curve operation on the hash to bring it get to a byte string I can use to generate a valid pubkey.
So far I've tried taking a modulus of the hash against constant secp256k1 curve order. Didn't work, probably because I don't fully understand the elliptic curve math necessary here...
/// Rust
///
/// Converts a federation id to a public key to which we don't know the
/// private key
///
/// That is ok because we only use it for adding a route
/// hint to LN invoices that tells fedimint clients that the invoice can
/// only be paid internally. Since no LN node with that pb key can exist
/// other LN senders will know that they cannot pay the invoice.
pub fn to_fake_ln_pub_key(seed: threshold_crypto::PublicKey) -> anyhow::Result<secp256k1::PublicKey> {
    let mut bytes = [0u8; 33];
    bytes[0] = 0x02;

    let modulus = BigUint::from_bytes_be(
        &<Sha256 as bitcoin_hashes::Hash>::hash(&seed).into_inner(),
    ) % BigUint::from_bytes_be(&secp256k1::constants::CURVE_ORDER);

    bytes[1..].copy_from_slice(&modulus.to_bytes_be());

    Ok(secp256k1::PublicKey::from_slice(&bytes)?)
}

Motivation and Context:
The pubkey I'm looking to generate in this way will be used as a source node id marker in a valid invoice that is only payable between clients within a Fedimint federation. In this scenario, the threshold pubkey we use as 'seed data' is actually the federation ID.
One client within a federation would generate a lightning invoice, adding a route hint with source node id set to this pubkey we are looking to generate.
Another client within the federation looking to pay this invoice should be able to generate a matching pubkey marker from federation id threshold pubkey, and match it against the marker.
With this marker, they can do a transaction between themselves within the federation without ever going over the lightning network.
Ref:

https://github.com/fedimint/fedimint/pull/2640
https://github.com/fedimint/fedimint/issues/2618

What properties does this public key need? Is it ok if nobody knows the corresponding private key? If not, who should be able to derive it?

I believe we only need the public key to be valid. We conventionally pick an even parity when creating the public key.
Nobody needs to know the corresponding private key and while anyone with sufficient information should be able to derive it, we (or they) should never use this key to sign anywhere

There exist various schemes for "hashing to the curve", with various properties, but among others, guarantee that nobody can compute the corresponding private key. They're nontrivial to implement, though. Alternatively, you can just use "Hash(data) * G" which allows anyone with access to the data to get the private key. Lastly, "Hash(data) * G + H" (with H a second generator) works too, has similar properties to hash-to-curve, and a lot easier to implement, but slower.

Preferred and implemented "Hash(data) * G" scheme. We can later iterate our scenario to a scheme where nobody can compute the private key. Thanks


text:
Coinjoined coins are not available on another instance of wallet
Let's have 2 instances of wasabi wallet installed on different PCs. I have restored a wallet from a seed phrase on both of them and i can see all my coins on both of them.
I start coinjoin on one machine and after time - i have all coins coinjoined. Everything seems okay, i can spend it from the wallet instance that coinjoined them.
But the balance on the second instance becomes zero, and i can't see my coins. Restart does not help.

How can i restore coins in this situation?
How are keys for coinjoined coins generated?
Is it ok to transfer all this coins to one particular address to be able to restore them with a seed phrase?

Could be a key gap issue.
Try to increase the gap limit of the wallet to 1000.
https://docs.wasabiwallet.io/FAQ/FAQ-UseWasabi.html#how-do-i-change-the-gap-limit-of-a-wallet

Is it ok to transfer all this coins to one particular address to be able to restore them with a seed phrase?

no. That is very bad for your privacy. If you would want to do something like this, you should do it in batches: multiple transfers and multiple (unused) addresses. However, avoid consolidating if possible.
Let us know if it works:)

Thank you! I thought of some kind of gap. I will try it

Great! I have done several experiments and it works perfect! Thank you a lot for your awesome advice!


text:
Force WasabiWallet to use system tor service
I am running Wasabi wallet on linux machine and would like to force it to use system tor service. Tor is being blocked by my ISP, but I have set up bridges for my system tor daemon, and it works OK. But Wasabi - does not.
It seems to me it starts it's own tor service and does not respects settings in system-wide /etc/tor/torrc config file.
Changing ISP or using VPN helps, but it is not the solution for me.

There are several important pieces of information mentioned here:

Wasabi Wallet 1 is distributed with a specific version of Tor binaries but WW1 actually works with any version of Tor running on given operating
system[^1].
Wasabi Wallet 2 is distributed with Tor binaries (i.e. Tor is bundled) and we actually always run the distributed Tor with non-standard port
setting
to avoid using any non-bundled Tor versions.

So to explain it in simple terms: Wasabi Wallet 2 uses a bundled Tor because WW2 requires access to Tor control protocol and because it makes sure that the Tor version is reasonably up to date. So Wasabi Wallet 2 deliberately does not use system-wide Tor.
I can see potentially several ways how to fix your issue.
For people without programming skills:

Open $HOME/.walletwasabi/client/TorLogs.txt file in a text editor and you should see a line Configuration file "/var/tmp/dist/tor/etc/tor/torrc" not present, using reasonable defaults. So maybe you can just modify this torrc file as you need.

For people with programming skills:

Modify parameters passed to the Wasabi Tor by changing https://github.com/zkSNACKs/WalletWasabi/blob/7201a57ddfce235a20815a76827ed378e318d169/WalletWasabi/Tor/TorSettings.cs#L96-L109 and build the Wasabi wallet.
Modify ports used by the Wasabi Wallet here https://github.com/zkSNACKs/WalletWasabi/blob/7201a57ddfce235a20815a76827ed378e318d169/WalletWasabi/Tor/TorSettings.cs#L60-L63 to use your system-wide Tor (i.e. 9050 and 9051). Make sure in your Wasabi Wallet settings that the option Terminate Tor when Wasabi shuts down is disabled but it's disabled by default. Also your linux user must have a permission to access Tor control port. So this is rather a theoretical option.

Great! The solution with adding custom config helped. The file was not present in that directory (and the directory also did not exist), so i just added a link to system torrc file like this: ln -s /etc/tor/torrc. Works perfect


text:
sending tx with fee/vsize < 1 satoshi
is it possible to send tx with fee smaller than 1 satoshi per vbyte?
e.g. vsize is 200 bytes, fee is 100 satoshis
do all nodes accept such transactions?
if not, what nodes do?
PS We're not talking about confirmation.
I just wanna know if nodes would accept it into their mempool.

No unmodified Bitcoin Core releases from 2017  to date will accept such a transactions to their mempool, relay them, or mine them.
Before 2017 there existed rules that in some cases permitted relay of transactions with lower or no fee at all, though these had been deprecated and default off for several years earlier.
Anyone is of course free to run software that implements their own policy.


text:
How is crypto Mining actually validating the block?
As far as I understand in crypto-mining you are trying to find the nonce such that the hash starts with some amount of zero's. I do not understand how this nonce is used to actually validate anything.

In the context of your question, you can think about mining in two distinct ways:

the act of building block templates and 'mining' to find a valid block (this done by miners)
the act of validating a block that another node has told you about (this is done by network nodes)

For miners that are building blocks, the nonce isn't used to validate anything per say, it is just a piece of data that can quickly be varied to produce different hash results for an otherwise unchanged block structure. This is to say, miners can create a block template, and then quickly vary the nonce to produce many slightly different versions of the block, each of which will have a distinct hash. Hopefully they can find a block structure (which includes a specific nonce) that leads to a valid hash.
For nodes that are validating blocks, there are many rules that the block is checked against to see if it is valid. One of the rules is 'does the block header produce a valid hash?' (ie, one that is below the target value). Since the nonce is a component of the block header, you could say that the nonce is needed to validate the block.
Note though, there are many other rules for validity that the node will run through, that do not utilize the nonce in any way.

could you please clarify what you mean by building block templates?

A 'block template' is the name for the block structure that a miner will create when trying to find a valid block. The block template will be an otherwise valid block full of whatever header and transaction data the miner chooses to add to it, and the miner will then 'mine on that template' by iterating the nonce (and 'extranonce') in the hopes of finding a hash that will be counted as a valid block on the network.

How is crypto Mining actually validating the block?

It isn't.
Before a miner starts mining a block template, they must have already have validated the data in the block template. They must already have checked that the data in the block template is valid. That each piece of data in it already passes all the Bitcoin rules.
Mining a block successfully acts to confirm transactions in the block but confirmation of transactions is completely different to validation (AKA verification) of transactions and blocks etc.

in crypto-mining you are trying to find the nonce such that the hash starts with some amount of zero's.

That is not true for Bitcoin. In Bitcoin, miners find a set of data, including nonce and other values, whose hash is less than or equal to a target value. There is no measuring of the number of leading zeroes.

I do not understand how this nonce is used to actually validate anything.

It isn't used in the way implied by the framing of your question.
See answer by chytrik The nonce is just a meaningless number whose value can be varied by the miner in the hope of finding a value that causes the hash of the whole block to be less than the target. It is part of the block data that all other nodes hash to validate that the block data does indeed have a hash less than the target, as it should. As chytrik noted, there are a large number of other characteristics of the block contents that are  also each separately validated.


text:
cw-144 oscillation problems
I am starting to get into Difficulty Algorithms and attacks on them. I came across cw-144 which used to be BCH's DAA at least until mid 2020 (recent developments do not interest me and this is not the point of this post). It became apparent it was vulnerable to rational miners moving between BTC and BCH mining. This was caused because cw-144 is a SMA DAA.
I couldn't manage to grasp why the fact the average is flat (and not EMA or LWMA) causes these oscillations while EMA, LWMA don't. I know this has something to do with the fact that blocks going out of the simple average window have the same effect as them going into the window but I didn't understand why that is (mentioned here). I would much appreciate help with this.
I also added a graph from the above link showing the oscillations.

I see some people are voting to close this question as "off-topic", however I think the topic of difficulty adjustment algorithms, miner switching and difficulty oscillations is very much applicable to Bitcoin, even if the discussion includes an altcoin.

@VojtěchStrnad I agree as well. Looks like that folks are trying to close BCH as "off-topic".

@MelroyvandenBerg BCH is indeed off-topic on Bitcoin Stack Exchange, see the relevant meta discussion. Whether this question specifically is off-topic is debatable, but it was closed as such by votes from multiple people, and until the author or someone else edits it to address the reason for closing, the vote stands.


text:
Does the payment for both parties are settled instantly in Lightning Network
Unlike Force Close mechanism, where there is a time lock, making settlement to take time, Does mutual closing channel funds settlement takes long time or funds are settled between channel partners instantly?

The time lock mechanism in uncooperative channel closes exists to create a dispute period during which the other party (or a watchtower on its behalf) can publish the "penalty transaction" and claim all channel funds for itself.
In contrast, a cooperative close already has agreement from both parties on the latest channel state, and so it's final once the closing transaction confirms (which takes 10 minutes on average, though it's better to wait for a few confirmations to happen).


text:
Need help recovering my Bitcoin wallet and what can I cleanup on bitcoin-qt?
I've bought Bitcoin back in 2014 and as my wallet I've used the bitcoin-qt client. Now I've remembered about it and I've recovered the wallet.dat file, but it's apparently encrypted by me (using bitcoin-qt) and I only remember what word was used for it, but not the whole password.
What I tried is downloading the bitcoin-qt client and tried unlocking the wallet via the console with walletpassphrase "passwordhere" 60 but the password is never correct. I did this offline though.
So my questions would be:

Can I somehow recover my password? Is there maybe a weakness in the encryption or something like that? I found a RPC password in a file, is that helpful in any way to unlock it?
Is it safe to delete the blockchain? If yes, which folders/files? That old PC of mine is lacking space apparently and it certainly can't fit the whole blockchain of today.
Could it be that being offline caused the wrong password prompt?
How could I possibly recover my public address of the wallet? I can see the transaction times, but the not the address apparently.

You can try to brute force the password, trying all the different possibilities for your password, it is also possible to make a script for this task, but only you who know what the password is could give some hints about it. The RPC password may give some hints about the password for the wallet.dat, but it is not really related to the wallet.dat file.

You shouldn't delete the blockchain, because if you want to sync the blockchain in that computer, you should keep the files there, but you could also copy the wallet.dat and move it to another computer with more storage.

No, usually the password encryption doesn't have anything to do with the network, so it is not necessary to be online.

Once you sync your wallet, you will see your balance, you could also use the command listunspent during that process in your QT wallet to see the public addresses which contain some funds.

Considering the fact that I don't have enough space on the PC isn't it safe to delete the blockchain or does it contain some useful information for me to deduce my public address or similar stuff?..

In regards to the brute force approach, the OP could potentially use the password finder that comes with Wasabi Wallet: https://docs.wasabiwallet.io/using-wasabi/PasswordFinder.html   It is open source, so you could potentially modify the tool for your needs.

@SirMuffington, the biggest folders are blocks and chainstate, you can delete them if you want, they don't have any data that can help you with the wallet.dat, but the other files like bitcoin.conf, debug.log, I would keep them.

I'm going to give a more optimistic answer, depending on what the user means by "wallet gone" in the subject line.
If they used a desktop bitcoin wallet, and they never backed it up, and they have thrown away the hard drive (or encrypted it multiple times and lost the key) then I think it's fair to say that their Bitcoin is irretrievably gone.
However, as I read the question, they simply stored their 12 word recovery phrase on their phone and then lost the phone. Their Bitcoin is still retrievable if a couple of conditions can be met:
If they used a web-based wallet (such as Blockchain.info) AND
They still control the email address that they used to register for that wallet AND
They remember part or all of the password to their wallet
Then they could retrieve their Bitcoin.
Here's how you'd do this if your wallet was on Blockchain.info:
Get your "Wallet ID", either by finding your original "Welcome to My Wallet" email in your inbox, or
Go to https://blockchain.info/wallet/#/login
Click on “View Options”
Click “Remind Me”
Enter your email address and submit the form
Wait a few minutes while Blockchain.info emails you your Wallet ID
Next, if you remember your password you can login to Blockchain.info with your Wallet ID and your password. Problem solved.
If you don't remember your password, but you have your Wallet ID and you're confident that you know part of the password then [shameless plug] a service like ours (https://www.recovercrypto.org) can help you recover your password.

Apparently none of the above applies, I even doubt blockchain.info even existed back then :/

Did "12 word recovery phrase" be a thing in 2014?

I doubt that... I don't recall any mmemonics


text:
How to gift an entire BTC wallet via QR code?
I have a unique scenario where I'd like to:

Create a BTC wallet and add a small amount of funds to it.
Generate a QR code that contains the private key.
Then gift that QR code to a friend so they can import the BTC.

I'm basically trying to replicate something like a Casascius coin but I'm unsure of the exact steps to take in making all this work.
Could I simply put my 24 seed words into the QR and somehow the recipient could take ownership that way?
To clarify: I understand you should never give out your private key under normal circumstances. This is an exercise in figuring out how to gift an entire wallet that I would no longer personally use.

Yes, you can encode the mnemonic phrase i.e. the "entire wallet" in a QR code. Most wallet software will not allow exporting a mnemonic as a QR code though since that often leads to bad security practises (e.g. taking screenshots).
I would suggest using BlueWallet since it's very easy to use and already encodes the mnemonic in a QR code for you when displaying the backup through ••• > Export/Backup.
The recipient of your gift simply needs to download BlueWallet and scan the QR code to import and effectively own the wallet.
However, you're not really "gifting" bitcoin here since you still have access to the wallet. There is no on-chain change of ownership. The recipient might want to send the funds on the gift wallet to one only they themselves have access to.

Personally, I think it would be best (and also the better learning experience for the recipient) if you just create a gift transaction to a freshly created wallet on their phone and explain what's happening along the way.

Exactly the info I was looking for, thank you!


text:
BTC early adopter - is there a way to recover my wallet from Mt Gox now?
In 2011 I was mining BTC via BTCMine.com and having the results deposited into my wallet at Mt. Gox. I never had a local copy of the wallet file, and of course then there was the first hack, which released account details. So the deposits were stopped.
Then there was the bigger hack where Mt Gox lost a bunch of BTC and went bankrupt, and I got out of crypto entirely. At the time my wallet was too small to fret over and I assumed there was nothing for it. I haven't looked at any of that in a decade...
Now I see news that Mt Gox is close to finishing their court stuff and it made me go looking - and lo and behold the master ledger, according to BitPay's Insight tool, says my wallet still has my balance in it. But I only have the payment address, found in the old emails from Mt Gox and BTCMine.
Does anyone know if there's a chance to get access to the wallet from Mt Gox, since my measly BTC balance is still in it and my coin apparently wasn't stolen?

Answer is no, not your keys not your coins. What have you been doing all these years? Now you're caring about it? It's too late.

Mt Gox became insolvent LONG ago, and the time period during which customers could make claims has long past. Sorry to say, your coins are likely long gone.

Yeah yeah, I know, I should have looked into it much sooner. Honestly my memory was faulty and I thought I had a miniscule fraction of one coin and wasn't too worried about it. I just happened to be cleaning up some really old emails, found the transfer notices and realized that I had more than I'd remembered - not a fortune, but enough to at least ask someone who knows more than I do :)

Mtgox was seized and your money is in the hands of the feds..
lesson learnt to stay away from centralised exchanges, they defeat bitcoins purpose.


text:
Bitcoin Core Peer Connecting Problems
I am trying to get Bitcoin Coin to sync .
I am having problem .
I have tcp port and Udp port setup . Tcp port is inbound 8333 outbound 8333.
But still no peer connection.
I don't know what to do at this point .

Is your problem that you aren't receiving any incoming connections, or are no outgoing connections made either?

I don't know what to do at this point.

I would look at the log files for clues. The location of the log files depends on your operating system and can also be set in the configuration file.
See How can I get logging information on incoming transactions with bitcoind? and Andrew Chow's Bitcoin Core Troubleshooting FAQ


text:
Upgrading fee in bitcoin
The guy who is mining my account is saying he needs an upgrading fee of $100 to withdraw my profit of $2000 is it not a scam

Yes, it is definitely a scam. "Mining my account", "needs an upgrade fee", neither of these things make any sense. Cut your losses, do not send the scammer anymore money.

Does this answer your question? Is it normal to be asked for an advance fee on a withdrawal? -- There is no such thing as an "upgrading fee" in the Bitcoin network and this is 100% a scam.


text:
Is it possible to determine what node a transaction originated from?
Let's say node-A is propagating a transaction to it's peers on the network: node-B, node-C, etc. Is there any way for the other nodes to know that node-A is the originator of that transaction, as opposed to simply being a source of gossip about the transaction ("gossip" e.g. node-B sharing the transaction with node-C)?
It seems like it would be very important privacy-wise for the originator of the transaction to be obfuscated by appearing on-network in exactly the same way as nodes who gossip about the transaction. But I am not sure how things stand in the bitcoin protocol. Are all relayings of transactions created equal, or are some recognizable as the original source of transmission to the network?

Does this answer your question? Are there any services that can reasonably guess what IP address a transaction originated from?

This is indeed a problem. While node-B and C cannot be sure that node-A is the originator, if they both belong to the same spy they can be increasingly confident if they have many other connections and both receive the transaction from node-A first.
This kind of attack has long been recognized and it is certainly being actively exploited by many blockchain analysis companies. There is research (see Dandelion and further developments of this idea) on how to make this attack harder, but it has some other tradeoffs and hasn't been included in bitcoin-core yet AFAIK.

Indeed, the Dandelion proposal is no longer pursued to be added to Bitcoin Core due to DOS attack concerns: https://bitcoin.stackexchange.com/q/81503/5406


text:
How are transactions broadcast from a personal Electrum server? Through the full Bitcoin Core node? Or by the Elecrum server itself?
When wallet software is connected directly to bitcoind, you can see when the wallet connects to the node, broadcasts a transaction through the node, etc. by watching the bitcoind log. But when you connect your software wallet to the Electrum server (which is, in turn, connected to your Bitcoin Core node) no connection or transaction broadcast information appears in the bitcoind log. This makes me wonder: how are transactions broadcast when your wallet is connected to your personal Electrum server? Is it the case that it relays the transaction information to the Bitcoin Core node and then the Bitcoin Core node broadcasts the transaction to the network? Or is it that the Electrum server is, somehow, broadcasting the transaction itself?
To put the question another way: assuming that the Bitcoin Core and the Electrum server have different IP addresses, which IP is broadcasting the transaction?


text:
Where to find the seed for the wallets that were created inside BitBox by Shift Crypto
I bought the Swiss hardware wallet BitBox2 in order to have a safe storage for my private keys and now I am disappointed because under Manage device > Show recovery words there is only one seed for the whole BitBox. In order to have full access to my wallets (independently of the BitBox) I had the notion that the BitBox just stores the various private keys for me, but now I feel like in a vendor lock-in. Probably it is by design that I cannot access the private keys of every wallet - if the information does not surface, it cannot be stolen. Can someone confirm my thoughts?

The BitBox02 doesn't store your private keys, it derives them from the mnemonic (+ passphrase). You can recover all your private keys, just with the mnemonic. There is no vendor lock-in here... What do you mean with "only one seed for the whole BitBox"?

You can import your seed phase into another wallet and access your ERC20 token and technically BitBox Support only BTC, LTC, ETH & ERC20 So what private key are you looking for it's not like it supports XMR, DASH, ALGO, HBAR, ZCASH, etc. Then you should be looking for PKs


text:
How to allow access to ports 9735 and 10009 on an AWS EC2 instance?
I am trying to allow access to ports 9735 and 10009 on an AWS EC2 instance as per https://github.com/alexbosworth/run-lnd
My instance currently has 2 security groups and I am not sure how to proceed:
Do I create a new security group or use one of the existing groups?
Do I add Inbound and Outbound rules?
What goes in the Type dropdown, Protocol dropdown, Port range, source and box with the magnifying glass?

You can to use the same security groups you have at the moment. Just create two inbound TCP rules, one for port 9735 and the other for 10009, CIDR block should be 0.0.0.0/0 as anyone should be able to communicate with your node, unless you explicitly don't want to. Good luck!


text:
Program isn't starting
The app would launch fine. However, one day after it was working as expected the app would not launch anymore. I have no idea if the files have become or what has happened. I have disabled my antivirus completely (which in this case is windows defender) and have even rolled back windows version. I've given the necessary permissions for the wallet to run and open as well, but it doesn't. I will also mention that as I run Bitcoin Core, I see the process tree rise up to the top in task manager and after around 2 seconds, it disappears with no evidence of the app actually launching. Keep in mind that I never let the computer shut down without safely closing the Bitcoin Core wallet. Please help as I really don't want to lose access to my bitcoin wallet.

Have you looked at the last 10-50 lines of %APPDATA%\Bitcoin\debug.log? What is in there?

The last thing that was ever logged was on the day 10/04 which I'm guessing is the last day the waller actually worked. Nothing else after that is logged no matter how many times I try to launch the wallet to this day. Any idea?

What appears or happens if you open a command prompt window and type cd \Program Files\Bitcoin then bitcoin-qt. What messages appear when you type cd \Program Files\Bitcoin\daemon and then bitcoind or   bitcoin-wallet info

When executing bitcoin-qt.exe the windows blue circle faintly appears next to the mouse cursor. No new process is started up during this time though. It says block files have been previously pruned when bitcoind.exe was executed. Then it tells me to use -reindex or -reindex-chainstate to recover. Which one should I choose? When executing bitcoin-wallet info it says failed to load database path (then lists a path) followed by saying data is not in a recognized format.

Sounds like some data files were corrupted. I would restore the Bitcoin data from a recent backup.

Yep, was doing that until my ssd said nope and killed itself. Isn't recognized by any os anymore.


text:
How can I rename my wallet in Bitcoin Core?
I created a wallet with some incorrect parameters. Now I’ve added a new wallet. But I would like to rename the first wallet (to something like “wallet-test”) and give my new wallet the name I originally intended.


text:
I found a historical OP_HASH256 hashlock unspent output with 1 Bitcoin still in it, is it spendable?
The output:

Block Height
TXID
Output Index
Satoshi Amount
Locking Script
Status

211914
AF32BB06F12F2AE5FDB7FACE7CD272BE67C923E86B7A66A76DED02D954C2F94D
0
100000000
aa20000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f87
Unspent

Upon inspecting the hash we can observe that it matches the hash of Bitcoin's genesis block: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f.
However, the hash is in the wrong byte order, so the genesis block header can't be used to unlock it, and whomever created it had permanently burned his 1 Bitcoin because the reversed-byte hash has some unknown preimage which will likely never be discovered, so no, it is not spendable.
There is another output, with the correct byte order:

Block Height
TXID
Output Index
Satoshi Amount
Locking Script
Status

211997
A4BFA8AB6435AE5F25DAE9D89E4EB67DFA94283CA751F393C1DDC5A837BBC31B
0
100000000
aa206fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000087
Spent

which was successfully spent by using Bitcoin's genesis block header as input script:
4c500100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c


text:
Is an attack on a local bitcoind via an img or embedded flash viable?
In this thread on the Bitcoin forums it was suggested that a local attack on bitcoind might be possible through malformed img tags or (more likely in my opinion) through embedded flash. This also brings up the possibility of exploitation via Java et al.
Unfortunately I don't know enough about flash to determine whether it's prevented from connecting to a listening client on localhost. I would assume it's sandboxed away from anything else on the local network, but I honestly don't know if they've bothered to restrict access to localhost.

This page says that a Flash applet can only access the port and hostname of the URL from which it was downloaded:

Adobe Flash, a plugin believed to be installed on about 99% of all
  desktops, incorporates a security model generally inspired by browser
  same-origin checks. Flash applets have their security context derived
  from the URL they are loaded from (as opposed to the site that embeds
  them with  or  tags), and within this realm, permission
  control follows the same basic principle as applied by browsers to DOM
  access: protocol, host name, and port of the requested resource is
  compared with that of the requestor, with universal access privileges
  granted to content stored on local disk. That said, there are
  important differences - and some interesting extensions - that make
  Flash capable of initiating cross-domain interactions to a degree
  greater than typically permitted for native browser content.

But apparently that applies to the result of a request not the request itself, so it's possible a Flash applet could send a request to your bitcoind to transfer coins, but not check to see whether it worked or not.  Using wallet encryption would help mitigate this.
I've been able to find balances using simple HTTP 'POST' requests:
$ echo '{"method":"getbalance","params":[""]}' | POST http://$user:$pass@localhost:8332/
{"result":-6203.99412537,"error":null,"id":null}

I don't know if it's possible using just a regular 'GET' request.
Edit: I just tried 'guessing' the wrong password 100 times in a row, and then getting it right.  bitcoind didn't stop accepting guesses or slow down at all, and accepted the final correct guess:
$ i=100; while ((i>0)); do ((i--)); echo $(echo $i; date;
  echo '{"method":"getbalance","params":[""]}' |
  POST http://$user:guess$i@localhost:8332/ 2>&1 | grep -i body);
  done; echo '{"method":"getbalance","params":[""]}' |
  POST http://$user:$pass@localhost:8332/
99 Tue Apr 24 09:10:10 PDT 2012
401 Unauthorized.

98 Tue Apr 24 09:10:10 PDT 2012
401 Unauthorized.

[...]
1 Tue Apr 24 09:10:53 PDT 2012
401 Unauthorized.

0 Tue Apr 24 09:10:53 PDT 2012
401 Unauthorized.

{"result":-6203.99412537,"error":null,"id":null}

Interesting. So assuming you were using a dictionary-word RPC password and an unencrypted wallet, a Flash applet could theoretically initiate a transfer. Is there no number of bad password attempts at which Bitcion's JSON RPC will simply stop accepting requests for a while? Even without a Flash exploit, the lack of such a feature would make bitcoin's RPC utterly brute-force-able...

It would have to guess a username as well as a password I think.  I edited my answer to show that you can guess wrong 100 times without being penalised.

Aaaaand I'm now heading over to github to open an issue re: RPC being brute-force-able :P
Thanks!

Question answered: There is a forced 250ms delay between RPC logins if your RPC password is < 20 characters long.

My 100 attempts took 43 seconds, so that's plausible.

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


text:
Is there any way to track an individual bitcoin (or satoshi)?
For example, if I wanted to "collect" important bitcoins is there any way to track a coin rather than a series of transactions? If I wanted one of the bitcoins from the infamous "Bitcoin pizza" purchase, for example, is there any way to do so?
Perhaps the question I should be asking is more like "Do bitcoins themselves even exist or just the records of transactions?"

Here is a possible schema describing transactions from two addresses A and B that contain initially 50 BTC each:
     (A) 50 btc --tx1-----------------------> 25 btc (C)
                   \
                    `-> 25 btc (D) --.
                                      \
                                       tx3--> 50 btc (*)
                                      /
                    .-> 25 btc (E) --'
                   /
     (B) 50 btc --tx2-----------------------> 25 btc (F)

There are three transactions here, and they mention only values: those transactions are stored in the block chain like:

tx1: (input on A: 50BTC; output on D: 25BTC, output on C: 25BTC)
tx2: (input on B: 50BTC; output on E: 25BTC, output on F: 25BTC)
tx3: (input on D: 25BTC,  input on E: 25BTC; output on *: 50BTC)

Only global amounts are involved, not individual satoshis. Could you tell where each of the satoshis in * came from? A or B? Just impossible.
Conclusion: There is no such thing as individual satoshis, they don't have identities in the Bitcoin framework.
(And it's the same, or even worse, for bitcoins. An individual bitcoin is not well defined. It might be a grouping of smaller amounts in the same place (wallet), or at the same address, or in the same transaction, but at a given point in time.)
It is however possible to track money flows between addresses, which may “dilute” into other flows, as illustrated in this answer.

I've been playing with Gavin's "bitcointools" (again) to track what happened to the famous "pizza" Bitcoins.
It turns out that rather than being rare collector's items, the 10,000 BTC exchanged for two pizzas have spread out to over a million different Bitcoin addresses since buying the pizzas, not counting the dilute fragments that ended up in transaction fees.
As of block 166149, on Feb 10th 2012, 1,037,382 addresses have held the pizza coins since they were spent.  174,584 of those still hold pizza coins (the others may or may not be empty addresses, since it's possible to have two different transactions output to the same address without the coins becoming mixed together.  In other words it's possible to have "pizza coins" and "non pizza coins" in the same address and still be able to tell which are which.  Of the approximately 600k addresses which are currently holding funds, around 29% of them contain pizza coins.
The shortest chain of transactions from the pizza purchase to currently held pizza coins has length 9, and the longest has length 6,723.
There is no currently unredeemed output which contains 100% pure pizza coins.  All the pizza coins have been diluted somewhat with other coins.  The purest remaining are these 100 BTC which are 90.7276% pure pizza coin, and just 11 transactions separated from the pizza transaction.  (The most recent 9 transactions each only have 1 input, so it's easy to follow it back that far.  In the next transaction back the pizza coins came from both the last but one input, worth 4223 BTC, and 5th from last input, worth 5777.  Together those 2 inputs make up the full 100% pure 10k BTC pizza coins.  The other inputs in this big transaction, worth 1022 BTC in total are the only non pizza coins introduced.  10000 * 100 / 11022 = 90.7276%, the purity).
I also checked my wallet to see if I was holding any pizza coins.  8 of my addresses are holding pizza coins, but very diluted.  My 'strongest' has a purity of 1.1760%, and is a tiny withdrawal I made from MtGox in October 2011.
Finally, here's some data showing the month-by-month spread of the pizza coins:
pizza payment of 10000.00000000 BTC to 17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ
is in block 57043

-block  --date--  --total--   ---used--%total-   -active---%total---%used-
 58815  May 2010          4         2 (50.00%)         4  100.00%  200.00%
 63561  Jun 2010          4         2 (50.00%)         0    0.00%    0.00%
 71436  Jul 2010         26         8 (30.77%)        24   92.31%  300.00%
 77452  Aug 2010         34        10 (29.41%)        13   38.24%  130.00%
 82997  Sep 2010        138        37 (26.81%)       106   76.81%  286.49%
 88892  Oct 2010      2,016       265 (13.14%)     1,898   94.15%  716.23%
 94801  Nov 2010      6,295       577 ( 9.17%)     4,428   70.34%  767.42%
100409  Dec 2010      7,510       835 (11.12%)     1,464   19.49%  175.33%

-block  --date--  --total--   ---used--%total-   -active---%total---%used-
105570  Jan 2011     13,271     1,540 (11.60%)     6,150   46.34%  399.35%
111136  Feb 2011     19,055     2,632 (13.81%)     6,423   33.71%  244.03%
116038  Mar 2011     42,027     5,605 (13.34%)    24,341   57.92%  434.27%
121126  Apr 2011     69,544     9,085 (13.06%)    29,727   42.75%  327.21%
127865  May 2011    123,997    26,032 (20.99%)    57,911   46.70%  222.46%
134121  Jun 2011    249,138    54,047 (21.69%)   132,348   53.12%  244.88%
139035  Jul 2011    382,845    93,928 (24.53%)   146,156   38.18%  155.60%
143408  Aug 2011    494,140   108,340 (21.92%)   126,134   25.53%  116.42%
147565  Sep 2011    589,942   119,491 (20.25%)   111,178   18.85%   93.04%
151314  Oct 2011    680,787   131,370 (19.30%)   105,320   15.47%   80.17%
155451  Nov 2011    780,292   142,302 (18.24%)   114,013   14.61%   80.12%
160036  Dec 2011    885,172   156,321 (17.66%)   120,631   13.63%   77.17%

-block  --date--  --total--   ---used--%total-   -active---%total---%used-
164780  Jan 2012    998,087   170,082 (17.04%)   136,985   13.72%   80.54%

166149  Feb 2012  1,037,382   174,584 (16.83%)    54,346    5.24%   31.13%

Edit: I just found these 100% pure allinvain coins - undiluted after 24 hops from when 25k BTC was stolen from his computer.
Edit 2: I don't mean to imply that the allinvain coins haven't been thoroughly looted.  They have touched 755,796 different addresses since being stolen and are currently sitting in 109,235 different addresses, including 8 from my own personal wallet.  The exact same 8 as have pizza coins in them, it turns out.

This is actually similar to the "Can a bitcoin be counterfeited?" question.
The answer is no, because as you seemed to hint at, there is no such thing as a bitcoin. There is simply a transaction list, that has consensus around it, where no wallets are ever allowed to go negative.

The simplest way to understand why the answer is "no" is to understand a very basic concept about Bitcoin transactions:
Each transaction (except generating transactions) has one or more "inputs" that pull in Bitcoins. And each transaction has one or more "outputs" that offer those Bitcoins.
In the transaction itself, all the Bitcoins pulled in form a pile. There is no way to track a particular input to a particular output, nor is that meaningful.
Imagine a transaction pulls in 25 Bitcoins from one place and 25 Bitcoins from another place and then sends out 10 Bitcoins to each of five different places. What does it mean to ask which input the coins in a particular output came from?
Bitcoins are more like account balances than pennies. If you put 10 pennies in a pile and give 1 out, you can ask which penny they got. But if you deposit two $10 checks and then withdraw $5, which check did that $5 come from? It's not even a meaningful question.

You might want to have a look at the concepts of "taint" and "colored coins". You can start here:
Taint: https://bitcointalk.org/index.php?topic=92416.0
Colored Coins: https://bitcointalk.org/index.php?topic=106373.0

Nowadays, the answer is "yes" thanks to ordinals, which basically enumerates each Sat via a FIFO heuristic. Thanks to that you can indeed find all the 1e12 Pizza Sats e.g. via https://ordiscan.com/satribute/pizza or https://magiceden.io/ordinals/marketplace/rare-sats?attributes=%257B%2522Satributes%2522%253A%255B%257B%2522value%2522%253A%2522Pizza%2522%252C%2522label%2522%253A%2522Pizza%2522%257D%255D%257D

If you know the TX number, you can go to blockchain.info, search the TX number, click "View Tree Chart" and a tree chart will show up and you can click on the yellow/orange circles. That is how I found out a bitcoin I sent to an exchange ended up plying ping-pong with SatoshiDice.

A "bitcoin" is an individual output of a transaction. It is a "coin", because it is not possible to spend only a part of it and somehow leave the rest resting in your wallet, hanging off the transaction it came from.
A transaction can be viewes as this: take these "bitcoins", melt them, mint new ones according to the specifications provided by me and distribute them as I am instructing. Each transaction destroys the bitcoins that are its inputs and produces bitcoins that are its outputs. The "transaction fees" are like "unused raw material" which returns back to the "ground" and can only be extracted back as a coin by mining.
This is similar to real physical coins - the cashier can't take a half of your 50 cent coin when your bill says you only owe 25 cents, he only can take the whole 50 cent coin and give you a 25 coin back to get rid of the excess payment of yours. Similarly if you have only 50 BTC coin on your account, and you want to pay 5 BTC, you (or, more specifically, your BTC client) must "melt" the 50 BTC coin to create a 5 BTC and a 45 BTC coin before it can give the 5 BTC to the destination address you specified. And this is also why you have to specify a destination for the 45 BTC coin as well (otherwise the 45 BTC will turn into "raw unmined bitcoin material" which is not directly usable and must be mined).
So the answer is "yes". A bitcoin starts its existence at an output of a transaction and continues its existence until it enters an input of a transaction. When the bitcoin entered another transaction, it no longer exists; the outputs of that another transaction are completely different bitcoins.

authors: Андрей Тихий

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


text:
ECDSA transaction signing on a smartcard?
I know that the underlying digitial signing method Bitcoin uses for transactions is ECDSA (sep256k1 if memory serves). I've also read a few papers about performing ECDSA signing on certain kinds of smart cards. Has anyone merged these concepts and made (or attempted to make) a smart card that can sign a transaction with an internally-held private key?

Yes, there is Smart Card Wallet project, though there seems to be no clear indication on what stage the project currently is.
There is also hardware wallet by Slush. It's not smart card based, but works pretty much the same way. Also still in development.


text:
What is the best way to exchange MTGUSD to USD?
Are there any better ways to exchange MTGUSD to real USD with lowest fees and the shortest time?
I had mining some bitcoins and exchange them to MTGUSD at Mt.Gox. But how do I actually use the USD in real life?
I proposed the following solutions but cannot determine which is the best one:

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

The first one seems logical, but the fees are so high. If I have only 100 MTDUSD to transfer then the transaction fees will be about 25%.
The second one seems good but it's really complicated. First I have to figure out how bitcoin-otc works, then I'll need to figure out how moneypak -> paypal and calculate the fees (4.5 USD?). Furthermore, I cannot calculate the total fees and the time for transferring.

as long as you deal with trustworthy members of otc, you can just get paypal directly. when selling hard currency like bitcoin or goxusd, you will generally have a much easier time getting willing counterparties. also note that mtgox allows you to withdraw to dwolla directly, which only takes 25cents of transaction fees. from dwolla, you can ACH directly to your bank.

@nanotube: Presumably the OP is not in the US, so Dwolla and ACH are irrelevant.

@MeniRosenfeld: yes, I am in Taiwan, which is an island near China. So Dwolla or ACH are not available to me.

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

Seems a good choice. I'll try it as soon as possible!

Just found this site recently, looks great:
https://www.aurumxchange.com/

Instead of bitcoin-otc you can find counterparties by posting on bitcointalk.org, which is easier to use. You don't really need to go through Moneypak either - direct Mtgox USD for PayPal USD will work.
The main problem with using PayPal for Bitcoin trades, which is their anti-Bitcoin policies, isn't very salient with person-to-person transactions. The other problem, chargebacks, means you need to transact with someone reputable.
Don't fret if you end up paying a few percentage in fees, they should only amount to a small part of your mining profitability.
Alternatively, instead of using mtgox, you could try selling the bitcoins on cryptoxchange, which are supposed to have more friendly deposit/withdrawal options for international customers.

Incidentally, the difficulties of getting money into and out of the big exchanges is why I strongly believe in local Bitcoin exchange services, which I also happen to run.


text:
How can i effectively split large outputs into smaller ones?
I have a wallet that pays lots of small amounts in the range of 0.x to 5 BTC.
I filled the wallet with one transaction of 50 BTC, so there is only one large input contained.
Now when i transfer 0.5 BTC anywhere, the transaction has two outputs - 0.5 for the receiver and 49.5 change.
Problem is that as long as this transaction is not confirmed the wallet is more or less blocked, as it only contains 49.5 unconfirmed balance.
So basically I end up with one transaction per block, as i need to wait for the change to be confirmed until i can create the next tx.
Edit:
Note that I am using the rawtransactions API and when constructing a transaction i only want to use confirmed outputs (from "listunspent" command) as inputs for the new tx.
What is the best way to split the big output in the wallet into something like e.g. 10*5.0 BTC?

I thought the Bitcoin-Qt client will let you spend your own change even if it has no confirmations.  Are you sure that you can't create another spend transaction?

Sorry, I was not fully clear with my question. I am using the rawtransactins API and when selecting outpoints for a transaction (from the "listunspent" command) I explicitly search for outpoints with >= 1 confirmation. But even if the original client will allow to spend unconfirmed change - Would it not take much longer to get confirmed?

@TripleSpeeder: Why would it take longer to confirm? In most cases, the transactions will be confirmed as soon as a block is found.

@TripleSpeeder: The standard term is "outputs".

@Meni: I always had the impression that using chains of unconfirmed transactions is quite risky. So if the first transaction does never get a confirmation for any reason, all transactions using the first transaction's change as input will also never confirm. So probably it will not take longer to get confirmed, but there is a higher risk involved. If this is the case I am surprised the original client allows that?

@TripleSpeeder: The standard client only allows spending your own change; it doesn't allow spending unconfirmed transactions from outside (that, too, is allowed by protocol however). I suppose this limitation is due to concerns such as those you described. I don't think the effect is very strong, though. In normal usage, spending unconfirmed coins will be rare even if allowed; so the crux of double-spending risk is with the last sender anyway.

The protocol and the standard client allow you to spend your own unconfirmed change. Multibit didn't allow this, but I believe it's a recently/soon added feature.
When constructing your transaction manually there is little advantage to choosing confirmed outputs.
If you do want to split your outputs, you can do it with a sendmany transaction. The Bitcoin-qt GUI allows you to do this ("Add Recipient"), which can scale to several outputs. For a larger number of outputs you can generate the command programmatically and issue it with the command line.
Bitcoin-qt does not allow you to pay an address multiple times in the same transaction. There seems to be little justification for that, and it may be possible with the raw transaction API. Alternatively, you can generate several addresses and split the amount between them.


text:
Which of the open-source Bitcoin clients has the most thoroughly commented source code?
Learning from a source code is very useful at times, but it is a pain if the code is not commented well. Which of the open source Bitcoin software have the most thoroughly and understandably commented source code? That is, if someone wanted to understand how the main client, miner, pool or other Bitcoin software works, which projects should one look at?

I remembered that I had seen answer to that question somewhere, after searching a bit I found it here.

Check out BitCoinJ (a from scratch bitcoin implementation in Java) and
BitCoinSharp (a C# port of BitCoinJ). They are not full
implementations yet, but they are very far along and can do most of
the tasks of a bitcoin client.
No matter what language you plan to create your implementation in,
looking at these is very valuable because they are very thoroughly
commented and much easier to understand than the official C++ client.

weird, because it's the answer to your other question.

Well, that mostly covers the main client, but I was inspired to ask this question by trying to find some easy to understand miner code. I was tempted to write about BitCoinJ in the question, but that would be covering just a part of the topic and not adding much to the question.


text:
Can't recover MtGox password
I go to:
https://mtgox.com/users/login
Click on "Forgot your password?".   Enter "User Name or email".  Click on "Recover my password".
Nothing happens.  They say " We will email you a link to reset your password."  But they don't.
Is there some way to get past this?  Is there some way to contact someone who maintains the site about this?

MtGox support is available on https://support.mtgox.com, by email (support AT mtgox.com) and on IRC freenode server channel #mtgox.
You could try to check your spam folder if you are using a bad webmail provider or bad antispam.

@DanKrajčovič: MtGox went insolvent last year.

this answer is from 2011 ! theres no more mtgox. only a bankruptcy process on https://claims.mtgox.com/


text:
What are bitcoin "confirmations"?
When I receive bitcoins I see a certain number of "confirmations" in the client. What do these mean? Why do most sites make me wait for 6 "confirmations" before a purchase will go through?

Bitcoin confirmations represent the number of blocks in the block chain that have been accepted by the network since the block that includes the transaction.
In simpler terms it represents the difficulty of a double spend attack. With zero confirmations no proof of work has been done, so you can't tell if anyone considers the transaction valid.  Even with a single transaction it is possible for an attacker to pre compute a single block.
With zero or even one confirmation a double spend is very possible since the next block that is solved may confirm a different block instead of the one that has the transaction.  That different block my show the coins being spent elsewhere.  The odds that a double spend has occurred gets exponentially smaller with each confirmation.
An attacker must match the power of the entire bitcoin network to keep up with block creation so as time goes by it becomes increasingly difficult to forge a transaction.
It is generally accepted for most transactions that 6 confirmations represent enough security to assure the transition is valid.

Probably you should differentiate between "a 50/50 chance that a double spend is possible" and "a 50/50 chance that a double spend occurred" since many people might take the former to mean the latter.

This answer could be improved be indicating the chance of a double spend is not 50/50.  It is based on the % of hashing power the attacker has (assuming it is less than 50%).  Thus if the attacker has 10% of hashing power he has a 10% chance of reversing one block.  Roughly a 0.1^2 = 1% chance of reversing two blocks, etc.  If the attacker has an 51% of hashing power then this doesn't apply as it requires an infinite number of blocks to ensure the transaction can't be reversed and thus alternative means are necessary to protect the block chain.

Most of this post succinctly answers the main question, but the 50/50 section is downright false. It would be great if that could be improved.

@Murch the 50/50 comment intentionally leaves out hashing rate because it is an unknown variable. You DO NOT KNOW the hashing rate a possible attacker may be employing when considering confirmations, but I agree that isn't clearly explained so I will clarify the answer. It is not "downright false", just unclear.

@JoshuaKolden Sorry, "downright false" was indeed the wrong way to put it. What I meant was: Maybe the expression "50/50" is used differently colloquially, but reading "about a 50/50 chance" would to me imply equal chances (50%/50% out of 100%) for each case. To somebody at the knowledge stage of asking "What is a confirmation?" it would sound as if double-spending is frequent, as well as much more likely to succeed than it is in reality, and that one should always wait for six confirmations to securely receive payments. The paragraphs implies more accuracy than the described scenario allows.

If you don't grasp the basic concept, imagine for a second that a network outage split the bitcoin network in half. I could send one transaction giving 30 bitcoins to Abel to one half and one transaction giving those same 30 bitcoins to Fred to the other. Each half would accept that transaction and until the two halves reconnected, you wouldn't know which transaction would be honored tomorrow.
Confirmations are simply blocks that have been generated after the block that contains your transaction. Because there is no central authority that can be consulted to be sure a transaction will be committed, recipients use the number of confirmations as a way of protecting against double-spend attacks.
The network is always trying to extend the longest chain, and eventually, some chain will win. The deeper the transaction is in the chain, the higher the chance it will win because the network tries very hard not to duplicate efforts. (Because miners want their coinbase transactions to win, they all try very hard to extend the chain most likely to win, which makes sure it does in fact win.)
Effectively, the more confirmations, the higher the likelihood that a transaction will remain forever in the public hash chain rather than a conflicting transaction if there was one. At 6 confirmations, it is perhaps one in a billion that a transaction won't be permanent -- and that's if the sender is attempting a double spend attack.

so if it take about 10 minutes for a new block to be mined, then 6 confirmations mean 60 minutes

Confirmations are a measure of how many times a Bitcoin transaction has been verified by the network.
When you receive Bitcoin, you will see a number of confirmations in your client. The more confirmations a transaction has, the more secure it is.
Most sites make you wait for 6 confirmations before a purchase will go through. This is because it takes 6 confirmations for a transaction to be considered irreversible.


text:
How do I develop mobile applications for Bitcoin?
I would like to develop a mobile Bitcoin application for the Android and iPhone platforms.  What libraries and resources can I use?

Currently there are only a few mobile apps that use the bitcoin protocol itself. Most communicate with a bitcoin client on a remote machine using the JSON API.
Those few that do, rely on BitcoinJ which is a "selfish" implementation of bitcoin that runs in Java (handily the native language for Android apps). It's got a few key modifications that bring its overhead low enough to run on embedded devices, most notably it does not download all blocks in the block-chain, only those blocks which relate to addresses in its own wallet (hence "selfish" client).
Either method works, and either is as valid a starting point as the other, given the current state of bitcoin's mobile development.

Bitcoin client provides RPC calls which are in JSON, you could communicate via the RPC to make your app.

The development forum of course! There is a great deal of code you could repurpose over on github. I would think android development would be easier, and maybe a good starting point.
If you know C++, definitely check out the bitcoin core.

You can develop a light weight and yet secure mobile app on top of the BCCAPI.
The BCCAPI is implemented in Java and connects to a server that does the heavy lifting required to manage the block chain. However, the server does not have your private keys, and depends on the mobile device to sign transactions.
BitcoinSpinner is an example of an Android app built on top of the BCCAPI.
If you were to use this to make an iPhone app you would have to port the BCCAPI from Java to a C-like language.


text:
is it possible to launder bitcoin by exchanging it for litecoin and then back to bitcoin?
The scenario I was thinking of was I have some bitcoin from doing Bad Things (TM) that I want to launder.  I could register with kraken.com and trade only virtual currencies with the L1 verification ( un/pw, country of residence, phone ).
Process

deposit dirty BTC
buy LTC
transfer to another LTC address
transfer back to another kraken account.
buy BTC
transfer BTC to another exchange that I have linked to a bank account
cash out BTC

What issues do you see with this?  From what I understand kraken.com only has a un/pw ( easy to create a throwaway ) country of origin ( no verification, can lie ) and phone ( easy to buy a burner ).  And even that isn't public knowledge.  Once I transfer to LTC those litecoins are now clean.  Does that make sense?  There is no link between BTC sold and LTC bought except for at the exchange and that only has untraceable details ( un/pw/fake country of origin/burner phone)

Why not just use a mixer service?

im not actually trying to launder bitcoins, its more of thought exercise.  Also, not sure I would trust a mixing service and they have weaknesses too.

Because all transactions in both Litecoin and Bitcoin are stored in the block chain, you run into the same issue you do here if you were just to try and withdraw USD for bitcoins, i.e., does your intermediary store logs of the off chain transactions? When you buy LTC using BTC on Kraken, if Kraken decides to log this transaction then there is now a link between the BTC and the LTC. This link could be used by law enforcement if they are trying to trace some dirty BTC. From an LEO point of view, this is how they would follow the money:

Use the BTC blockchain to trace the money to a Kraken account.
Ask Kraken for information about where that money went. Kraken gives them an LTC address.
Use the LTC blockchain to trace the money to another Kraken account.
Ask Kraken for information on where the LTC went. Kraken gives them a new BTC address.
Use the BTC blockchain to follow the "laundered" money.

The blockchain stores all transactions. The only way to clean money is to do some sort of transaction off of the block chain. To do that you need an intermediary who is willing to do that for you, and take the risk of LEO or some other regulatory firm calling them on it. Shady mixing pools might be willing to do this for you, but Kraken or other legitimate commercial exchanges will not.

Yes I would say that this is quite possible but because litecoin is traceable like Bitcoin the entire laundering process you described reposes on the exchanges platform confidentiality.
There is actually a coin called Zerocoin that is in preparation and that is designed to be completely untraceable. I hadn't a deep look into their White paper so I can not tell you if it will work well but you can may be find it out by yourself.

There is already one alternative crypto-currency that is trying to solve the problem of staying anonymous while performing transactions:
http://stablecoin.net

In strictly hypothetical terms, I think you're over thinking this. You're doing it all wrong. Stop it. With financial compliance laws in the US, you're going to set off some kind of red flag. Remember, exchanges are required to inform on you for anything that might look suspicious. Don't chance it.
Two thoughts:
Simply, use a service like Bitplastic.com, and swallow the 5%+1BTC fee. It's essentially a pre-paid MasterCard that works on the coinbase (I think) exchange rate. If you're in the US and doing bad things, this is appealing for a couple of reasons. The first being that it's an international card, so the FBI and local law enforcement has no jurisdiction over it. They would have to call Interpol on you, and they're not going to do that unless you're important. Stay unimportant, and you're made in the shade. The other thing that's nice is the simplicity of it. You don't have to involve an exchange (ie: a second or third potential point of failure) to use your ill gotten wealth.
The other thing I would do is start an LLC out of New Mexico. New Mexico LLC's are great, because they're almost totally anonymous. They're not totally online yet, so it might take a couple of months to file the paperwork. Trust me when I say this: It's totally worth having one of these. Anyway, from there, start a Delaware LLC that is registered to you, and not the New Mexico LLC. Still with me? Make sure both companies have bank accounts with different signers. Funnel the dirty bitcoins into the New Mexico LLC, and have it contract with the Delaware LLC to do some sort of legitimate work. Keep a record of this work. Call it "consulting." Just be careful, so that there are absolutely no ties between the companies on paper. When it's time, have the Delaware LLC pay taxes on all work. At that point, you're legal, only the anonymous LLC is tainted, and you're good to go. A third offshore LLC in a place like England might also be useful, but I don't want to get into that right now.
If you try something like this, and screw it up, you're probably  going to prison. Just remember that I take no responsibility for anything you may or may not do with these ideas. On the other hand, this too may be over thinking it. It's been my experience that the simplest solutions are usually the best.


text:
Have any cryptography experts vetted the bitcoin source code?
Theoretically, bitcoin's open source nature makes it more resistant to bugs and exploits. However, due to the specialized nature of the code, even many programmers don't fully understand the cryptography pieces. Have any well-regarded cryptography experts done an analysis of the code and published their thoughts anywhere?

I would really like to see a formal proof of security of BitCoin or at least a bare-bones version of it. That would be a fun project.

"It looks good to me" tends to make for a pretty boring paper.
Security expert Dan Kaminsky has given talks and written articles about the Bitcoin system. His two main points are that it cannot scale to the number of transactions a payment processing system needs and that it is not as anonymous as many people think.
He also wrote, "As a note, I have a tremendous amount of respect for BitCoin; I count it in the top five most interesting security projects of the decade.  Entire classes of bugs are missing.  But it's just not an anonymous solution, and the devs will say as much."

Gavin spoke about this during his talk at the Bitcoin conference. It seems the consensus is that Bitcoin is secure as David has quoted. +1

Brian Warner is a security expert and he has studied the source code. His presentation about Bitcoin is by far the best deep technical explanation I've seen:
http://vimeo.com/27177893
There is a brief mention about the security of the source code, embedded in two hours of brilliant explication of the security of the overall system design.
Also, the cryptography mailing list hosted by Jack Lloyd is a discussion forum for a wide range of cryptography and security experts. Bitcoin has been discussed several times. The discussions that I have looked at on that list tend to be more about the protocol, the economics, and so forth than about the actual source code. Here is a google search that returns letters from that mailing list that have the string "Bitcoin" in:
https://encrypted.google.com/search?hl=en&q=site%3Alists.randombit.net%20bitcoin

While not a crypto expert, security guru Steve Gibson covered Bitcoin in his podcast Security Now on February 9 2011.

Audio
Transcript

First announcement was 2009 November 1 on Metzdowd cryptography list.
Relevant archives found here:
http://www.mail-archive.com/search?l=cryptography@metzdowd.com&q=from:%22Satoshi+Nakamoto%22
http://www.mail-archive.com/search?l=cryptography@metzdowd.com&q=%22Bitcoin+P2P+e-cash+paper22
http://www.mail-archive.com/search?l=cryptography@metzdowd.com&q=%22Bitcoin+v0.1+released%22
Pretty raw stuff.  Paper now posted is much refined and clarified from first version.