-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
328 lines (264 loc) · 11.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Web Vouchers v0.1</title>
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' class='remove'></script>
<script class='remove'>
var respecConfig = {
specStatus: "CG-DRAFT",
editors: [{
name: "Melvin Carvalho",
url: "https://melvincarvalho.com/#me",
mailto: "[email protected]"
}],
authors: [{
name: "Melvin Carvalho",
url: "https://melvincarvalho.com/#me",
mailto: "[email protected]"
}],
wg: 'W3C Payments Community Group',
wgURI: 'https://www.w3.org/community/webpayments/',
wgPublicList: "public-webpayments",
processVersion: 2019,
edDraftURI: "https://github.com/solidpayorg/webvouchers/",
shortName: "webvouchers",
issueBase: "https://github.com/solidpayorg/webvouchers/"
};
</script>
<style>
.turtle .hll {
background-color: #ffffcc
}
pre .highlight {
font-weight: bold;
color: green;
}
pre .comment {
color: SteelBlue;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
</head>
<body>
<section id='abstract'>
<i><b>Web Vouchers: A Simple and Secure Way to Handle One-Time Payments on the Web.</b></i>.
<p>
Web Vouchers introduce a simple, standardized way to use vouchers, codes, or tokens for one-time
payments and services on the web. By using Uniform Resource Names (URNs), Web Vouchers easily
integrate into existing web systems, offering a secure and interoperable solution that improves upon
current methods.
</p>
<p>
Designed as urn:voucher:namespace:123456789abcdefghi, these vouchers can be used for everything
from e-commerce discounts to secure access for web services. This spec explains how to format
and use Web Vouchers, provides examples, and addresses important aspects like security, making sure
transactions are safe, and extensible, ensuring everyone can use them easily.
</p>
<p>
We've included guidelines for developers on how to implement Web Vouchers, along with tools to check
if they're set up correctly. Plus, there's information on how to give feedback and help improve future
versions of the spec.
</p>
<p>
In short, Web Vouchers aim to make web payments and services simpler and safer for everyone, everywhere.
</p>
</section>
<section id='sotd'>
<p>
This document in an informal draft originally discussed in the <a href="https://www.w3.org/community/webpayments/">w3c web
payments community group</a>.
</p>
</section>
<section>
<h2>Introduction</h2>
<p>One time codes are a popular way of solving one off problems on the web. And example might be sending someone a
code
to log in to a system, or one to reset a password or one to creating a private address for a calendar. However
there
exists no generic URN on the web to encode such a one time code such that it can be used for redeeming a payment,
good or service.
</p>
<p>
This document specifies a format, and operations that Web Vouchers may support.
</p>
<section>
<h3>Overview</h3>
This spec is a work in progress.
This document in an informal draft originally discussed in the <a href="https://www.w3.org/community/webpayments/">w3c web
payments community group</a>, now inactive. It has been updated to take into account new innovations such as electronic
coins such as bitcoin, the lightning network, and Cashu.
</section>
<section class="informative">
<h2>
Design Goals
</h2>
<p>
Web Vouchers are a component of larger systems, such as
the Linked Data ecosystem [[LINKED-DATA]], which have driven
the design goals for this specification. This section summarizes the
primary design goals for this specification.
</p>
<table class="simple">
<thead>
<tr>
<th>
Goal
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Decentralization
</td>
<td>
The voucher should not be server specific, though it may be.
</td>
</tr>
<tr>
<td>
Control
</td>
<td>
Only the entities that know the voucher URN can use it.
</td>
</tr>
<tr>
<td>
Privacy
</td>
<td>
The Voucher URN is kept private between those that honor it.
</td>
</tr>
<tr>
<td>
Security
</td>
<td>
Transmission of a URN will be over encrypted formats.
</td>
</tr>
<tr>
<td>
Discoverability
</td>
<td>
It may be possible to discover more information about a URN in a proof based network, or using an
authoritative server.
</td>
</tr>
<tr>
<td>
Interoperability
</td>
<td>
URIs and URNs are used to provide wide interoperability with existing systems on the web.
</td>
</tr>
<tr>
<td>
Portability
</td>
<td>
Be system and network-independent and
enable entities to use their digital identifiers with any
system that supports Web Vouchers.
</td>
</tr>
<tr>
<td>
Simplicity
</td>
<td>
Favor a reduced set of simple features in order to make the technology
easier to understand, implement, and deploy.
</td>
</tr>
<tr>
<td>
Extensibility
</td>
<td>
When possible, enable extensibility
provided it does not greatly hinder interoperability,
portability, or simplicity.
</td>
</tr>
</tbody>
</table>
</section>
</section>
<section>
<h2>Understanding Namespaces in Web Vouchers</h2>
<p>
In the context of Web Vouchers, namespaces play a crucial role in organizing and identifying vouchers across various domains and applications.
A namespace is a part of the voucher's URN that specifies its category or issuer, enabling a structured and hierarchical approach to voucher
management. This system facilitates the differentiation between vouchers, even when they originate from different entities or serve distinct purposes.
</p>
<p>
For example, the URN <code>urn:voucher:cashu:123456789abcdefghi</code> uses "cashu" as its namespace, indicating a voucher associated with the Cashu project.
Similarly, a voucher intended for general web use might employ a namespace like "web", as in <code>urn:voucher:web:123456789abcdefghi</code>.
The Web namespace is generic web based voucher issuance, JSON will safely encode small JSON objects, txo will be used by selectronic coins, and so on.
By utilizing namespaces, the Web Vouchers system ensures interoperability and clarity, allowing vouchers to be easily categorized, discovered, and validated.
</p>
<p>
The design of Web Vouchers supports a wide range of namespaces, accommodating everything from corporate issuers to cryptocurrencies, and from loyalty points
to fiat currencies. This flexibility ensures that Web Vouchers can adapt to various use cases and evolve alongside the web's ever-changing landscape.
</p>
</section>
<section>
<h3>URN Format</h3>
Each namespace will have its own format and a link to the documentation. Current namespaces are `txo` (transaction object), `cashu` <a href="https://github.com/cashubtc/nuts/blob/main/00.md">cashu nuts</a>, and `web` generic web vouchers
The basic idea is to create a capability URN (like a capability URI but with an URN) and allow it to be used as a
voucher for spending. The proposed format is :
<section>
<h3>Cashu</h3>
<a href="https://cashu.space/">Cashu</a> is a free and open-source Chaumian ecash system for Bitcoin which allows building privacy-preserving
custodial payment and voucher systems. The latest Cashu V3 token serialization format is: `cashu` then `A` which is the version followed by URL safe base64 encoded JSON.
<pre class="example nohighlight" title="A simple example a Web Voucher">
urn:voucher:cashu:cashuAeyJ0b2tlbiI6W3sibWludCI6Imh0dHBzOi8vODMzMy5zcGFjZTozMzM4IiwicHJvb2ZzIjpbeyJhbW91bnQiOjIsImlkIjoiMDA5YTFmMjkzMjUzZTQxZSIsInNlY3JldCI6IjQwNzkxNWJjMjEyYmU2MWE3N2UzZTZkMmFlYjRjNzI3OTgwYmRhNTFjZDA2YTZhZmMyOWUyODYxNzY4YTc4MzciLCJDIjoiMDJiYzkwOTc5OTdkODFhZmIyY2M3MzQ2YjVlNDM0NWE5MzQ2YmQyYTUwNmViNzk1ODU5OGE3MmYwY2Y4NTE2M2VhIn0seyJhbW91bnQiOjgsImlkIjoiMDA5YTFmMjkzMjUzZTQxZSIsInNlY3JldCI6ImZlMTUxMDkzMTRlNjFkNzc1NmIwZjhlZTBmMjNhNjI0YWNhYTNmNGUwNDJmNjE0MzNjNzI4YzcwNTdiOTMxYmUiLCJDIjoiMDI5ZThlNTA1MGI4OTBhN2Q2YzA5NjhkYjE2YmMxZDVkNWZhMDQwZWExZGUyODRmNmVjNjlkNjEyOTlmNjcxMDU5In1dfV0sInVuaXQiOiJzYXQiLCJtZW1vIjoiVGhhbmsgeW91LiJ9
</pre>
</section>
<section>
<h3>Transaction Objects</h3>
Transaction options are spendable token in electrionic coins such as bitcoin. Typically it will have, for a given chain, a public components, the txid plus output (vout),
plus a public key or script showing who can spend the token. A transaction object web voucher, can be made spendable by appending the private key K, to the end of the voucher.
Web vouchers including private keys should be kept or transmitted in a secure environment, as anyone with access to the string can spend all coins from that address.
<pre class="example nohighlight" title="A simple example a Web Voucher">
urn:voucher:txo:chain:123456789abcdef:vout?key=K&amount=1000000
</pre>
</section>
<section>
<h3>JSON format</h3>
The json format is a simple extension to the cashu system, which allows arbitrary json to be transmitted in an object. This is a work in progress, and has not currently been implmented.
<pre class="example nohighlight" title="A simple example a Web Voucher">
urn:voucher:json:123456789abcdefghi
</pre>
</section>
</section>
<section>
<h3>Discovery</h3>
There are two things that are useful to discover. Firstly, more information about a
voucher. The discovered document SHOULD return Linked Data. This can be done on a well known url, for example :
<pre class="example nohighlight" title="Well Known Discovery for a Web Voucher">
https://webvouchers.org/.well-known/voucher/cashu/123456789abcdefghi
</pre>
The other convenient thing that can be discovered is a server or servers that accept the voucher. This could be done
over a gossip network with an initial bootstrap. A discovery node accepts the URN and points to a document with
relevant servers.
</section>
<section>
<h3>Acknowledgments</h3>
This spec is a team effort. Thanks to Michiel De Jong, Andrew Bansford Brown, Stuart Rashford, Adrian Hope-Bailie,
Calle and many others for making this possible.
</section>
</body>
</html>