[Bitcoin-development] Bitcoin Core 0.10.1 release candidate 3 available

2015-04-21 Thread Wladimir J. van der Laan

I've just uploaded Bitcoin Core 0.10.1rc3 executables to:

https://bitcoin.org/bin/bitcoin-core-0.10.1/test/

The source code can be found in git under the tag 'v0.10.1rc3' on the `0.10` 
branch.

New in this RC is another batch of bug fixes,

- `eae305f` Fix missing lock in submitblock
- `57d1f46` Fix CheckBlockIndex for reindex
- `bac6fca` Set nSequenceId when a block is fully linked
- `139cd81` Cap nAttempts penalty at 8 and switch to pow instead of a division 
loop
- `323de27` `7494e09` `df45564` Various initialization setup environment locale 
fixes

Full (preliminary) release notes for 0.10.1 can be found at 
https://github.com/bitcoin/bitcoin/blob/v0.10.1rc3/doc/release-notes.md 

Thanks to everyone that participated in development or in the gitian build 
process. I sincerely hope that this can be the final release candidate for 
0.10.1,

Wladimir


--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] Relative CHECKLOCKTIMEVERIFY (was CLTV proposal)

2015-04-21 Thread Peter Todd
On Mon, Mar 16, 2015 at 10:22:13PM +, Matt Corallo wrote:
 In building some CLTV-based contracts, it is often also useful to have a
 method of requiring, instead of locktime-is-at-least-N,
 locktime-is-at-least-N-plus-the-height-of-my-input. ie you could imagine
 an OP_RELATIVECHECKLOCKTIMEVERIFY that reads (does not pop) the top
 stack element, adds the height of the output being spent and then has
 identical semantics to CLTV.

Depending on what you mean by identical this isn't actually reorg
safe. For instance consider this implementation:

nLockTime = stack[-1] + prevout.nHeight
if (nLockTime  txTo.nLockTime):
return False

Used with this scriptPubKey:

10 RCLTV DROP pubkey CHECKSIG

If I create that output in tx1 which is mined at height 42 I can spend
it in a tx2 at height  42+10 by setting tx2's nLockTime to 42+10, for
instance 53. However if a reorg happens and tx1 ends up at height 43
after the reorg I'm stuck - tx2's nLockTime is set at 42.

Thus RCTLV is only reorg safe if the height is compared against the
actual block height of the block containing the spending transaction,
not the spending transaction's nLockTime.

 A slightly different API (and different name) was described by maaku at
 http://www.reddit.com/r/Bitcoin/comments/2z2l91/time_to_lobby_bitcoins_core_devs_sf_bitcoin_devs/cpgc154
 which does a better job of saving softfork-available opcode space.
 
 There are two major drawbacks to adding such an operation, however.
 
 1) More transaction information is exposed inside the script (prior to
 CLTV we only had the sigchecking operation exposed, with a CLTV and
 RCLTV/OP_CHECK_MATURITY_VERIFY we expose two more functions).
 
 2) Bitcoin Core's mempool invariant of all transactions in the mempool
 could be thrown into one overside block and aside from block size, it
 would be valid becomes harder to enforce. Currently, during reorgs,
 coinbase spends need checked (specifically, anything spending THE
 coinbase 100 blocks ago needs checked) and locktime transactions need
 checked. With such a new operation, any script which used this new
 opcode during its execution would need to be re-evaluated during reorgs.

Yup, definitely kinda ugly.

If the above style of RCTLV was used, one possibility might be to make
the relative locktime difference be required to be at least 100 blocks,
same as the coinbase maturity, and just accept that it's probably not
going to cause any problems, but could in an extremely big reorg. But
re-orgs that big might be big enough that we're screwed anyway...

With the 100 block rule, during a sufficiently large reorg that
coinbases become unavailble, simply disconnect entire blocks - all
txouts created by them.

 I think both of these requirements are reasonable and not particularly
 cumbersome, and the value of such an operation is quite nice for some
 protocols (including settings setting up a contest interval in a
 sidechain data validation operation).

