Bitcoin Forum
January 11, 2026, 01:41:57 PM *
News: Latest Bitcoin Core release: 30.2 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: MPK import to electrum - main net and testnet  (Read 61 times)
jubalix (OP)
Legendary
*
Offline Offline

Activity: 2716
Merit: 1036


View Profile WWW
October 26, 2025, 04:01:07 AM
Last edit: October 26, 2025, 04:20:18 AM by jubalix
 #1

So I made a electrum wallet 24 words by make_seed(256) in console then restored a wallet with the seed and added a passphrase and then exported the MPK, and put that back in to

for MPK

[1] Mainet - all ok addresses are the same

[2] Testnet, it would not accept the MPK that is the ok button could not be pressed.

So what I did was restore the same seed into the testnet electrum and dumped that MPK and got a vpub and that imported.

Any views? on this. Am I missing something, I may try and restore in test net and dump the MPK and restore that.






Admitted Practicing Lawyer::BTC/Crypto Specialist. B.Engineering/B.Laws

https://www.binance.com/?ref=10062065
rat03gopoh
Hero Member
*****
Offline Offline

Activity: 2548
Merit: 908


Betpanda.io Casino


View Profile WWW
October 26, 2025, 05:07:12 AM
Merited by hosemary (1)
 #2

[2] Testnet, it would not accept the MPK that is the ok button could not be pressed.
Your Electrum detected an incorrect prefix version. Mainnet's MPK is not directly compatible with testnet due to different prefix versions (it's network-specific). Try to generate MPK directly from your testnet wallet (using the same seed, with the testnet option enabled). Electrum should generate the testnet version(tpub or vpub).

.
 betpanda.io 
 
ANONYMOUS & INSTANT
.......ONLINE CASINO.......
▄███████████████████████▄
█████████████████████████
█████████████████████████
████████▀▀▀▀▀▀███████████
████▀▀▀█░▀▀░░░░░░▄███████
████░▄▄█▄▄▀█▄░░░█▄░▄█████
████▀██▀░▄█▀░░░█▀░░██████
██████░░▄▀░░░░▐░░░▐█▄████
██████▄▄█░▀▀░░░█▄▄▄██████
█████████████████████████
█████████████████████████
█████████████████████████
▀███████████████████████▀
▄███████████████████████▄
█████████████████████████
██████████▀░░░▀██████████
█████████░░░░░░░█████████
███████░░░░░░░░░███████
████████░░░░░░░░░████████
█████████▄░░░░░▄█████████
███████▀▀▀█▄▄▄█▀▀▀███████
██████░░░░▄░▄░▄░░░░██████
██████░░░░█▀█▀█░░░░██████
██████░░░░░░░░░░░░░██████
█████████████████████████
▀███████████████████████▀
▄███████████████████████▄
█████████████████████████
██████████▀▀▀▀▀▀█████████
███████▀▀░░░░░░░░░███████
██████░░░░░░░░░░░░▀█████
██████░░░░░░░░░░░░░░▀████
██████▄░░░░░░▄▄░░░░░░████
████▀▀▀▀▀░░░█░░█░░░░░████
████░▀░▀░░░░░▀▀░░░░░█████
████░▀░▀▄░░░░░░▄▄▄▄██████
█████░▀░█████████████████
█████████████████████████
▀███████████████████████▀
.
SLOT GAMES
....SPORTS....
LIVE CASINO
▄░░▄█▄░░▄
▀█▀░▄▀▄░▀█▀
▄▄▄▄▄▄▄▄▄▄▄   
█████████████
█░░░░░░░░░░░█
█████████████

▄▀▄██▀▄▄▄▄▄███▄▀▄
▄▀▄█████▄██▄▀▄
▄▀▄▐▐▌▐▐▌▄▀▄
▄▀▄█▀██▀█▄▀▄
▄▀▄█████▀▄████▄▀▄
▀▄▀▄▀█████▀▄▀▄▀
▀▀▀▄█▀█▄▀▄▀▀

Regional Sponsor of the
Argentina National Team
Cookdata
Legendary
*
Offline Offline

Activity: 1554
Merit: 1205


Not Your Keys, Not Your Bitcoin


View Profile
October 26, 2025, 05:19:24 AM
Merited by hosemary (1)
 #3


So what I did was restore the same seed into the testnet electrum and dumped that MPK and got a vpub and that imported.

Any views? on this. Am I missing something, I may try and restore in test net and dump the MPK and restore that.

Master public key (mpk) from mainet can't be imported to the testnet because they don't have the same format, each prefix represent an address format.

Mainet wallet has xpub, zpub, ypub representing legacy, native segwit and nested segwit address.

Testnet has tpub, vpub and upub format for legacy address, nested segwit and segwit.

If you try to import testnet to mainet or vice versa, it will not work but you can use the same seed phrase on mainet and testnet to generate any the of mpk.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
jubalix (OP)
Legendary
*
Offline Offline

Activity: 2716
Merit: 1036


