Add SECP256k1/ECDSA support for transaction signing (#3861)

* Add SECP256k1/ECDSA support for transaction signing.

* Refactoring and fixes

* Fix for contracts

* Avoid breaking runtime host function

* Build fixes, make subkey work more generaically.

* Fix tests

* Dedpulicate a bit of code, remove unneeded code, docs

* Bump runtime version

* Fix a test and clean up some code.

* Derivation can derive seed.

* Whitespace

* Bump runtime again.

* Update core/primitives/src/crypto.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update core/primitives/src/ecdsa.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Fix AppVerify
This commit is contained in:
Gavin Wood
2019-10-24 10:59:09 +02:00
committed by GitHub
parent 62a238a81b
commit d97775542a
30 changed files with 1286 additions and 419 deletions
@@ -22,7 +22,7 @@ use structopt::StructOpt;
use keystore::{Store as Keystore};
use node_cli::chain_spec::{self, AccountId};
use primitives::{crypto::{Public, Ss58Codec}, traits::BareCryptoStore};
use primitives::{sr25519, crypto::{Public, Ss58Codec}, traits::BareCryptoStore};
/// A utility to easily create a testnet chain spec definition with a given set
/// of authorities and endowed accounts and/or generate random accounts.
@@ -237,11 +237,11 @@ fn main() -> Result<(), String> {
}
let endowed_accounts = endowed_seeds.iter().map(|seed| {
chain_spec::get_from_seed::<AccountId>(seed)
chain_spec::get_account_id_from_seed::<sr25519::Public>(seed)
.to_ss58check()
}).collect();
let sudo_account = chain_spec::get_from_seed::<AccountId>(&sudo_seed)
let sudo_account = chain_spec::get_account_id_from_seed::<sr25519::Public>(&sudo_seed)
.to_ss58check();
(authority_seeds, endowed_accounts, sudo_account)