diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c4377148f..2e1aec6587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,7 @@ - Allow a conn open ack to succeed in the happy case ([#699]) - [ibc-relayer] - - [nothing yet] + - Replaced `rust-crypto` & `bitcoin-wallet` deprecated dependencies ([#352]) - [ibc-relayer-cli] - Hermes guide: improved installation guideline ([#672]) @@ -55,6 +55,7 @@ - [ibc-relayer-cli] - [nothing yet] +[#352]: https://github.com/informalsystems/ibc-rs/issues/352 [#561]: https://github.com/informalsystems/ibc-rs/issues/561 [#599]: https://github.com/informalsystems/ibc-rs/issues/599 [#630]: https://github.com/informalsystems/ibc-rs/issues/630 diff --git a/Cargo.lock b/Cargo.lock index ce16ccb234..5971fca820 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "adler" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc89c5c7b5550ffb9372eb5c5ffc7f9f705cc3f4a128bd4669b9745f555093" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" @@ -157,12 +157,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - [[package]] name = "autocfg" version = "1.0.1" @@ -202,20 +196,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c7f7096bc256f5e5cb960f60dfc4f4ef979ca65abe7fb9d5a4f77150d3783d4" -[[package]] -name = "bitcoin" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc34f963060a2091b4e285d8082e1946be35caf467e73b3155262c8357fb4595" -dependencies = [ - "bech32 0.7.3", - "bitcoin_hashes 0.7.6", - "byteorder", - "hex 0.3.2", - "secp256k1 0.15.5", - "serde", -] - [[package]] name = "bitcoin" version = "0.26.0" @@ -223,32 +203,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec5f88a446d66e7474a3b8fa2e348320b574463fb78d799d90ba68f79f48e0e" dependencies = [ "bech32 0.7.3", - "bitcoin_hashes 0.9.4", - "secp256k1 0.20.1", -] - -[[package]] -name = "bitcoin-wallet" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b99191e69b23808ee29120a67cc4f6f1628c59ef3fdb48a779f4002c780f39c8" -dependencies = [ - "bitcoin 0.21.0", - "bitcoin_hashes 0.7.6", - "rand 0.7.3", - "rust-crypto", - "secp256k1 0.15.5", - "serde", - "serde_derive", -] - -[[package]] -name = "bitcoin_hashes" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b375d62f341cef9cd9e77793ec8f1db3fc9ce2e4d57e982c8fe697a2c16af3b6" -dependencies = [ - "serde", + "bitcoin_hashes", + "secp256k1", ] [[package]] @@ -274,54 +230,21 @@ dependencies = [ "wyz", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.3", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.4", + "generic-array", ] -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "byteorder" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.0.1" @@ -336,9 +259,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.0.41" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dae9c4b8fedcae85592ba623c4fd08cfdab3e3b72d6df780c6ead964a69bfff" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" [[package]] name = "cfg-if" @@ -366,15 +289,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - [[package]] name = "color-backtrace" version = "0.3.0" @@ -388,9 +302,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb27bc55bac783b7cfd5eafba8a3e94ff6d420fc4e04970a207980683145af83" +checksum = "78be6f41573684a3c8818457240a855189aceff6482944eb361b520017766968" [[package]] name = "contracts" @@ -457,7 +371,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.1", + "autocfg", "cfg-if 0.1.10", "lazy_static", ] @@ -468,18 +382,28 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" dependencies = [ - "autocfg 1.0.1", + "autocfg", "cfg-if 1.0.0", "lazy_static", ] +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + [[package]] name = "crypto-mac" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" dependencies = [ - "generic-array 0.14.4", + "generic-array", "subtle", ] @@ -490,7 +414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" dependencies = [ "byteorder", - "digest 0.9.0", + "digest", "rand_core 0.5.1", "subtle", "zeroize", @@ -551,22 +475,13 @@ dependencies = [ "syn", ] -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.3", -] - [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.4", + "generic-array", ] [[package]] @@ -624,7 +539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fbdb4ff710acb4db8ca29f93b897529ea6d6a45626d5183b47e012aa6ae7e4" dependencies = [ "elliptic-curve", - "hmac", + "hmac 0.10.1", "signature", ] @@ -649,7 +564,7 @@ dependencies = [ "rand 0.7.3", "serde", "serde_bytes", - "sha2 0.9.3", + "sha2", "zeroize", ] @@ -666,10 +581,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2db227e61a43a34915680bdda462ec0e212095518020a88a1f91acd16092c39" dependencies = [ "bitvec", - "digest 0.9.0", + "digest", "ff", "funty", - "generic-array 0.14.4", + "generic-array", "group", "pkcs8", "rand_core 0.5.1", @@ -677,34 +592,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "ff" version = "0.8.0" @@ -742,12 +629,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "funty" version = "1.1.0" @@ -855,12 +736,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "gcc" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" - [[package]] name = "generational-arena" version = "0.2.8" @@ -870,15 +745,6 @@ dependencies = [ "cfg-if 0.1.10", ] -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.4" @@ -970,11 +836,11 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" +checksum = "d832b01df74254fe364568d6ddc294443f61cbec82816b60904303af87efae78" dependencies = [ - "bytes 1.0.1", + "bytes", "fnv", "futures-core", "futures-sink", @@ -985,7 +851,6 @@ dependencies = [ "tokio", "tokio-util", "tracing", - "tracing-futures", ] [[package]] @@ -1006,7 +871,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72adf5a17a0952ecfcddf8d46d071271d5ee52e78443f07ba0b2dcfe3063a132" dependencies = [ - "bitcoin 0.26.0", + "bitcoin", "byteorder", ] @@ -1021,15 +886,19 @@ dependencies = [ [[package]] name = "hex" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" [[package]] -name = "hex" -version = "0.4.2" +name = "hmac" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest", +] [[package]] name = "hmac" @@ -1037,8 +906,8 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ - "crypto-mac", - "digest 0.9.0", + "crypto-mac 0.10.0", + "digest", ] [[package]] @@ -1047,7 +916,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ - "bytes 1.0.1", + "bytes", "fnv", "itoa", ] @@ -1058,7 +927,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" dependencies = [ - "bytes 1.0.1", + "bytes", "http", ] @@ -1096,7 +965,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8e946c2b1349055e0b72ae281b238baf1a3ea7307c7e9f9d64673bdd9c26ac7" dependencies = [ - "bytes 1.0.1", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -1120,12 +989,11 @@ version = "0.1.1" dependencies = [ "anomaly", "bech32 0.8.0", - "bytes 1.0.1", + "bytes", "chrono", "dyn-clonable", "ibc-proto", - "ics23", - "prost 0.7.0", + "prost", "prost-types", "regex", "serde", @@ -1146,8 +1014,8 @@ name = "ibc-proto" version = "0.7.1" dependencies = [ "anomaly", - "bytes 1.0.1", - "prost 0.7.0", + "bytes", + "prost", "prost-types", "tendermint-proto", "thiserror", @@ -1161,9 +1029,8 @@ dependencies = [ "anomaly", "async-trait", "bech32 0.8.0", - "bitcoin 0.26.0", - "bitcoin-wallet", - "bytes 1.0.1", + "bitcoin", + "bytes", "crossbeam-channel 0.5.0", "dirs-next", "dyn-clonable", @@ -1171,21 +1038,22 @@ dependencies = [ "funty", "futures", "hdpath", - "hex 0.4.2", + "hex", "humantime-serde", "ibc", "ibc-proto", "itertools 0.10.0", "k256", - "prost 0.7.0", + "prost", "prost-types", "retry", - "rust-crypto", + "ripemd160", "serde", "serde_cbor", "serde_derive", "serde_json", "serial_test", + "sha2", "sled", "subtle-encoding", "tendermint", @@ -1194,6 +1062,7 @@ dependencies = [ "tendermint-rpc", "tendermint-testgen", "thiserror", + "tiny-bip39", "tokio", "toml", "tonic", @@ -1210,12 +1079,12 @@ dependencies = [ "dirs-next", "futures", "gumdrop 0.7.0", - "hex 0.4.2", + "hex", "ibc", "ibc-proto", "ibc-relayer", "once_cell", - "prost 0.7.0", + "prost", "prost-types", "serde", "serde_derive", @@ -1233,21 +1102,6 @@ dependencies = [ "tracing-subscriber 0.2.16", ] -[[package]] -name = "ics23" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d020eb9116abc920452cb63aec8ff662483bf2b75199680046057389b1128988" -dependencies = [ - "bytes 0.5.6", - "failure", - "hex 0.4.2", - "prost 0.6.1", - "ripemd160", - "sha2 0.8.2", - "sha3", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -1271,7 +1125,7 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" dependencies = [ - "autocfg 1.0.1", + "autocfg", "hashbrown", ] @@ -1281,7 +1135,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" dependencies = [ - "bytes 1.0.1", + "bytes", ] [[package]] @@ -1293,15 +1147,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.9.0" @@ -1335,15 +1180,9 @@ dependencies = [ "cfg-if 1.0.0", "ecdsa", "elliptic-curve", - "sha2 0.9.3", + "sha2", ] -[[package]] -name = "keccak" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" - [[package]] name = "lazy_static" version = "1.4.0" @@ -1352,9 +1191,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" +checksum = "265d751d31d6780a3f956bb5b8022feba2d94eeee5a84ba64f4212eedca42213" [[package]] name = "lock_api" @@ -1407,7 +1246,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" dependencies = [ - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -1417,7 +1256,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -1469,7 +1308,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-traits", ] @@ -1479,7 +1318,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -1500,15 +1339,12 @@ checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" [[package]] name = "once_cell" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10acf907b94fc1b1a152d08ef97e7759650268cf986bf127f387e602b02c7e5a" - -[[package]] -name = "opaque-debug" -version = "0.2.3" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "ea78b9742c52ac729753c1590e9adc5248ea9bdaf974597efd46c74cfaa5fb54" +dependencies = [ + "parking_lot", +] [[package]] name = "opaque-debug" @@ -1550,6 +1386,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + [[package]] name = "percent-encoding" version = "2.1.0" @@ -1624,37 +1469,14 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "prost" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" -dependencies = [ - "bytes 0.5.6", - "prost-derive 0.6.1", -] - [[package]] name = "prost" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" dependencies = [ - "bytes 1.0.1", - "prost-derive 0.7.0", -] - -[[package]] -name = "prost-derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" -dependencies = [ - "anyhow", - "itertools 0.8.2", - "proc-macro2", - "quote", - "syn", + "bytes", + "prost-derive", ] [[package]] @@ -1676,8 +1498,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" dependencies = [ - "bytes 1.0.1", - "prost 0.7.0", + "bytes", + "prost", ] [[package]] @@ -1695,48 +1517,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64de9a0c5361e034f1aefc9f71a86871ec870e766fe31a009734a989b329286a" -[[package]] -name = "rand" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" -dependencies = [ - "libc", - "rand 0.4.6", -] - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", -] - [[package]] name = "rand" version = "0.7.3" @@ -1762,16 +1542,6 @@ dependencies = [ "rand_hc 0.3.0", ] -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -1792,21 +1562,6 @@ dependencies = [ "rand_core 0.6.2", ] -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" @@ -1825,15 +1580,6 @@ dependencies = [ "getrandom 0.2.2", ] -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -1852,68 +1598,6 @@ dependencies = [ "rand_core 0.6.2", ] -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.2.5" @@ -1981,26 +1665,13 @@ dependencies = [ [[package]] name = "ripemd160" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "opaque-debug 0.2.3", -] - -[[package]] -name = "rust-crypto" -version = "0.2.36" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" +checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" dependencies = [ - "gcc", - "libc", - "rand 0.3.23", - "rustc-serialize", - "time", + "block-buffer", + "digest", + "opaque-debug", ] [[package]] @@ -2010,10 +1681,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] -name = "rustc-serialize" -version = "0.3.24" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "ryu" @@ -2036,16 +1707,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "secp256k1" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d311229f403d64002e9eed9964dfa5a0a0c1ac443344f7546bf48e916c6053a" -dependencies = [ - "cc", - "rand 0.6.5", -] - [[package]] name = "secp256k1" version = "0.20.1" @@ -2179,23 +1840,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" dependencies = [ - "block-buffer 0.9.0", + "block-buffer", "cfg-if 1.0.0", "cpuid-bool", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "digest", + "opaque-debug", ] [[package]] @@ -2204,24 +1853,11 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ - "block-buffer 0.9.0", + "block-buffer", "cfg-if 1.0.0", "cpuid-bool", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha3" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" -dependencies = [ - "block-buffer 0.7.3", - "byte-tools", - "digest 0.8.1", - "keccak", - "opaque-debug 0.2.3", + "digest", + "opaque-debug", ] [[package]] @@ -2258,7 +1894,7 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29f060a7d147e33490ec10da418795238fd7545bba241504d6b31a409f2e6210" dependencies = [ - "digest 0.9.0", + "digest", "rand_core 0.5.1", ] @@ -2394,20 +2030,20 @@ checksum = "b1d8c80447d80ba50fe72c5fb424bdd139c58e71a445ab64a906b8fcd2c27799" dependencies = [ "anomaly", "async-trait", - "bytes 1.0.1", + "bytes", "chrono", "ed25519", "ed25519-dalek", "futures", "num-traits", "once_cell", - "prost 0.7.0", + "prost", "prost-types", "serde", "serde_bytes", "serde_json", "serde_repr", - "sha2 0.9.3", + "sha2", "signature", "subtle", "subtle-encoding", @@ -2446,11 +2082,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32afe47d9e66ac1ed94adaf389fd3ad42a06782508d0e7b2a8053738d45c2f2a" dependencies = [ "anomaly", - "bytes 1.0.1", + "bytes", "chrono", "num-derive", "num-traits", - "prost 0.7.0", + "prost", "prost-types", "serde", "serde_bytes", @@ -2466,7 +2102,7 @@ checksum = "f722a9797e443cb3886a80535b3654bfbd7a961cbcc5510fc7247a5df6a0ef1c" dependencies = [ "async-trait", "async-tungstenite", - "bytes 1.0.1", + "bytes", "chrono", "futures", "getrandom 0.1.16", @@ -2549,6 +2185,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "tiny-bip39" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2", + "thiserror", + "unicode-normalization", + "zeroize", +] + [[package]] name = "tinyvec" version = "1.1.1" @@ -2570,8 +2224,8 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a" dependencies = [ - "autocfg 1.0.1", - "bytes 1.0.1", + "autocfg", + "bytes", "libc", "memchr", "mio", @@ -2612,7 +2266,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebb7cb2f00c5ae8df755b252306272cd1790d39728363936e01827e11f0b017b" dependencies = [ - "bytes 1.0.1", + "bytes", "futures-core", "futures-sink", "log", @@ -2638,7 +2292,7 @@ dependencies = [ "async-stream", "async-trait", "base64", - "bytes 1.0.1", + "bytes", "futures-core", "futures-util", "h2", @@ -2647,8 +2301,8 @@ dependencies = [ "hyper", "percent-encoding", "pin-project", - "prost 0.7.0", - "prost-derive 0.7.0", + "prost", + "prost-derive", "tokio", "tokio-stream", "tokio-util", @@ -2660,9 +2314,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713c629c07a3a97f741c140e474e7304294fabec66a43a33f0832e98315ab07f" +checksum = "f715efe02c0862926eb463e49368d38ddb119383475686178e32e26d15d06a66" dependencies = [ "futures-core", "futures-util", @@ -2807,7 +2461,7 @@ checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" dependencies = [ "base64", "byteorder", - "bytes 1.0.1", + "bytes", "http", "httparse", "input_buffer", diff --git a/modules/Cargo.toml b/modules/Cargo.toml index 9fcda623bd..864dcb2837 100644 --- a/modules/Cargo.toml +++ b/modules/Cargo.toml @@ -23,7 +23,6 @@ mocks = [ "tendermint-testgen" ] [dependencies] # Proto definitions for all IBC-related interfaces, e.g., connections or channels. ibc-proto = { version = "0.7.1", path = "../proto" } -ics23 = "0.6.0" anomaly = "0.2.0" chrono = "0.4" thiserror = "1.0.24" diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index 5ae5927597..107b398c53 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -43,9 +43,10 @@ crossbeam-channel = "0.5.0" k256 = { version = "0.7.1", features = ["ecdsa-core", "ecdsa", "sha256"]} hex = "0.4" bitcoin = { version = "=0.26" } -bitcoin-wallet = "1.1.0" +tiny-bip39 = "0.8.0" hdpath = { version = "0.6.0", features = ["with-bitcoin"] } -rust-crypto = "0.2.36" +sha2 = "0.9.3" +ripemd160 = "0.9.1" bech32 = "0.8.0" itertools = "0.10.0" dyn-clonable = "0.9.0" diff --git a/relayer/src/auth/tx.rs b/relayer/src/auth/tx.rs deleted file mode 100644 index 49818c73c7..0000000000 --- a/relayer/src/auth/tx.rs +++ /dev/null @@ -1,130 +0,0 @@ -// use ibc_proto::tx::v1beta1::{Tx, TxBody, AuthInfo, SignDoc}; -// use ibc::tx_msg::Msg; -//use crate::error::Error; -// use ibc_proto::tx::v1beta1::mode_info::{Single, Sum}; -// use ibc_proto::tx::v1beta1::{AuthInfo, ModeInfo, SignDoc, SignerInfo, Tx, TxBody}; -// use ibc::tx_msg::Msg; -// use ibc_proto::base::crypto::v1beta1::public_key::Sum as PK_Sum; -// use ibc_proto::base::crypto::v1beta1::PublicKey; -// use tendermint::{account::Id, chain::Id as ChainId, net::Address}; -// use hex; -// use std::str::FromStr; -// Signer -// use k256::{ -// ecdsa::{signature::Signer, signature::Verifier, Signature, SigningKey, VerifyKey}, -// EncodedPoint, SecretKey, -// }; - -// pub struct TxWrapper { -// tx: Tx, -// body: Vec, -// auth_info: Vec, -// } - -// pub struct TxBuilder { -// -// } - -//impl TxBuilder { -// pub fn build_tx>(msg: Vec>, memo: String) -> Result { - -// Create TxBody -// let body = TxBody { -// messages: proto_msgs, -// memo: "".to_string(), -// timeout_height: 0, -// extension_options: Vec::::new(), -// non_critical_extension_options: Vec::::new(), -// }; -// -// // A protobuf serialization of a TxBody -// let mut body_buf = Vec::new(); -// prost::Message::encode(&body, &mut body_buf).unwrap(); - -// TODO: move this logic to tx builder -// let sum = Some(PK_Sum::Secp256k1(pubkey_bytes)); -// -// let pk = Some(PublicKey { sum }); -// -// let single = Single { mode: 1 }; -// let sum_single = Some(Sum::Single(single)); -// let mode = Some(ModeInfo { sum: sum_single }); -// -// let signer_info = SignerInfo { -// public_key: pk, -// mode_info: mode, -// sequence: 0, -// }; -// -// let auth_info = AuthInfo { -// signer_infos: vec![signer_info], -// fee: None, -// }; -// -// // A protobuf serialization of a AuthInfo -// let mut auth_buf = Vec::new(); -// prost::Message::encode(&auth_info, &mut auth_buf).unwrap(); -// -// let sign_doc = SignDoc { -// body_bytes: body_buf.clone(), -// auth_info_bytes: auth_buf.clone(), -// chain_id: chain_config.clone().id.to_string(), -// account_number: account_number, -// }; -// -// // A protobuf serialization of a AuthInfo -// let mut signdoc_buf = Vec::new(); -// prost::Message::encode(&sign_doc, &mut signdoc_buf).unwrap(); -// -// let signature: Signature = signing_key.sign(&signdoc_buf); -// -// status_info!("Signed Tx", "{:?}", signed_doc); -// -// let tx_raw = TxRaw { -// body_bytes, -// auth_info_bytes: auth_bytes, -// signatures: vec![signature.as_ref().to_vec()], -// }; -// -// let mut txraw_buf = Vec::new(); -// prost::Message::encode(&tx_raw, &mut txraw_buf).unwrap(); -// println!("{:?}", txraw_buf); -// } - -// pub fn get_sign_doc(body: TxBody, auth: AuthInfo) -> Result { -// // A protobuf serialization of a TxBody -// let mut body_buf = Vec::new(); -// prost::Message::encode(&body, &mut body_buf).unwrap(); -// -// // A protobuf serialization of a AuthInfo -// let mut auth_buf = Vec::new(); -// prost::Message::encode(&auth_info, &mut auth_buf).unwrap(); -// -// let sign_doc = SignDoc { -// body_bytes: body_buf.clone(), -// auth_info_bytes: auth_buf.clone(), -// chain_id: chain_config.clone().id.to_string(), -// account_number: account_number, -// }; -// -// Ok(signdoc) -// } - -// convenience function to get address from private key - -// fn get_account(pk: Vec) -> Vec { -// use crypto::digest::Digest; -// use crypto::ripemd160::Ripemd160; -// use crypto::sha2::Sha256; -// let mut seed = Sha256::new(); -// seed.input(pk.as_slice()); -// let mut bytes = vec![0; seed.output_bytes()]; -// seed.result(&mut bytes); -// -// let mut hash = Ripemd160::new(); -// hash.input(bytes.as_slice()); -// let mut acct = vec![0; hash.output_bytes()]; -// hash.result(&mut acct); -// acct.to_vec() -// } -//} diff --git a/relayer/src/keyring/store.rs b/relayer/src/keyring/store.rs index 2b6e6a1cb5..9083b962cd 100644 --- a/relayer/src/keyring/store.rs +++ b/relayer/src/keyring/store.rs @@ -6,15 +6,17 @@ use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use bech32::{ToBase32, Variant}; +use bip39::{Language, Mnemonic, Seed}; use bitcoin::{ network::constants::Network, secp256k1::Secp256k1, util::bip32::{DerivationPath, ExtendedPrivKey, ExtendedPubKey}, }; -use bitcoin_wallet::mnemonic::Mnemonic; use hdpath::StandardHDPath; use k256::ecdsa::{signature::Signer, Signature, SigningKey}; +use ripemd160::Ripemd160; use serde_json::Value; +use sha2::{Digest, Sha256}; use tendermint::account::Id as AccountId; use crate::config::ChainConfig; @@ -128,14 +130,13 @@ impl KeyRingOperations for KeyRing { /// Add a key entry in the store using a mnemonic. fn key_from_mnemonic(&self, mnemonic_words: &str) -> Result { - // Generate seed from mnemonic - let mnemonic = - Mnemonic::from_str(mnemonic_words).map_err(|e| Kind::InvalidMnemonic.context(e))?; - let seed = mnemonic.to_seed(Some("")); + let mnemonic = Mnemonic::from_phrase(mnemonic_words, Language::English) + .map_err(|e| Kind::InvalidMnemonic.context(e))?; + let seed = Seed::new(&mnemonic, ""); // Get Private Key from seed and standard derivation path let hd_path = StandardHDPath::try_from("m/44'/118'/0'/0/0").unwrap(); - let private_key = ExtendedPrivKey::new_master(Network::Bitcoin, &seed.0) + let private_key = ExtendedPrivKey::new_master(Network::Bitcoin, seed.as_bytes()) .and_then(|k| k.derive_priv(&Secp256k1::new(), &DerivationPath::from(hd_path))) .map_err(|e| Kind::PrivateKey.context(e))?; @@ -270,19 +271,18 @@ impl KeyRingOperations for KeyRing { /// Return an address from a Public Key fn get_address(pk: ExtendedPubKey) -> Vec { - use crypto::digest::Digest; - use crypto::ripemd160::Ripemd160; - use crypto::sha2::Sha256; - - let mut sha256 = Sha256::new(); - sha256.input(pk.public_key.to_bytes().as_slice()); - let mut bytes = vec![0; sha256.output_bytes()]; - sha256.result(&mut bytes); - let mut hash = Ripemd160::new(); - hash.input(bytes.as_slice()); - let mut acct = vec![0; hash.output_bytes()]; - hash.result(&mut acct); - acct.to_vec() + let mut hasher = Sha256::new(); + hasher.update(pk.public_key.to_bytes().as_slice()); + + // Read hash digest over the public key bytes & consume hasher + let pk_hash = hasher.finalize(); + + // Plug the hash result into the next crypto hash function. + let mut rip_hasher = Ripemd160::new(); + rip_hasher.update(pk_hash); + let rip_result = rip_hasher.finalize(); + + rip_result.to_vec() } fn get_test_backend_folder(chain_config: &ChainConfig) -> Result {