Skip to main content
edited tags
Link
Ismael
  • 30.3k
  • 23
  • 54
  • 97
added 12 characters in body
Source Link
goodvibration
  • 26.2k
  • 5
  • 49
  • 89

Is sample Example: from

Input key 0x025f37d20e5b18909361e0ead7ed17c69b417bee70746c9e9c2bcb1394d921d4ae = 0x025f37d20e5b18909361e0ead7ed17c69b417bee70746c9e9c2bcb1394d921d4ae

resultingOutput address is
0xd09D3103CcABfb769eDc3e9B01500Ca7241D470A= 0xd09D3103CcABfb769eDc3e9B01500Ca7241D470A

I have been using an algorithm from keccak-tiny.ckeccak-tiny.c by David Leon Gil, with the following change: padding

Padding with 0x010x01 instead 0x06of 0x06: 7 bytes of message "testing" give me 5f16f4c7f149ac4f9510d9cf8cf384038ad348b3bcdc01915f95de12df9d1b025f16f4c7f149ac4f9510d9cf8cf384038ad348b3bcdc01915f95de12df9d1b02 as is in "Which cryptographic hash function does Ethereum use?"

In "Generating an address from a public key" is algorithm, but I have questions: how exactly means getPublic,keyFromPublic ?

before keccak I must convert fro 33 byte key to 65 byte key (address will be compact-independent)?
or keccak is applied on hex string text form, not bytes?
how checksum address with upper/lower case?
  • how exactly means getPublic,keyFromPublic ?
  • before keccak I must convert from a 33-byte key to a 65-byte key (address will be compact-independent) or keccak is applied on hex string text form, not bytes?
  • how checksum address with upper/lower case?

How to do it with C++?

Is sample : from key 0x025f37d20e5b18909361e0ead7ed17c69b417bee70746c9e9c2bcb1394d921d4ae

resulting address is
0xd09D3103CcABfb769eDc3e9B01500Ca7241D470A

I have using algorithm from keccak-tiny.c by David Leon Gil with change: padding with 0x01 instead 0x06: 7 bytes of message "testing" give me 5f16f4c7f149ac4f9510d9cf8cf384038ad348b3bcdc01915f95de12df9d1b02 as is in "Which cryptographic hash function does Ethereum use?"

In "Generating an address from a public key" is algorithm, but I have questions: how exactly means getPublic,keyFromPublic ?

before keccak I must convert fro 33 byte key to 65 byte key (address will be compact-independent)?
or keccak is applied on hex string text form, not bytes?
how checksum address with upper/lower case?

How do it with C++?

Example:

Input key = 0x025f37d20e5b18909361e0ead7ed17c69b417bee70746c9e9c2bcb1394d921d4ae

Output address = 0xd09D3103CcABfb769eDc3e9B01500Ca7241D470A

I have been using an algorithm from keccak-tiny.c by David Leon Gil, with the following change:

Padding with 0x01 instead of 0x06: 7 bytes of message "testing" give me 5f16f4c7f149ac4f9510d9cf8cf384038ad348b3bcdc01915f95de12df9d1b02 as is in "Which cryptographic hash function does Ethereum use?"

In "Generating an address from a public key" is algorithm, but I have questions:

  • how exactly means getPublic,keyFromPublic ?
  • before keccak I must convert from a 33-byte key to a 65-byte key (address will be compact-independent) or keccak is applied on hex string text form, not bytes?
  • how checksum address with upper/lower case?

How to do it with C++?

Source Link
Saku
  • 131
  • 3

Generating an address from a public key in C++

Is sample : from key 0x025f37d20e5b18909361e0ead7ed17c69b417bee70746c9e9c2bcb1394d921d4ae

resulting address is
0xd09D3103CcABfb769eDc3e9B01500Ca7241D470A

I have using algorithm from keccak-tiny.c by David Leon Gil with change: padding with 0x01 instead 0x06: 7 bytes of message "testing" give me 5f16f4c7f149ac4f9510d9cf8cf384038ad348b3bcdc01915f95de12df9d1b02 as is in "Which cryptographic hash function does Ethereum use?"

In "Generating an address from a public key" is algorithm, but I have questions: how exactly means getPublic,keyFromPublic ?

before keccak I must convert fro 33 byte key to 65 byte key (address will be compact-independent)?
or keccak is applied on hex string text form, not bytes?
how checksum address with upper/lower case?

How do it with C++?