Return-Path: Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 45C2FC013A for ; Fri, 15 Jan 2021 17:28:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0273186B34 for ; Fri, 15 Jan 2021 17:28:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hp1Y-H3txPFw for ; Fri, 15 Jan 2021 17:28:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by fraxinus.osuosl.org (Postfix) with ESMTPS id E695A86B04 for ; Fri, 15 Jan 2021 17:28:30 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id AF4A223F17C5 for ; Fri, 15 Jan 2021 17:28:28 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=achow101.com header.i=@achow101.com header.b="tvUzcnkA" Date: Fri, 15 Jan 2021 17:28:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=achow101.com; s=protonmail3; t=1610731697; bh=fa46cazu9xk56Tmg8CLTquEzm5x6V4UB90to4LmJ2Xk=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=tvUzcnkAXB1usqzmS8b3duXd79re/GJXPBiwTw4CCKRuriBD7yfclFXKcb8277ig5 RIBm47HMFj3jlQup/ODSaXJOniq+uf+wULVPcCeCS4ZwDGNm8vlURN5lrFxmW+yGni j/vYj4VblzehNHWKn2RfdnYfezmm/CKal2xzB/0Q+8ABn/EtfUyI6WAfVjHnXMsqv9 uXUE7Z9oq635D61IY7n9loLdL8bmRlOSlolPZ/QCc3pCC2HytAs2BVShbhhvKBBEuh q+XKdK9Bh8BxL3C5f3PUua8QDKMTjBjOz5OHoDn/wl89KT/pYw54KplPL8qG9VITAq bc/OWWVi2fMKQ== To: Bitcoin Protocol Discussion From: Andrew Chow Reply-To: Andrew Chow Message-ID: In-Reply-To: <40089cb5-8d68-1868-c87b-241f2bd747fb@achow101.com> References: <1dd8c285-e3f4-4f03-d608-103a5026146d@achow101.com> <5a4697cb-b9cb-b925-e78f-d5b53f025704@achow101.com> <40089cb5-8d68-1868-c87b-241f2bd747fb@achow101.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [bitcoin-dev] New PSBT version proposal X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 17:28:35 -0000 Hi All, I've made some reorganization changes to the way that new PSBT versions=20 should be handled in BIP 174 (see=20 https://github.com/bitcoin/bips/pull/1055) so PSBTv2 will be submitted=20 as a separate BIP. The full document can be read at=20 https://github.com/achow101/bips/blob/psbt2/bip-psbt2.mediawiki and I=20 have also included it in this email. I've included Rusty's suggestion for PSBT_GLOBAL_UNDER_CONSTRUCTION and=20 made a few modifications. First, the field will be named=20 PSBT_GLOBAL_TX_MODIFIABLE and only include the inputs modifiable and=20 outputs modifiable flags. The SIGHASH_SINGLE bitmap will be included as=20 a separate field PSBT_GLOBAL_SIGHASH_SINGLE_INPUTS. This allows most=20 PSBTs to not have to carry around a useless bitmap. Andrew ***
 =C2=A0 BIP: PSBTv2
 =C2=A0 Layer: Applications
 =C2=A0 Title: PSBT Version 2
 =C2=A0 Author: Andrew Chow 
 =C2=A0 Comments-Summary: No comments yet.
 =C2=A0 Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-PSB=
T2
 =C2=A0 Status: Draft
 =C2=A0 Type: Standards Track
 =C2=A0 Created: 2021-01-14
 =C2=A0 License: BSD-2-Clause
