-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbase58-encodings.html
More file actions
336 lines (282 loc) · 15.6 KB
/
base58-encodings.html
File metadata and controls
336 lines (282 loc) · 15.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>base58 Encodings - XAG Ledger Dev Portal</title>
<!-- favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicons/favicon-32x32.png">
<link rel="manifest" href="assets/favicons/site.webmanifest">
<link rel="shortcut icon" href="favicon.ico">
<meta name="msapplication-TileColor" content="#25A768">
<meta name="msapplication-config" content="assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#25A768">
<!-- jQuery -->
<script src="assets/vendor/jquery-1.11.1.min.js"></script>
<!-- Stylesheet -->
<link href="assets/css/devportal.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<!-- syntax highlighting -->
<link rel="stylesheet" href="assets/vendor/docco.min.css" />
<script src="assets/vendor/highlight.min.js"></script>
<!-- expandable code samples -->
<script src="assets/js/expandcode.js"></script>
<!-- multi-code selection tabs -->
<script src="assets/js/multicodetab.js"></script>
<script>
$(document).ready(function() {
$(".multicode").minitabs();
hljs.initHighlighting();
make_code_expandable();
});
</script>
</head>
<body class="xrp-ledger-dev-portal sidebar-primary lang-en ">
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-white">
<a href="index.html" class="navbar-brand"><img src="assets/img/logo.png" class="logo" height="44" alt="XAG Ledger Dev Portal" /></a>
<button class="navbar-toggler" type="button" data-toggle="slide-collapse" data-target="#navbarHolder" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarHolder">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="dev-tools.html">Dev Tools</a>
</li>
<li class="nav-item">
<a class="nav-link" href="http://xagfans.com/" target="blank">BBS</a>
</li>
</ul>
<div class="nav navbar-nav language-selector">
<div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" id="language_selector_header_btn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
English
</button>
<div class="dropdown-menu" aria-labelledby="language_selector_header_btn">
<a class="dropdown-item" href="/base58-encodings.html">English</a>
<a class="dropdown-item" href="/cn/base58-encodings.html">中文</a>
</div><!--/.dropdown-menu-->
</div><!--/.dropdown-->
</div><!--/.language-selector-->
</div><!--/#navbarHolder-->
<div class="menu-overlay"></div>
</nav>
<div class="container-fluid" role="document" id="main_content_wrapper">
<div class="row">
<!-- Right sidebar first so it's at the beginning for mobile layouts -->
<aside class="right-sidebar col-lg-3 order-lg-4 p-0" role="complementary">
<div class="card" id="page-toc-wrapper">
<div class="card-header">
<h4>In this document</h4>
</div>
<ul class="card-body">
<li class="level-1"><a href="#base58-encodings">base58 Encodings</a></li>
<li class="level-2"><a href="#see-also">See Also</a></li>
</ul>
</div>
</aside>
<!-- main column -->
<main class="main col-md-7 col-lg-6 order-md-3 " role="main" id="main_content_body">
<nav class="breadcrumbs-wrap p-0 p-md-3" aria-label="breadcrumb">
<ul class="breadcrumb bg-white">
<li class="breadcrumb-item"><a href="index.html">Home</a></li>
<li class="active breadcrumb-item"><a href="docs.html">Docs</a></li>
<li class="active breadcrumb-item"><a href="references.html">References</a></li>
<li class="active breadcrumb-item"><a href="rippled-api.html">rippled API Reference</a></li>
<li class="active breadcrumb-item"><a href="api-conventions.html">API Conventions</a></li>
<li class="active breadcrumb-item">base58 Encodings</li>
</ul>
</nav><!--/.breadcrumbs-wrap--> <article class="pt-3 p-md-3">
<div class="content">
<h1 id="base58-encodings">base58 Encodings</h1>
<p>The <code>rippled</code> APIs often use a <a class="external-link" href="https://en.wikipedia.org/wiki/Base58" target="_blank">base58 <i aria-hidden="true" class="fa fa-external-link"></i></a> encoding with a checksum (sometimes called "Base58Check") to represent <a href="accounts.html#addresses">account addresses</a> and other types of values related to cryptographic keys. This encoding is the same as the one used for Bitcoin addresses, except that the XAG Ledger uses the following dictionary: <code>rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz</code>.</p>
<p>The XAG Ledger prefixes different types of values with a specific 8-bit number before encoding them to distinguish between different data types. Combined with the arrangement of characters in the XAG Ledger's base58 dictionary, the result is that the base58 representations for different types of encoded values start with specific letters by type.</p>
<p>The following table lists all the encodings the XAG Ledger uses:</p>
<table>
<thead>
<tr>
<th align="left">Data Type</th>
<th align="left">Starts With</th>
<th align="left">Type Prefix</th>
<th align="left">Content size¹</th>
<th align="left">Maximum characters</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><a href="accounts.html">Account</a> address</td>
<td align="left">r</td>
<td align="left"><code>0x00</code></td>
<td align="left">20 bytes</td>
<td align="left">35</td>
</tr>
<tr>
<td align="left">Account public key</td>
<td align="left">a</td>
<td align="left"><code>0x23</code></td>
<td align="left">33 bytes</td>
<td align="left">53</td>
</tr>
<tr>
<td align="left">Seed value (for secret keys)</td>
<td align="left">s</td>
<td align="left"><code>0x21</code></td>
<td align="left">16 bytes</td>
<td align="left">29</td>
</tr>
<tr>
<td align="left">Validation public key or node public key</td>
<td align="left">n</td>
<td align="left"><code>0x1C</code></td>
<td align="left">33 bytes</td>
<td align="left">53</td>
</tr>
</tbody>
</table>
<p>¹ Content size excludes the 1-byte type prefix.</p>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="accounts.html#address-encoding">Address Encoding</a> - detailed information on address encoding</li>
<li><a href="cryptographic-keys.html">Cryptographic Keys</a> - types of cryptographic keys in the XAG Ledger and how they're used</li>
<li><a href="wallet_propose.html">wallet_propose Reference</a> - API method for generating account keys</li>
<li><a href="validation_create.html">validation_create Reference</a> - API method for generating validator keys</li>
</ul>
<!-- -->
<!-- -->
<!-- API object types -->
<!-- -->
<!-- -->
<!-- -->
<!-- rippled release notes links -->
</div>
</article>
</main>
<!-- Left sidebar last so it's at the end for mobile -->
<aside class="sidebar col-md-5 col-lg-3 p-0 order-md-1" role="complementary">
<div class="tree_nav">
<!---->
<div class="sidenav_parent">
<a href="rippled-api.html"> rippled API Reference</a>
</div>
<!---->
<!---->
<div id="sidenav" role="tablist" aria-multiselectable="true">
<div class="card active">
<div class="card-header" role="tab" id="sidenav_cat_head_14">
<a class="sidenav_cat_toggler" role="button" data-toggle="collapse" href="#sidenav_collapse_14" aria-expanded="true" aria-controls="sidenav_collapse_14"></a>
<h5 class="card-title">
<a class="sidenav_cat_title active-parent" href="api-conventions.html">API Conventions</a>
</h5>
</div><!-- /.card-header -->
<div id="sidenav_collapse_14" class="collapse show" role="tabpanel" aria-labelledby="sidenav_cat_head_14">
<div class="card-body">
<ul class="sidebar_pagelist">
<li><a class="nosubcat-page" href="basic-data-types.html">Basic Data Types</a></li>
<li><a class="active nosubcat-page" href="base58-encodings.html">base58 Encodings</a></li>
<li><a class="nosubcat-page" href="currency-formats.html">Currency Formats</a></li>
<li><a class="nosubcat-page" href="error-formatting.html">Error Formatting</a></li>
<li><a class="nosubcat-page" href="markers-and-pagination.html">Markers and Pagination</a></li>
<li><a class="nosubcat-page" href="modifying-the-ledger.html">Modifying the Ledger</a></li>
<li><a class="nosubcat-page" href="rate-limiting.html">Rate Limiting</a></li>
<li><a class="nosubcat-page" href="request-formatting.html">Request Formatting</a></li>
<li><a class="nosubcat-page" href="response-formatting.html">Response Formatting</a></li>
<li><a class="nosubcat-page" href="rippled-server-states.html">rippled Server States</a></li>
<li><a class="nosubcat-page" href="serialization.html">Serialization Format</a></li>
</ul>
</div><!-- /.card-body -->
</div><!-- /#sidenav_collapse14 -->
</div><!-- /.panel -->
<div class="card">
<div class="card-header" role="tab" id="sidenav_cat_head_15">
<a class="collapsed sidenav_cat_toggler" role="button" data-toggle="collapse" href="#sidenav_collapse_15" aria-expanded="true" aria-controls="sidenav_collapse_15"></a>
<h5 class="card-title">
<a class="sidenav_cat_title" href="public-rippled-methods.html">Public rippled Methods</a>
</h5>
</div><!-- /.card-header -->
<div id="sidenav_collapse_15" class="collapse" role="tabpanel" aria-labelledby="sidenav_cat_head_15">
<div class="card-body">
<ul class="sidebar_pagelist">
<li><a class="subcat-title" href="account-methods.html">Account Methods</a></li>
<li><a class="subpage" href="account_currencies.html">account_currencies</a></li>
<li><a class="subpage" href="account_info.html">account_info</a></li>
<li><a class="subpage" href="account_lines.html">account_lines</a></li>
<li><a class="subpage" href="account_objects.html">account_objects</a></li>
<li><a class="subpage" href="account_offers.html">account_offers</a></li>
<li><a class="subpage" href="account_tx.html">account_tx</a></li>
<li><a class="subpage" href="gateway_balances.html">gateway_balances</a></li>
<li><a class="subpage" href="noripple_check.html">noripple_check</a></li>
<li><a class="subcat-title" href="ledger-methods.html">Ledger Methods</a></li>
<li><a class="subpage" href="ledger.html">ledger</a></li>
<li><a class="subpage" href="ledger_closed.html">ledger_closed</a></li>
<li><a class="subpage" href="ledger_current.html">ledger_current</a></li>
<li><a class="subpage" href="ledger_data.html">ledger_data</a></li>
<li><a class="subpage" href="ledger_entry.html">ledger_entry</a></li>
<li><a class="subcat-title" href="transaction-methods.html">Transaction Methods</a></li>
<li><a class="subpage" href="sign.html">sign</a></li>
<li><a class="subpage" href="sign_for.html">sign_for</a></li>
<li><a class="subpage" href="submit.html">submit</a></li>
<li><a class="subpage" href="submit_multisigned.html">submit_multisigned</a></li>
<li><a class="subpage" href="transaction_entry.html">transaction_entry</a></li>
<li><a class="subpage" href="tx.html">tx</a></li>
<li><a class="subpage" href="tx_history.html">tx_history</a></li>
<li><a class="subcat-title" href="path-and-order-book-methods.html">Path and Order Book Methods</a></li>
<li><a class="subpage" href="book_offers.html">book_offers</a></li>
<li><a class="subpage" href="deposit_authorized.html">deposit_authorized</a></li>
<li><a class="subpage" href="path_find.html">path_find</a></li>
<li><a class="subpage" href="ripple_path_find.html">ripple_path_find</a></li>
<li><a class="subcat-title" href="subscription-methods.html">Subscription Methods</a></li>
<li><a class="subpage" href="subscribe.html">subscribe</a></li>
<li><a class="subpage" href="unsubscribe.html">unsubscribe</a></li>
</ul>
</div><!-- /.card-body -->
</div><!-- /#sidenav_collapse15 -->
</div><!-- /.panel -->
</div><!-- /.panel -->
</div><!-- /#sidenav -->
</div><!-- /.tree_nav --> </aside>
</div><!--/.row (main layout)-->
</div>
<footer class="xrpl-footer" role="contentinfo">
<section class="container-fluid p-5 pl-sm-0">
<nav role="navigation" class="d-flex mb-3 language-selector">
<img class="language_selector_icon" src="assets/img/icon-language-selector.svg" width="32" height="40" alt="language selection icon" />
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="/base58-encodings.html"><i class="fa fa-check-circle"></i> English</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/cn/base58-encodings.html">中文</a>
</li>
</ul>
</nav>
<div class="absolute_bottom_footer">
<span>© XAG Ledger Project 2019</span>
<span><a href="">License</a></span>
</div><!-- /.absolute_bottom_footer -->
</section>
</footer>
<!-- Jump to top button -->
<a href="#main_content_wrapper" class="jump-to-top btn btn-primary btn-lg" role="button" title="Jump to top of page">Top</a>
<script type="text/javascript" src="assets/js/jump-to-top.js"></script>
<!-- Non-blocking resources -->
<!-- Bootstrap JS -->
<script src="assets/vendor/bootstrap.min.js"></script>
<!-- fontawesome icons -->
<link rel="stylesheet" href="assets/vendor/fontawesome/css/font-awesome.min.css" />
<!-- Algolia DocSearch -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '70de5b9b8ef95460f3c6e04054b325b2',
indexName: 'xrpl',
inputSelector: '#topsearchbar',
algoliaOptions: { 'facetFilters': ["lang:en"] },
debug: false
});
</script>
<script type="application/javascript">
gtag('set', {'content_group1': 'Content Docs'});
</script>
</body>
</html>