Can I use the same address in multiple chains?

+4 votes
Is it possible to use the same address in multiple chains, such that a User who is connected to multiple chains can be identified using a common identifier? If so, how?

Thanks

**** EDIT ****

Based on the information provided in Multichain's answer, I did the following:
1) multichain-util.exe create chainA

2) Opened C:\Users\<me>\AppData\Roaming\MultiChain\chainA\params.dat and grabbed the four key-value pairs mentioned in the answer

3) multichaind chainA -daemon

4) (In another terminal window) multichain-cli chainA listaddresses. Within the return, I got (redacted): "address" : "1XgzxPWTWb11...X9SXWdMA"

5) (In the main terminal window) Did Ctrl-C to stop chainA

6) multichain-util.exe create chainB

7) Opened C:\Users\<me>\AppData\Roaming\MultiChain\chainB\params.dat and replaced the four key-value pairs mentioned in the answer with the values I copied off from chainA

8) multichaind chainB -daemon

9) (In another terminal window) multichain-cli chainB listaddresses. Within the return, I got (redacted): "address" : "17rUhRqzZYSpfPi...CD2jMmwCTYGxME"

If I'm understanding the API correctly, this means that the answer did not work for me. Perhaps I'm misunderstanding the API, or what these addresses represent. Please advise

**** Final Answer ****

1) multichain-util.exe create chainA

2) Opened C:\Users\<me>\AppData\Roaming\MultiChain\chainA\params.dat and grabbed the four key-value pairs mentioned in the answer

3) multichaind chainA -daemon

4) (In another terminal window) multichain-cli chainA listaddresses. Within the return, I got (redacted): 1YhH8CJ...CCUTLZxG69y

5) multichain-cli chainA dumpprivkey <address from step 4> returns (redacted) VAR...TgS

6) (In the main terminal window) Did Ctrl-C to stop chainA

7) multichain-util.exe create chainB

8) Opened C:\Users\<me>\AppData\Roaming\MultiChain\chainB\params.dat and replaced the four key-value pairs mentioned in the answer with the values I copied off from chainA

9) multichaind chainB -daemon

10) (In another terminal window) multichain-cli chainB listaddresses. Within the return, I got (redacted):  1UvBtqMgLV...E1LrYVbv6u

11) (In another terminal window) multichain-cli chainB importaddress 1YhH8CJ...CCUTLZxG69y (the output of step 4)

12) (In another terminal window) multichain-cli chainB importprivkey VBX...Kpe (the output from step 5)

13) (In another terminal window) multichain-cli chainB listaddresses (again). This time, the address from Step 4 is listed (along with the address from step 9), and the address from step 4 has the property "ismine" : true

I think that did it! Basically, if I'm reading this correctly, I've successfully imported the identity from Chain A into Chain B. That's exactly what I was looking for.

Additionally, if you want this new address to be the primary address, do
multichain-cli chainB grant <imported address> all
multichain-cli chainB revoke <default, pre-generated address> all
asked Aug 16, 2017 by csandwith
edited Aug 18, 2017 by csandwith
Great - thanks for showing your full solution.

1 Answer

+1 vote
 
Best answer

Yes, you need to set the address parameters of the blockchain parameters to the same in both chains, i.e. copy then from the first when you create the second, before running it for the first time. Here are the relevant parameters:

address-pubkeyhash-version
address-scripthash-version
private-key-version
address-checksum-value

answered Aug 16, 2017 by MultiChain
selected Aug 18, 2017 by csandwith
(OP Here) Thank you for getting back to me, but unfortunately this answer did not work for me. I've included the steps I tried as an edit to the question.
The steps described ensure that the address spaces on the two blockchains are compatible. They do not mean that each node, when it creates its first random address on a chain, will choose the same address. You need to use dumpprivkey/importprivkey/importaddress to share addresses between chains. There is also the initprivkey runtime parameter you may find helpful.
...