user6532: I am creating an address generator for cardano. I am struggling to figure out what the differences would be when building an address for testnet instead of mainnet. What components of the address are different?

user4302: If you are using cardano-cli to build the address(es), the only difference would be in specifying which network (mainnet or testnet) the address is for. This is done via the --mainnet & --testnet-magic <MAGIC_NUMBER> flags. The same payment/stake.vkey files can be used in either case.
For example, if you are building a shelley address for the public testnet using cardano-cli, you would replace the following --mainnet flag with the --testnet-magic 1097911063 flag:
MAINNET:
cardano-cli address build \
--payment-verification-key-file payment.vkey \
--stake-verification-key-file stake.vkey \
--mainnet \
--out-file main-shelley.addr

PUBLIC TESTNET:
cardano-cli address build \
--payment-verification-key-file payment.vkey \
--stake-verification-key-file stake.vkey \
--testnet-magic 1097911063 \
--out-file test-shelley.addr

Note: mainnet shelley addresses all begin with addr1, whereas testnet shelley addresses all begin with addr_test

6532: <p>I am creating an address generator for cardano. I am struggling to figure out what the differences would be when building an address for testnet instead of mainnet. What components of the address are different?</p>
 4302: <p>If you are using <code>cardano-cli</code> to build the address(es), the only difference would be in specifying which network (mainnet or testnet) the address is for. This is done via the <code>--mainnet</code> &amp; <code>--testnet-magic &lt;MAGIC_NUMBER&gt;</code> flags. <strong>The same payment/stake.vkey files can be used in either case.</strong></p>
<p>For example, if you are building a shelley address for the public testnet using cardano-cli, you would replace the following <code>--mainnet</code> flag with the <code>--testnet-magic 1097911063</code> flag:</p>
<p>MAINNET:</p>
<pre><code>cardano-cli address build \
--payment-verification-key-file payment.vkey \
--stake-verification-key-file stake.vkey \
--mainnet \
--out-file main-shelley.addr
</code></pre>
<p>PUBLIC TESTNET:</p>
<pre><code>cardano-cli address build \
--payment-verification-key-file payment.vkey \
--stake-verification-key-file stake.vkey \
--testnet-magic 1097911063 \
--out-file test-shelley.addr
</code></pre>
<p>Note: mainnet shelley addresses all begin with <code>addr1</code>, whereas testnet shelley addresses all begin with <code>addr_test</code></p>
