-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
795 lines (721 loc) · 24.4 KB
/
index.html
File metadata and controls
795 lines (721 loc) · 24.4 KB
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Web Ledgers 0.1.4</title>
<meta
name="description"
content="A specification for mapping URIs to balances on the web, enabling distributed ledger systems across platforms and protocols."
/>
<meta
name="keywords"
content="web ledgers, distributed ledger, URI, balance, payments, cryptocurrency, nostr, decentralized"
/>
<script
src="https://www.w3.org/Tools/respec/respec-w3c"
class="remove"
></script>
<script class="remove">
var respecConfig = {
specStatus: 'CG-DRAFT',
publishDate: '2024-01-15',
editors: [
{
name: 'Melvin Carvalho',
url: 'https://melvincarvalho.com/#me',
company: 'Independent',
companyURL: 'https://melvincarvalho.com/#me'
}
],
authors: [
{
name: 'Melvin Carvalho',
url: 'https://melvincarvalho.com/#me',
company: 'Independent',
companyURL: 'https://melvincarvalho.com/#me'
}
],
group: 'payments',
groupURI: 'https://www.w3.org/community/webpayments/',
groupPublicList: 'public-webpayments',
processVersion: 2023,
edDraftURI: 'https://solidpayorg.github.io/webledgers/',
latestVersion: 'https://solidpayorg.github.io/webledgers/',
thisVersion: 'https://solidpayorg.github.io/webledgers/',
shortName: 'webledgers',
issueBase: 'https://github.com/solidpayorg/webledgers/issues/',
github: 'https://github.com/solidpayorg/webledgers/',
license: 'w3c-software-doc',
specStatus: 'unofficial',
localBiblio: {
'LINKED-DATA': {
title: 'Linked Data - Design Issues',
href: 'https://www.w3.org/DesignIssues/LinkedData.html',
authors: ['Tim Berners-Lee'],
publisher: 'W3C'
}
}
}
</script>
<style>
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">
<p>
Web Ledgers provide a standardized method for mapping Uniform Resource
Identifiers (URIs) to numerical balances on the web, enabling
distributed ledger systems that transcend platform boundaries. This
specification defines data models, serialization formats, and
interoperability guidelines for creating decentralized economic systems
using web-native identifiers.
</p>
<p>
By utilizing URIs as universal identifiers, Web Ledgers enable seamless
value transfer between heterogeneous systems including social platforms,
blockchain networks, communication protocols, and decentralized identity
systems. The specification supports multiple serialization formats
(JSON) and provides extensible entry types for different use cases.
</p>
<p>
This document defines the core data model, JSON Schema validation rules,
and provides comprehensive examples demonstrating interoperability
across platforms including Nostr, WebID, traditional web services, and
cryptocurrency systems.
</p>
</section>
<section id="sotd">
<p>
This document is an informal draft being discussed in the
<a href="https://www.w3.org/community/webpayments/"
>W3C Web Payments Community Group</a
>. It is not a W3C Standard nor is it on the W3C Standards Track.
</p>
<p>
This is a living document that may be updated, replaced, or obsoleted by
other documents at any time. It is inappropriate to cite this document
as other than work in progress.
</p>
<p>
Comments and feedback on this specification are welcome and should be
directed to the
<a href="https://github.com/solidpayorg/webledgers/issues/"
>GitHub issues</a
>
for this specification.
</p>
</section>
<section>
<h2>Introduction</h2>
<p>
The modern web consists of numerous independent platforms and services,
each maintaining their own user accounts and value systems. Traditional
ledgers, in their simplest form, consist of two columns: an identifier
for an agent and their corresponding balance. Web Ledgers extend this
concept to the web scale by utilizing [[RFC3986]] Uniform Resource
Identifiers (URIs) as universal identifiers that transcend platform
boundaries.
</p>
<p>
This specification defines a standardized approach for representing and
exchanging balance information across heterogeneous systems including
social networks, blockchain platforms, communication protocols, and
decentralized identity systems. By leveraging web standards and
providing multiple serialization formats, Web Ledgers enable
interoperability between previously incompatible systems.
</p>
<p>The Web Ledgers specification provides:</p>
<ul>
<li>A core data model for representing URI-to-balance mappings</li>
<li>JSON-LD based serialization format</li>
<li>
Flexible amount formats supporting single or multi-currency entries
</li>
<li>Interoperability guidelines for cross-platform integration</li>
</ul>
<section id="conformance" class="informative">
<h3>Conformance</h3>
<p>
As well as sections marked as non-normative, all authoring guidelines,
diagrams, examples, and notes in this specification are non-normative.
Everything else in this specification is normative.
</p>
<p>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [[RFC2119]].
</p>
</section>
<section class="informative">
<h2>Design Goals</h2>
<p>
Web Ledgers 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>Simplicity</td>
<td>
The ledger is designed to be as simple as possible. As such you
just need two data points. The user and the balance.
</td>
</tr>
<tr>
<td>Decentralization</td>
<td>
The ledger should not be server specific, though it may be.
</td>
</tr>
<tr>
<td>Security</td>
<td>
Transmission of a ledger changes tend to be over encrypted
channels.
</td>
</tr>
<tr>
<td>Discoverability</td>
<td>
It may be possible to discover more information about a URI by
standard mechanisms of dereferencing, including, but not limited
to HTTP.
</td>
</tr>
<tr>
<td>Interoperability</td>
<td>
URIs 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
Ledgers.
</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 id="design" class="informative">
<h3>Terminology</h3>
<h3>Terminology</h3>
<dl class="termlist">
<dt>
<dfn class="export" lt="web ledger|web ledgers">Web Ledger</dfn>
</dt>
<dd>
A structured data format that maps URIs to numerical balance values,
optionally including a human-readable name and description. A Web
Ledger enables interoperability between different systems by using
web-native identifiers.
</dd>
<dt><dfn class="export" lt="agent|agent">Agent</dfn></dt>
<dd>
An Agent is a URI that denotes a person, machine or account on the
web.
</dd>
<dt><dfn class="export" lt="balance|balance">balance</dfn></dt>
<dd>
Each URI maps to a balance in the Web Ledger. A balance is a numerical
value with an explicit or implicit unit of currency. If not unit is
stated the unit MAY be taken from the popular electronic coin,
bitcoin, and is equal to 1 satoshi.
</dd>
<dt><dfn class="export" lt="currency|currency">currency</dfn></dt>
<dd>A currency is denomination of a given balance</dd>
<dt>
<dfn class="export" lt="ledger name|ledger names">Ledger Name</dfn>
</dt>
<dd>
A human-readable string that identifies a Web Ledger. The name
provides a friendly identifier that helps users and systems
distinguish between different ledgers.
</dd>
<dt>
<dfn class="export" lt="decentralized system|decentralized systems"
>decentralized system</dfn
>
</dt>
<dd>
A system in which lower level components operate on local information
to accomplish global goals. For example, an ant colony is a
decentralized system as there is no central control determining when
food must be collected or how new tunnels should be excavated.
</dd>
</dl>
</section>
<section id="Data Model" class="Data Model">
<h2>Data Model</h2>
The Web Ledgers data model uses JSON-LD as its primary serialization
format, designed to have varying layers of complexity depending on the use
case.
<h3>JSON / JSON-LD</h3>
<p>
A structured JSON format for a ledger consists of an entries array with
metadata and typed entries. The ledger can include a human-readable name
and description to provide context about its purpose and contents. The
amount field supports both simple string values (for single currency)
and arrays of currency objects (for multi-currency entries).
</p>
<pre
class="example highlight"
title="Example of structured JSON-based web ledger"
>
{
"@context": "https://w3id.org/webledgers",
"type": "WebLedger",
"id": "https://example.com/ledger/1",
"name": "WebLedgers Example",
"description": "A ledger tracking balances across multiple platforms",
"created": 1705316200,
"updated": 1705316200,
"defaultCurrency": "satoshi",
"entries": [
{
"type": "Entry",
"url": "did:nostr:de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645",
"amount": "132500"
},
{
"type": "Entry",
"url": "https://www.w3.org/People/Berners-Lee/card#i",
"amount": "100000"
}
]
}
</pre
>
<h4>Entry Variations</h4>
<p>
All entries use the same "Entry" type but can have different properties
depending on their purpose. The amount field can be either a simple
string (for single currency in default denomination) or an array of
currency objects (for multi-currency entries):
</p>
<pre class="example highlight" title="Different entry variations">
{
"@context": "https://w3id.org/webledgers",
"type": "WebLedger",
"id": "https://gaming.example.com/ledger/tournament",
"name": "Gaming Tournament Rewards",
"description": "Prize distribution ledger for esports tournament participants",
"defaultCurrency": "satoshi",
"entries": [
{
"type": "Entry",
"url": "did:nostr:de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645",
"amount": "132500"
},
{
"type": "Entry",
"url": "https://www.w3.org/People/Berners-Lee/card#i",
"amount": [
{"currency": "satoshi", "value": "50000"},
{"currency": "USD", "value": "25.00"}
]
},
{
"type": "Entry",
"url": "urn:voucher:1234567890abcdef",
"amount": [
{"currency": "points", "value": "100"}
]
}
]
}
</pre
>
<h4>Amount Serialization Rules</h4>
<p>
The amount field supports flexible serialization based on the currency
context:
</p>
<ul>
<li>
<strong>Simple string format:</strong> Use when there is exactly one
balance in the ledger's defaultCurrency. Example:
<code>"amount": "100000"</code>
</li>
<li>
<strong>Array format:</strong> Use when there are multiple currencies
or when the currency differs from the defaultCurrency. Example:
<code>"amount": [{"currency": "USD", "value": "25.00"}]</code>
</li>
</ul>
<h3>Named Ledger Use Cases</h3>
<p>
Web Ledgers can use descriptive names to clarify their purpose and
context:
</p>
<h4>Community Reputation System</h4>
<pre class="example highlight" title="Community reputation ledger">
{
"@context": "https://w3id.org/webledgers",
"type": "WebLedger",
"id": "https://community.example.com/reputation",
"name": "Developer Community Reputation",
"description": "Reputation scores for open source contributors based on code contributions and peer reviews",
"defaultCurrency": "reputation-points",
"entries": [
{
"type": "Entry",
"url": "https://github.com/alice-dev#this",
"amount": "2750"
}
]
}
</pre
>
<h4>Educational Achievement Tracking</h4>
<pre class="example highlight" title="Educational achievement ledger">
{
"@context": "https://w3id.org/webledgers",
"type": "WebLedger",
"id": "https://university.example.edu/course-credits",
"name": "Computer Science Course Credits",
"description": "Academic credit tracking for CS degree program students",
"defaultCurrency": "credit-hours",
"entries": [
{
"type": "Entry",
"url": "mailto:student@university.example.edu",
"amount": "120"
}
]
}
</pre
>
</section>
<section id="security-considerations">
<h2>Security Considerations</h2>
<p>
Web Ledgers implementations SHOULD consider the following security
aspects:
</p>
<section>
<h3>Authentication and Authorization</h3>
<p>
Implementations SHOULD provide mechanisms to authenticate ledger
updates and authorize balance modifications. Without proper
authentication, malicious actors could manipulate balances or create
fraudulent entries.
</p>
<p>Recommended approaches include:</p>
<ul>
<li>Digital signatures using cryptographic key pairs</li>
<li>OAuth 2.0 or similar authentication protocols</li>
<li>Multi-signature schemes for high-value transactions</li>
</ul>
</section>
<section>
<h3>Data Integrity</h3>
<p>
Implementations SHOULD implement mechanisms to ensure data integrity
and prevent tampering. This includes:
</p>
<ul>
<li>Cryptographic hashing of ledger entries</li>
<li>Merkle tree structures for efficient verification</li>
<li>Timestamp validation to prevent replay attacks</li>
</ul>
</section>
<section>
<h3>Transport Security</h3>
<p>
All ledger data transmission MUST occur over secure channels
(HTTPS/TLS) to prevent man-in-the-middle attacks and ensure
confidentiality.
</p>
</section>
</section>
<section id="privacy-considerations">
<h2>Privacy Considerations</h2>
<p>
Web Ledgers may contain sensitive financial information. Implementations
SHOULD consider the following privacy aspects:
</p>
<section>
<h3>Data Minimization</h3>
<p>
Implementations SHOULD only store and transmit the minimum amount of
information necessary for ledger functionality. Sensitive metadata
should be avoided unless essential.
</p>
</section>
<section>
<h3>URI Privacy</h3>
<p>
URIs used as identifiers may reveal personal information.
Implementations SHOULD:
</p>
<ul>
<li>Support pseudonymous identifiers where possible</li>
<li>Provide mechanisms for identifier rotation</li>
<li>Clearly document any privacy implications of URI schemes</li>
</ul>
</section>
<section>
<h3>Access Control</h3>
<p>
Implementations MUST provide appropriate access controls to prevent
unauthorized access to balance information. This includes:
</p>
<ul>
<li>Role-based access control (RBAC)</li>
<li>Fine-grained permissions for different operations</li>
<li>Audit logging for compliance and monitoring</li>
</ul>
</section>
</section>
<section id="implementations" class="informative">
<h2>Implementations</h2>
<p>
This section is informative and provides guidance for implementers of
Web Ledgers systems.
</p>
<section>
<h3>Reference Implementation</h3>
<p>
A reference implementation is available at
<a href="https://github.com/solidpayorg/webledgers-reference"
>https://github.com/solidpayorg/webledgers-reference</a
>.
</p>
</section>
<section>
<h3>Known Implementations</h3>
<p>The following implementations are known to support Web Ledgers:</p>
<ul>
<li>
SolidPay Ledger Service - Production implementation supporting
multiple URI schemes
</li>
<li>
Nostr Ledger Extension - Experimental implementation for Nostr
protocol
</li>
</ul>
</section>
</section>
<section id="examples" class="appendix informative">
<h2>Examples</h2>
<h3>Decentralized Identifiers</h3>
<h4>Nostr DID</h4>
<p>
Nostr public keys represented as DIDs for decentralized social
networking.
</p>
<pre class="example highlight" title="Nostr DID ledger entry">
{
"type": "Entry",
"url": "did:nostr:de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645",
"amount": "132500"
}
</pre
>
<h4>WebID</h4>
<p>A WebID representing a person's web identity.</p>
<pre class="example highlight" title="WebID ledger entry">
{
"type": "Entry",
"url": "https://www.w3.org/People/Berners-Lee/card#i",
"amount": "100000"
}
</pre
>
<h3>Social Platforms</h3>
<h4>GitHub</h4>
<p>The popular git service platform.</p>
<pre class="example highlight" title="GitHub ledger entry">
{
"type": "Entry",
"url": "https://github.com/solid-pay#this",
"amount": "75000"
}
</pre
>
<h4>Twitter/X</h4>
<p>The microblogging service.</p>
<pre class="example highlight" title="Twitter ledger entry">
{
"type": "Entry",
"url": "https://x.com/user#this",
"amount": "50000"
}
</pre
>
<h4>YouTube</h4>
<p>The video sharing platform.</p>
<pre class="example highlight" title="YouTube ledger entry">
{
"type": "Entry",
"url": "https://www.youtube.com/channel/UCabcdef1234567890#this",
"amount": "25000"
}
</pre
>
<h3>Communication Protocols</h3>
<h4>Email</h4>
<p>Traditional email addresses as identifiers.</p>
<pre class="example highlight" title="Email ledger entry">
{
"type": "Entry",
"url": "mailto:timbl@w3.org",
"amount": "15000"
}
</pre
>
<h4>Mobile Phone</h4>
<p>Phone numbers as global identifiers.</p>
<pre class="example highlight" title="Mobile ledger entry">
{
"type": "Entry",
"url": "tel:+15550909090",
"amount": "10000"
}
</pre
>
<h3>Cryptocurrency & Blockchain</h3>
<h4>Bitcoin Address</h4>
<p>Bitcoin addresses as payment identifiers.</p>
<pre class="example highlight" title="Bitcoin ledger entry">
{
"type": "Entry",
"url": "bitcoin:1Kr6QSydW9bFQG1mXiPNNu6WpJGmUa9i1g",
"amount": "2100000"
}
</pre
>
<h4>Transaction Outputs</h4>
<p>Bitcoin transaction outputs (UTXOs) as specific balance holders.</p>
<pre class="example highlight" title="Transaction output ledger entry">
{
"type": "Entry",
"url": "txo:btc:f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16:0",
"amount": "5000000000"
}
</pre
>
<h3>Vouchers & Tokens</h3>
<h4>Web Voucher</h4>
<p>Digital vouchers following the webvoucher specification.</p>
<pre class="example highlight" title="Voucher ledger entry">
{
"type": "Entry",
"url": "urn:voucher:1234567890abcdef",
"amount": "25000"
}
</pre
>
<h3>Complete Ledger Example</h3>
<p>
A complete ledger with multiple entry variations demonstrating the full
data model with descriptive naming for clarity, including both simple
string amounts and multi-currency arrays.
</p>
<pre class="example highlight" title="Complete multi-platform ledger">
{
"@context": "https://w3id.org/webledgers",
"type": "WebLedger",
"id": "https://example.com/ledger/global",
"name": "Universal Web Credits",
"description": "Cross-platform ledger demonstrating interoperability between social networks, blockchain systems, and communication protocols",
"created": 1705276800,
"updated": 1705316200,
"defaultCurrency": "satoshi",
"entries": [
{
"type": "Entry",
"url": "did:nostr:de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645",
"amount": "132500"
},
{
"type": "Entry",
"url": "https://www.w3.org/People/Berners-Lee/card#i",
"amount": [
{"currency": "satoshi", "value": "100000"},
{"currency": "USD", "value": "50.00"},
{"currency": "reputation-points", "value": "500"}
]
},
{
"type": "Entry",
"url": "https://github.com/solid-pay#this",
"amount": "75000"
},
{
"type": "Entry",
"url": "mailto:timbl@w3.org",
"amount": [
{"currency": "EUR", "value": "12.50"}
]
},
{
"type": "Entry",
"url": "urn:voucher:1234567890abcdef",
"amount": "25000"
}
]
}
</pre
>
</section>
<section id="acknowledgements" class="appendix informative">
<h2>Acknowledgements</h2>
<p>
The editor would like to thank the
<a href="https://www.w3.org/community/webpayments/"
>W3C Web Payments Community Group</a
>
for their support and feedback during the development of this
specification.
</p>
<p>
Special thanks to the following individuals and organizations for their
contributions, feedback, and implementation efforts:
</p>
<ul>
<li>The W3C Web Payments Community Group participants</li>
<li>The Nostr protocol development community</li>
<li>The Solid project community</li>
<li>Contributors to the SolidPay project</li>
</ul>
<p>
This specification builds upon the foundational work of the World Wide
Web Consortium, particularly the URI specification [[RFC3986]] and the
JSON-LD specification [[JSON-LD11]].
</p>
</section>
</body>
</html>