• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

transactions – Question on PSBT interchange format (version 0)

Moussa by Moussa
March 6, 2025
in Bitcoin
0
peer discovery – how to obtain the IP addresses of nodes for mining pools?
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter

Related articles

How bitcoin browsers check P2PK and P2SH balance?

August 29, 2026
Should You Trust Their Bitcoin Price Calls?

Should You Trust Their Bitcoin Price Calls?

August 29, 2026


I am trying to understand the PSBT interchange format (version 0) described in BIP174 but am confused about the specification.

In the line :

 :=   * *

does the ‘*’ mean the same as in regular expressions, ie. 0 or more occurrences of the preceding item ?

So this would mean there is exactly one and zero or more ‘s and zero or more ‘s ?

I understand the separator of 0x00 for each of , , and works because a can never be zero.

However in PSBT version 0 there are no PSBT_GLOBAL_INPUT_COUNT or PSBT_GLOBAL_OUTPUT_COUNT global ‘s, so in parsing a version 0 how would we know when we are passing from the end of the ‘s into the ‘s ? Both have the same format * 0x00 and so are indistinguishable by looking at the binary bytes alone.

I have studied the valid PSBT test vector ‘PSBT with one P2PKH input. Outputs are empty’, which breaks down as shown below.

We see an followed by its separator 0x00, then we see 2 separator’s 0x00 0x00 immediately following that. So what do these two trailing 0x00‘s mean – do they indicate two ‘s both with empty ‘s, or could it be an with an empty followed by an with an empty ?

Was the omission of PSBT_GLOBAL_INPUT_COUNT and PSBT_GLOBAL_OUTPUT_COUNT global ‘s in version 0 considered a bug?

From BIP174 :

Test vector, valid PSBT : 'PSBT with one P2PKH input. Outputs are empty'

70736274ff0100750200000001268171371edff285e937adeea4b37b78000c0566cbb3ad64641713ca42171bf60000000000feffffff02d3dff505000000001976a914d0c59903c5bac2868760e90fd521a4665aa7652088ac00e1f5050000000017a9143545e6e33b832c47050f24d3eeb93c9c03948bc787b32e1300000100fda5010100000000010289a3c71eab4d20e0371bbba4cc698fa295c9463afa2e397f8533ccb62f9567e50100000017160014be18d152a9b012039daf3da7de4f53349eecb985ffffffff86f8aa43a71dff1448893a530a7237ef6b4608bbb2dd2d0171e63aec6a4890b40100000017160014fe3e9ef1a745e974d902c4355943abcb34bd5353ffffffff0200c2eb0b000000001976a91485cff1097fd9e008bb34af709c62197b38978a4888ac72fef84e2c00000017a914339725ba21efd62ac753a9bcd067d6c7a6a39d05870247304402202712be22e0270f394f568311dc7ca9a68970b8025fdd3b240229f07f8a5f3a240220018b38d7dcd314e734c9276bd6fb40f673325bc4baa144c800d2f2f02db2765c012103d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f210502483045022100d12b852d85dcd961d2f5f4ab660654df6eedcc794c0c33ce5cc309ffb5fce58d022067338a8e0e1725c197fb1a88af59f51e44e4255b20167c8684031c05d1f2592a01210223b72beef0965d10be0778efecd61fcac6f79a4ea169393380734464f84f2ab300000000000000              555 bytes


Breakdown :

70736274ff                          


 :

0100                                 :=   
                                     = PSBT_GLOBAL_UNSIGNED_TX = 0x00

75                                   = 117

 = 'The transaction in network serialization' :

02000000                                                                    4 bytes

01                                                                          1 byte

268171371edff285e937adeea4b37b78000c0566cbb3ad64641713ca42171bf6            32 bytes
00000000                                                                    4 bytes
00                                                                          1 byte
feffffff                                                                    4 bytes

02                                                                          1 byte

