You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should we be opinionated about the actual amount value #11
Should bitcoin_uri care about the amount presented?
Current behavior
parsing an amount in a uri where the amount is greater than max money does not produce an error.
Expected behavior
I might expect an error to crop up here but I am not totally sure if this is something we need to handle on the payjoin side or if this should be the wallet implementer's problem
Steps to reproduce
#[test]
fn test_fuzz_crash() {
let uri = "bitcoin:12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX?pj=HTTPS://example.com&pjos=0&amount=21000001";
let pjuri = Uri::try_from(uri)
.expect("Invalid uri")
.assume_checked();
assert!(pjuri.amount > Some(bitcoin::amount::Amount::MAX_MONEY))
}
Just my two cents, I would say bitcoin_uri should not care about amount. Validating the amount in pj uri is something the wallet implementation must do regardless to ensure user has sufficient funds, and user funds will naturally be within MAX_MONEY bounds.
Activity
Remove amount assert in pjuri fuzzer
Remove amount assert in pjuri fuzzer
xstoicunicornx commentedon Apr 15, 2026
Just my two cents, I would say
bitcoin_urishould not care about amount. Validating the amount in pj uri is something the wallet implementation must do regardless to ensure user has sufficient funds, and user funds will naturally be withinMAX_MONEYbounds.