Bitcoin Forum
May 06, 2024, 09:42:21 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 [3] 4 5 6 7 8 9 »
41  Bitcoin / Development & Technical Discussion / Re: 234078 Longest block to solve yet? on: May 02, 2013, 08:08:21 PM
My stats are a little rusty, but as far as I see, it doesn't, it goes up.

Hashing is Bernoulli trial, either you beat the target or you don't. That gives mining a geometric distribution, and so the variance (in number of hashes required) is (1-p)/p2. The re-targeting algorithm tries to keep the hashrate directly proportional to 1/p, so the variance in time quadratically increases with the hashrate. Right?

I guess the phenomenon above was a much higher variance in hashrate because of people turning their computers off at night, whereas now the variance is greatly reduced due to increased numbers and because miners tend to keep the gear running 24/7.
42  Bitcoin / Development & Technical Discussion / Re: DNS and wallet addresses on: May 02, 2013, 02:48:12 AM
See also https://en.bitcoin.it/wiki/BIP_0015
43  Bitcoin / Development & Technical Discussion / Re: why not measure difficulty in bits? on: May 02, 2013, 12:37:56 AM
It basically comes down to Satoshi's over-reliance on OpenSSL. The whole thing is a hack around the function BN_bn2mpi() (which converts a bignum to a sequence of bytes) so that only the 3 most significant bytes of the number are stored and the rest discarded.

EDIT: After re-reading, I seem to be answering a different question to the one asked. I thought the question was asking why the the 'bits' field was an encoding of the target rather than simply an encoding of the number of fractional bits.
44  Bitcoin / Development & Technical Discussion / Re: Merchant-pays-fee proposal for Bitcoin Payment Messages on: April 27, 2013, 05:06:07 AM
Regardless, I think this highlights some shortcomings in the payment protocol as it stands. It's been designed with a focus on merchants and as such is overly limited in its use for different use-cases. At its heart, it provides a mechanism for building a specific type of transaction between two parties without the users having to mess around with raw transactions. If you think a little bigger, you can cover the case of arbitrary transaction building and signing between multiple (not just 2) parties which subsumes the use-cases already catered for.

The current idea is that the merchant specifies which outputs the user should pay to and expects the transaction to be returned complete and signed.

The idea I've just come up with is that a general transaction (not just outputs) is passed around being build over a number of exchanges without the client software needing to know anything about how the exchange should happen. Signatures are not necessarily required, so arbitrary transactions can be built between multiple clients and a single server, allowing users to review the final transaction before authorizing it.

The thing that gets passed around is a transaction and some details about how the client should further build the transaction - what it should add to the transaction or if it should sign it. Wrap this as before with other useful details like the url, pki-sign etc.

Code:
message BuildDetails {
    // max number of inputs to add. Thus zero prevents adding inputs, one allows
    // enforcement of SIGHASH_SINGLE, other values to prevent huge dust txns etc
    optional uint_64 maxInputs;

    // total value of the inputs you need to provide
    optional uint_64 inputsValue;


    // max number of outputs to add (thus zero prevents adding outputs etc)
    optional uint_64 maxOutputs;

    // total value of the outputs you need to provide
    optional uint_64 outputsValue;

    
    // whether you need to sign the inputs
    required boolean sign;

    // how to sign them
    optional uint_8 sigHash;
}

message TxBuilder {
    optional bytes transaction;
    required BuildDetails buildDetails;
}

Now, in the standard use-case, originally the merchant creates the outputs he wants and wraps them in a PaymentDetails object and signs it, creating a PaymentRequest.
He sends it to the user who's client interprets this to mean 'I should add some inputs to pay for those outputs, (and maybe add an output for my change), sign it, and then send it back to the url given'. This interpretation is all implicit and built in and thus is limiting.

With the TxBuilder approach the interpretation is explicit.
The merchant takes the outputs he wants as before and creates a transaction. He wants the user to provide inputs who's value matches his outputs, so he specifies the 'inputsValue' and he wants the transaction to be signed, so he specifies this too. He doesn't care about additional outputs (maybe he cares about not creating a huge transaction, so limits outputs to 1 - whatever).
The user's client can read the build details and determine that it wants him to provide input of a certain value, is free to add outputs how he pleases and should sign the result.

My solution to Sergio's use case is also possible now:
Merchant creates a Tx with the output for his payment (maybe not with his change output yet). He specifies the value that the inputs should total and specifies that the transaction should NOT be signed.

The user's client can easily determine what is required and inform the user of the details if need be (as no signature is needed, there is little harm either way). The user agrees and the client fills in the inputs, adds a change output for itself and sends the transaction back.
The merchant can then add his fee payment input and change output. He specifies 0 inputs or outputs are to be added, and specifies to sign the transaction with SIGHASH_ALL.

The users client can then display the details of the final transaction and ask if the user agrees to sign. If so, it returns the almost completed transaction to the merchant who signs it himself (or of course he signs it in the previous step and gives up his ability to refuse the transaction).

