Bitcoin Forum
July 26, 2026, 12:31:20 AM *
News: Latest Bitcoin Core release: 31.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Looking for feedback on my UTXO model and address format  (Read 68 times)
Francesco Ferraro (OP)
Newbie
*
Offline

Activity: 9
Merit: 0


View Profile WWW
July 24, 2026, 12:20:32 PM
 #1

Hi everyone,

I'm continuing to improve my hobby blockchain project written in Python.

At the moment I'm implementing a Bitcoin-style UTXO model. The node can already return both balance and UTXO information through the API.

Example:

GET /balance/<address>
{
  "balance": 2050000000
}

GET /utxo/<address>
{
  "utxos": [
    {
      "address": "F369-5538-4066-7499-9028-0027",
      "amount": 2050000000,
      "spent": false,
      "txid": "dbd1af28d5894c29ed2231230e1e526d3995585c8b5180b8a94d6a983e05b152",
      "vout": 0
    }
  ]
}

I intentionally keep the structure simple while I learn how Bitcoin's UTXO model works.

I'd like to ask for feedback:

1. Does this UTXO structure look reasonable?
2. Am I missing any important fields?
3. Is there anything you would recommend changing before I continue with transaction validation and mining?

I'm still learning, so any suggestions are appreciated.

Thank you.
OsaiEmma
Full Member
***
Offline

Activity: 420
Merit: 173



View Profile
July 24, 2026, 01:36:39 PM
 #2

I'd like to ask for feedback:

1. Does this UTXO structure look reasonable?
2. Am I missing any important fields?
3. Is there anything you would recommend changing before I continue with transaction validation and mining?

I'm still learning, so any suggestions are appreciated.

Thank you.
1) Yes it does to me but with a little tweak: I'd recommend you remove this
Code:
 "spent": false,
The reason is that it feels redundant. This is an unspent transaction output (UTXO) meaning it is unspent; spent will never be true, so there is no need for it.

2) Yea, I'd suggest block_height for proper identification.

3) Just the 2 above, I know some other members might have more suggestions.

nc50lc
Legendary
*
Offline

Activity: 3220
Merit: 8935


Self-proclaimed Genius


View Profile
July 25, 2026, 06:25:17 AM
Merited by ABCbits (1)
 #3

2. Am I missing any important fields?
You haven't explained the example use-case of that API response.

At minimum, you'll only need the TXID, Vout and the amount. The client can already create a transaction using those.
Minimizing the API response's size is a better idea than adding more bloat to it.

Off topic: you might want to reconsider the address format though.
16^24 has quite weaker collision resistance than bitcoin's address and I suppose wont be safe in the near future.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
Francesco Ferraro (OP)
Newbie
*
Offline

Activity: 9
Merit: 0


View Profile WWW
July 25, 2026, 06:50:47 AM
Last edit: July 25, 2026, 10:35:47 AM by Mr. Big
 #4

2. Am I missing any important fields?
You haven't explained the example use-case of that API response.

At minimum, you'll only need the TXID, Vout and the amount. The client can already create a transaction using those.
Minimizing the API response's size is a better idea than adding more bloat to it.

Off topic: you might want to reconsider the address format though.
16^24 has quite weaker collision resistance than bitcoin's address and I suppose wont be safe in the near future.




Thank you for the suggestion.

The current API is mainly intended for my wallet application, so I initially included additional information for debugging and testing while I'm still learning.

I'll simplify the UTXO response and only keep the fields that are actually necessary.

Regarding the address format, thank you as well. I'm still experimenting with different ideas, so I'll study collision resistance more carefully before considering it final.



I'd like to ask for feedback:

1. Does this UTXO structure look reasonable?
2. Am I missing any important fields?
3. Is there anything you would recommend changing before I continue with transaction validation and mining?

I'm still learning, so any suggestions are appreciated.

Thank you.
1) Yes it does to me but with a little tweak: I'd recommend you remove this
Code:
 "spent": false,
The reason is that it feels redundant. This is an unspent transaction output (UTXO) meaning it is unspent; spent will never be true, so there is no need for it.

2) Yea, I'd suggest block_height for proper identification.

3) Just the 2 above, I know some other members might have more suggestions.





Thank you for your feedback.

You're right. Keeping "spent": false inside the UTXO response is redundant because an unspent transaction output is already a UTXO by definition.

I'll remove that field and also add the block height as you suggested.

Thank you for taking the time to review it.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!