View Profile WWW
October 26, 2025, 06:26:03 AM
Last edit: October 26, 2025, 10:16:05 PM by Mr. Big
 #4

[2] Testnet, it would not accept the MPK that is the ok button could not be pressed.
Your Electrum detected an incorrect prefix version. Mainnet's MPK is not directly compatible with testnet due to different prefix versions (it's network-specific). Try to generate MPK directly from your testnet wallet (using the same seed, with the testnet option enabled). Electrum should generate the testnet version(tpub or vpub).

Thanks yest did this -- now trying to confirme actual equivalence of addresses.

Quote
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BTC Address Equivalence Checker</title>
<style>
  body { font-family: system-ui, sans-serif; max-width: 600px; margin: 2rem auto; }
  input, button { width: 100%; padding: .5rem; margin-top: .5rem; font-size: 1rem; }
  pre { background:#f6f6f6; padding:1rem; border-radius:8px; }
  .ok { color:green; }
  .no { color:red; }
</style>
</head>
<body>
<h2>Bitcoin Mainnet ↔ Testnet Address Checker</h2>

<label>Mainnet or Testnet Address A:</label>
<input id="addrA" placeholder="bc1... or 1... or m...">

<label>Address B:</label>
<input id="addrB" placeholder="tb1... or m... or 1...">

<button id="btn">Compare</button>

<pre id="out"></pre>

<script type="module">
import { bech32 } from 'https://cdn.jsdelivr.net/npm/@scure/base@1.1.5/+esm';
import bs58check from 'https://cdn.jsdelivr.net/npm/bs58check@2.1.2/+esm';

function decodeAddress(addr) {
  addr = addr.trim();
  if (addr.toLowerCase().startsWith('bc1') || addr.toLowerCase().startsWith('tb1')) {
    const { prefix, words } = bech32.decode(addr);
    const version = words[0];
    const program = bech32.fromWords(words.slice(1));
    return { type: 'bech32', hrp: prefix, version, payload: bytesToHex(program) };
  } else {
    const buf = bs58check.decode(addr);
    const version = buf[0];
    const payload = buf.slice(1);
    return { type: 'base58', version, payload: bytesToHex(payload) };
  }
}

function bytesToHex(b){return Array.from(b, x=>x.toString(16).padStart(2,'0')).join('');}

function compare(a,b){
  try {
    const A = decodeAddress(a), B = decodeAddress(b);
    const eq = A.payload === B.payload && A.type === B.type;
    return {A,B,equivalent:eq};
  } catch(e){ return {error:e.message}; }
}

document.getElementById('btn').onclick = () => {
  const a = document.getElementById('addrA').value;
  const b = document.getElementById('addrB').value;
  const r = compare(a,b);
  const out = document.getElementById('out');
  if (r.error) { out.innerHTML = `<span class=no>Error:</span> ${r.error}`; return; }
  out.innerHTML = `
A → ${JSON.stringify(r.A, null, 2)}
\nB → ${JSON.stringify(r.B, null, 2)}
\nResult: <strong class="${r.equivalent?'ok':'no'}">
${r.equivalent ? 'Equivalent ✅' : 'Different ❌'}
</strong>`;
};
</script>
</body>
</html>





https://files.catbox.moe/6pserj.png

seems to work, tried for same seed in test net and main net and first address

(note burner seed of course)


https://github.com/jubalix/BTC-Address-Check/blob/main/btc_address_checker.html

Admitted Practicing Lawyer::BTC/Crypto Specialist. B.Engineering/B.Laws

https://www.binance.com/?ref=10062065
nc50lc
Legendary
*
Offline Offline

Activity: 3024
Merit: 8229


Self-proclaimed Genius


View Profile
October 26, 2025, 07:58:21 AM
 #5

Quote
-snip-
function compare(a,b){
  try {
    const A = decodeAddress(a), B = decodeAddress(b);
    const eq = A.payload === B.payload && A.type === B.type;
    return {A,B,equivalent:eq};
  } catch(e){ return {error:e.message}; }
}
-snip-
That reply with HTML code might be meant for your other thread about mainnet and testnet addresses.
The code seem to compare the scripPubKey of the decoded base58/bech32 addresses, not the extended public key.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
jubalix (OP)
Legendary
*
Offline Offline

Activity: 2716
Merit: 1036


View Profile WWW
October 26, 2025, 08:19:35 AM
 #6

Quote
-snip-
function compare(a,b){
  try {
    const A = decodeAddress(a), B = decodeAddress(b);
    const eq = A.payload === B.payload && A.type === B.type;
    return {A,B,equivalent:eq};
  } catch(e){ return {error:e.message}; }
}
-snip-
That reply with HTML code might be meant for your other thread about mainnet and testnet addresses.
The code seem to compare the scripPubKey of the decoded base58/bech32 addresses, not the extended public key.

sorry yes your right ...! I only want to be able to compare end use of addresses, and everything else must be correct to get there!

Admitted Practicing Lawyer::BTC/Crypto Specialist. B.Engineering/B.Laws

https://www.binance.com/?ref=10062065
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!