Return-Path: <rusty@ozlabs.org> Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id DB6E3725 for <bitcoin-dev@lists.linuxfoundation.org>; Sat, 1 Oct 2016 04:10:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5BFEC100 for <bitcoin-dev@lists.linuxfoundation.org>; Sat, 1 Oct 2016 04:10:53 +0000 (UTC) Received: by ozlabs.org (Postfix, from userid 1011) id 3smFGd5JW7z9sdn; Sat, 1 Oct 2016 14:10:49 +1000 (AEST) From: Rusty Russell <rusty@rustcorp.com.au> To: Luke Dashjr <luke@dashjr.org>, Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>, Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org> In-Reply-To: <201609230957.03138.luke@dashjr.org> References: <201609230957.03138.luke@dashjr.org> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Sat, 01 Oct 2016 13:31:04 +0930 Message-ID: <87oa34d8fz.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: Re: [bitcoin-dev] BIP draft: OP_CHECKBLOCKATHEIGHT X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org> List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe> List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/> List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org> List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help> List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe> X-List-Received-Date: Sat, 01 Oct 2016 04:10:54 -0000 Luke Dashjr via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> writes: > This BIP describes a new opcode (OP_CHECKBLOCKATHEIGHT) for the Bitcoin > scripting system to address reissuing bitcoin transactions when the coins they > spend have been conflicted/double-spent. > > https://github.com/luke-jr/bips/blob/bip-cbah/bip-cbah.mediawiki > > Does this seem like a good idea/approach? Prefer a three-arg version (gbits-to-compare, blocknum, hash): - If <bits> is 0 or > 256, invalid. - If the hash length is not (<bits> + 7) / 8, invalid. - If the hash unused bits are not 0, invalid. - Otherwise <bits> of hash is compared to lower <bits> of blockhash. This version also lets you play gambling games on-chain! Or maybe I've just put another nail in CBAH's coffin? Cheers, Rusty.