• R/O
  • HTTP
  • SSH
  • HTTPS

pybtm: 提交

Python3 implementation of the Bytom protocol. https://pypi.org/project/pybtm/


Commit MetaInfo

修订版4a5600df61ab039ac5594035f51d7b644933c906 (tree)
时间2019-03-25 18:29:07
作者Chengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

add get_mnemonic

更改概述

差异

--- a/README.md
+++ b/README.md
@@ -3,6 +3,8 @@ pybtm
33
44 - [1 Installation](#1-installation)
55 - [2 Usage](#2-usage)
6+ - [2.1 Create entropy](#21-create-entropy)
7+ - [Create mnemonics](#create-mnemonics)
68
79 Python3 implementation of the Bytom protocol.
810
@@ -14,3 +16,18 @@ $ pip install pybtm
1416
1517 ## 2 Usage
1618
19+### 2.1 Create entropy
20+
21+get_entropy() create 128bits entropy.
22+
23+```python
24+>>> from pybtm import key
25+>>> key.get_entropy()
26+'100e2704b431f914e3262926bdba6fce'
27+```
28+
29+### Create mnemonics
30+
31+```python
32+
33+```
\ No newline at end of file
--- a/pybtm/__init__.py
+++ b/pybtm/__init__.py
@@ -1,2 +1,2 @@
11 name = "pybtm"
2-version = "0.0.2"
\ No newline at end of file
2+version = "0.0.3"
\ No newline at end of file
--- /dev/null
+++ b/pybtm/english_mnemonic.txt
@@ -0,0 +1,2048 @@
1+abandon
2+ability
3+able
4+about
5+above
6+absent
7+absorb
8+abstract
9+absurd
10+abuse
11+access
12+accident
13+account
14+accuse
15+achieve
16+acid
17+acoustic
18+acquire
19+across
20+act
21+action
22+actor
23+actress
24+actual
25+adapt
26+add
27+addict
28+address
29+adjust
30+admit
31+adult
32+advance
33+advice
34+aerobic
35+affair
36+afford
37+afraid
38+again
39+age
40+agent
41+agree
42+ahead
43+aim
44+air
45+airport
46+aisle
47+alarm
48+album
49+alcohol
50+alert
51+alien
52+all
53+alley
54+allow
55+almost
56+alone
57+alpha
58+already
59+also
60+alter
61+always
62+amateur
63+amazing
64+among
65+amount
66+amused
67+analyst
68+anchor
69+ancient
70+anger
71+angle
72+angry
73+animal
74+ankle
75+announce
76+annual
77+another
78+answer
79+antenna
80+antique
81+anxiety
82+any
83+apart
84+apology
85+appear
86+apple
87+approve
88+april
89+arch
90+arctic
91+area
92+arena
93+argue
94+arm
95+armed
96+armor
97+army
98+around
99+arrange
100+arrest
101+arrive
102+arrow
103+art
104+artefact
105+artist
106+artwork
107+ask
108+aspect
109+assault
110+asset
111+assist
112+assume
113+asthma
114+athlete
115+atom
116+attack
117+attend
118+attitude
119+attract
120+auction
121+audit
122+august
123+aunt
124+author
125+auto
126+autumn
127+average
128+avocado
129+avoid
130+awake
131+aware
132+away
133+awesome
134+awful
135+awkward
136+axis
137+baby
138+bachelor
139+bacon
140+badge
141+bag
142+balance
143+balcony
144+ball
145+bamboo
146+banana
147+banner
148+bar
149+barely
150+bargain
151+barrel
152+base
153+basic
154+basket
155+battle
156+beach
157+bean
158+beauty
159+because
160+become
161+beef
162+before
163+begin
164+behave
165+behind
166+believe
167+below
168+belt
169+bench
170+benefit
171+best
172+betray
173+better
174+between
175+beyond
176+bicycle
177+bid
178+bike
179+bind
180+biology
181+bird
182+birth
183+bitter
184+black
185+blade
186+blame
187+blanket
188+blast
189+bleak
190+bless
191+blind
192+blood
193+blossom
194+blouse
195+blue
196+blur
197+blush
198+board
199+boat
200+body
201+boil
202+bomb
203+bone
204+bonus
205+book
206+boost
207+border
208+boring
209+borrow
210+boss
211+bottom
212+bounce
213+box
214+boy
215+bracket
216+brain
217+brand
218+brass
219+brave
220+bread
221+breeze
222+brick
223+bridge
224+brief
225+bright
226+bring
227+brisk
228+broccoli
229+broken
230+bronze
231+broom
232+brother
233+brown
234+brush
235+bubble
236+buddy
237+budget
238+buffalo
239+build
240+bulb
241+bulk
242+bullet
243+bundle
244+bunker
245+burden
246+burger
247+burst
248+bus
249+business
250+busy
251+butter
252+buyer
253+buzz
254+cabbage
255+cabin
256+cable
257+cactus
258+cage
259+cake
260+call
261+calm
262+camera
263+camp
264+can
265+canal
266+cancel
267+candy
268+cannon
269+canoe
270+canvas
271+canyon
272+capable
273+capital
274+captain
275+car
276+carbon
277+card
278+cargo
279+carpet
280+carry
281+cart
282+case
283+cash
284+casino
285+castle
286+casual
287+cat
288+catalog
289+catch
290+category
291+cattle
292+caught
293+cause
294+caution
295+cave
296+ceiling
297+celery
298+cement
299+census
300+century
301+cereal
302+certain
303+chair
304+chalk
305+champion
306+change
307+chaos
308+chapter
309+charge
310+chase
311+chat
312+cheap
313+check
314+cheese
315+chef
316+cherry
317+chest
318+chicken
319+chief
320+child
321+chimney
322+choice
323+choose
324+chronic
325+chuckle
326+chunk
327+churn
328+cigar
329+cinnamon
330+circle
331+citizen
332+city
333+civil
334+claim
335+clap
336+clarify
337+claw
338+clay
339+clean
340+clerk
341+clever
342+click
343+client
344+cliff
345+climb
346+clinic
347+clip
348+clock
349+clog
350+close
351+cloth
352+cloud
353+clown
354+club
355+clump
356+cluster
357+clutch
358+coach
359+coast
360+coconut
361+code
362+coffee
363+coil
364+coin
365+collect
366+color
367+column
368+combine
369+come
370+comfort
371+comic
372+common
373+company
374+concert
375+conduct
376+confirm
377+congress
378+connect
379+consider
380+control
381+convince
382+cook
383+cool
384+copper
385+copy
386+coral
387+core
388+corn
389+correct
390+cost
391+cotton
392+couch
393+country
394+couple
395+course
396+cousin
397+cover
398+coyote
399+crack
400+cradle
401+craft
402+cram
403+crane
404+crash
405+crater
406+crawl
407+crazy
408+cream
409+credit
410+creek
411+crew
412+cricket
413+crime
414+crisp
415+critic
416+crop
417+cross
418+crouch
419+crowd
420+crucial
421+cruel
422+cruise
423+crumble
424+crunch
425+crush
426+cry
427+crystal
428+cube
429+culture
430+cup
431+cupboard
432+curious
433+current
434+curtain
435+curve
436+cushion
437+custom
438+cute
439+cycle
440+dad
441+damage
442+damp
443+dance
444+danger
445+daring
446+dash
447+daughter
448+dawn
449+day
450+deal
451+debate
452+debris
453+decade
454+december
455+decide
456+decline
457+decorate
458+decrease
459+deer
460+defense
461+define
462+defy
463+degree
464+delay
465+deliver
466+demand
467+demise
468+denial
469+dentist
470+deny
471+depart
472+depend
473+deposit
474+depth
475+deputy
476+derive
477+describe
478+desert
479+design
480+desk
481+despair
482+destroy
483+detail
484+detect
485+develop
486+device
487+devote
488+diagram
489+dial
490+diamond
491+diary
492+dice
493+diesel
494+diet
495+differ
496+digital
497+dignity
498+dilemma
499+dinner
500+dinosaur
501+direct
502+dirt
503+disagree
504+discover
505+disease
506+dish
507+dismiss
508+disorder
509+display
510+distance
511+divert
512+divide
513+divorce
514+dizzy
515+doctor
516+document
517+dog
518+doll
519+dolphin
520+domain
521+donate
522+donkey
523+donor
524+door
525+dose
526+double
527+dove
528+draft
529+dragon
530+drama
531+drastic
532+draw
533+dream
534+dress
535+drift
536+drill
537+drink
538+drip
539+drive
540+drop
541+drum
542+dry
543+duck
544+dumb
545+dune
546+during
547+dust
548+dutch
549+duty
550+dwarf
551+dynamic
552+eager
553+eagle
554+early
555+earn
556+earth
557+easily
558+east
559+easy
560+echo
561+ecology
562+economy
563+edge
564+edit
565+educate
566+effort
567+egg
568+eight
569+either
570+elbow
571+elder
572+electric
573+elegant
574+element
575+elephant
576+elevator
577+elite
578+else
579+embark
580+embody
581+embrace
582+emerge
583+emotion
584+employ
585+empower
586+empty
587+enable
588+enact
589+end
590+endless
591+endorse
592+enemy
593+energy
594+enforce
595+engage
596+engine
597+enhance
598+enjoy
599+enlist
600+enough
601+enrich
602+enroll
603+ensure
604+enter
605+entire
606+entry
607+envelope
608+episode
609+equal
610+equip
611+era
612+erase
613+erode
614+erosion
615+error
616+erupt
617+escape
618+essay
619+essence
620+estate
621+eternal
622+ethics
623+evidence
624+evil
625+evoke
626+evolve
627+exact
628+example
629+excess
630+exchange
631+excite
632+exclude
633+excuse
634+execute
635+exercise
636+exhaust
637+exhibit
638+exile
639+exist
640+exit
641+exotic
642+expand
643+expect
644+expire
645+explain
646+expose
647+express
648+extend
649+extra
650+eye
651+eyebrow
652+fabric
653+face
654+faculty
655+fade
656+faint
657+faith
658+fall
659+false
660+fame
661+family
662+famous
663+fan
664+fancy
665+fantasy
666+farm
667+fashion
668+fat
669+fatal
670+father
671+fatigue
672+fault
673+favorite
674+feature
675+february
676+federal
677+fee
678+feed
679+feel
680+female
681+fence
682+festival
683+fetch
684+fever
685+few
686+fiber
687+fiction
688+field
689+figure
690+file
691+film
692+filter
693+final
694+find
695+fine
696+finger
697+finish
698+fire
699+firm
700+first
701+fiscal
702+fish
703+fit
704+fitness
705+fix
706+flag
707+flame
708+flash
709+flat
710+flavor
711+flee
712+flight
713+flip
714+float
715+flock
716+floor
717+flower
718+fluid
719+flush
720+fly
721+foam
722+focus
723+fog
724+foil
725+fold
726+follow
727+food
728+foot
729+force
730+forest
731+forget
732+fork
733+fortune
734+forum
735+forward
736+fossil
737+foster
738+found
739+fox
740+fragile
741+frame
742+frequent
743+fresh
744+friend
745+fringe
746+frog
747+front
748+frost
749+frown
750+frozen
751+fruit
752+fuel
753+fun
754+funny
755+furnace
756+fury
757+future
758+gadget
759+gain
760+galaxy
761+gallery
762+game
763+gap
764+garage
765+garbage
766+garden
767+garlic
768+garment
769+gas
770+gasp
771+gate
772+gather
773+gauge
774+gaze
775+general
776+genius
777+genre
778+gentle
779+genuine
780+gesture
781+ghost
782+giant
783+gift
784+giggle
785+ginger
786+giraffe
787+girl
788+give
789+glad
790+glance
791+glare
792+glass
793+glide
794+glimpse
795+globe
796+gloom
797+glory
798+glove
799+glow
800+glue
801+goat
802+goddess
803+gold
804+good
805+goose
806+gorilla
807+gospel
808+gossip
809+govern
810+gown
811+grab
812+grace
813+grain
814+grant
815+grape
816+grass
817+gravity
818+great
819+green
820+grid
821+grief
822+grit
823+grocery
824+group
825+grow
826+grunt
827+guard
828+guess
829+guide
830+guilt
831+guitar
832+gun
833+gym
834+habit
835+hair
836+half
837+hammer
838+hamster
839+hand
840+happy
841+harbor
842+hard
843+harsh
844+harvest
845+hat
846+have
847+hawk
848+hazard
849+head
850+health
851+heart
852+heavy
853+hedgehog
854+height
855+hello
856+helmet
857+help
858+hen
859+hero
860+hidden
861+high
862+hill
863+hint
864+hip
865+hire
866+history
867+hobby
868+hockey
869+hold
870+hole
871+holiday
872+hollow
873+home
874+honey
875+hood
876+hope
877+horn
878+horror
879+horse
880+hospital
881+host
882+hotel
883+hour
884+hover
885+hub
886+huge
887+human
888+humble
889+humor
890+hundred
891+hungry
892+hunt
893+hurdle
894+hurry
895+hurt
896+husband
897+hybrid
898+ice
899+icon
900+idea
901+identify
902+idle
903+ignore
904+ill
905+illegal
906+illness
907+image
908+imitate
909+immense
910+immune
911+impact
912+impose
913+improve
914+impulse
915+inch
916+include
917+income
918+increase
919+index
920+indicate
921+indoor
922+industry
923+infant
924+inflict
925+inform
926+inhale
927+inherit
928+initial
929+inject
930+injury
931+inmate
932+inner
933+innocent
934+input
935+inquiry
936+insane
937+insect
938+inside
939+inspire
940+install
941+intact
942+interest
943+into
944+invest
945+invite
946+involve
947+iron
948+island
949+isolate
950+issue
951+item
952+ivory
953+jacket
954+jaguar
955+jar
956+jazz
957+jealous
958+jeans
959+jelly
960+jewel
961+job
962+join
963+joke
964+journey
965+joy
966+judge
967+juice
968+jump
969+jungle
970+junior
971+junk
972+just
973+kangaroo
974+keen
975+keep
976+ketchup
977+key
978+kick
979+kid
980+kidney
981+kind
982+kingdom
983+kiss
984+kit
985+kitchen
986+kite
987+kitten
988+kiwi
989+knee
990+knife
991+knock
992+know
993+lab
994+label
995+labor
996+ladder
997+lady
998+lake
999+lamp
1000+language
1001+laptop
1002+large
1003+later
1004+latin
1005+laugh
1006+laundry
1007+lava
1008+law
1009+lawn
1010+lawsuit
1011+layer
1012+lazy
1013+leader
1014+leaf
1015+learn
1016+leave
1017+lecture
1018+left
1019+leg
1020+legal
1021+legend
1022+leisure
1023+lemon
1024+lend
1025+length
1026+lens
1027+leopard
1028+lesson
1029+letter
1030+level
1031+liar
1032+liberty
1033+library
1034+license
1035+life
1036+lift
1037+light
1038+like
1039+limb
1040+limit
1041+link
1042+lion
1043+liquid
1044+list
1045+little
1046+live
1047+lizard
1048+load
1049+loan
1050+lobster
1051+local
1052+lock
1053+logic
1054+lonely
1055+long
1056+loop
1057+lottery
1058+loud
1059+lounge
1060+love
1061+loyal
1062+lucky
1063+luggage
1064+lumber
1065+lunar
1066+lunch
1067+luxury
1068+lyrics
1069+machine
1070+mad
1071+magic
1072+magnet
1073+maid
1074+mail
1075+main
1076+major
1077+make
1078+mammal
1079+man
1080+manage
1081+mandate
1082+mango
1083+mansion
1084+manual
1085+maple
1086+marble
1087+march
1088+margin
1089+marine
1090+market
1091+marriage
1092+mask
1093+mass
1094+master
1095+match
1096+material
1097+math
1098+matrix
1099+matter
1100+maximum
1101+maze
1102+meadow
1103+mean
1104+measure
1105+meat
1106+mechanic
1107+medal
1108+media
1109+melody
1110+melt
1111+member
1112+memory
1113+mention
1114+menu
1115+mercy
1116+merge
1117+merit
1118+merry
1119+mesh
1120+message
1121+metal
1122+method
1123+middle
1124+midnight
1125+milk
1126+million
1127+mimic
1128+mind
1129+minimum
1130+minor
1131+minute
1132+miracle
1133+mirror
1134+misery
1135+miss
1136+mistake
1137+mix
1138+mixed
1139+mixture
1140+mobile
1141+model
1142+modify
1143+mom
1144+moment
1145+monitor
1146+monkey
1147+monster
1148+month
1149+moon
1150+moral
1151+more
1152+morning
1153+mosquito
1154+mother
1155+motion
1156+motor
1157+mountain
1158+mouse
1159+move
1160+movie
1161+much
1162+muffin
1163+mule
1164+multiply
1165+muscle
1166+museum
1167+mushroom
1168+music
1169+must
1170+mutual
1171+myself
1172+mystery
1173+myth
1174+naive
1175+name
1176+napkin
1177+narrow
1178+nasty
1179+nation
1180+nature
1181+near
1182+neck
1183+need
1184+negative
1185+neglect
1186+neither
1187+nephew
1188+nerve
1189+nest
1190+net
1191+network
1192+neutral
1193+never
1194+news
1195+next
1196+nice
1197+night
1198+noble
1199+noise
1200+nominee
1201+noodle
1202+normal
1203+north
1204+nose
1205+notable
1206+note
1207+nothing
1208+notice
1209+novel
1210+now
1211+nuclear
1212+number
1213+nurse
1214+nut
1215+oak
1216+obey
1217+object
1218+oblige
1219+obscure
1220+observe
1221+obtain
1222+obvious
1223+occur
1224+ocean
1225+october
1226+odor
1227+off
1228+offer
1229+office
1230+often
1231+oil
1232+okay
1233+old
1234+olive
1235+olympic
1236+omit
1237+once
1238+one
1239+onion
1240+online
1241+only
1242+open
1243+opera
1244+opinion
1245+oppose
1246+option
1247+orange
1248+orbit
1249+orchard
1250+order
1251+ordinary
1252+organ
1253+orient
1254+original
1255+orphan
1256+ostrich
1257+other
1258+outdoor
1259+outer
1260+output
1261+outside
1262+oval
1263+oven
1264+over
1265+own
1266+owner
1267+oxygen
1268+oyster
1269+ozone
1270+pact
1271+paddle
1272+page
1273+pair
1274+palace
1275+palm
1276+panda
1277+panel
1278+panic
1279+panther
1280+paper
1281+parade
1282+parent
1283+park
1284+parrot
1285+party
1286+pass
1287+patch
1288+path
1289+patient
1290+patrol
1291+pattern
1292+pause
1293+pave
1294+payment
1295+peace
1296+peanut
1297+pear
1298+peasant
1299+pelican
1300+pen
1301+penalty
1302+pencil
1303+people
1304+pepper
1305+perfect
1306+permit
1307+person
1308+pet
1309+phone
1310+photo
1311+phrase
1312+physical
1313+piano
1314+picnic
1315+picture
1316+piece
1317+pig
1318+pigeon
1319+pill
1320+pilot
1321+pink
1322+pioneer
1323+pipe
1324+pistol
1325+pitch
1326+pizza
1327+place
1328+planet
1329+plastic
1330+plate
1331+play
1332+please
1333+pledge
1334+pluck
1335+plug
1336+plunge
1337+poem
1338+poet
1339+point
1340+polar
1341+pole
1342+police
1343+pond
1344+pony
1345+pool
1346+popular
1347+portion
1348+position
1349+possible
1350+post
1351+potato
1352+pottery
1353+poverty
1354+powder
1355+power
1356+practice
1357+praise
1358+predict
1359+prefer
1360+prepare
1361+present
1362+pretty
1363+prevent
1364+price
1365+pride
1366+primary
1367+print
1368+priority
1369+prison
1370+private
1371+prize
1372+problem
1373+process
1374+produce
1375+profit
1376+program
1377+project
1378+promote
1379+proof
1380+property
1381+prosper
1382+protect
1383+proud
1384+provide
1385+public
1386+pudding
1387+pull
1388+pulp
1389+pulse
1390+pumpkin
1391+punch
1392+pupil
1393+puppy
1394+purchase
1395+purity
1396+purpose
1397+purse
1398+push
1399+put
1400+puzzle
1401+pyramid
1402+quality
1403+quantum
1404+quarter
1405+question
1406+quick
1407+quit
1408+quiz
1409+quote
1410+rabbit
1411+raccoon
1412+race
1413+rack
1414+radar
1415+radio
1416+rail
1417+rain
1418+raise
1419+rally
1420+ramp
1421+ranch
1422+random
1423+range
1424+rapid
1425+rare
1426+rate
1427+rather
1428+raven
1429+raw
1430+razor
1431+ready
1432+real
1433+reason
1434+rebel
1435+rebuild
1436+recall
1437+receive
1438+recipe
1439+record
1440+recycle
1441+reduce
1442+reflect
1443+reform
1444+refuse
1445+region
1446+regret
1447+regular
1448+reject
1449+relax
1450+release
1451+relief
1452+rely
1453+remain
1454+remember
1455+remind
1456+remove
1457+render
1458+renew
1459+rent
1460+reopen
1461+repair
1462+repeat
1463+replace
1464+report
1465+require
1466+rescue
1467+resemble
1468+resist
1469+resource
1470+response
1471+result
1472+retire
1473+retreat
1474+return
1475+reunion
1476+reveal
1477+review
1478+reward
1479+rhythm
1480+rib
1481+ribbon
1482+rice
1483+rich
1484+ride
1485+ridge
1486+rifle
1487+right
1488+rigid
1489+ring
1490+riot
1491+ripple
1492+risk
1493+ritual
1494+rival
1495+river
1496+road
1497+roast
1498+robot
1499+robust
1500+rocket
1501+romance
1502+roof
1503+rookie
1504+room
1505+rose
1506+rotate
1507+rough
1508+round
1509+route
1510+royal
1511+rubber
1512+rude
1513+rug
1514+rule
1515+run
1516+runway
1517+rural
1518+sad
1519+saddle
1520+sadness
1521+safe
1522+sail
1523+salad
1524+salmon
1525+salon
1526+salt
1527+salute
1528+same
1529+sample
1530+sand
1531+satisfy
1532+satoshi
1533+sauce
1534+sausage
1535+save
1536+say
1537+scale
1538+scan
1539+scare
1540+scatter
1541+scene
1542+scheme
1543+school
1544+science
1545+scissors
1546+scorpion
1547+scout
1548+scrap
1549+screen
1550+script
1551+scrub
1552+sea
1553+search
1554+season
1555+seat
1556+second
1557+secret
1558+section
1559+security
1560+seed
1561+seek
1562+segment
1563+select
1564+sell
1565+seminar
1566+senior
1567+sense
1568+sentence
1569+series
1570+service
1571+session
1572+settle
1573+setup
1574+seven
1575+shadow
1576+shaft
1577+shallow
1578+share
1579+shed
1580+shell
1581+sheriff
1582+shield
1583+shift
1584+shine
1585+ship
1586+shiver
1587+shock
1588+shoe
1589+shoot
1590+shop
1591+short
1592+shoulder
1593+shove
1594+shrimp
1595+shrug
1596+shuffle
1597+shy
1598+sibling
1599+sick
1600+side
1601+siege
1602+sight
1603+sign
1604+silent
1605+silk
1606+silly
1607+silver
1608+similar
1609+simple
1610+since
1611+sing
1612+siren
1613+sister
1614+situate
1615+six
1616+size
1617+skate
1618+sketch
1619+ski
1620+skill
1621+skin
1622+skirt
1623+skull
1624+slab
1625+slam
1626+sleep
1627+slender
1628+slice
1629+slide
1630+slight
1631+slim
1632+slogan
1633+slot
1634+slow
1635+slush
1636+small
1637+smart
1638+smile
1639+smoke
1640+smooth
1641+snack
1642+snake
1643+snap
1644+sniff
1645+snow
1646+soap
1647+soccer
1648+social
1649+sock
1650+soda
1651+soft
1652+solar
1653+soldier
1654+solid
1655+solution
1656+solve
1657+someone
1658+song
1659+soon
1660+sorry
1661+sort
1662+soul
1663+sound
1664+soup
1665+source
1666+south
1667+space
1668+spare
1669+spatial
1670+spawn
1671+speak
1672+special
1673+speed
1674+spell
1675+spend
1676+sphere
1677+spice
1678+spider
1679+spike
1680+spin
1681+spirit
1682+split
1683+spoil
1684+sponsor
1685+spoon
1686+sport
1687+spot
1688+spray
1689+spread
1690+spring
1691+spy
1692+square
1693+squeeze
1694+squirrel
1695+stable
1696+stadium
1697+staff
1698+stage
1699+stairs
1700+stamp
1701+stand
1702+start
1703+state
1704+stay
1705+steak
1706+steel
1707+stem
1708+step
1709+stereo
1710+stick
1711+still
1712+sting
1713+stock
1714+stomach
1715+stone
1716+stool
1717+story
1718+stove
1719+strategy
1720+street
1721+strike
1722+strong
1723+struggle
1724+student
1725+stuff
1726+stumble
1727+style
1728+subject
1729+submit
1730+subway
1731+success
1732+such
1733+sudden
1734+suffer
1735+sugar
1736+suggest
1737+suit
1738+summer
1739+sun
1740+sunny
1741+sunset
1742+super
1743+supply
1744+supreme
1745+sure
1746+surface
1747+surge
1748+surprise
1749+surround
1750+survey
1751+suspect
1752+sustain
1753+swallow
1754+swamp
1755+swap
1756+swarm
1757+swear
1758+sweet
1759+swift
1760+swim
1761+swing
1762+switch
1763+sword
1764+symbol
1765+symptom
1766+syrup
1767+system
1768+table
1769+tackle
1770+tag
1771+tail
1772+talent
1773+talk
1774+tank
1775+tape
1776+target
1777+task
1778+taste
1779+tattoo
1780+taxi
1781+teach
1782+team
1783+tell
1784+ten
1785+tenant
1786+tennis
1787+tent
1788+term
1789+test
1790+text
1791+thank
1792+that
1793+theme
1794+then
1795+theory
1796+there
1797+they
1798+thing
1799+this
1800+thought
1801+three
1802+thrive
1803+throw
1804+thumb
1805+thunder
1806+ticket
1807+tide
1808+tiger
1809+tilt
1810+timber
1811+time
1812+tiny
1813+tip
1814+tired
1815+tissue
1816+title
1817+toast
1818+tobacco
1819+today
1820+toddler
1821+toe
1822+together
1823+toilet
1824+token
1825+tomato
1826+tomorrow
1827+tone
1828+tongue
1829+tonight
1830+tool
1831+tooth
1832+top
1833+topic
1834+topple
1835+torch
1836+tornado
1837+tortoise
1838+toss
1839+total
1840+tourist
1841+toward
1842+tower
1843+town
1844+toy
1845+track
1846+trade
1847+traffic
1848+tragic
1849+train
1850+transfer
1851+trap
1852+trash
1853+travel
1854+tray
1855+treat
1856+tree
1857+trend
1858+trial
1859+tribe
1860+trick
1861+trigger
1862+trim
1863+trip
1864+trophy
1865+trouble
1866+truck
1867+true
1868+truly
1869+trumpet
1870+trust
1871+truth
1872+try
1873+tube
1874+tuition
1875+tumble
1876+tuna
1877+tunnel
1878+turkey
1879+turn
1880+turtle
1881+twelve
1882+twenty
1883+twice
1884+twin
1885+twist
1886+two
1887+type
1888+typical
1889+ugly
1890+umbrella
1891+unable
1892+unaware
1893+uncle
1894+uncover
1895+under
1896+undo
1897+unfair
1898+unfold
1899+unhappy
1900+uniform
1901+unique
1902+unit
1903+universe
1904+unknown
1905+unlock
1906+until
1907+unusual
1908+unveil
1909+update
1910+upgrade
1911+uphold
1912+upon
1913+upper
1914+upset
1915+urban
1916+urge
1917+usage
1918+use
1919+used
1920+useful
1921+useless
1922+usual
1923+utility
1924+vacant
1925+vacuum
1926+vague
1927+valid
1928+valley
1929+valve
1930+van
1931+vanish
1932+vapor
1933+various
1934+vast
1935+vault
1936+vehicle
1937+velvet
1938+vendor
1939+venture
1940+venue
1941+verb
1942+verify
1943+version
1944+very
1945+vessel
1946+veteran
1947+viable
1948+vibrant
1949+vicious
1950+victory
1951+video
1952+view
1953+village
1954+vintage
1955+violin
1956+virtual
1957+virus
1958+visa
1959+visit
1960+visual
1961+vital
1962+vivid
1963+vocal
1964+voice
1965+void
1966+volcano
1967+volume
1968+vote
1969+voyage
1970+wage
1971+wagon
1972+wait
1973+walk
1974+wall
1975+walnut
1976+want
1977+warfare
1978+warm
1979+warrior
1980+wash
1981+wasp
1982+waste
1983+water
1984+wave
1985+way
1986+wealth
1987+weapon
1988+wear
1989+weasel
1990+weather
1991+web
1992+wedding
1993+weekend
1994+weird
1995+welcome
1996+west
1997+wet
1998+whale
1999+what
2000+wheat
2001+wheel
2002+when
2003+where
2004+whip
2005+whisper
2006+wide
2007+width
2008+wife
2009+wild
2010+will
2011+win
2012+window
2013+wine
2014+wing
2015+wink
2016+winner
2017+winter
2018+wire
2019+wisdom
2020+wise
2021+wish
2022+witness
2023+wolf
2024+woman
2025+wonder
2026+wood
2027+wool
2028+word
2029+work
2030+world
2031+worry
2032+worth
2033+wrap
2034+wreck
2035+wrestle
2036+wrist
2037+write
2038+wrong
2039+yard
2040+year
2041+yellow
2042+you
2043+young
2044+youth
2045+zebra
2046+zero
2047+zone
2048+zoo
--- a/pybtm/key.py
+++ b/pybtm/key.py
@@ -1,6 +1,51 @@
11 import random
2+import hashlib
23
34 def get_entropy():
45 entropy = random.randint(0, 2**128)
56 entropy_hexstr = entropy.to_bytes(16, byteorder='big').hex()
6- return entropy_hexstr
\ No newline at end of file
7+ return entropy_hexstr
8+
9+
10+# get_mnemonic create mnemonic from 128 bits entropy(the entropy_hexstr length is 32)
11+# return 12 mnemonics
12+# You can get more test data from: https://gist.github.com/zcc0721/63aeb5143807950f7b7051fadc08cef0
13+# test data 1:
14+# entropy_hexstr: 1db8b283eb4623e749732a341396e0c9
15+# mnemonic_str: buffalo sheriff path story giraffe victory chair grab cross original return napkin
16+# test data 2:
17+# entropy_hexstr: 4d33735a9e92f634d22aecbb4044038d
18+# mnemonic_str: essay oppose stove diamond control bounce emerge frown robust acquire abstract brick
19+# test data 3:
20+# entropy_hexstr: 089fe9bf0cac76760bc4b131d938669e
21+# mnemonic_str: ancient young hurt bone shuffle deposit congress normal crack six boost despair
22+def get_mnemonic(entropy_hexstr=None):
23+ if entropy_hexstr is None:
24+ entropy_hexstr = get_entropy()
25+ mnemonic_str = ""
26+ mnemonic_length = 12
27+
28+ # create a 12 elements mnemonic_list
29+ mnemonic_list = []
30+ for _ in range(mnemonic_length):
31+ mnemonic_list.append('')
32+
33+ entropy_bytes = bytes.fromhex(entropy_hexstr[:32])
34+ checksum = hashlib.sha256(entropy_bytes).hexdigest()[:1]
35+ new_entropy_str = "0" + entropy_hexstr[:32] + checksum
36+ new_entropy_bytes = bytes.fromhex(new_entropy_str)
37+ new_entropy_int = int.from_bytes(new_entropy_bytes, byteorder='big')
38+
39+ file = open('english_mnemonic.txt', mode='r')
40+ word_list = file.readlines()
41+ file.close()
42+
43+ for i in range(11, -1, -1):
44+ word_index = new_entropy_int % 2048
45+ new_entropy_int = new_entropy_int >> 11
46+ mnemonic_list[i] = word_list[word_index]
47+
48+ for i in range(12):
49+ mnemonic_str += mnemonic_list[i][:-1]
50+ mnemonic_str += " "
51+ return mnemonic_str[:-1]
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
55
66 setuptools.setup(
77 name="pybtm",
8- version="0.0.2",
8+ version="0.0.3",
99 author="zcc0721",
1010 author_email="zcc0721@foxmail.com",
1111 description="Python3 implementation of the Bytom protocol.",
Show on old repository browser