Skip to content

Conversation

@carbolymer
Copy link
Contributor

Since currently both of the variants of quantity can store negative values, there is no point of having them both if they serve the same purpose.

There is a problem though: BigInt can store negative values, which do not make sense in case of assets in transaction outputs. One way to approach this would be to keep sum type quantity but use two different types: BigInt and some new type representing only positive values for example:

message BigUInt {
  oneof big_uint {
    uint64 int = 1;
    bytes big_u_int = 2;
  }
}

The question is if the introduced complexity justifies the gain in type safety.

@carbolymer carbolymer force-pushed the simplify-asset-message branch from 8be138e to ff92997 Compare November 28, 2025 19:43
@carbolymer carbolymer changed the base branch from main to chore/initialize-v1beta December 23, 2025 14:13
Since currently both of the variants of `quantity` can store negative
values, there is no point of having them both if they serve the same
purpose.
@carbolymer carbolymer force-pushed the simplify-asset-message branch from ff92997 to 77abd77 Compare December 23, 2025 14:14
@scarmuega scarmuega merged commit 4562752 into utxorpc:chore/initialize-v1beta Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants