public Identity(Mnemonic mnemonic, int index = 0) { Index = index; // This means we'll keep the recovery phrase in-memory for the lifetime of the process. This is needed for identity and // hub communication, but we should in the future only derive the extkey from the purpose (302) of identity, and then we should // use the extpubkey to derive wallet addresses (purpose 44). If we want to trust users to use the same recovery phrase for // both wallets and hub/identity, we must ensure that the private keys for the wallet is as secure as possible. this.mnemonic = mnemonic; masterNode = mnemonic.DeriveExtKey(); identity = masterNode.Derive(new KeyPath("m/302'")).Derive(index, true); ProfileNetwork network = new ProfileNetwork(); BitcoinAddress address = identity.ScriptPubKey.GetDestinationAddress(network); //this.identity = masterNode.Derive(new KeyPath("m/302'/0'")); // The default for keys is to be compressed, making it 33 bytes as oppose to 65. //identityPubKey = identity.GetPublicKey(); // FingerPrint = identityPubKey.GetHDFingerPrint(); // TODO: FIX THIS, API CHANGES! Id = address.ToString(); }
public ProfileController(ProfileNetwork profile) { Debug.WriteLine("[ProfileController]: MpOS Profile SubSystem started!"); profileDao = new ProfileNetworkDao(); this.profileNetwork = profile; }
public void NetworkAnalysis(ServerContent server, ProfileNetwork profile) { if (server == null) { throw new NetworkException("The remote service isn't ready for profile network"); } if (profile == ProfileNetwork.LIGHT) { taskNetwork = new ProfileNetworkLight(server); } else if (profile == ProfileNetwork.DEFAULT) { taskNetwork = new ProfileNetworkDefault(server); } else if (profile == ProfileNetwork.FULL) { taskNetwork = new ProfileNetworkFull(server); } EventIntercept(); taskNetwork.Execute(); }