Compare commits
No commits in common. "master" and "v1.0.3" have entirely different histories.
4
.gitignore
vendored
4
.gitignore
vendored
@ -20,9 +20,5 @@ __pycache__/
|
||||
*.pyc
|
||||
|
||||
.tags
|
||||
.idea
|
||||
|
||||
*.egg-info
|
||||
|
||||
venv/
|
||||
ENV/
|
||||
@ -5,7 +5,12 @@
|
||||
#
|
||||
# - Copy this file into /etc/udev/rules.d and unplug and re-plug your Coldcard.
|
||||
# - Udev does not have to be restarted.
|
||||
#
|
||||
|
||||
# probably not needed:
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="d13e", ATTRS{idProduct}=="cc10", GROUP="plugdev", MODE="0666"
|
||||
|
||||
# required:
|
||||
# from <https://github.com/signal11/hidapi/blob/master/udev/99-hid.rules>
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="d13e", ATTRS{idProduct}=="cc10", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="d13e", ATTRS{idProduct}=="cc10", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="d13e", ATTRS{idProduct}=="cc10", GROUP="plugdev", MODE="0666"
|
||||
|
||||
|
||||
@ -35,4 +35,4 @@ To build to release for Pypi:
|
||||
- `python3 setup.py sdist bdist_wheel`
|
||||
- maybe delete old version from `./dist`
|
||||
- tag source code with new version (at this point)
|
||||
- `twine upload dist/*1.x.y*` when ready, use `__token__` as username, and API token as password
|
||||
- `twine upload dist/*` when ready.
|
||||
|
||||
674
COPYING
Normal file
674
COPYING
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
44
COPYING-CC
44
COPYING-CC
@ -1,44 +0,0 @@
|
||||
(c) Copyright 2020 by Coinkite Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject
|
||||
to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
"Commons Clause" License Condition v1.0
|
||||
|
||||
The Software is provided to you by the Licensor under the License,
|
||||
as defined below, subject to the following condition.
|
||||
|
||||
Without limiting other conditions in the License, the grant of
|
||||
rights under the License will not include, and the License does not
|
||||
grant to you, the right to Sell the Software.
|
||||
|
||||
For purposes of the foregoing, "Sell" means practicing any or all
|
||||
of the rights granted to you under the License to provide to third
|
||||
parties, for a fee or other consideration (including without
|
||||
limitation fees for hosting or consulting/ support services related
|
||||
to the Software), a product or service whose value derives, entirely
|
||||
or substantially, from the functionality of the Software. Any license
|
||||
notice or attribution required by the License must also include
|
||||
this Commons Clause License Condition notice.
|
||||
|
||||
Software: All Coldcard associated files.
|
||||
License: MIT
|
||||
Licensor: Coinkite Inc.
|
||||
|
||||
16
LICENSE
Normal file
16
LICENSE
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
(c) Copyright 2018-2018 by Coinkite Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
in the file COPYING. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@ -64,7 +64,7 @@ which returns a signature over the session key using the Coldcard's
|
||||
main secret key used for funds.
|
||||
|
||||
At this time we are not requiring encryption for all commands, but
|
||||
that may change in the future. Since we may do that, it's best to enable
|
||||
that may change in the future. Since we do that, it's best to enable
|
||||
encryption immediately and use it consistently. Part of the response
|
||||
to "start encryption" command is the extended public key (XPUB) and
|
||||
master fingerprint that you will need for most purposes anyway.
|
||||
|
||||
110
README.md
110
README.md
@ -1,12 +1,10 @@
|
||||
# Coldcard CLI and Python Interface Library
|
||||
|
||||
Coldcard is an affordable, ultra-secure and open-source hardware
|
||||
wallet for Bitcoin. Built for hardcore Bitcoin users who demand
|
||||
maximum security.
|
||||
Coldcard is a Cheap, Ultra-secure & Opensource Hardware Wallet for #Bitcoin.
|
||||
|
||||
Learn more and get yours at: [Coldcard.com](http://coldcard.com)
|
||||
Get yours at [ColdcardWallet.com](http://coldcardwallet.com)
|
||||
|
||||
This is the python code and command-line utilities you need to communicate with it over USB.
|
||||
This is the python code and command-line utilities you need to communciate with it over USB.
|
||||
|
||||
## Setup For Everyday Use
|
||||
|
||||
@ -46,13 +44,9 @@ pip install --editable '.[cli]'
|
||||
Usage: ckcc [OPTIONS] COMMAND [ARGS]...
|
||||
|
||||
Options:
|
||||
-s, --serial HEX Operate on specific unit (default: first
|
||||
found)
|
||||
-c, --socket ckcc-simulator-<pid>.sock
|
||||
Operate on specific simulator
|
||||
-x, --simulator Connect to the simulator via Unix socket
|
||||
-P, --plaintext Disable USB link-layer encryption
|
||||
--help Show this message and exit.
|
||||
-s, --serial HEX Operate on specific unit (default: first found)
|
||||
-x, --simulator Connect to the simulator via Unix socket
|
||||
--help Show this message and exit.
|
||||
|
||||
Commands:
|
||||
addr Show the human version of an address
|
||||
@ -60,7 +54,6 @@ Commands:
|
||||
backup Creates 7z encrypted backup file after prompting user to...
|
||||
bag Factory: set or read bag number -- single use only!
|
||||
chain Get which blockchain (Bitcoin/Testnet) is configured.
|
||||
convert2cc Convert existing Electrum wallet file into COLDCARD wallet...
|
||||
debug Start interactive (local) debug session
|
||||
eval Simulator only: eval a python statement
|
||||
exec Simulator only: exec a python script
|
||||
@ -68,16 +61,14 @@ Commands:
|
||||
hsm Get current status of HSM feature.
|
||||
hsm-start Enable Hardware Security Module (HSM) mode.
|
||||
list List all attached Coldcard devices
|
||||
local-conf Generate the 6-digit code needed for a specific PSBT file...
|
||||
local-conf Generate the 6-digit code needed for a specific PSBT file to...
|
||||
logout Securely logout of device (will require replug to start over)
|
||||
miniscript Miniscript related commands
|
||||
msg Sign a short text message
|
||||
multisig Create a skeleton file which defines a multisig wallet.
|
||||
p2sh Show a multisig payment address on-screen.
|
||||
pass Provide a BIP39 passphrase
|
||||
pubkey Get the public key for a derivation path
|
||||
pubkey Get the public key for a derivation path Dump 33-byte...
|
||||
reboot Reboot coldcard, force relogin and start over
|
||||
restore Uploads 7z encrypted backup file & starts backup restore...
|
||||
sign Approve a spending transaction by signing it on Coldcard
|
||||
test Test USB connection (debug/dev)
|
||||
upgrade Send firmware file (.dfu) and trigger upgrade process
|
||||
@ -98,12 +89,12 @@ Usage: ckcc msg [OPTIONS] MESSAGE
|
||||
Sign a short text message
|
||||
|
||||
Options:
|
||||
-p, --path DERIVATION Derivation for key to use [default: m/44'/0'/0'/0/0]
|
||||
-v, --verbose Include fancy ascii armour
|
||||
-j, --just-sig Just the signature itself, nothing more
|
||||
-s, --segwit Address in segwit native (p2wpkh, bech32)
|
||||
-w, --wrap Address in segwit wrapped in P2SH (p2wpkh)
|
||||
--help Show this message and exit.
|
||||
-p, --path TEXT Derivation for key to use
|
||||
-v, --verbose Include fancy ascii armour
|
||||
-j, --just-sig Just the signature itself, nothing more
|
||||
-s, --segwit Address in segwit native (p2wpkh, bech32)
|
||||
-w, --wrap Address in segwit wrapped in P2SH (p2wpkh)
|
||||
--help Show this message and exit.
|
||||
|
||||
% ckcc msg "Hello Coldcard" -p m/34/23/33
|
||||
Waiting for OK on the Coldcard...
|
||||
@ -112,7 +103,6 @@ Hello Coldcard
|
||||
H4mTuwMUdnu3MyMA+6aJ3hiAF4L0WBDZFseTEno511hNN8/THIeM4GW4SnrcJJhS3WxMZEWFdEIZDSP+H5aIcao=
|
||||
```
|
||||
|
||||
|
||||
## Transaction Signing
|
||||
|
||||
```
|
||||
@ -122,15 +112,14 @@ Usage: ckcc sign [OPTIONS] PSBT_IN [PSBT_OUT]
|
||||
Approve a spending transaction by signing it on Coldcard
|
||||
|
||||
Options:
|
||||
-f, --finalize Show final signed transaction, ready for transmission
|
||||
-z, --visualize Show text of Coldcard's interpretation of the transaction
|
||||
(does not create transaction, no interaction needed)
|
||||
-p, --pushtx URL Broadcast transaction via provided PushTx URL. Shortcut
|
||||
options: coldcard, mempool
|
||||
-s, --signed Include a signature over visualization text
|
||||
-x, --hex Write out (signed) PSBT in hexidecimal
|
||||
-6, --base64 Write out (signed) PSBT encoded in base64
|
||||
--help Show this message and exit.
|
||||
-v, --verbose Show more details
|
||||
-f, --finalize Show final signed transaction, ready for transmission
|
||||
-z, --visualize Show text of Coldcard's interpretation of the transaction
|
||||
(does not create transaction, no interaction needed)
|
||||
-s, --signed Include a signature over visualization text
|
||||
-x, --hex Write out (signed) PSBT in hexidecimal
|
||||
-6, --base64 Write out (signed) PSBT encoded in base64
|
||||
--help Show this message and exit.
|
||||
|
||||
% (... acquire PSBT file for what you want to do ...)
|
||||
|
||||
@ -146,61 +135,6 @@ Ok! Downloading result (5119 bytes)
|
||||
00000020 c2 23 e1 06 22 1b 02 0e bd c8 1c 71 79 7d 3c 02 |.#.."......qy}<.|
|
||||
00000030 00 00 00 00 fe ff ff ff 4c 85 a0 2c 80 cb 2c 01 |........L..,..,.|
|
||||
|
||||
# sign PSBT provided via stdin
|
||||
% echo 'cHNidP8BAHcBAAAAASGhv...fX4RgPBWlDLAAAgAEAAIAAAACAAQAAAAUAAAAA' | ckcc sign -
|
||||
|
||||
```
|
||||
|
||||
## Miniscript
|
||||
|
||||
```
|
||||
% ckcc miniscript --help
|
||||
Usage: ckcc miniscript [OPTIONS] COMMAND [ARGS]...
|
||||
|
||||
Miniscript related commands
|
||||
|
||||
Options:
|
||||
--help Show this message and exit.
|
||||
|
||||
Commands:
|
||||
addr Get miniscript internal/external chain address by index with on...
|
||||
del Delete registered miniscript wallet by name with on device...
|
||||
enroll Enroll miniscript wallet
|
||||
get Get registered miniscript wallet by name.
|
||||
ls List registered miniscript wallet names.
|
||||
```
|
||||
|
||||
## Backup/Restore
|
||||
|
||||
```
|
||||
% ckcc backup --help
|
||||
Usage: ckcc backup [OPTIONS]
|
||||
|
||||
Creates 7z encrypted backup file after prompting user to remember a massive
|
||||
passphrase. Downloads the AES-encrypted data backup and by default, saves
|
||||
into current directory using a filename based on today's date.
|
||||
|
||||
Options:
|
||||
-d, --outdir DIRECTORY Save into indicated directory (auto filename)
|
||||
-o, --outfile filename.7z Name for backup file
|
||||
--help Show this message and exit.
|
||||
```
|
||||
|
||||
```
|
||||
% ckcc restore --help
|
||||
Usage: ckcc restore [OPTIONS] backup.7z
|
||||
|
||||
Uploads 7z encrypted backup file & starts backup restore process. User needs
|
||||
to specify what kind of backup is being uploaded. Default is 7z encrypted
|
||||
file with word-based password. Use -p/--password flag if your backup has
|
||||
custom not word-based password. User is prompted to enter backup password on
|
||||
the device.
|
||||
|
||||
Options:
|
||||
-c, --plaintext Force plaintext restore. No need to use if file has proper
|
||||
'.txt' suffix
|
||||
-p, --password This backup has custom password. Not words.
|
||||
-t, --tmp Force restoring backup as temporary seed. Only works for
|
||||
seedless Coldcard.
|
||||
--help Show this message and exit.
|
||||
```
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
# (c) Copyright 2021-2025 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
||||
|
||||
__version__ = '1.5.0'
|
||||
__version__ = '1.0.2'
|
||||
|
||||
__all__ = [ "client", "protocol", "constants" ]
|
||||
|
||||
|
||||
1434
ckcc/cli.py
1434
ckcc/cli.py
File diff suppressed because it is too large
Load Diff
104
ckcc/client.py
104
ckcc/client.py
@ -1,4 +1,3 @@
|
||||
# (c) Copyright 2021 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
||||
#
|
||||
# client.py
|
||||
#
|
||||
@ -9,26 +8,25 @@
|
||||
#
|
||||
# - ec_mult, ec_setup, aes_setup, mitm_verify
|
||||
#
|
||||
import hid, os, socket, atexit
|
||||
from binascii import b2a_hex
|
||||
import hid, sys, os
|
||||
from binascii import b2a_hex, a2b_hex
|
||||
from hashlib import sha256
|
||||
from .constants import USB_NCRY_V1, USB_NCRY_V2
|
||||
from .protocol import CCProtocolPacker, CCProtocolUnpacker, CCProtoError, MAX_MSG_LEN
|
||||
from .protocol import CCProtocolPacker, CCProtocolUnpacker, CCProtoError, MAX_MSG_LEN, MAX_BLK_LEN
|
||||
from .utils import decode_xpub, get_pubkey_string
|
||||
|
||||
# unofficial, unpermissioned... USB numbers
|
||||
COINKITE_VID = 0xd13e
|
||||
CKCC_PID = 0xcc10
|
||||
|
||||
DEFAULT_SIM_SOCKET = "/tmp/ckcc-simulator.sock"
|
||||
|
||||
# Unix domain socket used by the simulator
|
||||
CKCC_SIMULATOR_PATH = '/tmp/ckcc-simulator.sock'
|
||||
|
||||
class ColdcardDevice:
|
||||
def __init__(self, sn=None, dev=None, encrypt=True, ncry_ver=USB_NCRY_V1, is_simulator=False):
|
||||
def __init__(self, sn=None, dev=None, encrypt=True):
|
||||
# Establish connection via USB (HID) or Unix Pipe
|
||||
self.is_simulator = is_simulator
|
||||
self.is_simulator = False
|
||||
|
||||
if not dev and ((sn and ('/' in sn)) or self.is_simulator):
|
||||
if not dev and sn and '/' in sn:
|
||||
dev = UnixSimulatorPipe(sn)
|
||||
found = 'simulator'
|
||||
self.is_simulator = True
|
||||
@ -58,7 +56,6 @@ class ColdcardDevice:
|
||||
self.serial = found
|
||||
|
||||
# they will be defined after we've established a shared secret w/ device
|
||||
self.ncry_ver = ncry_ver
|
||||
self.session_key = None
|
||||
self.encrypt_request = None
|
||||
self.decrypt_response = None
|
||||
@ -68,7 +65,7 @@ class ColdcardDevice:
|
||||
self.resync()
|
||||
|
||||
if encrypt:
|
||||
self.start_encryption(version=self.ncry_ver)
|
||||
self.start_encryption()
|
||||
|
||||
def close(self):
|
||||
# close underlying HID device
|
||||
@ -102,14 +99,10 @@ class ColdcardDevice:
|
||||
# first byte of each 64-byte packet encodes length or packet-offset
|
||||
assert 4 <= len(msg) <= MAX_MSG_LEN, "msg length: %d" % len(msg)
|
||||
|
||||
if self.encrypt_request is None:
|
||||
if not self.encrypt_request:
|
||||
# disable encryption if not already enabled for this connection
|
||||
encrypt = False
|
||||
|
||||
if self.encrypt_request and self.ncry_ver == USB_NCRY_V2:
|
||||
# ncry version 2 - everything needs to be encrypted
|
||||
encrypt = True
|
||||
|
||||
if encrypt:
|
||||
msg = self.encrypt_request(msg)
|
||||
|
||||
@ -168,10 +161,10 @@ class ColdcardDevice:
|
||||
print("Rx [%2d]: %r" % (len(resp), b2a_hex(bytes(resp))))
|
||||
|
||||
return CCProtocolUnpacker.decode(resp)
|
||||
except CCProtoError:
|
||||
except CCProtoError as e:
|
||||
if expect_errors: raise
|
||||
raise
|
||||
except Exception:
|
||||
except:
|
||||
#print("Corrupt response: %r" % resp)
|
||||
raise
|
||||
|
||||
@ -229,7 +222,7 @@ class ColdcardDevice:
|
||||
self.encrypt_request = pyaes.AESModeOfOperationCTR(session_key, pyaes.Counter(0)).encrypt
|
||||
self.decrypt_response = pyaes.AESModeOfOperationCTR(session_key, pyaes.Counter(0)).decrypt
|
||||
|
||||
def start_encryption(self, version=USB_NCRY_V1):
|
||||
def start_encryption(self):
|
||||
# setup encryption on the link
|
||||
# - pick our own key pair, IV for AES
|
||||
# - send IV and pubkey to device
|
||||
@ -238,12 +231,10 @@ class ColdcardDevice:
|
||||
|
||||
pubkey = self.ec_setup()
|
||||
|
||||
msg = CCProtocolPacker.encrypt_start(pubkey, version=version)
|
||||
msg = CCProtocolPacker.encrypt_start(pubkey)
|
||||
|
||||
his_pubkey, fingerprint, xpub = self.send_recv(msg, encrypt=False)
|
||||
|
||||
self.ncry_ver = version
|
||||
|
||||
self.session_key = self.ec_mult(his_pubkey)
|
||||
|
||||
# capture some public details of remote side's master key
|
||||
@ -255,9 +246,21 @@ class ColdcardDevice:
|
||||
self.aes_setup(self.session_key)
|
||||
|
||||
def mitm_verify(self, sig, expected_xpub):
|
||||
# First try with Pycoin
|
||||
try:
|
||||
from pycoin.key.BIP32Node import BIP32Node
|
||||
from pycoin.contrib.msg_signing import verify_message
|
||||
from pycoin.encoding import from_bytes_32
|
||||
from base64 import b64encode
|
||||
|
||||
mk = BIP32Node.from_wallet_key(expected_xpub)
|
||||
return verify_message(mk, b64encode(sig), msg_hash=from_bytes_32(self.session_key))
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# If Pycoin is not available, do it using ecdsa
|
||||
from ecdsa import BadSignatureError, SECP256k1, VerifyingKey
|
||||
# of the returned (pubkey, chaincode) tuple, chaincode is not used
|
||||
pubkey, _ = decode_xpub(expected_xpub)
|
||||
pubkey, chaincode = decode_xpub(expected_xpub)
|
||||
vk = VerifyingKey.from_string(get_pubkey_string(pubkey), curve=SECP256k1)
|
||||
try:
|
||||
ok = vk.verify_digest(sig[1:], self.session_key)
|
||||
@ -324,66 +327,42 @@ class ColdcardDevice:
|
||||
|
||||
return data
|
||||
|
||||
def hash_password(self, text_password, v3=False):
|
||||
def hash_password(self, text_password):
|
||||
# Turn text password into a key for use in HSM auth protocol
|
||||
# - changed from pbkdf2_hmac_sha256 to pbkdf2_hmac_sha512 in version 4 of CC firmware
|
||||
from hashlib import pbkdf2_hmac, sha256
|
||||
from .constants import PBKDF2_ITER_COUNT
|
||||
|
||||
salt = sha256(b'pepper' + self.serial.encode('ascii')).digest()
|
||||
|
||||
return pbkdf2_hmac('sha256' if v3 else 'sha512', text_password, salt, PBKDF2_ITER_COUNT)[:32]
|
||||
|
||||
def firmware_version(self):
|
||||
return self.send_recv(CCProtocolPacker.version()).split("\n")
|
||||
|
||||
def is_edge(self):
|
||||
# returns True if device is running EDGE firmware version
|
||||
if self.is_simulator:
|
||||
cmd = "import version; RV.write(str(int(getattr(version, 'is_edge', 0))))"
|
||||
rv = self.send_recv(b'EXEC' + cmd.encode('utf-8'), timeout=60000, encrypt=False)
|
||||
return rv == b"1"
|
||||
|
||||
return self.firmware_version()[1][-1] == "X"
|
||||
return pbkdf2_hmac('sha256', text_password, salt, PBKDF2_ITER_COUNT)
|
||||
|
||||
|
||||
class UnixSimulatorPipe:
|
||||
# Use a UNIX pipe to the simulator instead of a real USB connection.
|
||||
# - emulates the API of hidapi device object.
|
||||
|
||||
def __init__(self, socket_path=None):
|
||||
self.socket_path = socket_path or DEFAULT_SIM_SOCKET
|
||||
def __init__(self, path):
|
||||
import socket, atexit
|
||||
self.pipe = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
try:
|
||||
self.pipe.connect(self.socket_path)
|
||||
except Exception:
|
||||
self.pipe.connect(path)
|
||||
except:
|
||||
self.close()
|
||||
raise RuntimeError("Cannot connect to simulator. Is it running?")
|
||||
|
||||
last_err = None
|
||||
for instance in range(5):
|
||||
# if simulator has PID in socket path, client will have matching, or empty
|
||||
pn = '/tmp/ckcc-client%s-%d-%d.sock' % (self.get_sim_pid(), os.getpid(), instance)
|
||||
instance = 0
|
||||
while instance < 10:
|
||||
pn = '/tmp/ckcc-client-%d-%d.sock' % (os.getpid(), instance)
|
||||
try:
|
||||
self.pipe.bind(pn) # just needs any name
|
||||
break
|
||||
except OSError as err:
|
||||
last_err = err
|
||||
if os.path.exists(pn):
|
||||
os.remove(pn)
|
||||
except OSError:
|
||||
instance += 1
|
||||
continue
|
||||
else:
|
||||
raise last_err # raise whatever was raised last in the loop
|
||||
|
||||
self.pipe_name = pn
|
||||
atexit.register(self.close)
|
||||
|
||||
def get_sim_pid(self):
|
||||
# return str PID if any in socket_path
|
||||
if self.socket_path == DEFAULT_SIM_SOCKET:
|
||||
return ""
|
||||
return "-" + self.socket_path.split(".")[0].split("-")[-1]
|
||||
|
||||
def read(self, max_count, timeout_ms=None):
|
||||
import socket
|
||||
if not timeout_ms:
|
||||
@ -409,11 +388,10 @@ class UnixSimulatorPipe:
|
||||
self.pipe.close()
|
||||
try:
|
||||
os.unlink(self.pipe_name)
|
||||
except Exception:
|
||||
pass
|
||||
except: pass
|
||||
|
||||
def get_serial_number_string(self):
|
||||
return 'F1'*6
|
||||
return 'simulator'
|
||||
|
||||
|
||||
# EOF
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
# (c) Copyright 2021 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
||||
#
|
||||
# Constants and various "limits" shared between embedded and desktop USB protocol
|
||||
#
|
||||
@ -7,22 +6,6 @@ try:
|
||||
except ImportError:
|
||||
const = int
|
||||
|
||||
# USB encryption versions (default USB_NCRY_V1)
|
||||
#
|
||||
# This introduces a new ncry version to close a potential attack vector:
|
||||
#
|
||||
# A malicious program may re-initialize the connection encryption by sending the ncry command a second time during USB operation.
|
||||
# This may prove particularly harmful in HSM mode.
|
||||
#
|
||||
# Sending version USB_NCRY_V2 changes the behavior in two ways:
|
||||
# * All future commands must be encrypted
|
||||
# * Returns an error if the ncry command is sent again for the duration of the power cycle
|
||||
#
|
||||
# USB_NCRY_V2 is most suitable for HSM mode as in case of any communication issue or simply by closing `ColdcardDevice`
|
||||
# Coldcard will need to reboot to recover USB operation if USB_NCRY_V2.
|
||||
USB_NCRY_V1 = const(0x01)
|
||||
USB_NCRY_V2 = const(0x02)
|
||||
|
||||
# For upload/download this is the max size of the data block.
|
||||
MAX_BLK_LEN = const(2048)
|
||||
|
||||
@ -34,29 +17,17 @@ MAX_MSG_LEN = const(4+4+4+MAX_BLK_LEN)
|
||||
# - the max on the wire for mainnet is 100k
|
||||
# - but a PSBT might contain a full txn for each input
|
||||
MAX_TXN_LEN = const(384*1024)
|
||||
MAX_TXN_LEN_MK4 = const(2*1024*1024)
|
||||
|
||||
# Max size of any upload (firmware.dfu files in particular)
|
||||
MAX_UPLOAD_LEN = const(2*MAX_TXN_LEN)
|
||||
MAX_UPLOAD_LEN_MK4 = const(2*MAX_TXN_LEN_MK4)
|
||||
|
||||
# Max length of text messages for signing
|
||||
MSG_SIGNING_MAX_LENGTH = const(240)
|
||||
|
||||
# Bitcoin limitation: max number of signatures in P2SH redeem script (non-segwit)
|
||||
# - 520 byte redeem script limit <= 15*34 bytes per pubkey == 510 bytes
|
||||
# - serializations of M/N in redeem scripts assume this range
|
||||
MAX_SIGNERS = const(15)
|
||||
# taproot artificial multisig limit
|
||||
MAX_TR_SIGNERS = const(34)
|
||||
|
||||
TAPROOT_LEAF_MASK = 0xfe
|
||||
TAPROOT_LEAF_TAPSCRIPT = 0xc0
|
||||
|
||||
# Types of user auth we support
|
||||
USER_AUTH_TOTP = const(1) # RFC6238
|
||||
USER_AUTH_HOTP = const(2) # RFC4226
|
||||
USER_AUTH_HMAC = const(3) # PBKDF2('hmac-sha512', scrt, sha256(psbt), PBKDF2_ITER_COUNT)[:32]
|
||||
USER_AUTH_HMAC = const(3) # PBKDF2('hmac-sha256', secret, sha256(psbt), PBKDF2_ITER_COUNT)
|
||||
USER_AUTH_SHOW_QR = const(0x80) # show secret on Coldcard screen (best for TOTP enroll)
|
||||
|
||||
MAX_USERNAME_LEN = 16
|
||||
@ -77,23 +48,19 @@ AFC_SEGWIT = const(0x02) # requires a witness to spend
|
||||
AFC_BECH32 = const(0x04) # just how we're encoding it?
|
||||
AFC_SCRIPT = const(0x08) # paying into a script
|
||||
AFC_WRAPPED = const(0x10) # for transition/compat types for segwit vs. old
|
||||
AFC_BECH32M = const(0x20) # no difference between script/key path in taproot
|
||||
|
||||
# Numeric codes for specific address types
|
||||
AF_BARE_PK = const(0x00) # p2pk bare public key address
|
||||
AF_CLASSIC = AFC_PUBKEY # 1addr
|
||||
AF_P2SH = AFC_SCRIPT # classic multisig / simple P2SH / 3hash
|
||||
AF_P2WPKH = AFC_PUBKEY | AFC_SEGWIT | AFC_BECH32 # bc1qsdklfj
|
||||
AF_P2WSH = AFC_SCRIPT | AFC_SEGWIT | AFC_BECH32 # segwit multisig
|
||||
AF_P2WPKH_P2SH = AFC_WRAPPED | AFC_PUBKEY | AFC_SEGWIT # looks classic P2SH, but p2wpkh inside
|
||||
AF_P2WSH_P2SH = AFC_WRAPPED | AFC_SCRIPT | AFC_SEGWIT # looks classic P2SH, segwit multisig
|
||||
AF_P2TR = AFC_PUBKEY | AFC_SEGWIT | AFC_BECH32M # bc1p
|
||||
|
||||
SUPPORTED_ADDR_FORMATS = frozenset([
|
||||
AF_CLASSIC,
|
||||
AF_P2SH,
|
||||
AF_P2WPKH,
|
||||
AF_P2TR,
|
||||
AF_P2WSH,
|
||||
AF_P2WPKH_P2SH,
|
||||
AF_P2WSH_P2SH,
|
||||
@ -101,73 +68,21 @@ SUPPORTED_ADDR_FORMATS = frozenset([
|
||||
|
||||
# BIP-174 aka PSBT defined values
|
||||
#
|
||||
# GLOBAL ===
|
||||
PSBT_GLOBAL_UNSIGNED_TX = const(0x00)
|
||||
PSBT_GLOBAL_XPUB = const(0x01)
|
||||
PSBT_GLOBAL_VERSION = const(0xfb)
|
||||
PSBT_GLOBAL_PROPRIETARY = const(0xfc)
|
||||
# BIP-370
|
||||
PSBT_GLOBAL_TX_VERSION = const(0x02)
|
||||
PSBT_GLOBAL_FALLBACK_LOCKTIME = const(0x03)
|
||||
PSBT_GLOBAL_INPUT_COUNT = const(0x04)
|
||||
PSBT_GLOBAL_OUTPUT_COUNT = const(0x05)
|
||||
PSBT_GLOBAL_TX_MODIFIABLE = const(0x06)
|
||||
# BIP-322
|
||||
PSBT_GLOBAL_GENERIC_SIGNED_MESSAGE = const(0x09)
|
||||
PSBT_GLOBAL_UNSIGNED_TX = const(0)
|
||||
PSBT_GLOBAL_XPUB = const(1)
|
||||
|
||||
# INPUTS ===
|
||||
PSBT_IN_NON_WITNESS_UTXO = const(0x00)
|
||||
PSBT_IN_WITNESS_UTXO = const(0x01)
|
||||
PSBT_IN_PARTIAL_SIG = const(0x02)
|
||||
PSBT_IN_SIGHASH_TYPE = const(0x03)
|
||||
PSBT_IN_REDEEM_SCRIPT = const(0x04)
|
||||
PSBT_IN_WITNESS_SCRIPT = const(0x05)
|
||||
PSBT_IN_BIP32_DERIVATION = const(0x06)
|
||||
PSBT_IN_FINAL_SCRIPTSIG = const(0x07)
|
||||
PSBT_IN_FINAL_SCRIPTWITNESS = const(0x08)
|
||||
PSBT_IN_POR_COMMITMENT = const(0x09)
|
||||
PSBT_IN_RIPEMD160 = const(0x0a)
|
||||
PSBT_IN_SHA256 = const(0x0b)
|
||||
PSBT_IN_HASH160 = const(0x0c)
|
||||
PSBT_IN_HASH256 = const(0x0d)
|
||||
# BIP-370
|
||||
PSBT_IN_PREVIOUS_TXID = const(0x0e)
|
||||
PSBT_IN_OUTPUT_INDEX = const(0x0f)
|
||||
PSBT_IN_SEQUENCE = const(0x10)
|
||||
PSBT_IN_REQUIRED_TIME_LOCKTIME = const(0x11)
|
||||
PSBT_IN_REQUIRED_HEIGHT_LOCKTIME = const(0x12)
|
||||
# BIP-371
|
||||
PSBT_IN_TAP_KEY_SIG = const(0x13)
|
||||
PSBT_IN_TAP_SCRIPT_SIG = const(0x14)
|
||||
PSBT_IN_TAP_LEAF_SCRIPT = const(0x15)
|
||||
PSBT_IN_TAP_BIP32_DERIVATION = const(0x16)
|
||||
PSBT_IN_TAP_INTERNAL_KEY = const(0x17)
|
||||
PSBT_IN_TAP_MERKLE_ROOT = const(0x18)
|
||||
PSBT_IN_NON_WITNESS_UTXO = const(0)
|
||||
PSBT_IN_WITNESS_UTXO = const(1)
|
||||
PSBT_IN_PARTIAL_SIG = const(2)
|
||||
PSBT_IN_SIGHASH_TYPE = const(3)
|
||||
PSBT_IN_REDEEM_SCRIPT = const(4)
|
||||
PSBT_IN_WITNESS_SCRIPT = const(5)
|
||||
PSBT_IN_BIP32_DERIVATION = const(6)
|
||||
PSBT_IN_FINAL_SCRIPTSIG = const(7)
|
||||
PSBT_IN_FINAL_SCRIPTWITNESS = const(8)
|
||||
|
||||
PSBT_IN_MUSIG2_PARTICIPANT_PUBKEYS = const(0x1a)
|
||||
PSBT_IN_MUSIG2_PUB_NONCE = const(0x1b)
|
||||
PSBT_IN_MUSIG2_PARTIAL_SIG = const(0x1c)
|
||||
|
||||
# OUTPUTS ===
|
||||
PSBT_OUT_REDEEM_SCRIPT = const(0x00)
|
||||
PSBT_OUT_WITNESS_SCRIPT = const(0x01)
|
||||
PSBT_OUT_BIP32_DERIVATION = const(0x02)
|
||||
# BIP-370
|
||||
PSBT_OUT_AMOUNT = const(0x03)
|
||||
PSBT_OUT_SCRIPT = const(0x04)
|
||||
# BIP-371
|
||||
PSBT_OUT_TAP_INTERNAL_KEY = const(0x05)
|
||||
PSBT_OUT_TAP_TREE = const(0x06)
|
||||
PSBT_OUT_TAP_BIP32_DERIVATION = const(0x07)
|
||||
PSBT_OUT_MUSIG2_PARTICIPANT_PUBKEYS = const(0x08)
|
||||
|
||||
RFC_SIGNATURE_TEMPLATE = '''\
|
||||
-----BEGIN BITCOIN SIGNED MESSAGE-----
|
||||
{msg}
|
||||
-----BEGIN BITCOIN SIGNATURE-----
|
||||
{addr}
|
||||
{sig}
|
||||
-----END BITCOIN SIGNATURE-----
|
||||
'''
|
||||
PSBT_OUT_REDEEM_SCRIPT = const(0)
|
||||
PSBT_OUT_WITNESS_SCRIPT = const(1)
|
||||
PSBT_OUT_BIP32_DERIVATION = const(2)
|
||||
|
||||
# EOF
|
||||
|
||||
156
ckcc/electrum.py
156
ckcc/electrum.py
@ -1,156 +0,0 @@
|
||||
# (c) Copyright 2021 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
||||
#
|
||||
import re
|
||||
import os
|
||||
import copy
|
||||
import json
|
||||
|
||||
from ckcc.utils import xfp2str
|
||||
from ckcc.client import ColdcardDevice
|
||||
from ckcc.protocol import CCProtocolPacker
|
||||
|
||||
|
||||
MULTISIG_WALLET_TYPE_PATTERN = r"^\d+of\d+$"
|
||||
MULTISIG_WALLET_KEY_PATTERN = r"^x\d+/$"
|
||||
|
||||
|
||||
def is_hww_keystore(keystore: dict) -> bool:
|
||||
return keystore["type"] == "hardware"
|
||||
|
||||
|
||||
def is_multisig_wallet(wallet: dict) -> bool:
|
||||
if re.match(MULTISIG_WALLET_TYPE_PATTERN, wallet["wallet_type"]):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_multisig_wallet_key(key: str) -> bool:
|
||||
if re.match(MULTISIG_WALLET_KEY_PATTERN, key):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def collect_multisig_hww_keystores_from_wallet(wallet: dict) -> dict:
|
||||
"""Find all hardware keystore objects in multisig wallet dict"""
|
||||
if not is_multisig_wallet(wallet):
|
||||
raise RuntimeError("Not an electrum multisig wallet")
|
||||
return {
|
||||
key: value
|
||||
for key, value in wallet.items()
|
||||
if is_multisig_wallet_key(key)
|
||||
if is_hww_keystore(value)
|
||||
}
|
||||
|
||||
|
||||
def multisig_find_target(keystores: dict, key: str, value: str) -> tuple:
|
||||
"""Find target keystore in list of keystores by key equals value"""
|
||||
result = [
|
||||
(k, keystore)
|
||||
for k, keystore in keystores.items()
|
||||
if keystore.get(key, None) == value
|
||||
]
|
||||
length = len(result)
|
||||
if length != 1:
|
||||
# if this is true, we have found more than one keystore and therefore
|
||||
# key value pair is ambiguous
|
||||
msg = "Found {} keystores.".format(length)
|
||||
raise RuntimeError(
|
||||
msg if length == 0 else msg + "{}:{} is ambiguous".format(key, value)
|
||||
)
|
||||
return result[0]
|
||||
|
||||
|
||||
def filepath_append_cc(f_path: str) -> str:
|
||||
"""Append '_cc' suffix to file path. Do consider one file extension"""
|
||||
dirname = os.path.dirname(f_path)
|
||||
filename, file_ext = os.path.splitext(os.path.basename(f_path))
|
||||
result = os.path.join(dirname, "{}_cc".format(filename) + file_ext)
|
||||
return result
|
||||
|
||||
|
||||
def cc_adjust_hww_keystore(keystore: dict, dev: ColdcardDevice = None) -> dict:
|
||||
"""Create new updated version of keystore"""
|
||||
new_keystore = copy.deepcopy(keystore)
|
||||
|
||||
if not is_hww_keystore(keystore):
|
||||
raise RuntimeError("Not a hardware wallet type")
|
||||
|
||||
# 1-3 can be done without coldcard connected
|
||||
#
|
||||
# 1. change hw type to coldcard
|
||||
new_keystore["hw_type"] = "coldcard"
|
||||
# 2. soft device id should be nullified
|
||||
new_keystore["soft_device_id"] = None
|
||||
# 3. remove cfg key if exists (ledger specific)
|
||||
if "cfg" in new_keystore:
|
||||
del new_keystore["cfg"]
|
||||
# 4. label ? we can do something about it - at least remove the label that is no longer in use
|
||||
new_keystore["label"] = "Coldcard {}".format(new_keystore["root_fingerprint"])
|
||||
|
||||
# for next steps we need coldcard connected (unnecessary)
|
||||
if dev:
|
||||
# 4. label Coldcard + fingerprint
|
||||
xfp = dev.master_fingerprint
|
||||
xfp = xfp2str(xfp).lower() # if any letters - lower them
|
||||
if xfp != new_keystore["root_fingerprint"]:
|
||||
raise RuntimeError(
|
||||
"Fingerprint missmatch! Is this a correct coldcard/wallet file?"
|
||||
" Make sure that your bip39 passphrase is in effect (if used)."
|
||||
" device fingerprint {}; wallet fingerprint {}".format(xfp, new_keystore["root_fingerprint"])
|
||||
)
|
||||
|
||||
label = "Coldcard {}".format(xfp)
|
||||
new_keystore["label"] = label
|
||||
# 5. ckcc xpub (master xpub)
|
||||
master_ext_pubkey = dev.master_xpub
|
||||
new_keystore["ckcc_xpub"] = master_ext_pubkey
|
||||
return new_keystore
|
||||
|
||||
|
||||
def cc_adjust_multisig_hww_keystore(wallet: dict, key: str, value: str, dev: ColdcardDevice = None) -> dict:
|
||||
"""Update multisig wallet keystore"""
|
||||
# 1. find target keystore
|
||||
k, keystore = multisig_find_target(
|
||||
keystores=collect_multisig_hww_keystores_from_wallet(wallet),
|
||||
key=key,
|
||||
value=value,
|
||||
)
|
||||
# 2. create new adjusted keystore for target
|
||||
new_keystore = cc_adjust_hww_keystore(keystore, dev)
|
||||
# 3. update target keystore in wallet
|
||||
wallet[k] = new_keystore
|
||||
return wallet
|
||||
|
||||
|
||||
def convert2cc(wallet_str: str, dev: ColdcardDevice = None, key: str = None, val: str = None):
|
||||
wallet = json.loads(wallet_str)
|
||||
wallet_type = wallet["wallet_type"]
|
||||
if wallet_type == "standard":
|
||||
new_keystore = cc_adjust_hww_keystore(wallet["keystore"], dev)
|
||||
wallet["keystore"] = new_keystore
|
||||
elif is_multisig_wallet(wallet):
|
||||
if key is None and val is None and dev is None:
|
||||
# dev is not defined, key val is not defined, we are in multisig - have to fail
|
||||
raise RuntimeError("--key and --val have to be specified for multisig wallets")
|
||||
elif key is None and val is None and dev:
|
||||
# user haven't provided arguments - try some auto-magic if coldcard is connected
|
||||
# look for root fingerprint
|
||||
cc_adjust_multisig_hww_keystore(
|
||||
wallet,
|
||||
key="root_fingerprint",
|
||||
value=xfp2str(dev.master_fingerprint).lower(),
|
||||
dev=dev
|
||||
)
|
||||
# is it sufficient to just check xfp?
|
||||
# shouldn't I try to re-create xpub (Vpub) or whatever I get as derivation path?
|
||||
else:
|
||||
# key val specified
|
||||
cc_adjust_multisig_hww_keystore(
|
||||
wallet,
|
||||
key=key,
|
||||
value=val,
|
||||
dev=dev
|
||||
)
|
||||
else:
|
||||
raise RuntimeError("Unsupported wallet type: {}".format(wallet_type))
|
||||
return json.dumps(wallet)
|
||||
@ -1,4 +1,3 @@
|
||||
# (c) Copyright 2021 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
||||
#
|
||||
# Details of our USB level protocol. Shared file between desktop and embedded.
|
||||
#
|
||||
@ -64,35 +63,11 @@ class CCProtocolPacker:
|
||||
|
||||
@staticmethod
|
||||
def start_backup():
|
||||
# prompts user with password for encrypted backup
|
||||
# prompts user with password for encrytped backup
|
||||
return b'back'
|
||||
|
||||
@staticmethod
|
||||
def restore_backup(length, file_sha, custom_pwd=False, plaintext=False, tmp=False):
|
||||
# backup file has to be already uploaded
|
||||
# custom_pwd: (bool) .7z encrypted with custom password
|
||||
# plaintext: (bool) clear-text (dev)
|
||||
# tmp (bool) force load as tmp, effective only on seed-less CC
|
||||
assert len(file_sha) == 32
|
||||
assert not (custom_pwd and plaintext)
|
||||
|
||||
bf = 0
|
||||
if custom_pwd:
|
||||
bf |= 1
|
||||
if plaintext:
|
||||
bf |= 2
|
||||
if tmp:
|
||||
bf |= 4
|
||||
|
||||
return pack('<4sI32sB', b'rest', length, file_sha, bf)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def encrypt_start(device_pubkey, version=USB_NCRY_V1):
|
||||
supported_versions = [USB_NCRY_V1, USB_NCRY_V2]
|
||||
if version not in supported_versions:
|
||||
raise ValueError("Unsupported USB encryption version. "
|
||||
"Supported versions: %s" % (supported_versions))
|
||||
def encrypt_start(device_pubkey, version=0x1):
|
||||
assert len(device_pubkey) == 64, "want uncompressed 64-byte pubkey, no prefix byte"
|
||||
return pack('<4sI64s', b'ncry', version, device_pubkey)
|
||||
|
||||
@ -112,14 +87,11 @@ class CCProtocolPacker:
|
||||
return b'sha2'
|
||||
|
||||
@staticmethod
|
||||
def sign_transaction(length, file_sha, finalize=False, flags=0x0, miniscript_name=None):
|
||||
def sign_transaction(length, file_sha, finalize=False, flags=0x0):
|
||||
# must have already uploaded binary, and give expected sha256
|
||||
assert len(file_sha) == 32
|
||||
flags |= (STXN_FINALIZE if finalize else 0x00)
|
||||
rv = pack('<4sII32s', b'stxn', length, int(flags), file_sha)
|
||||
if miniscript_name:
|
||||
rv += pack("B", len(miniscript_name)) + miniscript_name.encode()
|
||||
return rv
|
||||
return pack('<4sII32s', b'stxn', length, int(flags), file_sha)
|
||||
|
||||
@staticmethod
|
||||
def sign_message(raw_msg, subpath='m', addr_fmt=AF_CLASSIC):
|
||||
@ -148,42 +120,6 @@ class CCProtocolPacker:
|
||||
assert len(file_sha) == 32
|
||||
return pack('<4sI32s', b'enrl', length, file_sha)
|
||||
|
||||
@staticmethod
|
||||
def miniscript_ls():
|
||||
# list registered miniscript wallet names
|
||||
return b'msls'
|
||||
|
||||
@staticmethod
|
||||
def miniscript_delete(name):
|
||||
# delete registered miniscript wallet by name
|
||||
assert 2 <= len(name) <= 40, "name len"
|
||||
return b'msdl' + name.encode('ascii')
|
||||
|
||||
@staticmethod
|
||||
def miniscript_get(name):
|
||||
# get registered miniscript wallet object by name
|
||||
assert 2 <= len(name) <= 40, "name len"
|
||||
return b'msgt' + name.encode('ascii')
|
||||
|
||||
@staticmethod
|
||||
def miniscript_policy(name):
|
||||
# get BIP-388 policy of registered miniscript wallet object by name
|
||||
assert 2 <= len(name) <= 40, "name len"
|
||||
return b'mspl' + name.encode('ascii')
|
||||
|
||||
@staticmethod
|
||||
def miniscript_address(name, change=False, idx=0):
|
||||
# get miniscript address from internal or external chain by id
|
||||
assert 2 <= len(name) <= 40, "name len"
|
||||
assert 0 <= idx < (2**31), "child idx"
|
||||
return pack('<4sII', b'msas', int(change), idx) + name.encode('ascii')
|
||||
|
||||
@staticmethod
|
||||
def miniscript_enroll(length, file_sha):
|
||||
# miniscript details must already be uploaded as a text file, this starts approval process.
|
||||
assert len(file_sha) == 32
|
||||
return pack('<4sI32s', b'mins', length, file_sha)
|
||||
|
||||
@staticmethod
|
||||
def multisig_check(M, N, xfp_xor):
|
||||
# do we have a wallet already that matches M+N and xor(*xfps)?
|
||||
@ -288,62 +224,52 @@ class CCProtocolUnpacker:
|
||||
# - given full rx message to work from
|
||||
# - this is done after un-framing
|
||||
|
||||
@staticmethod
|
||||
def decode(msg):
|
||||
@classmethod
|
||||
def decode(cls, msg):
|
||||
assert len(msg) >= 4
|
||||
sign = str(msg[0:4], 'utf8', 'ignore')
|
||||
|
||||
d = getattr(CCProtocolUnpacker, sign, None)
|
||||
if d is None:
|
||||
d = getattr(cls, sign, cls)
|
||||
if d is cls:
|
||||
raise CCFramingError('Unknown response signature: ' + repr(sign))
|
||||
|
||||
return d(msg)
|
||||
|
||||
|
||||
# struct info for each response
|
||||
|
||||
@staticmethod
|
||||
|
||||
def okay(msg):
|
||||
# trivial response, w/ no content
|
||||
assert len(msg) == 4
|
||||
return None
|
||||
|
||||
# low-level errors
|
||||
@staticmethod
|
||||
def fram(msg):
|
||||
raise CCFramingError("Framing Error: " + str(msg[4:], 'utf8'))
|
||||
|
||||
@staticmethod
|
||||
raise CCFramingError("Framing Error", str(msg[4:], 'utf8'))
|
||||
def err_(msg):
|
||||
raise CCProtoError("Coldcard Error: " + str(msg[4:], 'utf8', 'ignore'), msg[4:])
|
||||
|
||||
@staticmethod
|
||||
def refu(msg):
|
||||
# user didn't want to approve something
|
||||
raise CCUserRefused()
|
||||
|
||||
@staticmethod
|
||||
def busy(msg):
|
||||
# user didn't want to approve something
|
||||
raise CCBusyError()
|
||||
|
||||
@staticmethod
|
||||
def biny(msg):
|
||||
# binary string: length implied by msg framing
|
||||
return msg[4:]
|
||||
|
||||
@staticmethod
|
||||
def int1(msg):
|
||||
return unpack_from('<I', msg, 4)[0]
|
||||
|
||||
@staticmethod
|
||||
def int2(msg):
|
||||
return unpack_from('<2I', msg, 4)
|
||||
|
||||
@staticmethod
|
||||
def int3(msg):
|
||||
return unpack_from('<3I', msg, 4)
|
||||
|
||||
@staticmethod
|
||||
def mypb(msg):
|
||||
# response to "ncry" command:
|
||||
# - the (uncompressed) pubkey of the Coldcard
|
||||
@ -354,19 +280,16 @@ class CCProtocolUnpacker:
|
||||
xpub = msg[-xpub_len:] if xpub_len else b''
|
||||
return dev_pubkey, fingerprint, xpub
|
||||
|
||||
@staticmethod
|
||||
def asci(msg):
|
||||
# hex/base58 string or other for-computers string, which isn't international
|
||||
return msg[4:].decode('ascii')
|
||||
|
||||
@staticmethod
|
||||
def smrx(msg):
|
||||
# message signing result. application specific!
|
||||
# returns actual address used (text), and raw binary signature (65 bytes)
|
||||
aln = unpack_from('<I', msg, 4)[0]
|
||||
return msg[8:aln+8].decode('ascii'), msg[8+aln:]
|
||||
|
||||
@staticmethod
|
||||
def strx(msg):
|
||||
# txn signing result, or other file operation. application specific!
|
||||
# returns length of resulting PSBT and it's sha256
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
# Autogen'ed file, don't edit. See stm32/sigheader.h for original
|
||||
# Autogen'ed file, don't edit. See bootloader/mk-sigheader.h for original
|
||||
|
||||
# (c) Copyright 2018 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
||||
|
||||
# Our simple firmware header.
|
||||
# Although called a header, this data is placed into the middle of the binary.
|
||||
@ -24,37 +23,23 @@ FW_HEADER_OFFSET = (0x4000-FW_HEADER_SIZE)
|
||||
|
||||
FW_HEADER_MAGIC = 0xCC001234
|
||||
|
||||
# Firmware Image Size
|
||||
|
||||
# arbitrary min size
|
||||
FW_MIN_LENGTH = (256*1024)
|
||||
|
||||
# (mk1-3) absolute max size: 1MB flash - 32k for bootloader = 1,015,808
|
||||
# - but practical limit for our-protocol USB upgrades: 786432 (or else settings damaged)
|
||||
# absolute max: 1MB flash - 32k for bootloader
|
||||
# practical limit for our-protocol USB upgrades: 786432 (or else settings damaged)
|
||||
FW_MAX_LENGTH = (0x100000 - 0x8000)
|
||||
|
||||
# .. for Mk4: 2Mbytes, less bootrom of 128k.
|
||||
FW_MAX_LENGTH_MK4 = (0x200000 - 0x20000)
|
||||
|
||||
# Arguments to be used w/ python's struct module.
|
||||
FWH_PY_FORMAT = "<I8s8sIIII8s20s64s"
|
||||
FWH_PY_VALUES = "magic_value timestamp version_string pubkey_num firmware_length install_flags hw_compat best_ts future signature"
|
||||
FWH_NUM_FUTURE = 7
|
||||
|
||||
# offset of pubkey number
|
||||
FWH_PY_FORMAT = "<I8s8sII36s64s"
|
||||
FWH_PY_VALUES = "magic_value timestamp version_string pubkey_num firmware_length future signature"
|
||||
FWH_NUM_FUTURE = 9
|
||||
FWH_PK_NUM_OFFSET = 20
|
||||
|
||||
# Bits in install_flags
|
||||
FWHIF_HIGH_WATER = 0x01
|
||||
FWHIF_BEST_TS = 0x02
|
||||
|
||||
# Bits in hw_compat
|
||||
MK_1_OK = 0x01
|
||||
MK_2_OK = 0x02
|
||||
MK_3_OK = 0x04
|
||||
MK_4_OK = 0x08
|
||||
MK_Q1_OK = 0x10
|
||||
MK_5_OK = 0x20
|
||||
# There is a copy of the header at this location in RAM, copied by bootloader
|
||||
# **after** it has been verified. Cannot write to this area, or you will be reset!
|
||||
RAM_HEADER_BASE = 0x10007c20
|
||||
|
||||
# Original copy of header, as recorded in flash/firmware file.
|
||||
FLASH_HEADER_BASE = 0x0800bf80
|
||||
|
||||
# EOF
|
||||
|
||||
@ -1,21 +1,6 @@
|
||||
# (c) Copyright 2021 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
||||
#
|
||||
|
||||
import binascii, hashlib, struct, hmac, base64
|
||||
import struct
|
||||
import binascii
|
||||
from collections import namedtuple
|
||||
from typing import Optional
|
||||
|
||||
from ckcc.constants import AF_P2WSH, AF_P2WSH_P2SH, AF_P2SH
|
||||
from ckcc.constants import AF_P2WPKH, AF_P2TR, AF_CLASSIC, AF_P2WPKH_P2SH
|
||||
|
||||
|
||||
B2A = lambda x: binascii.b2a_hex(x).decode('ascii')
|
||||
|
||||
|
||||
def xfp2str(xfp):
|
||||
# Standardized way to show an xpub's fingerprint... it's a 4-byte string
|
||||
# and not really an integer. Used to show as '0x%08x' but that's wrong endian.
|
||||
return binascii.b2a_hex(struct.pack('<I', xfp)).decode('ascii').upper()
|
||||
|
||||
def dfu_parse(fd):
|
||||
# do just a little parsing of DFU headers, to find start/length of main binary
|
||||
@ -39,14 +24,14 @@ def dfu_parse(fd):
|
||||
|
||||
assert dfu_prefix.signature == b'DfuSe', "Not a DFU file (bad magic)"
|
||||
|
||||
for _ in range(dfu_prefix.targets):
|
||||
for idx in range(dfu_prefix.targets):
|
||||
|
||||
prefix = consume(fd, 'Target', '<6sBI255s2I',
|
||||
'signature altsetting named name size elements')
|
||||
|
||||
#print("target%d: %r" % (idx, prefix))
|
||||
|
||||
for _ in range(prefix.elements):
|
||||
for ei in range(prefix.elements):
|
||||
# Decode target prefix
|
||||
# < little endian
|
||||
# I uint32_t element address
|
||||
@ -108,74 +93,18 @@ def calc_local_pincode(psbt_sha, next_local_code):
|
||||
# - next_local_code comes from the hsm_status response
|
||||
# - psbt_sha is sha256() over the binary PSBT you will be submitting
|
||||
#
|
||||
key = binascii.a2b_base64(next_local_code)
|
||||
from binascii import a2b_base64
|
||||
from hashlib import sha256
|
||||
import struct, hmac
|
||||
|
||||
key = a2b_base64(next_local_code)
|
||||
assert len(key) >= 15
|
||||
assert len(psbt_sha) == 32
|
||||
digest = hmac.new(key, psbt_sha, hashlib.sha256).digest()
|
||||
digest = hmac.new(key, psbt_sha, sha256).digest()
|
||||
|
||||
num = struct.unpack('>I', digest[-4:])[0] & 0x7fffffff
|
||||
|
||||
return '%06d' % (num % 1000000)
|
||||
|
||||
|
||||
def descriptor_template(xfp: str, xpub: str, path: str, fmt: int, m: int = None) -> Optional[str]:
|
||||
if m is None:
|
||||
m = "M"
|
||||
key_exp = "[%s%s]%s/0/*" % (xfp.lower(), path.replace("m", ''), xpub)
|
||||
if fmt == AF_P2SH:
|
||||
descriptor_template = "sh(sortedmulti(%s,%s,...))"
|
||||
elif fmt == AF_P2WSH_P2SH:
|
||||
descriptor_template = "sh(wsh(sortedmulti(%s,%s,...)))"
|
||||
elif fmt == AF_P2WSH:
|
||||
descriptor_template = "wsh(sortedmulti(%s,%s,...))"
|
||||
else:
|
||||
return None
|
||||
res = descriptor_template % (m, key_exp)
|
||||
return res
|
||||
|
||||
|
||||
def addr_fmt_help(dev, wrap=False, segwit=False, taproot=False):
|
||||
chain = 0
|
||||
if dev.master_xpub and dev.master_xpub[0] == "t":
|
||||
# testnet
|
||||
chain = 1
|
||||
if wrap:
|
||||
addr_fmt = AF_P2WPKH_P2SH
|
||||
af_path = f"m/49h/{chain}h/0h/0/0"
|
||||
elif segwit:
|
||||
addr_fmt = AF_P2WPKH
|
||||
af_path = f"m/84h/{chain}h/0h/0/0"
|
||||
elif taproot:
|
||||
addr_fmt = AF_P2TR
|
||||
af_path = f"m/86h/{chain}h/0h/0/0"
|
||||
else:
|
||||
addr_fmt = AF_CLASSIC
|
||||
af_path = f"m/44h/{chain}h/0h/0/0"
|
||||
|
||||
return addr_fmt, af_path
|
||||
|
||||
|
||||
def b2a_base64url(s):
|
||||
# see <https://datatracker.ietf.org/doc/html/rfc4648#section-5>
|
||||
# '=' still needs to be removed https://docs.python.org/3/library/base64.html#base64.urlsafe_b64encode
|
||||
return base64.urlsafe_b64encode(s).rstrip(b'=\n').decode()
|
||||
|
||||
|
||||
def txn_to_pushtx_url(txn, base_url, sha=None, chain="BTC", verify_sha=False):
|
||||
assert ("http://" in base_url) or ("https://" in base_url), "url schema"
|
||||
assert base_url[-1] in "#?&", "Final char must be # or ? or &."
|
||||
url = base_url
|
||||
url += 't=' + b2a_base64url(txn)
|
||||
|
||||
if sha is None:
|
||||
sha = hashlib.sha256(txn).digest()
|
||||
elif verify_sha:
|
||||
assert sha == hashlib.sha256(txn).digest(), "wrong hash"
|
||||
|
||||
url += '&c=' + b2a_base64url(sha[-8:])
|
||||
|
||||
if chain != 'BTC':
|
||||
url += '&n=' + chain # XTN or XRT
|
||||
return url
|
||||
|
||||
# EOF
|
||||
|
||||
BIN
dist/ckcc-protocol-0.8.0.tar.gz
vendored
Normal file
BIN
dist/ckcc-protocol-0.8.0.tar.gz
vendored
Normal file
Binary file not shown.
BIN
dist/ckcc-protocol-1.0.1.tar.gz
vendored
Normal file
BIN
dist/ckcc-protocol-1.0.1.tar.gz
vendored
Normal file
Binary file not shown.
BIN
dist/ckcc-protocol-1.0.2.tar.gz
vendored
Normal file
BIN
dist/ckcc-protocol-1.0.2.tar.gz
vendored
Normal file
Binary file not shown.
BIN
dist/ckcc-protocol-1.3.2.tar.gz
vendored
BIN
dist/ckcc-protocol-1.3.2.tar.gz
vendored
Binary file not shown.
BIN
dist/ckcc-protocol-1.4.0.tar.gz
vendored
BIN
dist/ckcc-protocol-1.4.0.tar.gz
vendored
Binary file not shown.
BIN
dist/ckcc-protocol-1.5.0.tar.gz
vendored
BIN
dist/ckcc-protocol-1.5.0.tar.gz
vendored
Binary file not shown.
BIN
dist/ckcc_protocol-0.8.0-py3-none-any.whl
vendored
Normal file
BIN
dist/ckcc_protocol-0.8.0-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
dist/ckcc_protocol-1.0.1-py3-none-any.whl
vendored
Normal file
BIN
dist/ckcc_protocol-1.0.1-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
dist/ckcc_protocol-1.0.2-py3-none-any.whl
vendored
Normal file
BIN
dist/ckcc_protocol-1.0.2-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
dist/ckcc_protocol-1.3.2-py3-none-any.whl
vendored
BIN
dist/ckcc_protocol-1.3.2-py3-none-any.whl
vendored
Binary file not shown.
BIN
dist/ckcc_protocol-1.4.0-py3-none-any.whl
vendored
BIN
dist/ckcc_protocol-1.4.0-py3-none-any.whl
vendored
Binary file not shown.
BIN
dist/ckcc_protocol-1.5.0-py3-none-any.whl
vendored
BIN
dist/ckcc_protocol-1.5.0-py3-none-any.whl
vendored
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
[pytest]
|
||||
addopts = -vvlx
|
||||
testpaths =
|
||||
tests
|
||||
@ -1 +0,0 @@
|
||||
pytest
|
||||
@ -8,5 +8,5 @@ hidapi>=0.7.99.post21
|
||||
click>=6.7
|
||||
|
||||
# required by link-layer encryption in client.py
|
||||
ecdsa>=0.17
|
||||
ecdsa>=0.13
|
||||
pyaes
|
||||
|
||||
8
setup.py
8
setup.py
@ -11,7 +11,7 @@ from setuptools import setup
|
||||
|
||||
requirements = [
|
||||
'hidapi>=0.7.99.post21',
|
||||
'ecdsa>=0.17',
|
||||
'ecdsa>=0.13',
|
||||
'pyaes',
|
||||
]
|
||||
|
||||
@ -19,10 +19,6 @@ cli_requirements = [
|
||||
'click>=6.7',
|
||||
]
|
||||
|
||||
tests_require = [
|
||||
'pytest'
|
||||
]
|
||||
|
||||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
@ -34,7 +30,6 @@ setup(
|
||||
packages=[ 'ckcc' ],
|
||||
python_requires='>3.6.0',
|
||||
install_requires=requirements,
|
||||
tests_require=tests_require,
|
||||
extras_require={
|
||||
'cli': cli_requirements,
|
||||
},
|
||||
@ -49,6 +44,7 @@ setup(
|
||||
ckcc=ckcc.cli:main
|
||||
''',
|
||||
classifiers=[
|
||||
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Operating System :: Microsoft :: Windows',
|
||||
'Operating System :: MacOS :: MacOS X',
|
||||
|
||||
@ -1,175 +0,0 @@
|
||||
import os
|
||||
import re
|
||||
import json
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
|
||||
from ckcc.cli import electrum_convert2cc
|
||||
from ckcc.electrum import (
|
||||
filepath_append_cc, multisig_find_target, collect_multisig_hww_keystores_from_wallet,
|
||||
cc_adjust_hww_keystore, is_multisig_wallet_key, is_multisig_wallet
|
||||
)
|
||||
|
||||
|
||||
# expecting cwd to be ckcc-protocol
|
||||
test_data_path = os.path.join("tests", "test_data")
|
||||
encrypted_path = os.path.join(test_data_path, "encrypted")
|
||||
ledger_path = os.path.join(test_data_path, "ledger")
|
||||
trezor_path = os.path.join(test_data_path, "trezor.json")
|
||||
bip32_path = os.path.join(test_data_path, "bip32_wallet")
|
||||
a2fa_path = os.path.join(test_data_path, "2fa_wallet")
|
||||
import_path = os.path.join(test_data_path, "import_wallet")
|
||||
multi3of5_path = os.path.join(test_data_path, "multi3of5")
|
||||
|
||||
|
||||
def assert_keystore(keystore):
|
||||
assert keystore["hw_type"] == "coldcard"
|
||||
assert "cfg" not in keystore
|
||||
assert keystore["label"] == "Coldcard {}".format(keystore["root_fingerprint"])
|
||||
assert keystore["soft_device_id"] is None
|
||||
# as this is run without coldcard connected - no ckcc_xpub
|
||||
# assert "ckcc_xpub" not in keystore
|
||||
|
||||
|
||||
def test_multisig_find_target():
|
||||
for pth in [ledger_path, trezor_path, bip32_path, a2fa_path]:
|
||||
with open(pth, "r") as f:
|
||||
wallet = json.loads(f.read())
|
||||
with pytest.raises(RuntimeError):
|
||||
multisig_find_target(
|
||||
keystores=collect_multisig_hww_keystores_from_wallet(wallet),
|
||||
key="hw_type", # key and value does not matter here as exc is raised before they can be used
|
||||
value="ledger"
|
||||
)
|
||||
|
||||
with open(multi3of5_path, "r") as f:
|
||||
wallet = json.loads(f.read())
|
||||
keystores = collect_multisig_hww_keystores_from_wallet(wallet)
|
||||
assert len(keystores) == 2 # only two are hardware
|
||||
for hw_type in ["trezor", "ledger"]:
|
||||
key, keystore = multisig_find_target(
|
||||
keystores=keystores,
|
||||
key="hw_type",
|
||||
value=hw_type
|
||||
)
|
||||
assert wallet[key] == keystore
|
||||
new_keystore = cc_adjust_hww_keystore(keystore)
|
||||
assert_keystore(new_keystore)
|
||||
|
||||
|
||||
def test_filepath_append_cc():
|
||||
assert filepath_append_cc("ledger_wallet") == "ledger_wallet_cc"
|
||||
assert filepath_append_cc("ledger_wallet.json") == "ledger_wallet_cc.json"
|
||||
assert filepath_append_cc("ledger wallet.json") == "ledger wallet_cc.json"
|
||||
assert filepath_append_cc("/ledger_wallet") == "/ledger_wallet_cc"
|
||||
assert filepath_append_cc("/tmp/.../ledger_wallet") == "/tmp/.../ledger_wallet_cc"
|
||||
assert filepath_append_cc("/user/local/h.ledger.wallet") == "/user/local/h.ledger_cc.wallet"
|
||||
|
||||
|
||||
def test_encrypted():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(electrum_convert2cc, [encrypted_path, "--dry-run"])
|
||||
assert result.exit_code == 1
|
||||
assert "Failed to load wallet file" in result.output
|
||||
|
||||
|
||||
def test_dry_run():
|
||||
runner = CliRunner()
|
||||
for pth in [ledger_path, trezor_path]:
|
||||
result = runner.invoke(electrum_convert2cc, [pth, "--dry-run"])
|
||||
assert result.exit_code == 0
|
||||
loaded = json.loads(result.output)
|
||||
assert isinstance(loaded, dict)
|
||||
keystore = loaded["keystore"]
|
||||
assert_keystore(keystore)
|
||||
|
||||
|
||||
def test_outfile():
|
||||
runner = CliRunner()
|
||||
for pth, name in zip([ledger_path, trezor_path], ["ledger00", "trezor00"]):
|
||||
outfile_path = os.path.join(test_data_path, name)
|
||||
result = runner.invoke(electrum_convert2cc, [pth, "-o", outfile_path])
|
||||
assert result.exit_code == 0
|
||||
assert "New wallet file created: tests/test_data/{}\n".format(name) == result.output
|
||||
with open(outfile_path, "r") as f:
|
||||
res = json.loads(f.read())
|
||||
assert_keystore(res["keystore"])
|
||||
os.remove(outfile_path)
|
||||
|
||||
|
||||
def test_outfile_same_as_file():
|
||||
runner = CliRunner()
|
||||
for pth in [ledger_path, trezor_path]:
|
||||
result = runner.invoke(electrum_convert2cc, [pth, "-o", pth])
|
||||
assert result.exit_code == 1
|
||||
assert "'FILE' and '--outfile' cannot be the same\n" == result.output
|
||||
|
||||
|
||||
def test_no_options():
|
||||
runner = CliRunner()
|
||||
for pth in [ledger_path, trezor_path]:
|
||||
result = runner.invoke(electrum_convert2cc, [pth])
|
||||
new_pth = filepath_append_cc(pth)
|
||||
assert result.exit_code == 0
|
||||
assert "New wallet file created: {}\n".format(new_pth) == result.output
|
||||
with open(new_pth, "r") as f:
|
||||
res = json.loads(f.read())
|
||||
assert_keystore(res["keystore"])
|
||||
os.remove(new_pth)
|
||||
|
||||
|
||||
def test_not_hww_wallet():
|
||||
runner = CliRunner()
|
||||
for pth in [bip32_path]:
|
||||
result = runner.invoke(electrum_convert2cc, [pth])
|
||||
assert result.exit_code == 1
|
||||
assert result.output == "convert2cc failed: Not a hardware wallet type\n"
|
||||
|
||||
|
||||
def test_not_standard_wallet():
|
||||
runner = CliRunner()
|
||||
for name, pth in [("2fa", a2fa_path), ("imported", import_path)]:
|
||||
result = runner.invoke(electrum_convert2cc, [pth])
|
||||
assert result.exit_code == 1
|
||||
assert result.output == "convert2cc failed: Unsupported wallet type: {}\n".format(name)
|
||||
|
||||
|
||||
def test_is_multisig_wallet():
|
||||
valid = ["2of3", "2of2", "35of50"]
|
||||
for val in valid:
|
||||
val = {"wallet_type": val}
|
||||
assert is_multisig_wallet(val) is True
|
||||
invalid = ["a2of3", "2ofo3", "2of3a", "aaa", "x", "of"]
|
||||
for val in invalid:
|
||||
val = {"wallet_type": val}
|
||||
assert is_multisig_wallet(val) is False
|
||||
|
||||
|
||||
def test_is_multisig_wallet_key():
|
||||
valid = ["x1/", "x2/", "x30/", "x156/"]
|
||||
for val in valid:
|
||||
assert is_multisig_wallet_key(val) is True
|
||||
invalid = ["1/", "x/", "xxxx", "aaa", "x", "of", "ax1/", "x1/a", "x1a/"]
|
||||
for val in invalid:
|
||||
assert is_multisig_wallet_key(val) is False
|
||||
|
||||
|
||||
def test_multisig():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(electrum_convert2cc, [multi3of5_path, "-k", "hw_type", "-v", "ledger"])
|
||||
assert result.exit_code == 0
|
||||
new_pth = filepath_append_cc(multi3of5_path)
|
||||
assert "New wallet file created: {}\n".format(new_pth) == result.output
|
||||
with open(new_pth, "r") as f:
|
||||
res = json.loads(f.read())
|
||||
# ledger is x2/ entry
|
||||
assert_keystore(res["x2/"])
|
||||
# make sure other entries are unchanged
|
||||
assert res["x3/"]["hw_type"] == "trezor"
|
||||
os.remove(new_pth)
|
||||
|
||||
result = runner.invoke(electrum_convert2cc, [multi3of5_path, "-k", "root_fingerprint", "-v", "7633218e"])
|
||||
assert result.exit_code == 1
|
||||
assert "Found 2 keystores" in result.output
|
||||
|
||||
|
||||
@ -1,110 +0,0 @@
|
||||
{
|
||||
"addr_history": {
|
||||
"tb1q08rczum2w2hwj9kf6gnuyz385ez39clnv0vd04t4m95qclavy7jq8ueux0": [],
|
||||
"tb1q3auyq4qngx7eq2dc4qmvwgl5mdc3gvqkmraw3x0j5mj7dc3ypmdsk93hu2": [],
|
||||
"tb1q4xu3wu64hzm7mead3y9ren5un3v43wu43dvets3fzkx04jw8dd2q6hvz56": [],
|
||||
"tb1q4z3kpa5505dhg8l7hz5qu7uzhyjs9fyh2dmn5spp6mvnxe0532dsp7uvn6": [],
|
||||
"tb1q5fqrqfhzka9aty9yhfk80yhjxg579wqn9reydzfc24f8587f57kqp9ykz9": [],
|
||||
"tb1q5s9yndsz2x8vevxgtg77eq5au37wv368lfjcj3rllh9k53f9dtaq9lptyy": [],
|
||||
"tb1q6n3vcymlvxxapces2eqz6x4c2q9xupkrtz5ejgjmzqqeyznsytfs8j4hvh": [],
|
||||
"tb1q8tksde53p8eckgywqmfsqyu3lucm5f08gfu7xnwj0dyxje8l50hsee87jx": [],
|
||||
"tb1q96eqjeej2jv37aa5rrv00zpgvhcurve60xz6zuyvgw369p45ukpsxrj7kd": [],
|
||||
"tb1qaf3lkcvcq2n6tx7y5dwu8fx4w0tjadh24vrmdeedtf64urpf6ndspruasu": [],
|
||||
"tb1qarhreuggzh2t67ldx3pg08ycc8pahgpu4r44nae8242ylkfvsuyq55g6xz": [],
|
||||
"tb1qdmjm8uc5hjkjdqlkt80ryzz3kpq7qlh3g835fxc5pf4xg45zghgqtvqnld": [],
|
||||
"tb1qdtfyjdus3w3mkqygx9q7x4z04as5k3jyv4zztxqan8tmkgn39zkqktrgn0": [],
|
||||
"tb1qeeuh0pegdx9drj7fz0n7cr9wthwq0fjd856c3fpam3xtwyzs2jksndr8c8": [],
|
||||
"tb1qeye9f5qsre5kyeshjcpy433mhjf3ucgns8sx2n4puvrskj3pep3svvx9km": [],
|
||||
"tb1qgkfva606rlhy6s3zd7zk06mku0tktv6lc3p8ea8cpwds2vlzrxfse374rk": [],
|
||||
"tb1qgt2gvt6zxd4m57l78a5fddwxmxfueul9m5zmj2pkfqzdz9y6uspsuqkfj6": [],
|
||||
"tb1qgxcgzhwxkyv8u4337jcm7keck3yw4999v4v2f0vdakpzt53yp35q83zg0k": [],
|
||||
"tb1qlgww6tk6w862jnhd3pa84sr3sg9ghdmwup8xs3r6dsuy0a2lk6hqwsq5u0": [],
|
||||
"tb1qm4epjuurk37xwqk5ezyxfdw96sryquwyxtzt7wy9gjg9c9gnugys0sqhw4": [],
|
||||
"tb1qnvtus3ssaxrtkdwj09ud3zfrkx8wejte3dggtvx0tfan7nzczpfquy7g6j": [],
|
||||
"tb1qrcfgn70k36pyepn5qps8safxwh0u5q957jxuqhw507phf3tzqjlsdequs7": [],
|
||||
"tb1qsjv4wqh9tfzxwqpwvp3zgccpyrwsmvyh0z6gjtu96u2zjq0mj5yq73dupu": [],
|
||||
"tb1qsl8jvteu45ffcml0wwpwsx4fhkma7evhpu3s2gta9a5ne3hddtqsy3kj27": [],
|
||||
"tb1qtcpa9n7gw0e3xy5g8hm04un93mkyc6rskzwjn0ufnfs9fgdmhehs4rhhyr": [],
|
||||
"tb1qtgpvla8syhvu7vxzj77nscjfau4mzlw4dhfwy26w907azqmlev8s9gjlun": [],
|
||||
"tb1qtz9snq70m0v9mzs7gdfcx4gdrzays4kldmj8u27mtdpjxhajxpdqj2ex6h": [],
|
||||
"tb1qugnn5qnsj45nh6ad47wm0qp5h3ytm2nduxvleltsc8pgftms6kts4yxxg3": [],
|
||||
"tb1qy265l50a9mzvqvlc0jkm0984rjzth43j47643e8krnpga43ey2rq8kue25": [],
|
||||
"tb1qy7el5pxppt777llmeufpaygtgclj9uwdxyx5qtddpee43w7r4gust46u5h": []
|
||||
},
|
||||
"addresses": {
|
||||
"change": [
|
||||
"tb1qgt2gvt6zxd4m57l78a5fddwxmxfueul9m5zmj2pkfqzdz9y6uspsuqkfj6",
|
||||
"tb1qdtfyjdus3w3mkqygx9q7x4z04as5k3jyv4zztxqan8tmkgn39zkqktrgn0",
|
||||
"tb1q08rczum2w2hwj9kf6gnuyz385ez39clnv0vd04t4m95qclavy7jq8ueux0",
|
||||
"tb1qeeuh0pegdx9drj7fz0n7cr9wthwq0fjd856c3fpam3xtwyzs2jksndr8c8",
|
||||
"tb1q6n3vcymlvxxapces2eqz6x4c2q9xupkrtz5ejgjmzqqeyznsytfs8j4hvh",
|
||||
"tb1qtgpvla8syhvu7vxzj77nscjfau4mzlw4dhfwy26w907azqmlev8s9gjlun",
|
||||
"tb1qy265l50a9mzvqvlc0jkm0984rjzth43j47643e8krnpga43ey2rq8kue25",
|
||||
"tb1qgkfva606rlhy6s3zd7zk06mku0tktv6lc3p8ea8cpwds2vlzrxfse374rk",
|
||||
"tb1qsjv4wqh9tfzxwqpwvp3zgccpyrwsmvyh0z6gjtu96u2zjq0mj5yq73dupu",
|
||||
"tb1q4xu3wu64hzm7mead3y9ren5un3v43wu43dvets3fzkx04jw8dd2q6hvz56"
|
||||
],
|
||||
"receiving": [
|
||||
"tb1qgxcgzhwxkyv8u4337jcm7keck3yw4999v4v2f0vdakpzt53yp35q83zg0k",
|
||||
"tb1q4z3kpa5505dhg8l7hz5qu7uzhyjs9fyh2dmn5spp6mvnxe0532dsp7uvn6",
|
||||
"tb1q5fqrqfhzka9aty9yhfk80yhjxg579wqn9reydzfc24f8587f57kqp9ykz9",
|
||||
"tb1qarhreuggzh2t67ldx3pg08ycc8pahgpu4r44nae8242ylkfvsuyq55g6xz",
|
||||
"tb1qeye9f5qsre5kyeshjcpy433mhjf3ucgns8sx2n4puvrskj3pep3svvx9km",
|
||||
"tb1qdmjm8uc5hjkjdqlkt80ryzz3kpq7qlh3g835fxc5pf4xg45zghgqtvqnld",
|
||||
"tb1qrcfgn70k36pyepn5qps8safxwh0u5q957jxuqhw507phf3tzqjlsdequs7",
|
||||
"tb1qsl8jvteu45ffcml0wwpwsx4fhkma7evhpu3s2gta9a5ne3hddtqsy3kj27",
|
||||
"tb1q8tksde53p8eckgywqmfsqyu3lucm5f08gfu7xnwj0dyxje8l50hsee87jx",
|
||||
"tb1q96eqjeej2jv37aa5rrv00zpgvhcurve60xz6zuyvgw369p45ukpsxrj7kd",
|
||||
"tb1qm4epjuurk37xwqk5ezyxfdw96sryquwyxtzt7wy9gjg9c9gnugys0sqhw4",
|
||||
"tb1q3auyq4qngx7eq2dc4qmvwgl5mdc3gvqkmraw3x0j5mj7dc3ypmdsk93hu2",
|
||||
"tb1q5s9yndsz2x8vevxgtg77eq5au37wv368lfjcj3rllh9k53f9dtaq9lptyy",
|
||||
"tb1qy7el5pxppt777llmeufpaygtgclj9uwdxyx5qtddpee43w7r4gust46u5h",
|
||||
"tb1qtz9snq70m0v9mzs7gdfcx4gdrzays4kldmj8u27mtdpjxhajxpdqj2ex6h",
|
||||
"tb1qtcpa9n7gw0e3xy5g8hm04un93mkyc6rskzwjn0ufnfs9fgdmhehs4rhhyr",
|
||||
"tb1qaf3lkcvcq2n6tx7y5dwu8fx4w0tjadh24vrmdeedtf64urpf6ndspruasu",
|
||||
"tb1qlgww6tk6w862jnhd3pa84sr3sg9ghdmwup8xs3r6dsuy0a2lk6hqwsq5u0",
|
||||
"tb1qugnn5qnsj45nh6ad47wm0qp5h3ytm2nduxvleltsc8pgftms6kts4yxxg3",
|
||||
"tb1qnvtus3ssaxrtkdwj09ud3zfrkx8wejte3dggtvx0tfan7nzczpfquy7g6j"
|
||||
]
|
||||
},
|
||||
"fiat_value": {},
|
||||
"frozen_coins": {},
|
||||
"invoices": {},
|
||||
"labels": {},
|
||||
"payment_requests": {},
|
||||
"prevouts_by_scripthash": {},
|
||||
"seed_version": 41,
|
||||
"spent_outpoints": {},
|
||||
"transactions": {},
|
||||
"tx_fees": {},
|
||||
"txi": {},
|
||||
"txo": {},
|
||||
"use_encryption": false,
|
||||
"use_trustedcoin": true,
|
||||
"verified_tx3": {},
|
||||
"wallet_type": "2fa",
|
||||
"x1/": {
|
||||
"derivation": "m/0'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "edbe3843",
|
||||
"type": "bip32",
|
||||
"xprv": "Vprv1ABNdy1wDM2BKBkx7KGs4bs3cxXf92YpYWwRc3oJ2cYCbmJ9EBeNceV2D1twFFyJph6bhHWXZ8Kttbrp2QqoNwRn8rcBX5VmVZJt2EXfAhy",
|
||||
"xpub": "Vpub5gsQnP4BMihrCenjzxwTU1XABz3bJMjj7pYCtZqbStLbSFYuraTxo96tPAAqKWnZ8SWVYP3PR9uJzjyddjFEX9Vvie4YTEnfNs5mn7WY51Y"
|
||||
},
|
||||
"x2/": {
|
||||
"derivation": "m/1'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "edbe3843",
|
||||
"type": "bip32",
|
||||
"xprv": null,
|
||||
"xpub": "Vpub5gsQnP4BMihrEMYnkd2fSVox4vmUSXUpPPnapUi3qFBaAxZ8E7LRAcfcY4UUq8nikrm788ZSGqyfBZ7XSCAadVFs2QJmw3FM9ivQHR7iLXs"
|
||||
},
|
||||
"x3/": {
|
||||
"derivation": "m",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "318643d2",
|
||||
"type": "bip32",
|
||||
"xprv": null,
|
||||
"xpub": "Vpub5dEvVGKn7251zN1qiD6AEQNdRDNJA9JPRQms65nuoQjEneTRisTC9k1oWHnc3xx7odT33eemwHFy8VidEwkyvsv9hweRFGiiFxuxHEdATws"
|
||||
}
|
||||
}
|
||||
@ -1,103 +0,0 @@
|
||||
{
|
||||
"addr_history": {
|
||||
"tb1q02k45prve7wucpfjfx03ufkqkt8y6ydrgfj4sx": [],
|
||||
"tb1q0dhtn7tqggn0zpp3pwxq59ak3grc4fen00eaw3": [],
|
||||
"tb1q2dua5crlk0j2vty4t64qsrmc83phwzxec72x2c": [],
|
||||
"tb1q5n3exr2q4k7asguj3xss4n5v7ltev7efxxev6j": [],
|
||||
"tb1q6498tcaa5e4jk5t38hwd08uafa30ymnl2afams": [],
|
||||
"tb1q6mfsud76tmnwr0mntlu4thgewxl5aajkutzn3d": [],
|
||||
"tb1q6qsd3vskmae0lv42fjgquqwpwuuzqlthylxs2v": [],
|
||||
"tb1q7h9lwk9529pttlrmhtrsdkartx8sp2gu3sej0x": [],
|
||||
"tb1q93wvsrv6c5jx3t6809mv5celp4hmhs4n206wec": [],
|
||||
"tb1q9r543fwz6f0xtfefgag7enm2p8j6gddl32p87v": [],
|
||||
"tb1qc00yrpj7zjwc46vjmzlrtkpvnqhs5d97dvgvhh": [],
|
||||
"tb1qg0jhlz0yzv23nepxhnpgd6tthe5e87uak2kzrr": [],
|
||||
"tb1qg7tr05l688czg5s44w6sr7x7n29lmnz5j0x0az": [],
|
||||
"tb1qk03z4hargc3aktzjd67pdjkujflkdmceq0f9jt": [],
|
||||
"tb1qk35zs0nwm927y7sk78q3wn2auuyvt0wth26826": [],
|
||||
"tb1qkaw8yj6j8ynl94wznc6gj69ctd5h9f45l6pz24": [],
|
||||
"tb1qkxccvdeltuz5mjt99daj520dcvrfc345rrglz8": [],
|
||||
"tb1qlnp2jlvmn4x4mklzgy0epfs5fjg42lcvy3kwpl": [],
|
||||
"tb1qmpdjprr4kjam7ey9j8p9w9r86tpw2nralzxlqa": [],
|
||||
"tb1qqgcsd88sch24fgwjl9gw7ncc4kjhuxmzqtns0l": [],
|
||||
"tb1qrhfvvla8d9h7nmht2926c2z50v67w5lpxmvpe4": [],
|
||||
"tb1qsqknmh693p7jjwaelu93et2yk93245xt9juqsz": [],
|
||||
"tb1qut2tk5g7pm5fptw6s6e0zthesdsd0z3lsfxpr3": [],
|
||||
"tb1qv02a5fc8z0dfyxxxuy5leyljufqe70u4cweama": [],
|
||||
"tb1qwarr6yfvy89ga9an4sxjf27j52mevq0w7h7vlk": [],
|
||||
"tb1qwcp87nfwykhdjuqaryqmqfjkeg5mgf02s26t5s": [],
|
||||
"tb1qwkz5y7v5eqjqxh763e2cpfgvfz9rez2zkuq0yh": [],
|
||||
"tb1qy4xu2wq3fwjlcp6qaq6x9dc6tjnarrtdxplplz": [],
|
||||
"tb1qzelf3truw7hk3w4wac2hay39dz6twec8vphx85": [],
|
||||
"tb1qzfqcqqcqnyvq76pje0elxuchae6vztdnp9ewqr": []
|
||||
},
|
||||
"addresses": {
|
||||
"change": [
|
||||
"tb1qwarr6yfvy89ga9an4sxjf27j52mevq0w7h7vlk",
|
||||
"tb1qsqknmh693p7jjwaelu93et2yk93245xt9juqsz",
|
||||
"tb1qv02a5fc8z0dfyxxxuy5leyljufqe70u4cweama",
|
||||
"tb1qut2tk5g7pm5fptw6s6e0zthesdsd0z3lsfxpr3",
|
||||
"tb1qqgcsd88sch24fgwjl9gw7ncc4kjhuxmzqtns0l",
|
||||
"tb1qrhfvvla8d9h7nmht2926c2z50v67w5lpxmvpe4",
|
||||
"tb1q02k45prve7wucpfjfx03ufkqkt8y6ydrgfj4sx",
|
||||
"tb1qg7tr05l688czg5s44w6sr7x7n29lmnz5j0x0az",
|
||||
"tb1q6qsd3vskmae0lv42fjgquqwpwuuzqlthylxs2v",
|
||||
"tb1qkxccvdeltuz5mjt99daj520dcvrfc345rrglz8"
|
||||
],
|
||||
"receiving": [
|
||||
"tb1q6mfsud76tmnwr0mntlu4thgewxl5aajkutzn3d",
|
||||
"tb1qlnp2jlvmn4x4mklzgy0epfs5fjg42lcvy3kwpl",
|
||||
"tb1qkaw8yj6j8ynl94wznc6gj69ctd5h9f45l6pz24",
|
||||
"tb1q93wvsrv6c5jx3t6809mv5celp4hmhs4n206wec",
|
||||
"tb1qzelf3truw7hk3w4wac2hay39dz6twec8vphx85",
|
||||
"tb1q5n3exr2q4k7asguj3xss4n5v7ltev7efxxev6j",
|
||||
"tb1q9r543fwz6f0xtfefgag7enm2p8j6gddl32p87v",
|
||||
"tb1q2dua5crlk0j2vty4t64qsrmc83phwzxec72x2c",
|
||||
"tb1qwcp87nfwykhdjuqaryqmqfjkeg5mgf02s26t5s",
|
||||
"tb1qzfqcqqcqnyvq76pje0elxuchae6vztdnp9ewqr",
|
||||
"tb1qk35zs0nwm927y7sk78q3wn2auuyvt0wth26826",
|
||||
"tb1qy4xu2wq3fwjlcp6qaq6x9dc6tjnarrtdxplplz",
|
||||
"tb1q6498tcaa5e4jk5t38hwd08uafa30ymnl2afams",
|
||||
"tb1q7h9lwk9529pttlrmhtrsdkartx8sp2gu3sej0x",
|
||||
"tb1qg0jhlz0yzv23nepxhnpgd6tthe5e87uak2kzrr",
|
||||
"tb1qc00yrpj7zjwc46vjmzlrtkpvnqhs5d97dvgvhh",
|
||||
"tb1qmpdjprr4kjam7ey9j8p9w9r86tpw2nralzxlqa",
|
||||
"tb1q0dhtn7tqggn0zpp3pwxq59ak3grc4fen00eaw3",
|
||||
"tb1qwkz5y7v5eqjqxh763e2cpfgvfz9rez2zkuq0yh",
|
||||
"tb1qk03z4hargc3aktzjd67pdjkujflkdmceq0f9jt"
|
||||
]
|
||||
},
|
||||
"channels": {},
|
||||
"fiat_value": {},
|
||||
"frozen_coins": {},
|
||||
"imported_channel_backups": {},
|
||||
"invoices": {},
|
||||
"keystore": {
|
||||
"derivation": "m/0'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "1ec7a1e6",
|
||||
"seed": "earn next inject hobby dismiss argue light stable able exhibit crime bread",
|
||||
"seed_type": "segwit",
|
||||
"type": "bip32",
|
||||
"xprv": "vprv9FTjsu3EEZrNzwb99jtobgZK4qEM8T7vSrQb21rs42MEdo1LmmojntthHinvffnRZ8TUabuUPzFmJ3p8h2zVAUu7bGLwNSefcBTa3uveMPV",
|
||||
"xpub": "vpub5UT6HQa84wQgDRfcFmRoxpW3cs4qXuqmp5LBpQGUcMtDWbLVKK7zLhDB91DqQoXojNxkgP9rNYooNu62YTbgRgi43AnTVzib1nfQpZT2k2Q"
|
||||
},
|
||||
"labels": {},
|
||||
"lightning_payments": {},
|
||||
"lightning_preimages": {},
|
||||
"lightning_xprv": "vprv9HjmveMJPCP8inKDxvSeEGaQvZBr2UXjLjmGhU43Z7YSLEXjLhbzaQp6LcSdjv2tNVTqFEGMbAxmAzEkDLF91HnHLYcwDarajrTPvXegjta",
|
||||
"onchain_channel_backups": {},
|
||||
"payment_requests": {},
|
||||
"prevouts_by_scripthash": {},
|
||||
"seed_type": "segwit",
|
||||
"seed_version": 41,
|
||||
"spent_outpoints": {},
|
||||
"submarine_swaps": {},
|
||||
"transactions": {},
|
||||
"tx_fees": {},
|
||||
"txi": {},
|
||||
"txo": {},
|
||||
"use_encryption": false,
|
||||
"verified_tx3": {},
|
||||
"wallet_type": "standard"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -1,36 +0,0 @@
|
||||
{
|
||||
"addr_history": {},
|
||||
"addresses": {
|
||||
"mgb2DbgefFJKAbDwtcgvQJ6ViZmnFTgCeo": {
|
||||
"pubkey": "0300fcbd59ff8329c25bf44e064c0a70fb3e259eff2d03dc3ec6cef573e580c3ce",
|
||||
"type": "p2pkh"
|
||||
},
|
||||
"n3qGszoY3x7rhZVwZSM2tHWz5JepDWSxJL": {
|
||||
"pubkey": "031e4f5dde3e1170da5b9fba04d8af8c61d9dfbf523b8870dfc209abdd3fc714c5",
|
||||
"type": "p2pkh"
|
||||
}
|
||||
},
|
||||
"fiat_value": {},
|
||||
"frozen_coins": {},
|
||||
"invoices": {},
|
||||
"keystore": {
|
||||
"keypairs": {
|
||||
"0300fcbd59ff8329c25bf44e064c0a70fb3e259eff2d03dc3ec6cef573e580c3ce": "cUHywJvvdbcea8uMQueczZ9ZHcnjFw6ipBuAcrm7rAnmhenUWEbX",
|
||||
"031e4f5dde3e1170da5b9fba04d8af8c61d9dfbf523b8870dfc209abdd3fc714c5": "cQQKy31b2yaQ1ZEF26pi3jFyPKbQ5ggdDDH8yZECT2h2YRxLSSVE"
|
||||
},
|
||||
"pw_hash_version": 1,
|
||||
"type": "imported"
|
||||
},
|
||||
"labels": {},
|
||||
"payment_requests": {},
|
||||
"prevouts_by_scripthash": {},
|
||||
"seed_version": 41,
|
||||
"spent_outpoints": {},
|
||||
"transactions": {},
|
||||
"tx_fees": {},
|
||||
"txi": {},
|
||||
"txo": {},
|
||||
"use_encryption": false,
|
||||
"verified_tx3": {},
|
||||
"wallet_type": "imported"
|
||||
}
|
||||
@ -1,302 +0,0 @@
|
||||
{
|
||||
"addr_history": {
|
||||
"tb1q0tgs4r89esl0m6emahf0xcz63kyz92pzxl69w9": [],
|
||||
"tb1q2zg6ljw0r0rfw4njrcjd48dzc9a86p8hgljlwj": [],
|
||||
"tb1q4jefgulpwpxtx25tkfxypwzj5qjm94t694ad5z": [],
|
||||
"tb1q5mhhpkzt9n6twl05q7gdr278mayl4gsdqv4ff5": [],
|
||||
"tb1q8qgdz86w3yjt9rlea5yydk8gp3sl3caju2xr0n": [],
|
||||
"tb1q9fcfp4xc62eaz40qxfynczkd2wwgprktgmcudf": [],
|
||||
"tb1q9jh9uzhaauenmpqwhxmwrj7449lvveekfta5kq": [
|
||||
[
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c",
|
||||
2138279
|
||||
]
|
||||
],
|
||||
"tb1q9qx9phjfxkzswjhf5qc3q2cx58a0d3vavqa7fu": [],
|
||||
"tb1q9upnsjxd7qcmzj0h825plwhdya4fl6gr45mdu9": [],
|
||||
"tb1qas9vpp2h7kpcyetdgeheaj6n9m5qsxztcna2xh": [],
|
||||
"tb1qc9lrygeurs39xdgt5zepcgf9k8fuc09jjxaq4y": [],
|
||||
"tb1qcegz3lkxuwk2f7xpgjpld5s38tf4fdhlvlvrmm": [],
|
||||
"tb1qcrx5gx5vytle4syse3kvx7rr3p4qw6dgh82stj": [],
|
||||
"tb1qczy6jxej2qagvzwpdtnyzhj0sxyqxy0fdxrufm": [],
|
||||
"tb1qd7xhtw6ennkrg3ys0tmll3wjt5v9h7llpqvgcs": [],
|
||||
"tb1qefafzcq8mp7h4w6keeh6yzdfqz00k9anlsnsgm": [],
|
||||
"tb1qej2j2zwc9grkr5lja77sstcngccr9dvp5rxt0j": [],
|
||||
"tb1qgkwn6lvkcad0u857gsaqjugdlladzew8z64f5g": [
|
||||
[
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e",
|
||||
2138285
|
||||
]
|
||||
],
|
||||
"tb1qgznxl9va7uksephynxdq28xrqefjln5yuj7yzu": [],
|
||||
"tb1qj5sr0fuvc4437k9xu2w243d2cqdga07w44cwc0": [],
|
||||
"tb1qjyvgpqf8drv0ly906556m43fkvpv0yxen7urss": [],
|
||||
"tb1qkm2f7392g3mz34vcvtr4prkfqw3rpsc73ajjv6": [],
|
||||
"tb1qlfmy3fhzfyxeagn9ly7h50vjstx38wcnwhz7k2": [],
|
||||
"tb1qlj8rmuhpfg4xkftg0zjghnlzdzeq4trmrfmf6u": [],
|
||||
"tb1qnwxvapverw8ne4trl9957ktcq0lmvhntd37w7y": [],
|
||||
"tb1qpv6g49qlye5kdj8pckqyzgg956a0l22j37kxlk": [],
|
||||
"tb1qrmdwn3txhag9ad4x2degay9lnp778nm4lyqxrd": [],
|
||||
"tb1qsdl73sx8wr7h3ee0v6cxvxyyjqjjey89ljuyhv": [],
|
||||
"tb1qsm5t5ec6kj5ycldxzsrpddny0n8l7y8ll8kcfx": [],
|
||||
"tb1qsmvlht2f5ja942jyejf9mqhdq2828kjhaf3qyx": [],
|
||||
"tb1qsmykk6mm6x574hrydue9tprse6lvsyqs4uxpa6": [],
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key": [
|
||||
[
|
||||
"ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032",
|
||||
2138361
|
||||
]
|
||||
]
|
||||
},
|
||||
"addresses": {
|
||||
"change": [
|
||||
"tb1q0tgs4r89esl0m6emahf0xcz63kyz92pzxl69w9",
|
||||
"tb1qjyvgpqf8drv0ly906556m43fkvpv0yxen7urss",
|
||||
"tb1qlfmy3fhzfyxeagn9ly7h50vjstx38wcnwhz7k2",
|
||||
"tb1qsmvlht2f5ja942jyejf9mqhdq2828kjhaf3qyx",
|
||||
"tb1q9qx9phjfxkzswjhf5qc3q2cx58a0d3vavqa7fu",
|
||||
"tb1qsm5t5ec6kj5ycldxzsrpddny0n8l7y8ll8kcfx",
|
||||
"tb1qgznxl9va7uksephynxdq28xrqefjln5yuj7yzu",
|
||||
"tb1qsdl73sx8wr7h3ee0v6cxvxyyjqjjey89ljuyhv",
|
||||
"tb1qczy6jxej2qagvzwpdtnyzhj0sxyqxy0fdxrufm",
|
||||
"tb1qcegz3lkxuwk2f7xpgjpld5s38tf4fdhlvlvrmm"
|
||||
],
|
||||
"receiving": [
|
||||
"tb1q9jh9uzhaauenmpqwhxmwrj7449lvveekfta5kq",
|
||||
"tb1qgkwn6lvkcad0u857gsaqjugdlladzew8z64f5g",
|
||||
"tb1qnwxvapverw8ne4trl9957ktcq0lmvhntd37w7y",
|
||||
"tb1qj5sr0fuvc4437k9xu2w243d2cqdga07w44cwc0",
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key",
|
||||
"tb1qsmykk6mm6x574hrydue9tprse6lvsyqs4uxpa6",
|
||||
"tb1qas9vpp2h7kpcyetdgeheaj6n9m5qsxztcna2xh",
|
||||
"tb1qej2j2zwc9grkr5lja77sstcngccr9dvp5rxt0j",
|
||||
"tb1q2zg6ljw0r0rfw4njrcjd48dzc9a86p8hgljlwj",
|
||||
"tb1qrmdwn3txhag9ad4x2degay9lnp778nm4lyqxrd",
|
||||
"tb1q5mhhpkzt9n6twl05q7gdr278mayl4gsdqv4ff5",
|
||||
"tb1qpv6g49qlye5kdj8pckqyzgg956a0l22j37kxlk",
|
||||
"tb1qd7xhtw6ennkrg3ys0tmll3wjt5v9h7llpqvgcs",
|
||||
"tb1q9fcfp4xc62eaz40qxfynczkd2wwgprktgmcudf",
|
||||
"tb1q8qgdz86w3yjt9rlea5yydk8gp3sl3caju2xr0n",
|
||||
"tb1qefafzcq8mp7h4w6keeh6yzdfqz00k9anlsnsgm",
|
||||
"tb1qc9lrygeurs39xdgt5zepcgf9k8fuc09jjxaq4y",
|
||||
"tb1qlj8rmuhpfg4xkftg0zjghnlzdzeq4trmrfmf6u",
|
||||
"tb1q4jefgulpwpxtx25tkfxypwzj5qjm94t694ad5z",
|
||||
"tb1q9upnsjxd7qcmzj0h825plwhdya4fl6gr45mdu9",
|
||||
"tb1qkm2f7392g3mz34vcvtr4prkfqw3rpsc73ajjv6",
|
||||
"tb1qcrx5gx5vytle4syse3kvx7rr3p4qw6dgh82stj"
|
||||
]
|
||||
},
|
||||
"contacts": {
|
||||
"mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt": [
|
||||
"address",
|
||||
"give_back_faucet_addr"
|
||||
]
|
||||
},
|
||||
"fiat_value": {},
|
||||
"frozen_coins": {},
|
||||
"invoices": {},
|
||||
"keystore": {
|
||||
"cfg": {
|
||||
"mode": 0
|
||||
},
|
||||
"derivation": "m/84'/1'/0'",
|
||||
"hw_type": "ledger",
|
||||
"label": " ",
|
||||
"root_fingerprint": "7633218e",
|
||||
"soft_device_id": "7633218e",
|
||||
"type": "hardware",
|
||||
"xpub": "vpub5YMBGy6B5LkHSJdFGNfnGE3spXDSPKay9yXju7V5YDu8Kc6Mopm9XdBNVBefotaUsbE5g9iKGJ3jBaMFEDGFi1U21CdnmeouJgwPfyzEYCj"
|
||||
},
|
||||
"labels": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": "faucet0",
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": "faucet1",
|
||||
"tb1qj5sr0fuvc4437k9xu2w243d2cqdga07w44cwc0": "ocean",
|
||||
"tb1qnwxvapverw8ne4trl9957ktcq0lmvhntd37w7y": "more",
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key": "faucet2"
|
||||
},
|
||||
"payment_requests": {
|
||||
"tb1qj5sr0fuvc4437k9xu2w243d2cqdga07w44cwc0": {
|
||||
"amount_sat": 80000,
|
||||
"bip70": null,
|
||||
"exp": 0,
|
||||
"height": 2138359,
|
||||
"id": "5e97a3715c",
|
||||
"message": "ocean",
|
||||
"outputs": [
|
||||
[
|
||||
0,
|
||||
"tb1qj5sr0fuvc4437k9xu2w243d2cqdga07w44cwc0",
|
||||
80000
|
||||
]
|
||||
],
|
||||
"requestor": null,
|
||||
"time": 1643704012,
|
||||
"type": 0
|
||||
},
|
||||
"tb1qnwxvapverw8ne4trl9957ktcq0lmvhntd37w7y": {
|
||||
"amount_sat": 100000,
|
||||
"bip70": null,
|
||||
"exp": 86400,
|
||||
"height": 2138359,
|
||||
"id": "202680ee57",
|
||||
"message": "more",
|
||||
"outputs": [
|
||||
[
|
||||
0,
|
||||
"tb1qnwxvapverw8ne4trl9957ktcq0lmvhntd37w7y",
|
||||
100000
|
||||
]
|
||||
],
|
||||
"requestor": null,
|
||||
"time": 1643703981,
|
||||
"type": 0
|
||||
},
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key": {
|
||||
"amount_sat": 100000,
|
||||
"bip70": null,
|
||||
"exp": 86400,
|
||||
"height": 2138359,
|
||||
"id": "ed3197c2b9",
|
||||
"message": "faucet2",
|
||||
"outputs": [
|
||||
[
|
||||
0,
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key",
|
||||
100000
|
||||
]
|
||||
],
|
||||
"requestor": null,
|
||||
"time": 1643704051,
|
||||
"type": 0
|
||||
}
|
||||
},
|
||||
"prevouts_by_scripthash": {
|
||||
"00d99b16edad8719f7a391161ee74c84e116ff498f05280b45f258da36dc5878": [
|
||||
[
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c:1",
|
||||
100000
|
||||
]
|
||||
],
|
||||
"159831b1ef4d54b57b9facb26de0ebe6d0cf54514079cdd484c0820f514c232f": [
|
||||
[
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e:0",
|
||||
100000
|
||||
]
|
||||
],
|
||||
"9870e63757af196092f3a409e2c73c872e59a00fcbffde7b087baa2639fd1570": [
|
||||
[
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c:0",
|
||||
18587817
|
||||
]
|
||||
],
|
||||
"d93bbfc876f7b52058934cabf50c8a00887271ee4f70a9233a11e7ca99ce7d52": [
|
||||
[
|
||||
"ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032:0",
|
||||
1056210
|
||||
]
|
||||
],
|
||||
"f093f18f4c88e8a543a26ae055b61ba858a332ac7a958e5283f05de8e3211df3": [
|
||||
[
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e:1",
|
||||
5718908
|
||||
]
|
||||
],
|
||||
"fd634085a227edc1d00c5b23a0945174b275e542824963cb26ec28a72af409fb": [
|
||||
[
|
||||
"ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032:1",
|
||||
100000
|
||||
]
|
||||
]
|
||||
},
|
||||
"qt-console-history": [],
|
||||
"seed_version": 41,
|
||||
"spent_outpoints": {
|
||||
"789dd1956ae8b7b0ac895bf776d8234fd9705e544e7440b43b0d6beaa709698b": {
|
||||
"0": "22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c"
|
||||
},
|
||||
"c094a65dc96f874de708b61f9b321f97b9f986ea20ea8ce72252edb27db42c44": {
|
||||
"0": "ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032"
|
||||
},
|
||||
"dbde0ed97faa4857de15c52b634587d539821413b008ffabe5387277dcd1dd21": {
|
||||
"0": "cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e"
|
||||
}
|
||||
},
|
||||
"stored_height": 2138361,
|
||||
"transactions": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": "020000000001018b6909a7ea6b0d3bb440744e545e70d94f23d876f75b89acb0b7e86a95d19d780000000000feffffff02a9a01b010000000016001458bb2fbb77850bc9ac83a60c759a51a4a5a1091aa0860100000000001600142cae5e0afdef333d840eb9b6e1cbd5a97ec6673602473044022040a4913e6deb629f142e124f7d328858064e418841598844fa9a5a69a78804d302203b2ce857a69cfef895ee84ba80b4acdc7f24975e61ab835f2bb743a2304b9aff012102072b2d81a786399c8041cf749d1f7fc7c5668476b1727e7ba5fa58d91f7ffa06a6a02000",
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": "0200000000010121ddd1dc777238e5abff08b013148239d58745632bc515de5748aa7fd90ededb0000000000feffffff02a086010000000000160014459d3d7d96c75afe1e9e443a09710dfffad165c77c435700000000001600144567e78437684c9c3c01b9bfa28902f381887d36024730440220392961defacc1428318ab463542418c4189bb9e0cbc32423228e5b82d3d1134f02207b311788b6bf155c7b7fb0e36acd6cd0d5628860bf79e1f9407494effcac3e7a012103e7ed231710fc5f0f4949c604b8c0dfd193fe515bc70d40bf34c8c89e67658394aca02000",
|
||||
"ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032": "02000000000101442cb47db2ed5222e78cea20ea86f9b9971f329b1fb608e74d876fc95da694c00000000000feffffff02d21d10000000000016001485122af0824b2920a055c37ab1292633632084faa08601000000000016001431175e294b2dd71be39782a87a9a3191461b96ba02473044022036b3f2237cab600ac4e1c5ff726a20768d11cac3a3bbbf5f13bfd3b51d2bb66b022043d1d47fb454c1fa0ff232b9f3faf700ef534c65a37ac62238bf606463c12e3a0121025e674c57b28b56eb876a45f1dab9f9cdf2d9ed15d7c45050f4e24573e3ce54e1f8a02000"
|
||||
},
|
||||
"tx_fees": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": [
|
||||
null,
|
||||
false,
|
||||
1
|
||||
],
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": [
|
||||
null,
|
||||
false,
|
||||
1
|
||||
],
|
||||
"ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032": [
|
||||
null,
|
||||
false,
|
||||
1
|
||||
]
|
||||
},
|
||||
"txi": {},
|
||||
"txo": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": {
|
||||
"tb1q9jh9uzhaauenmpqwhxmwrj7449lvveekfta5kq": {
|
||||
"1": [
|
||||
100000,
|
||||
false
|
||||
]
|
||||
}
|
||||
},
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": {
|
||||
"tb1qgkwn6lvkcad0u857gsaqjugdlladzew8z64f5g": {
|
||||
"0": [
|
||||
100000,
|
||||
false
|
||||
]
|
||||
}
|
||||
},
|
||||
"ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032": {
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key": {
|
||||
"1": [
|
||||
100000,
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"use_encryption": false,
|
||||
"verified_tx3": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": [
|
||||
2138279,
|
||||
1643635839,
|
||||
94,
|
||||
"00000000f3e1b9294dc650ec7e9db2e687ea4e9fefb0792d3f2ee192a7c464f2"
|
||||
],
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": [
|
||||
2138285,
|
||||
1643641753,
|
||||
54,
|
||||
"00000000f5ee636b483669c0c35f9a247a5349253ac525d8a8bd03a993d8d42e"
|
||||
],
|
||||
"ef2692a124ce350d2765517cda611e66a0bed01cf735c292e6b4deb40abbb032": [
|
||||
2138361,
|
||||
1643704147,
|
||||
3,
|
||||
"000000000000004638e2bf9fcaa6804ead712488967176ead76abe654e869fa7"
|
||||
]
|
||||
},
|
||||
"wallet_type": "standard",
|
||||
"winpos-qt": [
|
||||
100,
|
||||
100,
|
||||
840,
|
||||
400
|
||||
]
|
||||
}
|
||||
@ -1,134 +0,0 @@
|
||||
{
|
||||
"addr_history": {
|
||||
"tb1q0xkv8naevd39ckxtnkkhpqls8g097g6lh26lrz8mtwme9k86rhrsyfca0j": [],
|
||||
"tb1q6jn4klgxf37vn5zyffvud3ypdnaw3mlf5zvmvsw686mq6um47g9shdmmcq": [],
|
||||
"tb1q8ex9z3ph3m4pcgnah6gwnvaud7vm5wf2cnm6agywckkpeww0e6gsm6zllq": [],
|
||||
"tb1q8xmcxdt0pt0lxxyzftu9yasj6wkjupmxwgqruw9qfdcxnzdpj2ys8w4n5h": [],
|
||||
"tb1q9ewp57dfynp88xfhc2qmmvmakqq68y5uhh0cefc2v2pgxz73ressztr7ec": [],
|
||||
"tb1q9mc3r4ls4r0fr9m5pd780v3xkj2sp93j6z6n0tp7etaqpjuxs3eszcjcgw": [],
|
||||
"tb1q9v43hze20h43n7k5tfd565cr484jffltxkvtvjdenmyefulyg9nsm2gfmm": [],
|
||||
"tb1qaul3zktd3k4dqwf48ge6yp9vyl7h0d5wgzx59l83f9m7qqh7vcmq4trjtl": [],
|
||||
"tb1qe925dg79zdgpls0tx2fw3yz0aywnpqdv8lh3m3v9ekypnyfqvy4q2wtf0z": [],
|
||||
"tb1qemj8pacgrye85d2tn5um34p9kfqdllxxhmtsmt278upuudlqz4esav4v0r": [],
|
||||
"tb1qgw2up7tm6ttgqldev6d25df63zdecjv28dkghaeulkg20wcvtrrsnfvxuc": [],
|
||||
"tb1qhte2y83qj7z5ulfte97nqc4y4t45976ndmqfvxv82gm3gr8sys8smeacv3": [],
|
||||
"tb1qj0sm9ddg6w69q0fxj5vrakquu7xpj8dznfv9hwvn9tm9cchr4clqlqfv48": [],
|
||||
"tb1qk3xatmk9s9snd2r6a7x8ua53xp97l3vz8lzpv3858x4uq3lwntcqzk6qzs": [],
|
||||
"tb1ql0wufpza4t0z6actlg8pm3ck5mlqwcz0ca242m293nr9ruh5pdfsk3nz6g": [],
|
||||
"tb1ql2yrh65x3486j5fu0f758nzgh6hhly44nt5twv6u8pr55ltrznrqhpfkth": [],
|
||||
"tb1ql58vlrp9gn5j5cm7q6r2jclhmc0thtf2gzc3kstd2cu04720zycs884kt3": [],
|
||||
"tb1qmj2ewkf7ud2fehvf3mhp4ks78nk66ev6hkzgcw2n53nw8ecf8gjsk5u00x": [],
|
||||
"tb1qnqxju3vx2zl60ylsfa5p6kt9eqa9kwn7tnluzvh6u0ejmc5la6vqxuxfy0": [],
|
||||
"tb1qpgvn0yuhkh908pdf8dpt8yne85luz73dwrpfxv5hrh7hpwhdlxjs294xme": [],
|
||||
"tb1qpsda4quw9ahmpnawszrp2erp7ez6tgy8970ywase3jw6pwmlgmkqx88j90": [],
|
||||
"tb1qquhuma0x3ud4lmnp4fajv9e46sal9ahq5p3hhm6kc9ywsjduekjqgvhe0d": [],
|
||||
"tb1qqvu9zzw0qpcqgwz5twf9q0uxl9vyynva98av8x2nfwhuwvgdmcqslk62h3": [],
|
||||
"tb1qrs0xucy7yq6jx35a4g0v5czxax8cwvgfl9ct2casvcsstytd7h2slsnsf0": [],
|
||||
"tb1qs3d9u87nd3wnxf48vmpw2dxtpyaluh6nmsfuys08cyzgf9txcxhqdr96af": [],
|
||||
"tb1qwux7s46f6t0l77u5vl45veahtrm4ees43e2zzv3anvaxump2fmyq2jngt2": [],
|
||||
"tb1qxsqg669ju7qqw653zya5a5aulcaxwq8wnfejk20xjv0sm9q9cstqky9pum": [],
|
||||
"tb1qy90wd4hhvctn89zy25yzy6v5r96s2343528tqjm80x7k9e2ylrcsnk20lx": [],
|
||||
"tb1qyc9jhfsg23rpnfq2wvq9ryucc6ultzw4xz66yncdq0dtwajdeznqu573w3": [],
|
||||
"tb1qz6lx8wxvw0tw44lalcz73arpdmxu8crngh36k0gsu0fjuve5gc9qqdr870": []
|
||||
},
|
||||
"addresses": {
|
||||
"change": [
|
||||
"tb1ql58vlrp9gn5j5cm7q6r2jclhmc0thtf2gzc3kstd2cu04720zycs884kt3",
|
||||
"tb1qrs0xucy7yq6jx35a4g0v5czxax8cwvgfl9ct2casvcsstytd7h2slsnsf0",
|
||||
"tb1qemj8pacgrye85d2tn5um34p9kfqdllxxhmtsmt278upuudlqz4esav4v0r",
|
||||
"tb1q6jn4klgxf37vn5zyffvud3ypdnaw3mlf5zvmvsw686mq6um47g9shdmmcq",
|
||||
"tb1qj0sm9ddg6w69q0fxj5vrakquu7xpj8dznfv9hwvn9tm9cchr4clqlqfv48",
|
||||
"tb1q9mc3r4ls4r0fr9m5pd780v3xkj2sp93j6z6n0tp7etaqpjuxs3eszcjcgw",
|
||||
"tb1q0xkv8naevd39ckxtnkkhpqls8g097g6lh26lrz8mtwme9k86rhrsyfca0j",
|
||||
"tb1qnqxju3vx2zl60ylsfa5p6kt9eqa9kwn7tnluzvh6u0ejmc5la6vqxuxfy0",
|
||||
"tb1ql0wufpza4t0z6actlg8pm3ck5mlqwcz0ca242m293nr9ruh5pdfsk3nz6g",
|
||||
"tb1qaul3zktd3k4dqwf48ge6yp9vyl7h0d5wgzx59l83f9m7qqh7vcmq4trjtl"
|
||||
],
|
||||
"receiving": [
|
||||
"tb1qhte2y83qj7z5ulfte97nqc4y4t45976ndmqfvxv82gm3gr8sys8smeacv3",
|
||||
"tb1qquhuma0x3ud4lmnp4fajv9e46sal9ahq5p3hhm6kc9ywsjduekjqgvhe0d",
|
||||
"tb1q9ewp57dfynp88xfhc2qmmvmakqq68y5uhh0cefc2v2pgxz73ressztr7ec",
|
||||
"tb1qwux7s46f6t0l77u5vl45veahtrm4ees43e2zzv3anvaxump2fmyq2jngt2",
|
||||
"tb1qz6lx8wxvw0tw44lalcz73arpdmxu8crngh36k0gsu0fjuve5gc9qqdr870",
|
||||
"tb1q9v43hze20h43n7k5tfd565cr484jffltxkvtvjdenmyefulyg9nsm2gfmm",
|
||||
"tb1q8ex9z3ph3m4pcgnah6gwnvaud7vm5wf2cnm6agywckkpeww0e6gsm6zllq",
|
||||
"tb1qpgvn0yuhkh908pdf8dpt8yne85luz73dwrpfxv5hrh7hpwhdlxjs294xme",
|
||||
"tb1qs3d9u87nd3wnxf48vmpw2dxtpyaluh6nmsfuys08cyzgf9txcxhqdr96af",
|
||||
"tb1qgw2up7tm6ttgqldev6d25df63zdecjv28dkghaeulkg20wcvtrrsnfvxuc",
|
||||
"tb1qmj2ewkf7ud2fehvf3mhp4ks78nk66ev6hkzgcw2n53nw8ecf8gjsk5u00x",
|
||||
"tb1qy90wd4hhvctn89zy25yzy6v5r96s2343528tqjm80x7k9e2ylrcsnk20lx",
|
||||
"tb1qpsda4quw9ahmpnawszrp2erp7ez6tgy8970ywase3jw6pwmlgmkqx88j90",
|
||||
"tb1qe925dg79zdgpls0tx2fw3yz0aywnpqdv8lh3m3v9ekypnyfqvy4q2wtf0z",
|
||||
"tb1qqvu9zzw0qpcqgwz5twf9q0uxl9vyynva98av8x2nfwhuwvgdmcqslk62h3",
|
||||
"tb1ql2yrh65x3486j5fu0f758nzgh6hhly44nt5twv6u8pr55ltrznrqhpfkth",
|
||||
"tb1q8xmcxdt0pt0lxxyzftu9yasj6wkjupmxwgqruw9qfdcxnzdpj2ys8w4n5h",
|
||||
"tb1qyc9jhfsg23rpnfq2wvq9ryucc6ultzw4xz66yncdq0dtwajdeznqu573w3",
|
||||
"tb1qk3xatmk9s9snd2r6a7x8ua53xp97l3vz8lzpv3858x4uq3lwntcqzk6qzs",
|
||||
"tb1qxsqg669ju7qqw653zya5a5aulcaxwq8wnfejk20xjv0sm9q9cstqky9pum"
|
||||
]
|
||||
},
|
||||
"fiat_value": {},
|
||||
"frozen_coins": {},
|
||||
"invoices": {},
|
||||
"labels": {},
|
||||
"payment_requests": {},
|
||||
"prevouts_by_scripthash": {},
|
||||
"seed_version": 41,
|
||||
"spent_outpoints": {},
|
||||
"transactions": {},
|
||||
"tx_fees": {},
|
||||
"txi": {},
|
||||
"txo": {},
|
||||
"use_encryption": false,
|
||||
"verified_tx3": {},
|
||||
"wallet_type": "3of5",
|
||||
"x1/": {
|
||||
"derivation": "m/1'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "76e6b5e1",
|
||||
"seed": "horn true fetch gauge grit develop quantum deliver regret proud move distance",
|
||||
"seed_type": "segwit",
|
||||
"type": "bip32",
|
||||
"xprv": "Vprv19Ji9sxLov2pmA4gkn15Mc4KvGbvZFSG7KNwtUQBftJ93L93PDn5RVc2p7D1xeHYZ6GVQSzSeCuHyFB9qV1m59aZyKZPUvRNuddh6W123Lf",
|
||||
"xpub": "Vpub5fzkJHzaxHiVed6UeRffm1iSVJ7riadAgcyjAzSV6A6XspPp1cbfbzDtzFtow4RTPszJqDcn9edAudhvkp3tapN2vXzKbxZWxncnLaCKqLa"
|
||||
},
|
||||
"x2/": {
|
||||
"cfg": {
|
||||
"mode": 0
|
||||
},
|
||||
"derivation": "m/48'/1'/0'/2'",
|
||||
"hw_type": "ledger",
|
||||
"label": " ",
|
||||
"root_fingerprint": "7633218e",
|
||||
"soft_device_id": "7633218e",
|
||||
"type": "hardware",
|
||||
"xpub": "Vpub5m81VsUZdngsPtKEJBf68CKrXgudGqw78cB3Cjtr623FcZyCtYttwiVcNNwHPedUcjc9Sw9GM678Jz7n1dxVxE4iMxkSAXHK6qiSU3BD7Yy"
|
||||
},
|
||||
"x3/": {
|
||||
"derivation": "m/480'/1'/0'/2'",
|
||||
"hw_type": "trezor",
|
||||
"label": "citadel",
|
||||
"root_fingerprint": "7633218e",
|
||||
"soft_device_id": "F3CFC15194D3033AE0D1BCCA",
|
||||
"type": "hardware",
|
||||
"xpub": "Vpub5ko88SR6Nh94KEAJ6XcbQSCAKuFuC69omZBriVmwUnUje7DnG6ttPDXT7hvTHjUQdRJF9bcQmYhpH81WotPyGUUmoF4awCVMtR3JQht7Fib"
|
||||
},
|
||||
"x4/": {
|
||||
"derivation": "m/1'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "1ec7a1e6",
|
||||
"seed": "earn next inject hobby dismiss argue light stable able exhibit crime bread",
|
||||
"seed_type": "segwit",
|
||||
"type": "bip32",
|
||||
"xprv": "Vprv18f9GEGKVXHNnELgRxGzroQYTZnDNTgJ37SxMpcQt6qW47En4KKzMdBtYaURojWryfWkKPi2iVVCy3BZDXSEtFhdddA6aphcqegDyaUYUSt",
|
||||
"xpub": "Vpub5fMBQeJZdty3fhNUKbwbGD4f2bJ9XnsCcR3jeLeiJNdttbVYgi9aY7okih93v9ARmgiPQJYtGCpSBiWZxUhSrJr6yEzxwSEcKeTeQeij9yX"
|
||||
},
|
||||
"x5/": {
|
||||
"derivation": "m/48'/1'/0'/2'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "4112ec5d",
|
||||
"type": "bip32",
|
||||
"xprv": "Vprv1EN3cr8ReqMJYT5q4oMcxQ5gpzcJhZBzTMyPHPFZhRJEd5bnGkD7jevesW5Mjm5waGvRnLHadgUK6zFxz3mMuYaLJvJv5R6aFewqybrZqCr",
|
||||
"xpub": "Vpub5m45mGAfoD2yRv7cxT2DMojoQ28ErtNu2faAZuHs7h6dTZrYu92hv9YX3gaPf4aeZmEJ47rGABaa2H9VR6pe6CooqD2MjBTGmsnwyzkVVib"
|
||||
}
|
||||
}
|
||||
@ -1,143 +0,0 @@
|
||||
{
|
||||
"addr_history": {
|
||||
"tb1q0xkv8naevd39ckxtnkkhpqls8g097g6lh26lrz8mtwme9k86rhrsyfca0j": [],
|
||||
"tb1q6jn4klgxf37vn5zyffvud3ypdnaw3mlf5zvmvsw686mq6um47g9shdmmcq": [],
|
||||
"tb1q8ex9z3ph3m4pcgnah6gwnvaud7vm5wf2cnm6agywckkpeww0e6gsm6zllq": [],
|
||||
"tb1q8xmcxdt0pt0lxxyzftu9yasj6wkjupmxwgqruw9qfdcxnzdpj2ys8w4n5h": [],
|
||||
"tb1q9ewp57dfynp88xfhc2qmmvmakqq68y5uhh0cefc2v2pgxz73ressztr7ec": [],
|
||||
"tb1q9mc3r4ls4r0fr9m5pd780v3xkj2sp93j6z6n0tp7etaqpjuxs3eszcjcgw": [],
|
||||
"tb1q9v43hze20h43n7k5tfd565cr484jffltxkvtvjdenmyefulyg9nsm2gfmm": [],
|
||||
"tb1qaul3zktd3k4dqwf48ge6yp9vyl7h0d5wgzx59l83f9m7qqh7vcmq4trjtl": [],
|
||||
"tb1qe925dg79zdgpls0tx2fw3yz0aywnpqdv8lh3m3v9ekypnyfqvy4q2wtf0z": [],
|
||||
"tb1qemj8pacgrye85d2tn5um34p9kfqdllxxhmtsmt278upuudlqz4esav4v0r": [],
|
||||
"tb1qgw2up7tm6ttgqldev6d25df63zdecjv28dkghaeulkg20wcvtrrsnfvxuc": [],
|
||||
"tb1qhte2y83qj7z5ulfte97nqc4y4t45976ndmqfvxv82gm3gr8sys8smeacv3": [],
|
||||
"tb1qj0sm9ddg6w69q0fxj5vrakquu7xpj8dznfv9hwvn9tm9cchr4clqlqfv48": [],
|
||||
"tb1qk3xatmk9s9snd2r6a7x8ua53xp97l3vz8lzpv3858x4uq3lwntcqzk6qzs": [],
|
||||
"tb1ql0wufpza4t0z6actlg8pm3ck5mlqwcz0ca242m293nr9ruh5pdfsk3nz6g": [],
|
||||
"tb1ql2yrh65x3486j5fu0f758nzgh6hhly44nt5twv6u8pr55ltrznrqhpfkth": [],
|
||||
"tb1ql58vlrp9gn5j5cm7q6r2jclhmc0thtf2gzc3kstd2cu04720zycs884kt3": [],
|
||||
"tb1qmj2ewkf7ud2fehvf3mhp4ks78nk66ev6hkzgcw2n53nw8ecf8gjsk5u00x": [],
|
||||
"tb1qnqxju3vx2zl60ylsfa5p6kt9eqa9kwn7tnluzvh6u0ejmc5la6vqxuxfy0": [],
|
||||
"tb1qpgvn0yuhkh908pdf8dpt8yne85luz73dwrpfxv5hrh7hpwhdlxjs294xme": [],
|
||||
"tb1qpsda4quw9ahmpnawszrp2erp7ez6tgy8970ywase3jw6pwmlgmkqx88j90": [],
|
||||
"tb1qquhuma0x3ud4lmnp4fajv9e46sal9ahq5p3hhm6kc9ywsjduekjqgvhe0d": [],
|
||||
"tb1qqvu9zzw0qpcqgwz5twf9q0uxl9vyynva98av8x2nfwhuwvgdmcqslk62h3": [],
|
||||
"tb1qrs0xucy7yq6jx35a4g0v5czxax8cwvgfl9ct2casvcsstytd7h2slsnsf0": [],
|
||||
"tb1qs3d9u87nd3wnxf48vmpw2dxtpyaluh6nmsfuys08cyzgf9txcxhqdr96af": [],
|
||||
"tb1qwux7s46f6t0l77u5vl45veahtrm4ees43e2zzv3anvaxump2fmyq2jngt2": [],
|
||||
"tb1qxsqg669ju7qqw653zya5a5aulcaxwq8wnfejk20xjv0sm9q9cstqky9pum": [],
|
||||
"tb1qy90wd4hhvctn89zy25yzy6v5r96s2343528tqjm80x7k9e2ylrcsnk20lx": [],
|
||||
"tb1qyc9jhfsg23rpnfq2wvq9ryucc6ultzw4xz66yncdq0dtwajdeznqu573w3": [],
|
||||
"tb1qz6lx8wxvw0tw44lalcz73arpdmxu8crngh36k0gsu0fjuve5gc9qqdr870": []
|
||||
},
|
||||
"addresses": {
|
||||
"change": [
|
||||
"tb1ql58vlrp9gn5j5cm7q6r2jclhmc0thtf2gzc3kstd2cu04720zycs884kt3",
|
||||
"tb1qrs0xucy7yq6jx35a4g0v5czxax8cwvgfl9ct2casvcsstytd7h2slsnsf0",
|
||||
"tb1qemj8pacgrye85d2tn5um34p9kfqdllxxhmtsmt278upuudlqz4esav4v0r",
|
||||
"tb1q6jn4klgxf37vn5zyffvud3ypdnaw3mlf5zvmvsw686mq6um47g9shdmmcq",
|
||||
"tb1qj0sm9ddg6w69q0fxj5vrakquu7xpj8dznfv9hwvn9tm9cchr4clqlqfv48",
|
||||
"tb1q9mc3r4ls4r0fr9m5pd780v3xkj2sp93j6z6n0tp7etaqpjuxs3eszcjcgw",
|
||||
"tb1q0xkv8naevd39ckxtnkkhpqls8g097g6lh26lrz8mtwme9k86rhrsyfca0j",
|
||||
"tb1qnqxju3vx2zl60ylsfa5p6kt9eqa9kwn7tnluzvh6u0ejmc5la6vqxuxfy0",
|
||||
"tb1ql0wufpza4t0z6actlg8pm3ck5mlqwcz0ca242m293nr9ruh5pdfsk3nz6g",
|
||||
"tb1qaul3zktd3k4dqwf48ge6yp9vyl7h0d5wgzx59l83f9m7qqh7vcmq4trjtl"
|
||||
],
|
||||
"receiving": [
|
||||
"tb1qhte2y83qj7z5ulfte97nqc4y4t45976ndmqfvxv82gm3gr8sys8smeacv3",
|
||||
"tb1qquhuma0x3ud4lmnp4fajv9e46sal9ahq5p3hhm6kc9ywsjduekjqgvhe0d",
|
||||
"tb1q9ewp57dfynp88xfhc2qmmvmakqq68y5uhh0cefc2v2pgxz73ressztr7ec",
|
||||
"tb1qwux7s46f6t0l77u5vl45veahtrm4ees43e2zzv3anvaxump2fmyq2jngt2",
|
||||
"tb1qz6lx8wxvw0tw44lalcz73arpdmxu8crngh36k0gsu0fjuve5gc9qqdr870",
|
||||
"tb1q9v43hze20h43n7k5tfd565cr484jffltxkvtvjdenmyefulyg9nsm2gfmm",
|
||||
"tb1q8ex9z3ph3m4pcgnah6gwnvaud7vm5wf2cnm6agywckkpeww0e6gsm6zllq",
|
||||
"tb1qpgvn0yuhkh908pdf8dpt8yne85luz73dwrpfxv5hrh7hpwhdlxjs294xme",
|
||||
"tb1qs3d9u87nd3wnxf48vmpw2dxtpyaluh6nmsfuys08cyzgf9txcxhqdr96af",
|
||||
"tb1qgw2up7tm6ttgqldev6d25df63zdecjv28dkghaeulkg20wcvtrrsnfvxuc",
|
||||
"tb1qmj2ewkf7ud2fehvf3mhp4ks78nk66ev6hkzgcw2n53nw8ecf8gjsk5u00x",
|
||||
"tb1qy90wd4hhvctn89zy25yzy6v5r96s2343528tqjm80x7k9e2ylrcsnk20lx",
|
||||
"tb1qpsda4quw9ahmpnawszrp2erp7ez6tgy8970ywase3jw6pwmlgmkqx88j90",
|
||||
"tb1qe925dg79zdgpls0tx2fw3yz0aywnpqdv8lh3m3v9ekypnyfqvy4q2wtf0z",
|
||||
"tb1qqvu9zzw0qpcqgwz5twf9q0uxl9vyynva98av8x2nfwhuwvgdmcqslk62h3",
|
||||
"tb1ql2yrh65x3486j5fu0f758nzgh6hhly44nt5twv6u8pr55ltrznrqhpfkth",
|
||||
"tb1q8xmcxdt0pt0lxxyzftu9yasj6wkjupmxwgqruw9qfdcxnzdpj2ys8w4n5h",
|
||||
"tb1qyc9jhfsg23rpnfq2wvq9ryucc6ultzw4xz66yncdq0dtwajdeznqu573w3",
|
||||
"tb1qk3xatmk9s9snd2r6a7x8ua53xp97l3vz8lzpv3858x4uq3lwntcqzk6qzs",
|
||||
"tb1qxsqg669ju7qqw653zya5a5aulcaxwq8wnfejk20xjv0sm9q9cstqky9pum"
|
||||
]
|
||||
},
|
||||
"channels": {},
|
||||
"fiat_value": {},
|
||||
"frozen_coins": {},
|
||||
"invoices": {},
|
||||
"labels": {},
|
||||
"payment_requests": {},
|
||||
"prevouts_by_scripthash": {},
|
||||
"qt-console-history": [],
|
||||
"seed_version": 43,
|
||||
"spent_outpoints": {},
|
||||
"stored_height": 2163195,
|
||||
"transactions": {},
|
||||
"tx_fees": {},
|
||||
"txi": {},
|
||||
"txo": {},
|
||||
"use_encryption": false,
|
||||
"verified_tx3": {},
|
||||
"wallet_type": "3of5",
|
||||
"winpos-qt": [
|
||||
167,
|
||||
152,
|
||||
840,
|
||||
400
|
||||
],
|
||||
"x1/": {
|
||||
"derivation": "m/1'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "76e6b5e1",
|
||||
"seed": "horn true fetch gauge grit develop quantum deliver regret proud move distance",
|
||||
"seed_type": "segwit",
|
||||
"type": "bip32",
|
||||
"xprv": "Vprv19Ji9sxLov2pmA4gkn15Mc4KvGbvZFSG7KNwtUQBftJ93L93PDn5RVc2p7D1xeHYZ6GVQSzSeCuHyFB9qV1m59aZyKZPUvRNuddh6W123Lf",
|
||||
"xpub": "Vpub5fzkJHzaxHiVed6UeRffm1iSVJ7riadAgcyjAzSV6A6XspPp1cbfbzDtzFtow4RTPszJqDcn9edAudhvkp3tapN2vXzKbxZWxncnLaCKqLa"
|
||||
},
|
||||
"x2/": {
|
||||
"cfg": {
|
||||
"mode": 0
|
||||
},
|
||||
"derivation": "m/48'/1'/0'/2'",
|
||||
"hw_type": "ledger",
|
||||
"label": " ",
|
||||
"root_fingerprint": "7633218e",
|
||||
"soft_device_id": "7633218e",
|
||||
"type": "hardware",
|
||||
"xpub": "Vpub5m81VsUZdngsPtKEJBf68CKrXgudGqw78cB3Cjtr623FcZyCtYttwiVcNNwHPedUcjc9Sw9GM678Jz7n1dxVxE4iMxkSAXHK6qiSU3BD7Yy"
|
||||
},
|
||||
"x3/": {
|
||||
"derivation": "m/480'/1'/0'/2'",
|
||||
"hw_type": "trezor",
|
||||
"label": "citadel",
|
||||
"root_fingerprint": "eecfa1e6",
|
||||
"soft_device_id": "F3CFC15194D3033AE0D1BCCA",
|
||||
"type": "hardware",
|
||||
"xpub": "Vpub5ko88SR6Nh94KEAJ6XcbQSCAKuFuC69omZBriVmwUnUje7DnG6ttPDXT7hvTHjUQdRJF9bcQmYhpH81WotPyGUUmoF4awCVMtR3JQht7Fib"
|
||||
},
|
||||
"x4/": {
|
||||
"derivation": "m/1'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "1ec7a1e6",
|
||||
"seed": "earn next inject hobby dismiss argue light stable able exhibit crime bread",
|
||||
"seed_type": "segwit",
|
||||
"type": "bip32",
|
||||
"xprv": "Vprv18f9GEGKVXHNnELgRxGzroQYTZnDNTgJ37SxMpcQt6qW47En4KKzMdBtYaURojWryfWkKPi2iVVCy3BZDXSEtFhdddA6aphcqegDyaUYUSt",
|
||||
"xpub": "Vpub5fMBQeJZdty3fhNUKbwbGD4f2bJ9XnsCcR3jeLeiJNdttbVYgi9aY7okih93v9ARmgiPQJYtGCpSBiWZxUhSrJr6yEzxwSEcKeTeQeij9yX"
|
||||
},
|
||||
"x5/": {
|
||||
"derivation": "m/48'/1'/0'/2'",
|
||||
"pw_hash_version": 1,
|
||||
"root_fingerprint": "4112ec5d",
|
||||
"type": "bip32",
|
||||
"xprv": "Vprv1EN3cr8ReqMJYT5q4oMcxQ5gpzcJhZBzTMyPHPFZhRJEd5bnGkD7jevesW5Mjm5waGvRnLHadgUK6zFxz3mMuYaLJvJv5R6aFewqybrZqCr",
|
||||
"xpub": "Vpub5m45mGAfoD2yRv7cxT2DMojoQ28ErtNu2faAZuHs7h6dTZrYu92hv9YX3gaPf4aeZmEJ47rGABaa2H9VR6pe6CooqD2MjBTGmsnwyzkVVib"
|
||||
}
|
||||
}
|
||||
@ -1,192 +0,0 @@
|
||||
{
|
||||
"addr_history": {
|
||||
"tb1q0tgs4r89esl0m6emahf0xcz63kyz92pzxl69w9": [],
|
||||
"tb1q2zg6ljw0r0rfw4njrcjd48dzc9a86p8hgljlwj": [],
|
||||
"tb1q4jefgulpwpxtx25tkfxypwzj5qjm94t694ad5z": [],
|
||||
"tb1q5mhhpkzt9n6twl05q7gdr278mayl4gsdqv4ff5": [],
|
||||
"tb1q8qgdz86w3yjt9rlea5yydk8gp3sl3caju2xr0n": [],
|
||||
"tb1q9fcfp4xc62eaz40qxfynczkd2wwgprktgmcudf": [],
|
||||
"tb1q9jh9uzhaauenmpqwhxmwrj7449lvveekfta5kq": [
|
||||
[
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c",
|
||||
2138279
|
||||
]
|
||||
],
|
||||
"tb1q9qx9phjfxkzswjhf5qc3q2cx58a0d3vavqa7fu": [],
|
||||
"tb1q9upnsjxd7qcmzj0h825plwhdya4fl6gr45mdu9": [],
|
||||
"tb1qas9vpp2h7kpcyetdgeheaj6n9m5qsxztcna2xh": [],
|
||||
"tb1qc9lrygeurs39xdgt5zepcgf9k8fuc09jjxaq4y": [],
|
||||
"tb1qcegz3lkxuwk2f7xpgjpld5s38tf4fdhlvlvrmm": [],
|
||||
"tb1qcrx5gx5vytle4syse3kvx7rr3p4qw6dgh82stj": [],
|
||||
"tb1qczy6jxej2qagvzwpdtnyzhj0sxyqxy0fdxrufm": [],
|
||||
"tb1qd7xhtw6ennkrg3ys0tmll3wjt5v9h7llpqvgcs": [],
|
||||
"tb1qefafzcq8mp7h4w6keeh6yzdfqz00k9anlsnsgm": [],
|
||||
"tb1qej2j2zwc9grkr5lja77sstcngccr9dvp5rxt0j": [],
|
||||
"tb1qgkwn6lvkcad0u857gsaqjugdlladzew8z64f5g": [
|
||||
[
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e",
|
||||
2138285
|
||||
]
|
||||
],
|
||||
"tb1qgznxl9va7uksephynxdq28xrqefjln5yuj7yzu": [],
|
||||
"tb1qj5sr0fuvc4437k9xu2w243d2cqdga07w44cwc0": [],
|
||||
"tb1qjyvgpqf8drv0ly906556m43fkvpv0yxen7urss": [],
|
||||
"tb1qkm2f7392g3mz34vcvtr4prkfqw3rpsc73ajjv6": [],
|
||||
"tb1qlfmy3fhzfyxeagn9ly7h50vjstx38wcnwhz7k2": [],
|
||||
"tb1qlj8rmuhpfg4xkftg0zjghnlzdzeq4trmrfmf6u": [],
|
||||
"tb1qnwxvapverw8ne4trl9957ktcq0lmvhntd37w7y": [],
|
||||
"tb1qpv6g49qlye5kdj8pckqyzgg956a0l22j37kxlk": [],
|
||||
"tb1qrmdwn3txhag9ad4x2degay9lnp778nm4lyqxrd": [],
|
||||
"tb1qsdl73sx8wr7h3ee0v6cxvxyyjqjjey89ljuyhv": [],
|
||||
"tb1qsm5t5ec6kj5ycldxzsrpddny0n8l7y8ll8kcfx": [],
|
||||
"tb1qsmvlht2f5ja942jyejf9mqhdq2828kjhaf3qyx": [],
|
||||
"tb1qsmykk6mm6x574hrydue9tprse6lvsyqs4uxpa6": [],
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key": []
|
||||
},
|
||||
"addresses": {
|
||||
"change": [
|
||||
"tb1q0tgs4r89esl0m6emahf0xcz63kyz92pzxl69w9",
|
||||
"tb1qjyvgpqf8drv0ly906556m43fkvpv0yxen7urss",
|
||||
"tb1qlfmy3fhzfyxeagn9ly7h50vjstx38wcnwhz7k2",
|
||||
"tb1qsmvlht2f5ja942jyejf9mqhdq2828kjhaf3qyx",
|
||||
"tb1q9qx9phjfxkzswjhf5qc3q2cx58a0d3vavqa7fu",
|
||||
"tb1qsm5t5ec6kj5ycldxzsrpddny0n8l7y8ll8kcfx",
|
||||
"tb1qgznxl9va7uksephynxdq28xrqefjln5yuj7yzu",
|
||||
"tb1qsdl73sx8wr7h3ee0v6cxvxyyjqjjey89ljuyhv",
|
||||
"tb1qczy6jxej2qagvzwpdtnyzhj0sxyqxy0fdxrufm",
|
||||
"tb1qcegz3lkxuwk2f7xpgjpld5s38tf4fdhlvlvrmm"
|
||||
],
|
||||
"receiving": [
|
||||
"tb1q9jh9uzhaauenmpqwhxmwrj7449lvveekfta5kq",
|
||||
"tb1qgkwn6lvkcad0u857gsaqjugdlladzew8z64f5g",
|
||||
"tb1qnwxvapverw8ne4trl9957ktcq0lmvhntd37w7y",
|
||||
"tb1qj5sr0fuvc4437k9xu2w243d2cqdga07w44cwc0",
|
||||
"tb1qxyt4u22t9ht3hcuhs2584x33j9rph946n33key",
|
||||
"tb1qsmykk6mm6x574hrydue9tprse6lvsyqs4uxpa6",
|
||||
"tb1qas9vpp2h7kpcyetdgeheaj6n9m5qsxztcna2xh",
|
||||
"tb1qej2j2zwc9grkr5lja77sstcngccr9dvp5rxt0j",
|
||||
"tb1q2zg6ljw0r0rfw4njrcjd48dzc9a86p8hgljlwj",
|
||||
"tb1qrmdwn3txhag9ad4x2degay9lnp778nm4lyqxrd",
|
||||
"tb1q5mhhpkzt9n6twl05q7gdr278mayl4gsdqv4ff5",
|
||||
"tb1qpv6g49qlye5kdj8pckqyzgg956a0l22j37kxlk",
|
||||
"tb1qd7xhtw6ennkrg3ys0tmll3wjt5v9h7llpqvgcs",
|
||||
"tb1q9fcfp4xc62eaz40qxfynczkd2wwgprktgmcudf",
|
||||
"tb1q8qgdz86w3yjt9rlea5yydk8gp3sl3caju2xr0n",
|
||||
"tb1qefafzcq8mp7h4w6keeh6yzdfqz00k9anlsnsgm",
|
||||
"tb1qc9lrygeurs39xdgt5zepcgf9k8fuc09jjxaq4y",
|
||||
"tb1qlj8rmuhpfg4xkftg0zjghnlzdzeq4trmrfmf6u",
|
||||
"tb1q4jefgulpwpxtx25tkfxypwzj5qjm94t694ad5z",
|
||||
"tb1q9upnsjxd7qcmzj0h825plwhdya4fl6gr45mdu9",
|
||||
"tb1qkm2f7392g3mz34vcvtr4prkfqw3rpsc73ajjv6",
|
||||
"tb1qcrx5gx5vytle4syse3kvx7rr3p4qw6dgh82stj"
|
||||
]
|
||||
},
|
||||
"fiat_value": {},
|
||||
"frozen_coins": {},
|
||||
"invoices": {},
|
||||
"keystore": {
|
||||
"derivation": "m/84'/1'/0'",
|
||||
"hw_type": "trezor",
|
||||
"label": "citadel",
|
||||
"root_fingerprint": "7633218e",
|
||||
"soft_device_id": "F3CFC15194D3033AE0D1BCCA",
|
||||
"type": "hardware",
|
||||
"xpub": "vpub5YMBGy6B5LkHSJdFGNfnGE3spXDSPKay9yXju7V5YDu8Kc6Mopm9XdBNVBefotaUsbE5g9iKGJ3jBaMFEDGFi1U21CdnmeouJgwPfyzEYCj"
|
||||
},
|
||||
"labels": {},
|
||||
"payment_requests": {},
|
||||
"prevouts_by_scripthash": {
|
||||
"00d99b16edad8719f7a391161ee74c84e116ff498f05280b45f258da36dc5878": [
|
||||
[
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c:1",
|
||||
100000
|
||||
]
|
||||
],
|
||||
"159831b1ef4d54b57b9facb26de0ebe6d0cf54514079cdd484c0820f514c232f": [
|
||||
[
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e:0",
|
||||
100000
|
||||
]
|
||||
],
|
||||
"9870e63757af196092f3a409e2c73c872e59a00fcbffde7b087baa2639fd1570": [
|
||||
[
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c:0",
|
||||
18587817
|
||||
]
|
||||
],
|
||||
"f093f18f4c88e8a543a26ae055b61ba858a332ac7a958e5283f05de8e3211df3": [
|
||||
[
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e:1",
|
||||
5718908
|
||||
]
|
||||
]
|
||||
},
|
||||
"qt-console-history": [],
|
||||
"seed_version": 41,
|
||||
"spent_outpoints": {
|
||||
"789dd1956ae8b7b0ac895bf776d8234fd9705e544e7440b43b0d6beaa709698b": {
|
||||
"0": "22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c"
|
||||
},
|
||||
"dbde0ed97faa4857de15c52b634587d539821413b008ffabe5387277dcd1dd21": {
|
||||
"0": "cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e"
|
||||
}
|
||||
},
|
||||
"stored_height": 2138287,
|
||||
"transactions": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": "020000000001018b6909a7ea6b0d3bb440744e545e70d94f23d876f75b89acb0b7e86a95d19d780000000000feffffff02a9a01b010000000016001458bb2fbb77850bc9ac83a60c759a51a4a5a1091aa0860100000000001600142cae5e0afdef333d840eb9b6e1cbd5a97ec6673602473044022040a4913e6deb629f142e124f7d328858064e418841598844fa9a5a69a78804d302203b2ce857a69cfef895ee84ba80b4acdc7f24975e61ab835f2bb743a2304b9aff012102072b2d81a786399c8041cf749d1f7fc7c5668476b1727e7ba5fa58d91f7ffa06a6a02000",
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": "0200000000010121ddd1dc777238e5abff08b013148239d58745632bc515de5748aa7fd90ededb0000000000feffffff02a086010000000000160014459d3d7d96c75afe1e9e443a09710dfffad165c77c435700000000001600144567e78437684c9c3c01b9bfa28902f381887d36024730440220392961defacc1428318ab463542418c4189bb9e0cbc32423228e5b82d3d1134f02207b311788b6bf155c7b7fb0e36acd6cd0d5628860bf79e1f9407494effcac3e7a012103e7ed231710fc5f0f4949c604b8c0dfd193fe515bc70d40bf34c8c89e67658394aca02000"
|
||||
},
|
||||
"tx_fees": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": [
|
||||
null,
|
||||
false,
|
||||
1
|
||||
],
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": [
|
||||
null,
|
||||
false,
|
||||
1
|
||||
]
|
||||
},
|
||||
"txi": {},
|
||||
"txo": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": {
|
||||
"tb1q9jh9uzhaauenmpqwhxmwrj7449lvveekfta5kq": {
|
||||
"1": [
|
||||
100000,
|
||||
false
|
||||
]
|
||||
}
|
||||
},
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": {
|
||||
"tb1qgkwn6lvkcad0u857gsaqjugdlladzew8z64f5g": {
|
||||
"0": [
|
||||
100000,
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"use_encryption": false,
|
||||
"verified_tx3": {
|
||||
"22dd98d6299959afe23259fe021707964fa9e73ea151aadb933a7b81c7adce9c": [
|
||||
2138279,
|
||||
1643635839,
|
||||
94,
|
||||
"00000000f3e1b9294dc650ec7e9db2e687ea4e9fefb0792d3f2ee192a7c464f2"
|
||||
],
|
||||
"cdf1929708fdbd411a903fa036dd0020ce0014b0f2b1085bbc31c93a754c348e": [
|
||||
2138285,
|
||||
1643641753,
|
||||
54,
|
||||
"00000000f5ee636b483669c0c35f9a247a5349253ac525d8a8bd03a993d8d42e"
|
||||
]
|
||||
},
|
||||
"wallet_type": "standard",
|
||||
"winpos-qt": [
|
||||
960,
|
||||
98,
|
||||
840,
|
||||
400
|
||||
]
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
import pytest
|
||||
from ckcc.constants import AF_P2WPKH, USB_NCRY_V1, USB_NCRY_V2
|
||||
from ckcc.client import ColdcardDevice, CCProtocolPacker
|
||||
|
||||
|
||||
# v2 tests require you to have firmware supporting usb encryption v2
|
||||
# after each v2 test, coldcard needs to be reconnected
|
||||
|
||||
|
||||
def test_ncry_v1():
|
||||
# USB_NCRY_V1 is the default
|
||||
dev = ColdcardDevice()
|
||||
session_key = dev.session_key
|
||||
assert session_key
|
||||
# re-establish shared secret
|
||||
dev.start_encryption()
|
||||
assert dev.ncry_ver == USB_NCRY_V1
|
||||
assert session_key != dev.session_key
|
||||
session_key = dev.session_key
|
||||
# we can do this many times over - it will always work
|
||||
dev.start_encryption()
|
||||
assert dev.ncry_ver == USB_NCRY_V1
|
||||
assert session_key != dev.session_key
|
||||
|
||||
|
||||
def test_ncry_v2():
|
||||
# after this test, one needs to reconnect coldcard
|
||||
dev = ColdcardDevice(ncry_ver=USB_NCRY_V2)
|
||||
assert dev.session_key
|
||||
assert dev.ncry_ver == USB_NCRY_V2
|
||||
# cannot start new session - already bound
|
||||
with pytest.raises(Exception):
|
||||
dev.start_encryption()
|
||||
# cannot start new session even with v2 - already bound
|
||||
with pytest.raises(Exception):
|
||||
dev.start_encryption(version=USB_NCRY_V2)
|
||||
# if above conditions are met - all commands gonna be encrypted
|
||||
assert dev.ncry_ver == USB_NCRY_V2
|
||||
addr = dev.send_recv(CCProtocolPacker.show_address("m/84'/0'/0'/0/0", AF_P2WPKH), timeout=None)
|
||||
assert addr
|
||||
|
||||
|
||||
def test_ncry_v2_via_start_encryption():
|
||||
dev = ColdcardDevice()
|
||||
assert dev.session_key
|
||||
assert dev.ncry_ver == USB_NCRY_V1
|
||||
dev.start_encryption(version=USB_NCRY_V2)
|
||||
assert dev.ncry_ver == USB_NCRY_V2
|
||||
# cannot start new session - already bound
|
||||
with pytest.raises(Exception):
|
||||
dev.start_encryption()
|
||||
# cannot start new session even with v2 - already bound
|
||||
with pytest.raises(Exception):
|
||||
dev.start_encryption(version=USB_NCRY_V2)
|
||||
# test some commands
|
||||
assert dev.ncry_ver == USB_NCRY_V2
|
||||
assert dev.encrypt_request is not None
|
||||
# if above conditions are met - all commands gonna be encrypted
|
||||
addr = dev.send_recv(CCProtocolPacker.show_address("m/84'/0'/0'/0/0", AF_P2WPKH), timeout=None)
|
||||
assert addr
|
||||
|
||||
|
||||
def test_unsupported_version():
|
||||
dev = ColdcardDevice()
|
||||
with pytest.raises(ValueError):
|
||||
dev.start_encryption(version=0x3)
|
||||
dev.close()
|
||||
with pytest.raises(ValueError):
|
||||
ColdcardDevice(ncry_ver=0x3)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user