当前位置: 首页 > 工具软件 > bitcoinlib > 使用案例 >

[4th of series6] Get Transaction Fees of Confirmed Transactions via Python-Bitcoinlib v0.9.0

鲜于宏义
2023-12-01

Abstract

This blog is going to calculate the transaction fees of each non-coinbase transaction in a specific block via Python-Bitcoinlib v0.9.0. By the way, Bitcoin transactions have two types: coinbase transactions and non-coinbase transactions, where the coinbase transactions have no transaction fees while non-coinbase transactions have certain transaction fees to pay.


1. Example One

The first example is going to calculate the transaction fees of each non-coinbase transaction in a specific block via Python-Bitcoinlib v0.9.0.

First, we get a specific block.

Second, we go through all transactions in the block.

Third, we sum up the inputs of each transaction, sum up the outputs of each transaction, and calculate the transaction fee via a simple subtraction operation.

Fourth, the source code is named

 类似资料:

相关阅读

相关文章

相关问答