The merchant can finally issue an acknowledgement as before so that the user knows that the exchange is complete and its status.


EDIT: @Sergio, sorry for hijacking
45  Bitcoin / Development & Technical Discussion / Re: Merchant-pays-fee proposal for Bitcoin Payment Messages on: April 27, 2013, 02:19:17 AM
Lots of other ways that merchants could arrange to pay transaction fees, I don't think we need a hard fork to solve that problem.

Agreed

Or an extension to the payment protocol so the merchant provides an already-signed SIGHASH_SINGLE / SIGHASH_ANYONECANPAY input to pay the fee that the client includes as the first input in the transaction.

You've kind of missed the point. The problem Sergio is addressing is that the merchant needs to include an output for his change after paying the fee, and the payee needs to have an output for his own change. Thus you end up with 3 outputs. The merchant does not know what the change address is for the payee, so cannot create a transaction with all the outputs without asking the payee. SIGHASH_SINGLE can help because it allows you to add outputs but is crippled because you don't have a choice as to which output you are signing, in particular this isn't helpful if your funds are spread about a lot and have to use multiple inputs because now the input and output indices cannot possibly match.

Your solution assumes that the merchant has an unspent output with the exact amount needed for the fee. If instead he needs to use multiple inputs, then he can't use SIGHASH_SINGLE. If he does indeed have the exact amount in 1 unspent output, then there is no need to provide his payment first, he can simply add it after.

Also the merchant shouldn't already sign it because then he loses the power to reject the payment. The payee can take the fee amount off the amount owed and only pay the difference. The transaction will be valid but with a smaller (no fee) and the payee can broadcast it themselves.


