From 1bf8c85a65971d239ea4c7cd89476f3c750019d4 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 15 May 2020 17:56:45 +0200 Subject: [PATCH] electrum seed version system support --- drongo | 2 +- .../sparrow/control/FileWalletExportPane.java | 4 +- .../com/sparrowwallet/sparrow/io/Bip39.java | 2 +- .../sparrowwallet/sparrow/io/Electrum.java | 59 +++++++++++++++---- .../sparrow/io/ElectrumTest.java | 35 +++++++++-- .../sparrow/io/electrum-encrypted | 2 +- .../io/electrum-singlesig-seed-wallet.json | 21 +++++++ .../sparrow/io/electrum-singlesig-wallet.json | 2 +- 8 files changed, 104 insertions(+), 23 deletions(-) create mode 100644 src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-seed-wallet.json diff --git a/drongo b/drongo index f6414a44..9e5a7d0e 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit f6414a447550eb87a871c54c7e376713cae8eb9c +Subproject commit 9e5a7d0e8d31eb4e21d543081c23f7f0aaef9795 diff --git a/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java b/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java index afb88f35..8e1fbe18 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java @@ -58,11 +58,11 @@ public class FileWalletExportPane extends TitledDescriptionPane { copy.decrypt(password.get(), ""); for(Keystore keystore : copy.getKeystores()) { - if(keystore.hasSeed() && keystore.getSeed().needPassphrase()) { + if(keystore.hasSeed() && keystore.getSeed().usesPassphrase()) { KeystorePassphraseDialog passphraseDialog = new KeystorePassphraseDialog(keystore); Optional passphrase = passphraseDialog.showAndWait(); if(passphrase.isPresent()) { - keystore.setPassphrase(passphrase.get()); + keystore.getSeed().setPassphrase(passphrase.get()); } else { return; } diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java b/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java index ffbcae9c..34943f71 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java @@ -28,7 +28,7 @@ public class Bip39 implements KeystoreMnemonicImport { public Keystore getKeystore(List derivation, List mnemonicWords, String passphrase) throws ImportException { try { Bip39MnemonicCode.INSTANCE.check(mnemonicWords); - DeterministicSeed seed = new DeterministicSeed(mnemonicWords, null, passphrase, System.currentTimeMillis()); + DeterministicSeed seed = new DeterministicSeed(mnemonicWords, null, passphrase, System.currentTimeMillis(), DeterministicSeed.Type.BIP39); return Keystore.fromSeed(seed, derivation); } catch (Exception e) { throw new ImportException(e); diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Electrum.java b/src/main/java/com/sparrowwallet/sparrow/io/Electrum.java index 7fd4eeb0..8a5f2a7b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Electrum.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Electrum.java @@ -5,19 +5,17 @@ import com.google.gson.reflect.TypeToken; import com.sparrowwallet.drongo.ExtendedKey; import com.sparrowwallet.drongo.KeyDerivation; import com.sparrowwallet.drongo.Utils; -import com.sparrowwallet.drongo.crypto.ECIESKeyCrypter; -import com.sparrowwallet.drongo.crypto.ECKey; +import com.sparrowwallet.drongo.crypto.*; import com.sparrowwallet.drongo.policy.Policy; import com.sparrowwallet.drongo.policy.PolicyType; import com.sparrowwallet.drongo.protocol.ScriptType; -import com.sparrowwallet.drongo.wallet.Keystore; -import com.sparrowwallet.drongo.wallet.KeystoreSource; -import com.sparrowwallet.drongo.wallet.Wallet; -import com.sparrowwallet.drongo.wallet.WalletModel; +import com.sparrowwallet.drongo.wallet.*; import java.io.*; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Base64; import java.util.LinkedHashMap; import java.util.Map; import java.util.zip.InflaterInputStream; @@ -92,7 +90,17 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport ScriptType scriptType = null; for(ElectrumKeystore ek : ew.keystores.values()) { - Keystore keystore = new Keystore(ek.label != null ? ek.label : "Electrum " + ek.root_fingerprint); + Keystore keystore = new Keystore(); + ExtendedKey xPub = ExtendedKey.fromDescriptor(ek.xpub); + String derivationPath = ek.derivation; + if(derivationPath == null) { + derivationPath = "m/0"; + } + String masterFingerprint = ek.root_fingerprint; + if(masterFingerprint == null) { + masterFingerprint = Utils.bytesToHex(xPub.getParentFingerprint()); + } + if("hardware".equals(ek.type)) { keystore.setSource(KeystoreSource.HW_USB); keystore.setWalletModel(WalletModel.fromType(ek.hw_type)); @@ -100,16 +108,32 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport throw new ImportException("Wallet has keystore of unknown hardware wallet type \"" + ek.hw_type + "\""); } } else if("bip32".equals(ek.type)) { - if(ek.xprv != null) { + if(ek.xprv != null && ek.seed == null) { + throw new ImportException("Electrum does not support exporting BIP39 derived seeds."); + } else if(ek.seed != null) { keystore.setSource(KeystoreSource.SW_SEED); + String seed = ek.seed; + String passphrase = ek.passphrase; + if(password != null) { + seed = decrypt(seed, password); + passphrase = decrypt(passphrase, password); + } + + keystore.setSeed(new DeterministicSeed(seed, null, passphrase, 0, DeterministicSeed.Type.ELECTRUM)); + keystore.getSeed().setPassphrase(passphrase); + + if(derivationPath == "m/0") { + derivationPath = "m/0'"; + } } else { keystore.setSource(KeystoreSource.SW_WATCH); } keystore.setWalletModel(WalletModel.ELECTRUM); } - ExtendedKey xPub = ExtendedKey.fromDescriptor(ek.xpub); - keystore.setKeyDerivation(new KeyDerivation(ek.root_fingerprint, ek.derivation)); + + keystore.setKeyDerivation(new KeyDerivation(masterFingerprint, derivationPath)); keystore.setExtendedPublicKey(xPub); + keystore.setLabel(ek.label != null ? ek.label : "Electrum " + masterFingerprint); wallet.getKeystores().add(keystore); ExtendedKey.Header xpubHeader = ExtendedKey.Header.fromExtendedKey(ek.xpub); @@ -140,6 +164,13 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport } } + private String decrypt(String encrypted, String password) { + byte[] passwordHash = Utils.sha256sha256(password.getBytes(StandardCharsets.UTF_8)); + byte[] encryptedBytes = Base64.getDecoder().decode(encrypted); + byte[] decrypted = Utils.decryptAesCbcPkcs7(Arrays.copyOfRange(encryptedBytes, 0, 16), Arrays.copyOfRange(encryptedBytes, 16, encryptedBytes.length), passwordHash); + return new String(decrypted, StandardCharsets.UTF_8); + } + @Override public String getWalletImportDescription() { return "Import an Electrum wallet"; @@ -177,7 +208,12 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport ek.xpub = keystore.getExtendedPublicKey().toString(xpubHeader); ek.xprv = keystore.getExtendedPrivateKey().toString(xprvHeader); ek.pw_hash_version = 1; - ew.seed_type = "bip39"; + if(keystore.getSeed().getType() == DeterministicSeed.Type.ELECTRUM) { + ek.seed = keystore.getSeed().getMnemonicString(); + ek.passphrase = keystore.getSeed().getPassphrase(); + } else if(keystore.getSeed().getType() == DeterministicSeed.Type.BIP39) { + ew.seed_type = "bip39"; + } ew.use_encryption = false; } else if(keystore.getSource() == KeystoreSource.SW_WATCH) { ek.type = "bip32"; @@ -245,6 +281,7 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport public String type; public String derivation; public String seed; + public String passphrase; public Integer pw_hash_version; } } diff --git a/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java b/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java index 4404d974..a8350d5c 100644 --- a/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java +++ b/src/test/java/com/sparrowwallet/sparrow/io/ElectrumTest.java @@ -1,6 +1,7 @@ package com.sparrowwallet.sparrow.io; import com.google.common.io.ByteStreams; +import com.sparrowwallet.drongo.Utils; import com.sparrowwallet.drongo.policy.PolicyType; import com.sparrowwallet.drongo.protocol.ScriptType; import com.sparrowwallet.drongo.wallet.Wallet; @@ -22,7 +23,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); Assert.assertEquals("pkh(trezortest)", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("ab543c67", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); - Assert.assertEquals("m/84'/0'/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); + Assert.assertEquals("m/49'/0'/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub6FFEQVG6QR28chQzgSJ7Gjx5j5BGLkCMgZ9bc41YJCXfwYiCKUQdcwm4Fe1stvzRjosz5udMedYZFRL56AeZXCsiVmnVUysio4jkAKTukmN", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); Assert.assertTrue(wallet.isValid()); } @@ -42,7 +43,7 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); Assert.assertEquals("pkh(trezortest)", wallet.getDefaultPolicy().getMiniscript().getScript()); Assert.assertEquals("ab543c67", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); - Assert.assertEquals("m/84'/0'/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); + Assert.assertEquals("m/49'/0'/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); Assert.assertEquals("xpub6FFEQVG6QR28chQzgSJ7Gjx5j5BGLkCMgZ9bc41YJCXfwYiCKUQdcwm4Fe1stvzRjosz5udMedYZFRL56AeZXCsiVmnVUysio4jkAKTukmN", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); } @@ -94,9 +95,31 @@ public class ElectrumTest extends IoTest { Assert.assertEquals(PolicyType.SINGLE, wallet.getPolicyType()); Assert.assertEquals(ScriptType.P2WPKH, wallet.getScriptType()); Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); - Assert.assertEquals("pkh(electrum05aba071)", wallet.getDefaultPolicy().getMiniscript().getScript()); - Assert.assertEquals("05aba071", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); + Assert.assertEquals("pkh(electrumf881eac5)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("f881eac5", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); Assert.assertEquals("m/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); - Assert.assertEquals("xpub67vv394epQsLhdjNGx7dfgURicP7XwBMuHPTVAMdXcXhDuC9VP8SqVvh2cYqKWm9xoUd6YynWK8JzRcXpmeuZFRH7i1kt8fR9GXoJSiHk1E", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); + Assert.assertEquals("xpub69iSRreMB6fu24sU8Tdxv7yYGqzPkDwPkwqUfKJTxW3p8afW7XvTewVCapuX3dQjdD197iF65WcjYaNpFbwWT3RyuZ1KJ3ToJNVWKWyAJ6f", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); } -} + + @Test + public void testSinglesigSeedExport() throws ImportException, ExportException, IOException { + Electrum electrum = new Electrum(); + byte[] walletBytes = ByteStreams.toByteArray(getInputStream("electrum-singlesig-seed-wallet.json")); + Wallet wallet = electrum.importWallet(new ByteArrayInputStream(walletBytes), null); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + electrum.exportWallet(wallet, baos); + Assert.assertEquals("e14c40c638e2c83d1f20e5ee9cd744bc2ba1ef64fa939926f3778fc8735e891f56852f687b32bbd044f272d2831137e3eeba61fd1f285fa73dcc97d9f2be3cd1", Utils.bytesToHex(wallet.getKeystores().get(0).getSeed().getSeedBytes())); + + wallet = electrum.importWallet(new ByteArrayInputStream(baos.toByteArray()), null); + Assert.assertTrue(wallet.isValid()); + Assert.assertEquals(PolicyType.SINGLE, wallet.getPolicyType()); + Assert.assertEquals(ScriptType.P2WPKH, wallet.getScriptType()); + Assert.assertEquals(1, wallet.getDefaultPolicy().getNumSignaturesRequired()); + Assert.assertEquals("pkh(electrum59c5474f)", wallet.getDefaultPolicy().getMiniscript().getScript()); + Assert.assertEquals("59c5474f", wallet.getKeystores().get(0).getKeyDerivation().getMasterFingerprint()); + Assert.assertEquals("m/0'", wallet.getKeystores().get(0).getKeyDerivation().getDerivationPath()); + Assert.assertEquals("xpub68YmVxWbxqjpxbUqqaPrgkBQPBSJuq6gEaL22uuytSEojtS2x5eLPN2uspUuyigtnMkoHrFSF1KwoXPwjzuaUjErUwztxfHquAwuaQhSd9J", wallet.getKeystores().get(0).getExtendedPublicKey().toString()); + Assert.assertEquals(wallet.getKeystores().get(0).getSeed().getMnemonicString(), "coach fan denial rifle frost rival join install one wasp cool antique"); + Assert.assertEquals("e14c40c638e2c83d1f20e5ee9cd744bc2ba1ef64fa939926f3778fc8735e891f56852f687b32bbd044f272d2831137e3eeba61fd1f285fa73dcc97d9f2be3cd1", Utils.bytesToHex(wallet.getKeystores().get(0).getSeed().getSeedBytes())); + } +} \ No newline at end of file diff --git a/src/test/resources/com/sparrowwallet/sparrow/io/electrum-encrypted b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-encrypted index a79d404a..bd62f807 100644 --- a/src/test/resources/com/sparrowwallet/sparrow/io/electrum-encrypted +++ b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-encrypted @@ -1 +1 @@ -QklFMQNn9crHbQuMAnus+PuzTNaAo5bakJojG4CTAaL0dR76ZDSHLuzWWcIDDeUjHJiL3x1D08PHxVHcq2bfo64jcoKn2WoncmubkuPAiGgI6cI3Pj/6Crb7KhqdpG22QOESIDUXsBjUk93qsEr7nTTPnMSfSBChZcdhb4FC7nCF3BL/Jr2ah+p1XgvNcnnSZCxn7DOJODt9n6AoV5qD1e55Kv/vlfzOmIJhKqdVAhLql8IWcwMl82b0W49Dv0gnTaFWJSvNGseNXOs6xE+nXxbn1+T4+SQQprbRH5QR/z7ftCVOEime8QdjOqhPjebSFJeMWkNBDqHhsOuFWF2xM/1q+MLeneihr+hNamBMxcFITkzPyU+faySWJJmXrnd252UnFjzayPT8PajLTXyJpqT5X8Ac2+3rb0NkQwddRjT7pOCUYH48l1iXeUz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ki6ACxKSC3XznSu0RDBw9afZN1gQ3v2zkucPRNZWL5HEvIsQKgTc4tKBjHpInCvE/Z6n8k4O/+9ThD9W49Pjiya/xCfClup4JnFqHts4axkH1NW6A/LAk/BZiHJ09WPBdPlQmMR8aJ9FQ74lrDota8Onw/e9jJgjX1jXSOIBSIKb9MiSIEj2fdFv2O98DA3ZgwGAElae98LfXfVsgWWdzBJtAbscuThaFY2y1QSKzO+FfYrTwPaFn436I8PbkPH8yOVSbrJukR4SfV/x6aZyBJZGzmQlNckAq4bLt1U5hbfFt0TXFqjbOQwzqcfhnFysr5E52dmAYUcfZ1dQHLn6ti+Rqfhe5hOVv9wUCL476vl79ZpV/BM3k5Ojx9656Oft+QbW65sWiTTAcEeipTABRVrgl66L7Eoboh6/UExYwNNwPzO3r5jY6bSgdPas/MBWeLfivWsfb0WsarGo6waEiBEM0BUaXZl18PeSt6HHa9I471RgJl3OV7eylPNK2CRFJNYriMo5ivxjGMx/KXb44DAjJy/alhP5ZU2aiAlTvAvpbDTmrrmNoX0/0Pyoz9LLSurW20dG/5GfMICbmMbHNi4ezXEhu0NjxzmecktvV8AGLF8MwuU/MZsZwu4FQ+Bi+QUwxKdYH+Cu196YjlmrMt0udvro2w30A73oLrIpXdOO2oIGpQa54niZVu5JNgmHeR4df993fo6utexQ9A9mp0qurCGb/I+4JgsYT9Eh6grNgxvJTpyJi8wObjlLLhByeomuEgLImAvtQFoLdjaEYnAGZO \ No newline at end of file diff --git a/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-seed-wallet.json b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-seed-wallet.json new file mode 100644 index 00000000..60b6b3a7 --- /dev/null +++ b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-seed-wallet.json @@ -0,0 +1,21 @@ +{ + "keystore": { + "passphrase": "thisisapassphrase", + "pw_hash_version": 1, + "seed": "coach fan denial rifle frost rival join install one wasp cool antique", + "type": "bip32", + "xprv": "zprvAZDwhnKYRqGVShncQGS6jnRgB5tiPcMphaSroKJ967TayHjLurfD5h2i4wkwDVBC4REYf1aDp8sXG7ShPXxgUHBPUWMi6aFNc6x8hXtJ5WF", + "xpub": "zpub6nDJ7HrSGCpnfBs5WHy76vNQj7jCo55g4oNTbhhkeSzZr64VTPyTdVMBvEQ5yXzjbdzQnoSZAL33a6d5BPjc5Cc4DdPk8UvpSd5CMXhCKEi" + }, + "seed_type": "segwit", + "seed_version": 18, + "spent_outpoints": {}, + "stored_height": 630454, + "transactions": {}, + "tx_fees": {}, + "txi": {}, + "txo": {}, + "use_encryption": false, + "verified_tx3": {}, + "wallet_type": "standard" +} \ No newline at end of file diff --git a/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json index c1ea7ba6..74e70404 100644 --- a/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json +++ b/src/test/resources/com/sparrowwallet/sparrow/io/electrum-singlesig-wallet.json @@ -2,7 +2,7 @@ "fiat_value": {}, "invoices": {}, "keystore": { - "derivation": "m/84'/0'/0'", + "derivation": "m/49'/0'/0'", "hw_type": "trezor", "label": "trezortest", "root_fingerprint": "ab543c67",