nockchain 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nockchain/__init__.py ADDED
@@ -0,0 +1,143 @@
1
+ """Nockchain V1 wallets and transactions with bounded, immutable nouns."""
2
+
3
+ from ._core import (
4
+ PRIME,
5
+ MAX_NOUN_NODES,
6
+ MAX_JAM_BYTES,
7
+ NICKS_PER_NOCK,
8
+ NockchainError,
9
+ Cell,
10
+ Noun,
11
+ Digest,
12
+ atom,
13
+ noun_tuple,
14
+ noun_list,
15
+ noun_equal,
16
+ hash_words,
17
+ hash_noun,
18
+ parse_digest,
19
+ jam,
20
+ cue,
21
+ parse_nocks,
22
+ format_nocks,
23
+ )
24
+ from .keys import (
25
+ ExtendedKey,
26
+ Signature,
27
+ ReceiveAddress,
28
+ master,
29
+ generate,
30
+ parse_extended_key,
31
+ parse_public_key,
32
+ lock_root,
33
+ verify_digest,
34
+ derive_receive_address,
35
+ )
36
+ from .seed import (
37
+ Seed,
38
+ RecoveryPhrase,
39
+ generate_seed,
40
+ generate_mnemonic,
41
+ mnemonic_from_entropy,
42
+ seed_from_mnemonic,
43
+ generate_wallet,
44
+ restore_wallet,
45
+ )
46
+ from .locks import HeightRange, TimelockV1, LockV1, new_pkh_lock_v1, NoteName, NoteV1, note_first_v1
47
+ from .transaction import (
48
+ MAX_TRANSFER_INPUTS,
49
+ MAX_TRANSFER_OUTPUTS,
50
+ MAX_NOTE_DATA_WORDS_V1,
51
+ LockedPaymentV1,
52
+ LockedSpendPlanV1,
53
+ OutputV1,
54
+ SpendSummaryV1,
55
+ TransactionSummaryV1,
56
+ TransactionV1,
57
+ prepare_transaction_v1,
58
+ parse_transaction_v1,
59
+ minimum_transaction_fee_v1,
60
+ )
61
+ from .wallet import (
62
+ UnspentNote,
63
+ Payment,
64
+ PaymentV1,
65
+ SpendPlanV1,
66
+ TransferOptions,
67
+ TransferSummary,
68
+ PreparedTransfer,
69
+ minimum_transfer_fee_v1,
70
+ sign_transfer_v1,
71
+ prepare_transfer,
72
+ select_transfer,
73
+ )
74
+
75
+ __all__ = [
76
+ "PRIME",
77
+ "MAX_NOUN_NODES",
78
+ "MAX_JAM_BYTES",
79
+ "NICKS_PER_NOCK",
80
+ "NockchainError",
81
+ "Cell",
82
+ "Noun",
83
+ "Digest",
84
+ "atom",
85
+ "noun_tuple",
86
+ "noun_list",
87
+ "noun_equal",
88
+ "hash_words",
89
+ "hash_noun",
90
+ "parse_digest",
91
+ "jam",
92
+ "cue",
93
+ "parse_nocks",
94
+ "format_nocks",
95
+ "ExtendedKey",
96
+ "Signature",
97
+ "ReceiveAddress",
98
+ "master",
99
+ "generate",
100
+ "parse_extended_key",
101
+ "parse_public_key",
102
+ "lock_root",
103
+ "verify_digest",
104
+ "derive_receive_address",
105
+ "Seed",
106
+ "RecoveryPhrase",
107
+ "generate_seed",
108
+ "generate_mnemonic",
109
+ "mnemonic_from_entropy",
110
+ "seed_from_mnemonic",
111
+ "generate_wallet",
112
+ "restore_wallet",
113
+ "HeightRange",
114
+ "TimelockV1",
115
+ "LockV1",
116
+ "new_pkh_lock_v1",
117
+ "NoteName",
118
+ "NoteV1",
119
+ "note_first_v1",
120
+ "MAX_TRANSFER_INPUTS",
121
+ "MAX_TRANSFER_OUTPUTS",
122
+ "MAX_NOTE_DATA_WORDS_V1",
123
+ "LockedPaymentV1",
124
+ "LockedSpendPlanV1",
125
+ "OutputV1",
126
+ "SpendSummaryV1",
127
+ "TransactionSummaryV1",
128
+ "TransactionV1",
129
+ "prepare_transaction_v1",
130
+ "parse_transaction_v1",
131
+ "minimum_transaction_fee_v1",
132
+ "UnspentNote",
133
+ "Payment",
134
+ "PaymentV1",
135
+ "SpendPlanV1",
136
+ "TransferOptions",
137
+ "TransferSummary",
138
+ "PreparedTransfer",
139
+ "minimum_transfer_fee_v1",
140
+ "sign_transfer_v1",
141
+ "prepare_transfer",
142
+ "select_transfer",
143
+ ]
@@ -0,0 +1,374 @@
1
+ """TIP5 permutation constants from the canonical protocol."""
2
+
3
+ LOOKUP = (
4
+ 0,
5
+ 7,
6
+ 26,
7
+ 63,
8
+ 124,
9
+ 215,
10
+ 85,
11
+ 254,
12
+ 214,
13
+ 228,
14
+ 45,
15
+ 185,
16
+ 140,
17
+ 173,
18
+ 33,
19
+ 240,
20
+ 29,
21
+ 177,
22
+ 176,
23
+ 32,
24
+ 8,
25
+ 110,
26
+ 87,
27
+ 202,
28
+ 204,
29
+ 99,
30
+ 150,
31
+ 106,
32
+ 230,
33
+ 14,
34
+ 235,
35
+ 128,
36
+ 213,
37
+ 239,
38
+ 212,
39
+ 138,
40
+ 23,
41
+ 130,
42
+ 208,
43
+ 6,
44
+ 44,
45
+ 71,
46
+ 93,
47
+ 116,
48
+ 146,
49
+ 189,
50
+ 251,
51
+ 81,
52
+ 199,
53
+ 97,
54
+ 38,
55
+ 28,
56
+ 73,
57
+ 179,
58
+ 95,
59
+ 84,
60
+ 152,
61
+ 48,
62
+ 35,
63
+ 119,
64
+ 49,
65
+ 88,
66
+ 242,
67
+ 3,
68
+ 148,
69
+ 169,
70
+ 72,
71
+ 120,
72
+ 62,
73
+ 161,
74
+ 166,
75
+ 83,
76
+ 175,
77
+ 191,
78
+ 137,
79
+ 19,
80
+ 100,
81
+ 129,
82
+ 112,
83
+ 55,
84
+ 221,
85
+ 102,
86
+ 218,
87
+ 61,
88
+ 151,
89
+ 237,
90
+ 68,
91
+ 164,
92
+ 17,
93
+ 147,
94
+ 46,
95
+ 234,
96
+ 203,
97
+ 216,
98
+ 22,
99
+ 141,
100
+ 65,
101
+ 57,
102
+ 123,
103
+ 12,
104
+ 244,
105
+ 54,
106
+ 219,
107
+ 231,
108
+ 96,
109
+ 77,
110
+ 180,
111
+ 154,
112
+ 5,
113
+ 253,
114
+ 133,
115
+ 165,
116
+ 98,
117
+ 195,
118
+ 205,
119
+ 134,
120
+ 245,
121
+ 30,
122
+ 9,
123
+ 188,
124
+ 59,
125
+ 142,
126
+ 186,
127
+ 197,
128
+ 181,
129
+ 144,
130
+ 92,
131
+ 31,
132
+ 224,
133
+ 163,
134
+ 111,
135
+ 74,
136
+ 58,
137
+ 69,
138
+ 113,
139
+ 196,
140
+ 67,
141
+ 246,
142
+ 225,
143
+ 10,
144
+ 121,
145
+ 50,
146
+ 60,
147
+ 157,
148
+ 90,
149
+ 122,
150
+ 2,
151
+ 250,
152
+ 101,
153
+ 75,
154
+ 178,
155
+ 159,
156
+ 24,
157
+ 36,
158
+ 201,
159
+ 11,
160
+ 243,
161
+ 132,
162
+ 198,
163
+ 190,
164
+ 114,
165
+ 233,
166
+ 39,
167
+ 52,
168
+ 21,
169
+ 209,
170
+ 108,
171
+ 238,
172
+ 91,
173
+ 187,
174
+ 18,
175
+ 104,
176
+ 194,
177
+ 37,
178
+ 153,
179
+ 34,
180
+ 200,
181
+ 143,
182
+ 126,
183
+ 155,
184
+ 236,
185
+ 118,
186
+ 64,
187
+ 80,
188
+ 172,
189
+ 89,
190
+ 94,
191
+ 193,
192
+ 135,
193
+ 183,
194
+ 86,
195
+ 107,
196
+ 252,
197
+ 13,
198
+ 167,
199
+ 206,
200
+ 136,
201
+ 220,
202
+ 207,
203
+ 103,
204
+ 171,
205
+ 160,
206
+ 76,
207
+ 182,
208
+ 227,
209
+ 217,
210
+ 158,
211
+ 56,
212
+ 174,
213
+ 4,
214
+ 66,
215
+ 109,
216
+ 139,
217
+ 162,
218
+ 184,
219
+ 211,
220
+ 249,
221
+ 47,
222
+ 125,
223
+ 232,
224
+ 117,
225
+ 43,
226
+ 16,
227
+ 42,
228
+ 127,
229
+ 20,
230
+ 241,
231
+ 25,
232
+ 149,
233
+ 105,
234
+ 156,
235
+ 51,
236
+ 53,
237
+ 168,
238
+ 145,
239
+ 247,
240
+ 223,
241
+ 79,
242
+ 78,
243
+ 226,
244
+ 15,
245
+ 222,
246
+ 82,
247
+ 115,
248
+ 70,
249
+ 210,
250
+ 27,
251
+ 41,
252
+ 1,
253
+ 170,
254
+ 40,
255
+ 131,
256
+ 192,
257
+ 229,
258
+ 248,
259
+ 255,
260
+ )
261
+ ROUND_CONSTANTS = (
262
+ 1332676891236936200,
263
+ 16607633045354064669,
264
+ 12746538998793080786,
265
+ 15240351333789289931,
266
+ 10333439796058208418,
267
+ 986873372968378050,
268
+ 153505017314310505,
269
+ 703086547770691416,
270
+ 8522628845961587962,
271
+ 1727254290898686320,
272
+ 199492491401196126,
273
+ 2969174933639985366,
274
+ 1607536590362293391,
275
+ 16971515075282501568,
276
+ 15401316942841283351,
277
+ 14178982151025681389,
278
+ 2916963588744282587,
279
+ 5474267501391258599,
280
+ 5350367839445462659,
281
+ 7436373192934779388,
282
+ 12563531800071493891,
283
+ 12265318129758141428,
284
+ 6524649031155262053,
285
+ 1388069597090660214,
286
+ 3049665785814990091,
287
+ 5225141380721656276,
288
+ 10399487208361035835,
289
+ 6576713996114457203,
290
+ 12913805829885867278,
291
+ 10299910245954679423,
292
+ 12980779960345402499,
293
+ 593670858850716490,
294
+ 12184128243723146967,
295
+ 1315341360419235257,
296
+ 9107195871057030023,
297
+ 4354141752578294067,
298
+ 8824457881527486794,
299
+ 14811586928506712910,
300
+ 7768837314956434138,
301
+ 2807636171572954860,
302
+ 9487703495117094125,
303
+ 13452575580428891895,
304
+ 14689488045617615844,
305
+ 16144091782672017853,
306
+ 15471922440568867245,
307
+ 17295382518415944107,
308
+ 15054306047726632486,
309
+ 5708955503115886019,
310
+ 9596017237020520842,
311
+ 16520851172964236909,
312
+ 8513472793890943175,
313
+ 8503326067026609602,
314
+ 9402483918549940854,
315
+ 8614816312698982446,
316
+ 7744830563717871780,
317
+ 14419404818700162041,
318
+ 8090742384565069824,
319
+ 15547662568163517559,
320
+ 17314710073626307254,
321
+ 10008393716631058961,
322
+ 14480243402290327574,
323
+ 13569194973291808551,
324
+ 10573516815088946209,
325
+ 15120483436559336219,
326
+ 3515151310595301563,
327
+ 1095382462248757907,
328
+ 5323307938514209350,
329
+ 14204542692543834582,
330
+ 12448773944668684656,
331
+ 13967843398310696452,
332
+ 14838288394107326806,
333
+ 13718313940616442191,
334
+ 15032565440414177483,
335
+ 13769903572116157488,
336
+ 17074377440395071208,
337
+ 16931086385239297738,
338
+ 8723550055169003617,
339
+ 590842605971518043,
340
+ 16642348030861036090,
341
+ 10708719298241282592,
342
+ 12766914315707517909,
343
+ 11780889552403245587,
344
+ 113183285481780712,
345
+ 9019899125655375514,
346
+ 3300264967390964820,
347
+ 12802381622653377935,
348
+ 891063765000023873,
349
+ 15939045541699412539,
350
+ 3240223189948727743,
351
+ 4087221142360949772,
352
+ 10980466041788253952,
353
+ 18199914337033135244,
354
+ 7168108392363190150,
355
+ 16860278046098150740,
356
+ 13088202265571714855,
357
+ 4712275036097525581,
358
+ 16338034078141228133,
359
+ 1455012125527134274,
360
+ 5024057780895012002,
361
+ 9289161311673217186,
362
+ 9401110072402537104,
363
+ 11919498251456187748,
364
+ 4173156070774045271,
365
+ 15647643457869530627,
366
+ 15642078237964257476,
367
+ 1405048341078324037,
368
+ 3059193199283698832,
369
+ 1605012781983592984,
370
+ 7134876918849821827,
371
+ 5796994175286958720,
372
+ 7251651436095127661,
373
+ 4565856221886323991,
374
+ )