7 use JSON
::MaybeXS
qw(decode_json);
10 my $filepath = shift or die "Usage: $0 wallet.json\n";
12 my $in = do { open(my $fh, '<', $filepath); local $/; <$fh> };
13 my $wallet = decode_json
($in);
16 print STDERR Dumper
$wallet;
18 my $qrcode = $filepath;
19 $qrcode =~ s/\.json$/.png/;
21 my $template = do { local $/; <DATA
> };
24 my $t = Template
::Alloy-
>new;
25 $t->process(\
$template, { %$wallet, qrcode
=> $qrcode }, \
$doc);
31 \documentclass
[letterpaper
]{article
}
33 \author
{Bitcoin Multisig Wallet Backup File
}
37 \usepackage
[margin
=1in]{geometry
}
44 \section
{General Information
}
47 \item Quorum
: \texttt
{[% quorum
.requiredSigners
%] of
[% quorum
.totalSigners
%]}
48 \item Address type
: \texttt
{[% addressType
%]}
49 \item Network
: \texttt
{[% network
%]}
50 \item Starting address
index: \texttt
{[% startingAddressIndex
%]}
55 [%- FOR key IN extendedPublicKeys
%]
56 \subsubsection
{Cosigner
[% loop.count
%]}
59 \item Label
: \texttt
{[% key
.name
%]}
60 \item Master fingerprint
: \texttt
{[% key
.xfp
%]}
61 \item Derivation path
: \texttt
{[% key
.bip32Path
%]}
62 \item Extended public key
: \texttt
{[% key
.xpub
.replace
('(.{60})', '$1 \\\\ ') %]}
72 \includegraphics
{[% qrcode
%]}
75 \subsection
{Directions
}
77 Scan this QR code to quickly import the wallet backup file into a digital
80 The data file can be used by Caravan software
, a stateless multisig coordinator
: \\
81 \texttt
{https
://unchained
-capital
.github
.io
/caravan/} \\
83 The data contained within the wallet backup file can also be entered into
84 other wallet software
, such as Electrum
, Sparrow
and Specter
.
89 % \label
{sec
:limitations
}
93 % \includegraphics
[scale
=0.45]{fig1
.pdf
}
94 % \caption
{Activity diagram
.}
95 % \label
{fig
:activity1
}
98 % \begin
{lstlisting
}[caption
=Bar
]
103 % \begin
{tabular
}{r
|l
}
106 % byte
& {\tt
0x01} (literal
) \\
107 % String
& Player
's name \\