4

I'd like to create a 2-of-3 paper wallet on an offline machine. How can I do this? I've found a paper wallet generator, but it doesn't allow to create N of M wallets

  • Is that paper wallet generator secure? – Come-from-Beyond Dec 3 '17 at 12:54
  • I wouldn't take my word for it, but I've checked the code for myself and it uses iota.lib.js. The code is quite easy to read and short enough. It doesn't create a seed, so randomness is out of scope. But I might be mislead, so again: don't take my word for it – brenzi Dec 3 '17 at 13:21
1

I'm using a ubuntu 16.04 VirtualBox VM to set up a LiveCD to be used offline. The LiveCD can be created with respin(unmaintained) or clonezilla.

While your vm is still online (before creating iso image), install the following:

sudo apt-get install ssss nodejs npm qrencode
npm install iota-generate-seed iota.lib.js chalk

create a javascript file called generateIOTAaddress.js

const IOTA = require('iota.lib.js');
const generate = require('iota-generate-seed');
const fs = require('fs');
const chalk = require('chalk')


var iota = new IOTA({
    'host': 'http://localhost',
    'port': 14700
});

//generate new seed 
const seed = generate();
console.log('Seed: ', chalk.yellow(seed), "\n")
var options = {};

options.index=0
options.security=2
options.deterministic = "off";
options.checksum = true;
options.total = 1;

iota.api.getNewAddress(seed,options, function (e,add) {
        address=add[0];
        console.log('Address: ', chalk.yellow(address));
        fs.writeFile("paperwallet.pub", address.concat("\n"), function(err) {
            if(err) {
                return console.log(err);
            }
        });
});
fs.writeFile("paperwallet.priv", seed.concat("\n"), function(err) {
    if(err) {
        return console.log(err);
    }
});
console.log(chalk.red('written to paperwallet.pub/.priv'), "\n")

create a bash script:

#!/bin/bash
CTR=1
# generate 2 of 3 secret

#remove old keys if file exists
echo "" > paperwallet.keys

# generate new ripple keypair using ripple-lib
nodejs generateIOTAaddress.js

#generate QR code for bitcoin address
echo "iota:" > paperwallet.puburi
cat paperwallet.pub >> paperwallet.puburi
cat paperwallet.pub | tr -d '\n'| qrencode -o "paperwallet.pub.png"

#start html output
echo "<html>" > paperwallet.html
echo "<header><style>" >> paperwallet.html
echo "          table {border-collapse:collapse; table-layout:fixed; width:800px}" >> paperwallet.html
echo "          table td {border:solid 1px #fab; width:400px; word-wrap:break-word;}"  >> paperwallet.html
echo "</style></header><body>" >> paperwallet.html

#split private key into 3 keys
cat paperwallet.priv | ssss-split -t 2 -n 3 -w privatekeypart -q | while read -r line; do 
        echo $line | qrencode -o "paperwallet.priv.part$CTR.png"

        echo "This is <b>part $CTR</b> of a IOTA paper wallet. two of three parts are needed to recover the original seed<br>$
        echo "<table><tr><td>Public Key: " >> paperwallet.html
        cat paperwallet.pub >> paperwallet.html 
        echo "</td><td>" >> paperwallet.html
        echo "Private Key (one among three): " >> paperwallet.html
        echo $line >> paperwallet.html
        echo "</td></tr><tr><td>" >> paperwallet.html
        echo "<img src=paperwallet.pub.png width=150>" >> paperwallet.html
        echo "</td><td>" >> paperwallet.html
        echo "<img src=paperwallet.priv.part$CTR.png width=200>" >> paperwallet.html
        echo "</td></tr></table>" >> paperwallet.html
        echo "use linux command <i>ssss-combine -t 2</i> to recover original private key from two paper wallets<br><hr>" >> p$
        CTR=$[CTR+1]
done

echo "</body></html>" >> paperwallet.html

now you can call your bash script which will create "paperwallet.html" which you can open in a browser and print

Use the address to send your funds to (you don't need to attach this address to the tangle previously!)

To reclaim your seed, use any two of your three parts and call

ssss-combine -t 2 

You can now use this seed with your IOTA wallet

  • 1
    Note that this is not using IOTA's multisig feature, but instead splits a traditional seed into three parts using third-party tools. Therefore, the person who created the multisig wallet had access to all three parts, and whenever someone spends from the address, the whole seed will have to be regenerated by one person the others have to trust. – mihi Dec 3 '17 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.