I think the solution is simply have the payee provide the merchant with a partial transaction with all his details included (but not signed obviously!). It has each of his inputs and includes a single output for his own change so that the difference in value is the exact value of the thing he is purchasing. The merchant then can add the output for the actual payment, inputs to pay for the fee and another output for his own change. He sends this back to the payee who signs it and sends to the merchant who finally chooses whether to accept or decline. If he accepts he can sign it himself and broadcast.
46  Bitcoin / Development & Technical Discussion / Re: Limits to accepting a new longest chain to prevent >50% on: April 24, 2013, 04:21:48 PM
I must admit I hadn't thought about SPV clients although if all headers of all blocks (including those of a fork) were available then couldn't an SPV client also decide to ignore new headers that it decides are too old (i.e. they still have the timestamps for every header they are using don't they)?

Anyway, the issue has been discussed to death before. Taking priority into account is something Gavin mentioned on his blog last year, and that was just to make sure the public realized there are last ditch options available.

Any link to where this has been discussed in depth before (maybe I am not searching on the right thing)?


http://gavintech.blogspot.ca/2012/05/neutralizing-51-attack.html
47  Bitcoin / Development & Technical Discussion / Re: Is it really 256 bit? Or is it really 160 bit? on: April 24, 2013, 05:50:31 AM
But this raises the question:  why didn't satoshi use sept160k1 which would have pubkeys of only 40+ digit hex (corresponding to the strength of ripemd160), instead of 64+ digit hex for sepc256? 

What you're missing is that paying to 160-bit script hash is an addition that wasn't part of the original client. Originally you paid directly to the full public keys.
48  Bitcoin / Development & Technical Discussion / Re: Is it known that every block CAN produce a hash under target? on: April 24, 2013, 05:20:30 AM
Greg's point is this:

At the minimum difficulty, the average number of hashes required to find a block is 232. The nonce field is 32 bits (surprise!) , so on average, each candidate block will have exactly 1 nonce to make it under the target.

The current difficulty is 8,974,296, which means that on average 8,974,296 times more hashes are required to find a block than at the minimum difficulty, so for each block there is a 1 in 8,974,296 chance of there existing a nonce making it under the target.  Put another way, we have to try all 232 nonces for 8,974,296 different blocks on average to find a valid block.

This number is about 223, so we only need to have 23 or so more bits other than the nonce that we can change in order to find a valid block.
49  Bitcoin / Development & Technical Discussion / Re: ECDSA questions on: April 24, 2013, 03:47:30 AM
Yes and yes.
50  Bitcoin / Development & Technical Discussion / Re: ECDSA questions on: April 24, 2013, 02:47:30 AM
The points on an elliptic curve can be added (via the construction you describe) and similarly can be subtracted as you've worked out. By repeated addition, you get multiplication of a point by an integer.
The curve that is used in Bitcoin has the property that from a single point G, (for generator point) by repeatedly adding it to itself you get every point (with integer coordinates) on the elliptic curve.

In elliptic curve cryptography a private key, k, is simply an integer, and the public key is the point you get by adding G to itself k times. Given a general point on the curve, there is no known way to get back to the number k without simply trying every one until you get lucky.

The recovery of the Sony keys was because of a flaw in their implementation of the signing algorithm. The algorithm requires a random number which should be different every time something is signed. Sony used the same number every time and this allowed the private key to be recovered (though of course it took a long time before anyone realized that they were always using the same number). The signature is dependent on the random number, so repeatedly signing the same message should give a different signature every time.
51  Bitcoin / Development & Technical Discussion / Re: Generating key pairs in Linux from a passphrase? on: April 23, 2013, 06:02:01 PM
Step 1: delete your bash history
Step 2: don't try to roll your own security tools
52  Bitcoin / Development & Technical Discussion / Re: amortizable hashcash & zero-trust poolfree on: April 21, 2013, 04:19:03 PM
There's a lot of shoulds, cans and coulds but no how.

Also, I know that Hashcash is your baby and you're rightly proud of it, but Bitcoin isn't Hashcash and your insistence on crowbarring its terminology into your posts make them all the more difficult to read.
53  Economy / Service Announcements / Re: Bitcoin Condoms - Cryptocondom Collection on: April 20, 2013, 08:55:38 PM
Bitcoin condoms - so you don't end up hard-forking your family.
or
Fork safely.

 Cheesy
54  Bitcoin / Development & Technical Discussion / Re: Getting block headers on: April 20, 2013, 11:27:43 AM
The client will relay invs to its other peers for every new block it receives. If it's syncing, then it receives a lot of new blocks and so you get a lot of invs.
55  Bitcoin / Development & Technical Discussion / Re: Getting block headers on: April 20, 2013, 10:52:49 AM
Is your local node syncing at the time?

There is a new field in the version message you send which tells the other peer not to send you inv's like this.

To receive block headers, you need to ask with a 'getheaders' message, it doesn't follow the 'getblocks' -> receive 'inv' -> 'getdata' -> receive block  message sequence.
56  Bitcoin / Development & Technical Discussion / Re: Solving the fast payments problem on: April 19, 2013, 10:46:23 PM
Seems like a nice way to artificially reduce the network hashing rate / temporarily split the network.
I use a number of nodes to send 2 transactions spending the same input to the network, but I make sure to send them as close as possible to the same time. Thus, the rest of the network see that there is a double spend, but there isn't a strong consensus as to which order the transactions arrived, so half the network mine a fork with one transaction and the other half mine a fork with the other. At some point in the future, one side decides it must have been wrong and one of the forks wins. Up until that time, each fork has been competing possibly with many reorgs.

That's for a single double spend. Now think about a collection of nodes which continuously pump out double spends. Each split halves the hashing power if perfectly timed, it doesn't take much to bring the network to its knees.
57  Bitcoin / Development & Technical Discussion / Re: Reminder: zero-conf is not safe; $500USD reward posted for replace-by-fee patch on: April 18, 2013, 12:47:03 PM
Isn't this already done?

Quote
change the relay rules so that transactions are replaced based on fees regardless of how that changes transaction outputs.

John Dillon seems to want to make it so that clients won't check outputs are the same before replacing the transaction.

With the same inputs, the total value of the transaction is the same. Changing the fees means that the total value must be redistributed in a different way to before. Thus some outputs must get less if the fees are to get more.
I'm assuming he doesn't mean to allow adding or removing outputs.
58  Bitcoin / Development & Technical Discussion / Re: Recovering from a drop in hashing power on: April 17, 2013, 01:00:17 PM
So if I have a reasonable proportion of hashing power, I can stop mining blocks and trigger this mechanism. Then the network will happily accept lower difficulty blocks which I can mine very fast, possibly putting my effective hashing power over 51% if other miners still try to produce blocks at the full difficulty.

Alternatively, when the hashing power drops and this is triggered, some nodes will be pumping out blocks with minimum difficulty and others at some other higher difficulty. Do we stick to the largest proof-of-work chain or simply switch to longest chain as the main chain? All you end up with is a bunch of competing chains and many reorgs. This effectively prevents users from making transactions until the chaos has subsided because they can't be sure they won't be undone. Thus the result is largely the same as if the rules hadn't been changed - you have to wait much longer for your transactions to get into a block, and because of the reduced frequency of blocks, there is more competition for the space and higher uncertainty of your transaction not making the cut.
59  Bitcoin / Development & Technical Discussion / Re: An idea on how to reduce the risk of a 51 % attack on: April 17, 2013, 12:46:27 PM
It's an interesting idea, but you've made too many assumptions on the actions of a 51% attacker. Why is it required that they do not include most transactions into their chain? Their competing chain could include every transaction in the honest chain except one (unspending their own coins) and defeat this protection. A 51% attacker cannot spend coins which are not his, all he can do unspend recently spent coins, in particular his own, allowing double spending. If he only ever changes his own transactions, then these canary transactions will never die and no alarm will sound.
60  Bitcoin / Development & Technical Discussion / Re: Block headers download on: April 15, 2013, 10:58:16 PM
Well it depends how lazy you are Wink. If you share the downloads between the peers without connecting to more peers, then no problem. If you purposely connect to as many peers as there are checkpoints, then it's not the same, especially if you don't bother to disconnect from most of them after you've finished downloading.
Pages: « 1 2 [3] 4 5 6 7 8 9 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!