Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/database/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl Database {
)
})?;

// Parse address - Platform addresses (DIP-17/18) use Bech32m encoding with dashevo/tdashevo prefix
// Parse address - Platform addresses (DIP-17/18) use Bech32m encoding with evo/tevo prefix
// and need special handling when stored (we store as Core address format internally)
let address = if path_reference == DerivationPathReference::PlatformPayment {
// Platform addresses are stored as Core P2PKH format for efficient internal lookup.
Expand Down
4 changes: 2 additions & 2 deletions src/model/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ impl Wallet {
Ok(())
}

/// Bootstrap DIP-17 Platform payment addresses (dashevo/tdashevo Bech32m prefix per DIP-18)
/// Bootstrap DIP-17 Platform payment addresses (evo/tevo Bech32m prefix)
/// These addresses are for receiving Dash Credits on Platform, independent of identities.
fn bootstrap_platform_payment_addresses(
&mut self,
Expand Down Expand Up @@ -2006,7 +2006,7 @@ impl Signer<PlatformAddress> for Wallet {
// The Signer trait doesn't pass network info, so we try each network.
// This is safe because:
// 1. A wallet instance only stores keys for ONE network (set at creation)
// 2. Platform addresses encode their network in the bech32m prefix (dashevo/tdashevo)
// 2. Platform addresses encode their network in the bech32m prefix (evo/tevo)
// 3. get_platform_address_private_key will only succeed for the correct network
// 4. Only one network's derivation will match the wallet's seed
let private_key = self
Expand Down
4 changes: 2 additions & 2 deletions src/ui/identities/transfer_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ impl TransferScreen {

let input = self.platform_address_input.trim();

// Try to parse as Bech32m Platform address first (DIP-18 format: dashevo1.../tdashevo1...)
if input.starts_with("dashevo1") || input.starts_with("tdashevo1") {
// Try to parse as Bech32m Platform address first (evo1.../tevo1...)
if input.starts_with("evo1") || input.starts_with("tevo1") {
let (addr, _network) = PlatformAddress::from_bech32m_string(input)
.map_err(|e| format!("Invalid Bech32m address: {}", e))?;
return Ok(addr);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/tools/address_balance_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ impl AddressBalanceScreen {
ui.heading("Platform Address Balance Lookup");
ui.add_space(10.0);

ui.label("Enter a Platform address (dashevo1... or tdashevo1...):");
ui.label("Enter a Platform address (evo1... or tevo1...):");
ui.add_space(5.0);

let text_edit = TextEdit::singleline(&mut self.address_input)
.hint_text("dashevo1... or tdashevo1...")
.hint_text("evo1... or tevo1...")
.desired_width(500.0);

let response = ui.add(text_edit);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/wallets/account_summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum AccountCategory {
ProviderOwner,
ProviderOperator,
ProviderPlatform,
/// DIP-17: Platform Payment Addresses (dashevo/tdashevo Bech32m prefix per DIP-18)
/// DIP-17: Platform Payment Addresses (evo/tevo Bech32m prefix per DIP-18)
PlatformPayment,
Other(DerivationPathReference),
}
Expand Down Expand Up @@ -124,7 +124,7 @@ impl AccountCategory {
Some("Platform service key branch used by masternode platform nodes.")
}
AccountCategory::PlatformPayment => Some(
"DIP-17 Platform payment addresses (dashevo/tdashevo prefix). Hold Dash Credits on Platform, independent of identities.",
"DIP-17 Platform payment addresses (evo/tevo prefix). Hold Dash Credits on Platform, independent of identities.",
),
AccountCategory::Other(_) => None,
}
Expand Down
10 changes: 5 additions & 5 deletions src/ui/wallets/send_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl WalletSendScreen {
}

// Check for Platform address (Bech32m format)
if trimmed.starts_with("dashevo1") || trimmed.starts_with("tdashevo1") {
if trimmed.starts_with("evo1") || trimmed.starts_with("tevo1") {
return AddressType::Platform;
}

Expand Down Expand Up @@ -363,7 +363,7 @@ impl WalletSendScreen {
let dest_type = self.detect_address_type(&self.destination_address);
if dest_type == AddressType::Unknown {
return Err(
"Invalid destination address. Use a Dash address (X.../y...) or Platform address (dashevo1.../tdashevo1...)"
"Invalid destination address. Use a Dash address (X.../y...) or Platform address (evo1.../tevo1...)"
.to_string(),
);
}
Expand Down Expand Up @@ -853,7 +853,7 @@ impl WalletSendScreen {
.show(ui, |ui| {
ui.add(
egui::TextEdit::singleline(&mut self.destination_address)
.hint_text("Enter address (X.../y.../dashevo1.../tdashevo1...)")
.hint_text("Enter address (X.../y.../evo1.../tevo1...)")
.desired_width(f32::INFINITY),
);
});
Expand Down Expand Up @@ -1479,7 +1479,7 @@ impl WalletSendScreen {
ui.label("To:");
ui.add(
egui::TextEdit::singleline(&mut self.advanced_outputs[idx].address)
.hint_text("Enter address (X.../y.../dashevo1.../tdashevo1...)")
.hint_text("Enter address (X.../y.../evo1.../tevo1...)")
.desired_width(350.0),
);

Expand Down Expand Up @@ -1550,7 +1550,7 @@ impl WalletSendScreen {
}

// Check for Platform address (Bech32m format)
if trimmed.starts_with("dashevo1") || trimmed.starts_with("tdashevo1") {
if trimmed.starts_with("evo1") || trimmed.starts_with("tevo1") {
return AddressType::Platform;
}

Expand Down
23 changes: 17 additions & 6 deletions src/ui/wallets/wallets_screen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct AddressData {

impl AddressData {
/// Returns the address formatted for display.
/// Platform Payment addresses are shown in DIP-18 Bech32m format (e.g., tdashevo...).
/// Platform Payment addresses are shown in DIP-18 Bech32m format (e.g., tevo1...).
fn display_address(&self, network: Network) -> String {
if self.account_category == AccountCategory::PlatformPayment {
use dash_sdk::dpp::address_funds::PlatformAddress;
Expand Down Expand Up @@ -2287,7 +2287,7 @@ impl WalletsBalancesScreen {
}

/// Generate a new Platform address for the wallet.
/// Returns the address in DIP-18 Bech32m format (e.g., tdashevo1... for testnet)
/// Returns the address in Bech32m format (e.g., tevo1... for testnet)
fn generate_platform_address(&self, wallet: &Arc<RwLock<Wallet>>) -> Result<String, String> {
use dash_sdk::dpp::address_funds::PlatformAddress;
let mut wallet_guard = wallet.write().map_err(|e| e.to_string())?;
Expand Down Expand Up @@ -2697,13 +2697,24 @@ impl WalletsBalancesScreen {
return AppAction::None;
};

// Parse the Platform address (Bech32m format: dashevo1.../tdashevo1...)
// Parse the Platform address (Bech32m format: evo1.../tevo1...)
use dash_sdk::dashcore_rpc::dashcore::address::NetworkUnchecked;
let platform_addr = if selected_addr.starts_with("dashevo1")
|| selected_addr.starts_with("tdashevo1")
let platform_addr = if selected_addr.starts_with("evo1")
|| selected_addr.starts_with("tevo1")
{
match PlatformAddress::from_bech32m_string(selected_addr) {
Ok((addr, _network)) => addr,
Ok((addr, network)) => {
// Validate that address network matches app network
if network != self.app_context.network {
self.fund_platform_dialog.status = Some(format!(
"Address network mismatch: address is for {:?} but app is on {:?}",
network, self.app_context.network
));
self.fund_platform_dialog.status_is_error = true;
return AppAction::None;
}
addr
}
Err(e) => {
self.fund_platform_dialog.status =
Some(format!("Invalid Bech32m address: {}", e));
Expand Down
Loading