d3dff50500000000                                                            8 bytes
19                                                                          1 byte
76a914d0c59903c5bac2868760e90fd521a4665aa7652088ac                          25 bytes

00e1f50500000000                                                            8 bytes
17                                                                          1 byte
a9143545e6e33b832c47050f24d3eeb93c9c03948bc787                              23 bytes

b32e1300                                                                    4 bytes

TOTAL BYTES                                                                 117 bytes

00                                                                          SEPARATOR => end of 




0100                                 :=   
                                     = PSBT_IN_NON_WITNESS_UTXO = 0x00

fda501                               = 256 + 165 = 421

 = 'The transaction in network serialization format the current input spends from' :

0100000000010289a3c71eab4d20e0371bbba4cc698fa295c9463afa2e397f8533ccb62f9567e50100000017160014be18d152a9b012039daf3da7de4f53349eecb985ffffffff86f8aa43a71dff1448893a530a7237ef6b4608bbb2dd2d0171e63aec6a4890b40100000017160014fe3e9ef1a745e974d902c4355943abcb34bd5353ffffffff0200c2eb0b000000001976a91485cff1097fd9e008bb34af709c62197b38978a4888ac72fef84e2c00000017a914339725ba21efd62ac753a9bcd067d6c7a6a39d05870247304402202712be22e0270f394f568311dc7ca9a68970b8025fdd3b240229f07f8a5f3a240220018b38d7dcd314e734c9276bd6fb40f673325bc4baa144c800d2f2f02db2765c012103d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f210502483045022100d12b852d85dcd961d2f5f4ab660654df6eedcc794c0c33ce5cc309ffb5fce58d022067338a8e0e1725c197fb1a88af59f51e44e4255b20167c8684031c05d1f2592a01210223b72beef0965d10be0778efecd61fcac6f79a4ea169393380734464f84f2ab300000000            421 bytes

00                                                                          SEPARATOR => end of 

00                                                                          SEPARATOR => ?

00                                                                          SEPARATOR => ?


Breakdown of 421 bytes :

01000000            version no
0001                segwit bytes

02                  input counter

Input #0 :
89a3c71eab4d20e0371bbba4cc698fa295c9463afa2e397f8533ccb62f9567e5
01000000
17
160014be18d152a9b012039daf3da7de4f53349eecb985
ffffffff

Input #1 :
86f8aa43a71dff1448893a530a7237ef6b4608bbb2dd2d0171e63aec6a4890b4
01000000
17
160014fe3e9ef1a745e974d902c4355943abcb34bd5353
ffffffff

02                  output counter

Output #0 :
00c2eb0b00000000
19
76a91485cff1097fd9e008bb34af709c62197b38978a4888ac

Output #1 :
72fef84e2c000000
17
a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587

Witness #0 :
02                  
47
304402202712be22e0270f394f568311dc7ca9a68970b8025fdd3b240229f07f8a5f3a240220018b38d7dcd314e734c9276bd6fb40f673325bc4baa144c800d2f2f02db2765c01
21
03d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f2105

Witness #1 :
02
48
3045022100d12b852d85dcd961d2f5f4ab660654df6eedcc794c0c33ce5cc309ffb5fce58d022067338a8e0e1725c197fb1a88af59f51e44e4255b20167c8684031c05d1f2592a01
21
0223b72beef0965d10be0778efecd61fcac6f79a4ea169393380734464f84f2ab3

00000000            Tx locktime



Source link

Share76Tweet47

Related Posts

How bitcoin browsers check P2PK and P2SH balance?

by Moussa
August 29, 2026
0

Suppose someone sends bitcoins to me using P2PK, I only enter my address starting with 1 in the bitcoin browser,...

Should You Trust Their Bitcoin Price Calls?

Should You Trust Their Bitcoin Price Calls?

by Moussa
August 29, 2026
0

Key TakeawaysArmstrong and CZ remain broadly bullish, but their forecasts often follow bitcoin’s price action.Long-term price calls offer entertainment value...