So to be clear, right now the minimal interface to script execution is
simply:

int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, 
unsigned int scriptPubKeyLen,
   const unsigned char *txTo, 
unsigned int txToLen,
   unsigned int nIn, unsigned int flags, 
bitcoinconsensus_error* err);

Where scriptPubKey is derived from the unspent coin in the UTXO set and
txTo is the transaction containing the script that is being executed.
The UTXO set itself currently contains CCoins entries, one for each
transaction with unspent outputs, which basically contain:

nVersion - tx nVersion
nHeight  - Height of the block the transaction is contained in.
vout - Unspent CTxOut's of the transaction.

The block nTime isn't directly available through the UTXO set, although
it can be found in the block headers. This does require nodes to have
the block headers, but at 4MB/year growth it's reasonable to assume the
UTXO set will grow faster.

Script execution does not have direct access to the current block
height/block time, however it does have indirect access via nLockTime.

Thus we have a few possibilities:

1) RCLTV against nLockTime

Needs a minimum age  COINBASE_MATURITY to be safe.


2) RCLTV against current block height/time

Completely reorg safe.


3) GET_TXOUT_HEIGHT/TIME diff ADD CLTV

To be reorg safe GET_TXOUT_HEIGHT/TIME must fail if minimum age 
COINBASE_MATURITY. This can be implemented by comparing against
nLockTime.


All three possibilities require us to make information about the
prevout's height/time available to VerifyScript(). The only question is
if we want VerifyScript() to also take the current block height/time - I
see no reason why it can't. As for the mempool, keeping track of what
transactions made use of these opcodes so they can be reevaluated if
their prevouts are re-organised seems fine to me.


Absolute CLTV
=

If we are going to make the block 

Re: [Bitcoin-development] Double spending and replace by fee

2015-04-21 Thread Peter Todd
On Wed, Apr 08, 2015 at 11:28:08PM -0700, Adrian Macneil wrote:
 Fwiw, Coinbase relies on the current first-seen mempool behaviour. Wide 
 adoption of RBF (without a suitable replacement available) would make it 
 extremely difficult to pitch bitcoin as a viable alternative to credit cards 
 payments to large merchants.

Some questions:

1) Are you contractually obliged to accept zeroconf transactions with
   existing customers?

I keep hearing rumors of this, but would like some confirmation. In
particular, it would be good to know if you have the option of turning
zeroconf off at all, contractually speaking.


2) What are your double-spend losses to date?

3) Are you actively marketing zeroconf guarantees to new customers?

You're API is a bit unclear as to what exactly those guarantees are;
looks like they only apply if a merchant has convert to fiat turned
on.


4) What are your short, medium, and long term plans to move away from
   dependency on first-seen mempool policy?

e.g. hub-and-spoke payment channels, Lightning network, off-chain, etc.


5) What is your plan for new Bitcoin Core releases that break zeroconf
   via changed tx acceptance rules?

Basically every release we've ever made has added a zeroconf exploit due
to different tx acceptance rules. (e.g. my 95% success rate last summer)


6) What are your plans for Bitcoin Core releases that fundementally
   break zeroconf?

For instance changes like limiting the mempool size create zeroconf
vulnerabilities that can't be avoided in many situations. Yet they may
also be unavoidably needed for, for instance, DoS protection. Will you
oppose these improvements?


7) If a mining pool adopts adopted policy that broke zeroconf, e.g.
   replace-by-fee, would you take any action?

8) Would you take legal action against a mining pool for adopting
   replace-by-fee publicly?

9) Would you take action against a mining pool who is mining
   double-spends without explanation?

e.g. one that claims not to be running non-Bitcoin Core policy, but
keeps on mining double-spends.

-- 
'peter'[:-1]@petertodd.org
089abd68efc18c03d2a294295f3706a13966613a3ff3b390


signature.asc
Description: Digital signature
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development