From: Matt Corallo Date: Sat, 13 Jul 2024 19:45:36 +0000 (+0000) Subject: Detect and warn on silent payments in the body of the URI X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=b6a1e5424518df92ac087924df73ee8a35f5b2b0;p=satsto.me Detect and warn on silent payments in the body of the URI --- diff --git a/index.html b/index.html index 68665d6..03ac955 100644 --- a/index.html +++ b/index.html @@ -314,8 +314,14 @@ addr_idx += 1; addr_ty_table += "
" + value + "
"; }; + var res = "

It works!

" + name + " was successfully resolved to the following addresses.
Your wallet should have automatically opened to pay, but if not, click here to do so."; if (base_and_params[0].length != 0) { - push_table_entry("On-Chain Non-Private Address", "", base_and_params[0]); + if (base_and_params[0].startsWith("sp1q")) { + res += "
Note: the response included a Silent Payment address which was encoded in the \"body\" position in the URI (i.e. bitcoin:sp1q...) rather than in the \"sp\" query parameter (i.e. bitcoin:?sp=sp1q...). This is incorrect and may cause some wallets to fail to pay on-chain."; + push_table_entry("On-Chain Silent Payment", "", base_and_params[0]); + } else { + push_table_entry("On-Chain Non-Private Address", "", base_and_params[0]); + } } if (base_and_params.length > 1 && base_and_params[1].length > 0) { for (const param of base_and_params[1].split("&")) { @@ -329,7 +335,6 @@ } } } - var res = "

It works!

" + name + " was successfully resolved to the following addresses.
Your wallet should have automatically opened to pay, but if not, click here to do so."; if (addr_ty_table != "") { res += "
" + addr_ty_table; }