Bitcointalk · URI-scheme for bitcoin

中本聪,2010 年 5 月 16 日

SN-0316 已核对来源,附原文与上下文。

阅读语言
中文译文

freenet URI 是这样的:

http://127.0.0.1:8888/USK@oshw3DxmJUt7q4ThF4dCez5IXbc9hCGcv0VuwLRCmeQ,ckeXv20F1gBzkqssB4RXHZ2nB1YRT8Pb8KYZk8wj-bs,AQACAAE/occamsrazor/6/f.pdf

瞧,我们完全可以照同样的方式做,比如: http://127.0.0.1:8330/?to=;amount=

Bitcoin 可以像在 8332 上应答 JSON-RPC 那样,在本地回环的 8330 端口上应答,给出 HTTP 应答。

bitcoin 链接应该更像 mailto: 而不是 magnet:,恕我直言。

我想我们能办到。

虽然 Bitcoin 有可能在 HTTP 应答里呈现 HTML 界面、直接把事情办了,但作为用户,我会疑惑:是某个网站想骗我,还是我真的在和自己的 Bitcoin 服务器对话?

HTTP 应答可以只是一段带 JavaScript 的 HTML,等价于后退按钮,把浏览器送回原页面。然后 Bitcoin 弹出发送比特币对话框,目标比特币地址和金额已经填好。工作方式就像 mailto: 链接弹出一个已填好地址的新邮件。

127.0.0.1 回环对机器上的任何用户都可访问,没有按用户隔离,但这没关系,因为它只提供"预填对话框字段"的便利功能。你仍然得按发送。我们要确保发送按钮不处于选中状态,免得你正在敲空格或回车时它跳到前台。

ORIGINAL · 英文原文

There you go, we could easily do it the same way, like:
http://127.0.0.1:8330/?to=<bitcoinaddress>;amount=<amount>

Bitcoin can answer port 8330 on local loopback just as it does for JSON-RPC on 8332.  It would give an HTTP answer.


A bitcoin-link should be more like mailto: than magnet: IMHO.

I think we can do that.

Although it would be possible for Bitcoin to take care of business in the HTTP response by presenting HTML UI to the user, as a user I would wonder if some website is trying to trick me or if I'm really talking to my own Bitcoin server.

The HTTP response could simply be HTML with the JavaScript equivalent of the back button, sending it back to the page.  Bitcoin then pops up the Send Bitcoins dialog with the destination bitcoin address and amount already filled in.  It would work just like a mailto: link that pops up a new email with the address filled in.

127.0.0.1 loopback is accessible by any user on the machine, it doesn't have per-user separation, but it's OK because it would only serve the convenience function of pre-filling the fields in a dialog.  You'd still have to press Send.  We'd have to make sure the Send button is not selected so it couldn't jump into the foreground while you're typing a space or enter.


来源
Bitcointalk 原始链接 ↗ 记录编号 SN-0316