DMDcoin / diamond-contracts-claiming

claiming contracts
0 stars 2 forks source link

support for reconstruction of DMDv3 Address #24

Closed SurfingNerd closed 7 months ago

SurfingNerd commented 7 months ago

Given a Signature and the corresponding message, we are able to recover the public key, and with the public key the Ripe160 result. (This is the essential part of a DMD/BTC LegacyCompressed address)

That's good enough for claiming. In the case of Bitcoin, it was possible to recover the address out of this Information, but in the case of DMD, there is something special behind the scenes.

We are currently only able to show the Ripe160 of the DMD address. The extraction of the Ripe160 was possible, because the data is stored at the same location as it is for BTC LegacyCompressed addresses.

But the other way around - calculating the DMD Address out of a Ripe160 is not done yet, and would be a nice to have for the UI.

There is implementation we can copy from:

out of iancoleman.io i could recover the following metainformation about DMD:

  diamond: {
  messagePrefix: '\x18Diamond Signed Message:\n',
  bip32: {
    public: 0x0488B21E,
    private: 0x0488ADE4,
  },
  pubKeyHash: 0x5a,
  scriptHash: 0x08,
  wif: 0xda,
  },