diff --git a/runtime/chainx/src/lib.rs b/runtime/chainx/src/lib.rs index f6449c027..321363453 100644 --- a/runtime/chainx/src/lib.rs +++ b/runtime/chainx/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("chainx"), impl_name: create_runtime_str!("chainx-net"), authoring_version: 1, - spec_version: 14, + spec_version: 15, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 4, diff --git a/runtime/dev/src/lib.rs b/runtime/dev/src/lib.rs index dbc9717d8..dc29fca66 100644 --- a/runtime/dev/src/lib.rs +++ b/runtime/dev/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("chainx"), impl_name: create_runtime_str!("chainx-dev"), authoring_version: 1, - spec_version: 14, + spec_version: 15, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 4, diff --git a/runtime/malan/src/lib.rs b/runtime/malan/src/lib.rs index 1c3a8e97d..9244ec557 100644 --- a/runtime/malan/src/lib.rs +++ b/runtime/malan/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("chainx"), impl_name: create_runtime_str!("chainx-malan"), authoring_version: 1, - spec_version: 14, + spec_version: 15, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 4, diff --git a/xpallets/gateway/Trustee.md b/xpallets/gateway/Trustee.md index 4264c76b4..1111ae08e 100644 --- a/xpallets/gateway/Trustee.md +++ b/xpallets/gateway/Trustee.md @@ -28,7 +28,7 @@ To become a trust, you must first be elected as a council member or runners up. - hot_entity: Btc public key. Such as `0x043858204f15d385da76fcbdf019debde624689e296c5ac53f6437491528857617691fe85c5c529b692bd75e361a9d0995dbd3e20a81e949642dfb74095520d981`. - cold_entity: Btc public key. Such as `0x043858204f15d385da76fcbdf019debde624689e296c5ac53f6437491528857617691fe85c5c529b692bd75e361a9d0995dbd3e20a81e949642dfb74095520d981`. -The hot public key is obtained through **Coming** and used in **Coming**, and the cold public key is obtained through the hardware wallet and used in the [hardware wallet script](https://github.com/chainx-org/trustee-cli-ts/tree/upgrade-taproot). +The hot public key is obtained through **Coming** and used in **Coming**, and the cold addresses are also obtained through Coming but with a different mnemonic. # Reward distribution diff --git a/xpallets/gateway/TrusteeAdmin.md b/xpallets/gateway/TrusteeAdmin.md index 256585953..b905ee502 100644 --- a/xpallets/gateway/TrusteeAdmin.md +++ b/xpallets/gateway/TrusteeAdmin.md @@ -10,8 +10,6 @@ Call through the council to vote for the election. The voting threshold needs to ##### 1. Trustee administrator is required to create hot multi-signature addresses in the ComingChat trustee group in time for the election, and teach other trustees to obtain and use the hardware wallet signature script. -Trustee Cold Wallet Signature Script Repository: https://github.com/chainx-org/trustee-cli-ts/tree/upgrade-taproot - ##### 2. Trustee administrator needs to identify problematic trustees in a timely manner and move them into a small black house for transition. Call to move to the little black house diff --git a/xpallets/gateway/bitcoin/src/trustee.rs b/xpallets/gateway/bitcoin/src/trustee.rs index dd73eb21f..91c8c84c5 100644 --- a/xpallets/gateway/bitcoin/src/trustee.rs +++ b/xpallets/gateway/bitcoin/src/trustee.rs @@ -222,6 +222,20 @@ impl TrusteeForChain::InvalidAddress)?; + // Set cold address for taproot threshold address + let cold_pks = cold_keys + .into_iter() + .map(|k| k.try_into().map_err(|_| Error::::InvalidPublicKey)) + .collect::, Error>>()?; + + let cold_mast = Mast::new(cold_pks, sig_num).map_err(|_| Error::::InvalidAddress)?; + + let cold_threshold_addr: Address = cold_mast + .generate_address(&Pallet::::network_id().to_string()) + .map_err(|_| Error::::InvalidAddress)? + .parse() + .map_err(|_| Error::::InvalidAddress)?; + // Aggregate public key script and corresponding personal public key index let mut agg_pubkeys: Vec> = vec![]; let mut personal_accounts: Vec> = vec![]; @@ -243,15 +257,10 @@ impl TrusteeForChain(&cold_keys, sig_num).ok_or_else(|| { - log!( - error, - "[generate_trustee_session_info] Create cold_addr error, cold_keys:{:?}", - cold_keys - ); - Error::::GenerateMultisigFailed - })?; + let cold_trustee_addr_info: BtcTrusteeAddrInfo = BtcTrusteeAddrInfo { + addr: cold_threshold_addr.to_string().into_bytes(), + redeem_script: vec![], + }; log!( info, @@ -378,6 +387,7 @@ pub fn get_sig_num() -> (u32, u32) { (two_thirds_unsafe(trustee_num), trustee_num) } +#[allow(dead_code)] pub(crate) fn create_multi_address( pubkeys: &[Public], sig_num: u32,