=3D=3DIntroduction=3D=3D =3D=3D=3DAbstract=3D=3D=3D This document proposes a second version of the Partially Signed Bitcoin=20 Transaction format described in BIP 174 which allows for inputs and outputs to be added to=20 the PSBT after creation. =3D=3D=3DCopyright=3D=3D=3D This BIP is licensed under the 2-clause BSD license. =3D=3D=3DMotivation=3D=3D=3D Partially Signed Bitcoin Transaction Version 0 as described in BIP 174=20 is unable to have new inputs and outputs be added to the transaction. The fixed global=20 unsigned transaction cannot be changed which prevents any additional inputs or outputs to be=20 added. PSBT Version 2 is intended to rectify this problem. An additional benficial side effect is that all information for a given=20 input or output will be provided by its or . With=20 Version 0, to retrieve all of the information for an input or output, data would need to be=20 found in two locations: the / and the global unsigned=20 transaction. PSBT Version 2 now moves all related information to one place. =3D=3DSpecification=3D=3D PSBT Version 2 (PSBTv2) only specifies new fields and field=20 inclusion/exclusion requirements. PSBT_GLOBAL_UNSIGNED_TX must be excluded in PSBTv2. PSBT_GLOBAL_VERSION must be included in PSBTv2 and set to=20 version number 2'''What happened to version number 1?''' Version number 1 is skipped because PSBT Version 0 has been colloquially=20 referred to as version 1. Originally this BIP was to be version 1, but because it has been colloquially referred to as version 2=20 during its design phrase, it was decided to change the version number to 2 so that there would not be any confusion. The new global types for PSBT Version 2 are as follows: {| ! Name ! ! ! Description ! ! Description ! Versions Requiring Inclusion ! Versions Requiring Exclusion ! Versions Allowing Inclusion |- | Transaction Version | PSBT_GLOBAL_TX_VERSION =3D 0x02 | None | No key data | <32-bit uint> | The 32-bit little endian signed integer representing the version=20 number of the transaction being created. Note that this is not the same=20 as the PSBT version number specified by the PSBT_GLOBAL_VERSION field. | 2 | 0 | 2 |- | Fallback Locktime | PSBT_GLOBAL_FALLBACK_LOCKTIME =3D 0x03 | None | No key data | <32-bit uint> | The 32-bit little endian unsigned integer representing the transaction=20 locktime to use if no inputs specify a required locktime. | | 0 | 2 |- | Input Count | PSBT_GLOBAL_INPUT_COUNT =3D 0x04 | None | No key data | | Compact size unsigned integer representing the number of inputs in=20 this PSBT. | 2 | 0 | 2 |- | Output Count | PSBT_GLOBAL_OUTPUT_COUNT =3D 0x05 | None | No key data | | Compact size unsigned integer representing the number of outputs in=20 this PSBT. | 2 | 0 | 2 |- | Transaction Modifiable Flags | PSBT_GLOBAL_TX_MODIFIABLE =3D 0x06 | None | No key data | | A single byte boolean (0 for False, 1 for True) representing whether=20 inputs can be modified, referred to as the Inputs Modifiable Flag. This=20 is followed by a single byte boolean representing whether outputs can be=20 modified, referred to as the Outputs Modifiable Flag. | | 0 | 2 |- | SIGHASH_SINGLE Inputs | PSBT_GLOBAL_SIGHASH_SINGLE_INPUTS =3D 0x07 | None | No key data | | A bit vector representing which input indexes use SIGHASH_SINGLE. If=20 the bit for an index is set to 1, then the input and output pair at that=20 index are tied together with SIGHASH_SINGLE and must be moved together. | | 0 | 2 |} The new per-input types for PSBT Version 2 are defined as follows: {| ! Name ! ! ! Description ! ! Description ! Versions Requiring Inclusion ! Versions Requiring Exclusion ! Versions Allowing Inclusion |- | Previous TXID | PSBT_IN_PREVIOUS_TXID =3D 0x0e | None | No key data | | 32 byte txid of the previous transaction whose output at=20 PSBT_IN_OUTPUT_INDEX is being spent. | 2 | 0 | 2 |- | Spent Output Index | PSBT_IN_OUTPUT_INDEX =3D 0x0f | None | No key data | <32-bit uint> | 32 bit little endian integer representing the index of the output=20 being spent in the transaction with the txid of PSBT_IN_PREVIOUS_TXID. | 2 | 0 | 2 |- | Sequence Number | PSBT_IN_SEQUENCE =3D 0x10 | None | No key data | <32-bit uint> | The 32 bit unsigned little endian integer for the sequence number of=20 this input. If omitted, the sequence number is assumed to be the final=20 sequence number (0xffffffff). | | 0 | 2 |- | Required Time-based Locktime | PSBT_IN_REQUIRED_TIME_LOCKTIME =3D 0x11 | None | No key data | <32-bit uint> | 32 bit unsigned little endian integer greater than or equal to=20 500000000 representing the minimum Unix timestamp that this input=20 requires to be set as the transaction's lock time. | | 0 | 2 |- | Required Height-based Locktime | PSBT_IN_REQUIRED_HEIGHT_LOCKTIME =3D 0x12 | None | No key data | <32-bit uiht> | 32 bit unsigned little endian integer less than 500000000 representing=20 the minimum block height that this input requires to be set as the=20 transaction's lock time. | | 0 | 2 |} The new per-output types for PSBT Version 2 are defined as follows: {| ! Name ! ! ! Description ! ! Description ! Versions Requiring Inclusion ! Versions Requiring Exclusion ! Versions Allowing Inclusion |- | Output Amount | PSBT_OUT_AMOUNT =3D 0x03 | None | No key data | <64-bit uint> | 64 bit signed little endian integer representing the output's amount=20 in satoshis. | 2 | 0 | 2 |- | Output Script | PSBT_OUT_SCRIPT =3D 0x03 | None | No key data |