diff --git a/browser/net/decentralized_dns_network_delegate_helper_unittest.cc b/browser/net/decentralized_dns_network_delegate_helper_unittest.cc index 20dd1f27de5..96142749c49 100644 --- a/browser/net/decentralized_dns_network_delegate_helper_unittest.cc +++ b/browser/net/decentralized_dns_network_delegate_helper_unittest.cc @@ -212,14 +212,21 @@ TYPED_TEST(DecentralizedDnsNetworkDelegateHelperTest, const char* url; bool is_valid; } test_cases[] = { - {"https://brave.888", false}, + {"https://brave.888", false}, // + {"https://brave.agent", true}, + {"https://brave.ai4", true}, {"https://brave.altimist", true}, + {"https://brave.amped", true}, {"https://brave.anime", true}, + {"https://brave.anyone", true}, + {"https://brave.arculus", true}, {"https://brave.ask", true}, + {"https://brave.ath", true}, {"https://brave.austin", true}, {"https://brave.bald", true}, {"https://brave.basenji", true}, {"https://brave.bay", true}, + {"https://brave.bch", true}, {"https://brave.benji", true}, {"https://brave.binanceus", true}, {"https://brave.bitcoin", true}, @@ -228,65 +235,99 @@ TYPED_TEST(DecentralizedDnsNetworkDelegateHelperTest, {"https://brave.blockchain", true}, {"https://brave.boomer", true}, {"https://brave.brave", true}, + {"https://brave.bunni", true}, {"https://brave.calicoin", true}, + {"https://brave.carbon", true}, {"https://brave.caw", true}, + {"https://brave.cgai", true}, + {"https://brave.chip", true}, {"https://brave.chomp", true}, {"https://brave.clay", true}, {"https://brave.coin", false}, + {"https://brave.collect", true}, {"https://brave.crypto", true}, {"https://brave.dao", true}, + {"https://brave.dejay", true}, + {"https://brave.depin", true}, + {"https://brave.derad", true}, {"https://brave.dfz", true}, + {"https://brave.digibyte", true}, {"https://brave.doga", true}, {"https://brave.donut", true}, {"https://brave.dream", true}, + {"https://brave.dsci", true}, {"https://brave.emir", true}, {"https://brave.ethermail", true}, {"https://brave.farms", true}, + {"https://brave.goblin", true}, + {"https://brave.gotchi", true}, {"https://brave.grow", true}, {"https://brave.her", true}, + {"https://brave.hub", true}, + {"https://brave.imtoken", true}, {"https://brave.kingdom", true}, {"https://brave.klever", true}, {"https://brave.kresus", true}, {"https://brave.kryptic", true}, + {"https://brave.learn", true}, {"https://brave.lfg", true}, {"https://brave.ltc", true}, + {"https://brave.lunar", true}, {"https://brave.manga", true}, + {"https://brave.marketer", true}, {"https://brave.metropolis", true}, {"https://brave.miku", true}, {"https://brave.ministry", true}, + {"https://brave.mobix", true}, {"https://brave.moon", true}, + {"https://brave.mooncat", true}, {"https://brave.mumu", true}, + {"https://brave.mycircle", true}, {"https://brave.nft", true}, {"https://brave.nibi", true}, {"https://brave.npc", true}, + {"https://brave.ohm", true}, {"https://brave.onchain", true}, + {"https://brave.pack", true}, {"https://brave.pastor", true}, + {"https://brave.pbdx", true}, + {"https://brave.pendle", true}, + {"https://brave.pilot", true}, {"https://brave.podcast", true}, {"https://brave.pog", true}, + {"https://brave.pokt", true}, {"https://brave.polygon", true}, + {"https://brave.presearch", true}, {"https://brave.privacy", true}, {"https://brave.propykeys", true}, {"https://brave.pudgy", true}, + {"https://brave.pundi", true}, {"https://brave.quantum", true}, {"https://brave.rad", true}, {"https://brave.raiin", true}, {"https://brave.secret", true}, {"https://brave.smobler", true}, {"https://brave.south", true}, + {"https://brave.spend", true}, {"https://brave.stepn", true}, + {"https://brave.supernova", true}, {"https://brave.tball", true}, {"https://brave.tea", true}, {"https://brave.tribe", true}, + {"https://brave.twin", true}, {"https://brave.u", true}, {"https://brave.ubu", true}, {"https://brave.unstoppable", true}, {"https://brave.wallet", true}, + {"https://brave.web3", true}, {"https://brave.wifi", true}, {"https://brave.witg", true}, {"https://brave.wrkx", true}, {"https://brave.x", true}, {"https://brave.xec", true}, {"https://brave.xmr", true}, + {"https://brave.xyo", true}, + {"https://brave.zano", true}, {"https://brave.zil", true}, {"https://brave", false}, {"https://brave.com", false}, diff --git a/components/brave_wallet/browser/json_rpc_service.cc b/components/brave_wallet/browser/json_rpc_service.cc index 7365ca84310..662e2f9f265 100644 --- a/components/brave_wallet/browser/json_rpc_service.cc +++ b/components/brave_wallet/browser/json_rpc_service.cc @@ -142,13 +142,19 @@ constexpr char kSnsDomainPattern[] = R"(^(?:[a-z0-9-]+\.)+sol$)"; // Then one of fixed suffixes(should match `supportedUDExtensions` array from // domain-extensions.ts). constexpr char kUDPattern[] = - "(?:[a-z0-9-]+)\\.(?:altimist|anime|ask|austin|bald|basenji|bay|benji|" - "binanceus|bitcoin|bitget|bitscrunch|blockchain|boomer|brave|calicoin|caw|" - "chomp|clay|crypto|dao|dfz|doga|donut|dream|emir|ethermail|farms|grow|her|" - "kingdom|klever|kresus|kryptic|lfg|ltc|manga|metropolis|miku|ministry|moon|" - "mumu|nft|nibi|npc|onchain|pastor|podcast|pog|polygon|privacy|propykeys|" - "pudgy|quantum|rad|raiin|secret|smobler|south|stepn|tball|tea|tribe|u|ubu|" - "unstoppable|wallet|wifi|witg|wrkx|x|xec|xmr|zil)"; + "(?:[a-z0-9-]+)\\.(?:agent|ai4|altimist|amped|anime|anyone|arculus|ask|ath|" + "austin|bald|basenji|bay|bch|benji|binanceus|bitcoin|bitget|bitscrunch|" + "blockchain|boomer|brave|bunni|calicoin|carbon|caw|cgai|chip|chomp|clay|" + "collect|crypto|dao|dejay|depin|derad|dfz|digibyte|doga|donut|dream|dsci|" + "emir|ethermail|farms|goblin|gotchi|grow|her|hub|imtoken|kingdom|klever|" + "kresus|kryptic|learn|lfg|ltc|lunar|manga|marketer|metropolis|miku|" + "ministry|" + "mobix|moon|mooncat|mumu|mycircle|nft|nibi|npc|ohm|onchain|pack|pastor|" + "pbdx|pendle|pilot|podcast|pog|pokt|polygon|presearch|privacy|propykeys|" + "pudgy|pundi|quantum|rad|raiin|secret|smobler|south|spend|stepn|supernova|" + "tball|" + "tea|tribe|twin|u|ubu|unstoppable|wallet|web3|wifi|witg|wrkx|x|xec|xmr|xyo|" + "zano|zil)"; constexpr auto kUnstoppableDomainsProxyReaderContractAddresses = base::MakeFixedFlatMap( diff --git a/components/brave_wallet/browser/json_rpc_service_unittest.cc b/components/brave_wallet/browser/json_rpc_service_unittest.cc index f3e86fc52e2..a778cc31745 100644 --- a/components/brave_wallet/browser/json_rpc_service_unittest.cc +++ b/components/brave_wallet/browser/json_rpc_service_unittest.cc @@ -4032,13 +4032,20 @@ TEST_F(JsonRpcServiceUnitTest, IsValidUnstoppableDomain) { "test.blockchain", "test.bitcoin", "test.brave", + "brave.agent", + "brave.ai4", "brave.altimist", + "brave.amped", "brave.anime", + "brave.anyone", + "brave.arculus", "brave.ask", + "brave.ath", "brave.austin", "brave.bald", "brave.basenji", "brave.bay", + "brave.bch", "brave.benji", "brave.binanceus", "brave.bitcoin", @@ -4047,64 +4054,98 @@ TEST_F(JsonRpcServiceUnitTest, IsValidUnstoppableDomain) { "brave.blockchain", "brave.boomer", "brave.brave", + "brave.bunni", "brave.calicoin", + "brave.carbon", "brave.caw", + "brave.cgai", + "brave.chip", "brave.chomp", "brave.clay", + "brave.collect", "brave.crypto", "brave.dao", + "brave.dejay", + "brave.depin", + "brave.derad", "brave.dfz", + "brave.digibyte", "brave.doga", "brave.donut", "brave.dream", + "brave.dsci", "brave.emir", "brave.ethermail", "brave.farms", + "brave.goblin", + "brave.gotchi", "brave.grow", "brave.her", + "brave.hub", + "brave.imtoken", "brave.kingdom", "brave.klever", "brave.kresus", "brave.kryptic", + "brave.learn", "brave.lfg", "brave.ltc", + "brave.lunar", "brave.manga", + "brave.marketer", "brave.metropolis", "brave.miku", "brave.ministry", + "brave.mobix", "brave.moon", + "brave.mooncat", "brave.mumu", + "brave.mycircle", "brave.nft", "brave.nibi", "brave.npc", + "brave.ohm", "brave.onchain", + "brave.pack", "brave.pastor", + "brave.pbdx", + "brave.pendle", + "brave.pilot", "brave.podcast", "brave.pog", + "brave.pokt", "brave.polygon", + "brave.presearch", "brave.privacy", "brave.propykeys", "brave.pudgy", + "brave.pundi", "brave.quantum", "brave.rad", "brave.raiin", "brave.secret", "brave.smobler", "brave.south", + "brave.spend", "brave.stepn", + "brave.supernova", "brave.tball", "brave.tea", "brave.tribe", + "brave.twin", "brave.u", "brave.ubu", "brave.unstoppable", "brave.wallet", + "brave.web3", "brave.wifi", "brave.witg", "brave.wrkx", "brave.x", "brave.xec", "brave.xmr", + "brave.xyo", + "brave.zano", "brave.zil", "a.crypto", "1.crypto", diff --git a/components/brave_wallet_ui/common/constants/domain-extensions.ts b/components/brave_wallet_ui/common/constants/domain-extensions.ts index 2dcba02d3e8..2b598cae9ec 100644 --- a/components/brave_wallet_ui/common/constants/domain-extensions.ts +++ b/components/brave_wallet_ui/common/constants/domain-extensions.ts @@ -7,13 +7,20 @@ export const supportedENSExtensions = ['.eth'] export const supportedSNSExtensions = ['.sol'] // Should match `kUDPattern` array from json_rpc_service.cc. export const supportedUDExtensions = [ + '.agent', + '.ai4', '.altimist', + '.amped', '.anime', + '.anyone', + '.arculus', '.ask', + '.ath', '.austin', '.bald', '.basenji', '.bay', + '.bch', '.benji', '.binanceus', '.bitcoin', @@ -22,64 +29,98 @@ export const supportedUDExtensions = [ '.blockchain', '.boomer', '.brave', + '.bunni', '.calicoin', + '.carbon', '.caw', + '.cgai', + '.chip', '.chomp', '.clay', + '.collect', '.crypto', '.dao', + '.dejay', + '.depin', + '.derad', '.dfz', + '.digibyte', '.doga', '.donut', '.dream', + '.dsci', '.emir', '.ethermail', '.farms', + '.goblin', + '.gotchi', '.grow', '.her', + '.hub', + '.imtoken', '.kingdom', '.klever', '.kresus', '.kryptic', + '.learn', '.lfg', '.ltc', + '.lunar', '.manga', + '.marketer', '.metropolis', '.miku', '.ministry', + '.mobix', '.moon', + '.mooncat', '.mumu', + '.mycircle', '.nft', '.nibi', '.npc', + '.ohm', '.onchain', + '.pack', '.pastor', + '.pbdx', + '.pendle', + '.pilot', '.podcast', '.pog', + '.pokt', '.polygon', + '.presearch', '.privacy', '.propykeys', '.pudgy', + '.pundi', '.quantum', '.rad', '.raiin', '.secret', '.smobler', '.south', + '.spend', '.stepn', + '.supernova', '.tball', '.tea', '.tribe', + '.twin', '.u', '.ubu', '.unstoppable', '.wallet', + '.web3', '.wifi', '.witg', '.wrkx', '.x', '.xec', '.xmr', + '.xyo', + '.zano', '.zil', ] export const allSupportedExtensions = [ diff --git a/ios/brave-ios/Sources/BraveWallet/WalletConstants.swift b/ios/brave-ios/Sources/BraveWallet/WalletConstants.swift index d526211c8f4..e91cb49f85a 100644 --- a/ios/brave-ios/Sources/BraveWallet/WalletConstants.swift +++ b/ios/brave-ios/Sources/BraveWallet/WalletConstants.swift @@ -157,13 +157,20 @@ public struct WalletConstants { static let supportedSNSExtensions = [".sol"] /// The supported Unstoppable Domain (UD) extensions public static let supportedUDExtensions = [ + ".agent", + ".ai4", ".altimist", + ".amped", ".anime", + ".anyone", + ".arculus", ".ask", + ".ath", ".austin", ".bald", ".basenji", ".bay", + ".bch", ".benji", ".binanceus", ".bitcoin", @@ -172,64 +179,98 @@ public struct WalletConstants { ".blockchain", ".boomer", ".brave", + ".bunni", ".calicoin", + ".carbon", ".caw", + ".cgai", + ".chip", ".chomp", ".clay", + ".collect", ".crypto", ".dao", + ".dejay", + ".depin", + ".derad", ".dfz", + ".digibyte", ".doga", ".donut", ".dream", + ".dsci", ".emir", ".ethermail", ".farms", + ".goblin", + ".gotchi", ".grow", ".her", + ".hub", + ".imtoken", ".kingdom", ".klever", ".kresus", ".kryptic", + ".learn", ".lfg", ".ltc", + ".lunar", ".manga", + ".marketer", ".metropolis", ".miku", ".ministry", + ".mobix", ".moon", + ".mooncat", ".mumu", + ".mycircle", ".nft", ".nibi", ".npc", + ".ohm", ".onchain", + ".pack", ".pastor", + ".pbdx", + ".pendle", + ".pilot", ".podcast", ".pog", + ".pokt", ".polygon", + ".presearch", ".privacy", ".propykeys", ".pudgy", + ".pundi", ".quantum", ".rad", ".raiin", ".secret", ".smobler", ".south", + ".spend", ".stepn", + ".supernova", ".tball", ".tea", ".tribe", + ".twin", ".u", ".ubu", ".unstoppable", ".wallet", + ".web3", ".wifi", ".witg", ".wrkx", ".x", ".xec", ".xmr", + ".xyo", + ".zano", ".zil", ] diff --git a/net/decentralized_dns/constants.cc b/net/decentralized_dns/constants.cc index 35796ed34fa..143cc4b52df 100644 --- a/net/decentralized_dns/constants.cc +++ b/net/decentralized_dns/constants.cc @@ -55,28 +55,32 @@ struct SuffixComparator { } }; -inline constexpr auto kUnstoppableDomains = - base::MakeFixedFlatSet( - {".altimist", ".anime", ".ask", ".austin", - ".bald", ".basenji", ".bay", ".benji", - ".binanceus", ".bitcoin", ".bitget", ".bitscrunch", - ".blockchain", ".boomer", ".brave", ".calicoin", - ".caw", ".chomp", ".clay", ".crypto", - ".dao", ".dfz", ".doga", ".donut", - ".dream", ".emir", ".ethermail", ".farms", - ".grow", ".her", ".kingdom", ".klever", - ".kresus", ".kryptic", ".lfg", ".ltc", - ".manga", ".metropolis", ".miku", ".ministry", - ".moon", ".mumu", ".nft", ".nibi", - ".npc", ".onchain", ".pastor", ".podcast", - ".pog", ".polygon", ".privacy", ".propykeys", - ".pudgy", ".quantum", ".rad", ".raiin", - ".secret", ".smobler", ".south", ".stepn", - ".tball", ".tea", ".tribe", ".u", - ".ubu", ".unstoppable", ".wallet", ".wifi", - ".witg", ".wrkx", ".x", ".xec", - ".xmr", ".zil"}, - SuffixComparator()); +inline constexpr auto kUnstoppableDomains = base::MakeFixedFlatSet< + std::string_view>( + {".agent", ".ai4", ".altimist", ".amped", ".anime", + ".anyone", ".arculus", ".ask", ".ath", ".austin", + ".bald", ".basenji", ".bay", ".bch", ".benji", + ".binanceus", ".bitcoin", ".bitget", ".bitscrunch", ".blockchain", + ".boomer", ".brave", ".bunni", ".calicoin", ".carbon", + ".caw", ".cgai", ".chip", ".chomp", ".clay", + ".collect", ".crypto", ".dao", ".dejay", ".depin", + ".derad", ".dfz", ".digibyte", ".doga", ".donut", + ".dream", ".dsci", ".emir", ".ethermail", ".farms", + ".goblin", ".gotchi", ".grow", ".her", ".hub", + ".imtoken", ".kingdom", ".klever", ".kresus", ".kryptic", + ".learn", ".lfg", ".ltc", ".lunar", ".manga", + ".marketer", ".metropolis", ".miku", ".ministry", ".mobix", + ".moon", ".mooncat", ".mumu", ".mycircle", ".nft", + ".nibi", ".npc", ".ohm", ".onchain", ".pack", + ".pastor", ".pbdx", ".pendle", ".pilot", ".podcast", + ".pog", ".pokt", ".polygon", ".presearch", ".privacy", + ".propykeys", ".pudgy", ".pundi", ".quantum", ".rad", + ".raiin", ".secret", ".smobler", ".south", ".spend", + ".stepn", ".supernova", ".tball", ".tea", ".tribe", + ".twin", ".u", ".ubu", ".unstoppable", ".wallet", + ".web3", ".wifi", ".witg", ".wrkx", ".x", + ".xec", ".xmr", ".xyo", ".zano", ".zil"}, + SuffixComparator()); // Ensure all domain suffixes start with `.` constexpr bool CheckAllDomainSuffixesStartWithDot() {