Could Bitcoin Power the Next Generation of Trust-Minimized Prediction Markets?

by Moussa
August 29, 2026
0

Prediction markets are becoming an interesting intersection of blockchain technology, real-time data, and artificial intelligence. The basic idea is simple:...

Bitcoin Moves Closer to Gold as US Debt Revives Debasement Trade

Bitcoin Moves Closer to Gold as US Debt Revives Debasement Trade

by Moussa
August 29, 2026
0

Key TakeawaysBitcoin’s 90-day correlation with gold has climbed above 50%.Its Nasdaq 100 correlation has fallen from above 60% to about...

Evernorth XRP Treasury Deal Advances After SEC Filing Takes Effect – Bitcoin News

Evernorth XRP Treasury Deal Advances After SEC Filing Takes Effect – Bitcoin News

by Moussa
August 29, 2026
0

Key TakeawaysShareholders will vote on Evernorth’s proposed merger on Sept. 30.The registration statement becoming effective moves the deal forward but...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5wJTIwdG5wLXN1YnNjcmlwdGlvbiUyMiUzRSUwQSUzQ2Zvcm0lMjBtZXRob2QlM0QlMjJwb3N0JTIyJTIwYWN0aW9uJTNEJTIyaHR0cHMlM0ElMkYlMkZhcHByb3gub3JnJTJGJTNGbmElM0RzJTIyJTNFJTBBJTBBJTNDaW5wdXQlMjB0eXBlJTNEJTIyaGlkZGVuJTIyJTIwbmFtZSUzRCUyMm5sYW5nJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1maXJzdG5hbWUlMjIlM0UlM0NsYWJlbCUyMGZvciUzRCUyMnRucC0xJTIyJTNFRmlyc3QlMjBuYW1lJTIwb3IlMjBmdWxsJTIwbmFtZSUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQlMjBjbGFzcyUzRCUyMnRucC1uYW1lJTIyJTIwdHlwZSUzRCUyMnRleHQlMjIlMjBuYW1lJTNEJTIybm4lMjIlMjBpZCUzRCUyMnRucC0xJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0MlMkZkaXYlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1lbWFpbCUyMiUzRSUzQ2xhYmVsJTIwZm9yJTNEJTIydG5wLTIlMjIlM0VFbWFpbCUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQlMjBjbGFzcyUzRCUyMnRucC1lbWFpbCUyMiUyMHR5cGUlM0QlMjJlbWFpbCUyMiUyMG5hbWUlM0QlMjJuZSUyMiUyMGlkJTNEJTIydG5wLTIlMjIlMjB2YWx1ZSUzRCUyMiUyMiUyMHJlcXVpcmVkJTNFJTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJ0bnAtZmllbGQlMjB0bnAtcHJpdmFjeS1maWVsZCUyMiUzRSUzQ2xhYmVsJTNFJTNDaW5wdXQlMjB0eXBlJTNEJTIyY2hlY2tib3glMjIlMjBuYW1lJTNEJTIybnklMjIlMjByZXF1aXJlZCUyMGNsYXNzJTNEJTIydG5wLXByaXZhY3klMjIlM0UlQzIlQTBCeSUyMGNvbnRpbnVpbmclMkMlMjB5b3UlMjBhY2NlcHQlMjB0aGUlMjBwcml2YWN5JTIwcG9saWN5JTNDJTJGbGFiZWwlM0UlM0MlMkZkaXYlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1idXR0b24lMjIlM0UlM0NpbnB1dCUyMGNsYXNzJTNEJTIydG5wLXN1Ym1pdCUyMiUyMHR5cGUlM0QlMjJzdWJtaXQlMjIlMjB2YWx1ZSUzRCUyMlN1YnNjcmliZSUyMiUyMCUzRSUwQSUzQyUyRmRpdiUzRSUwQSUzQyUyRmZvcm0lM0UlMEElM0MlMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News