aeternity / aepp-calldata-js

Aeternity data serialization library
ISC License
3 stars 4 forks source link

`contract_pubkey` and `account_address` inconsistency #197

Closed davidyuk closed 1 year ago

davidyuk commented 1 year ago

I've noticed that contract_address has been renamed to contract_pubkey recently. Probably it is enforced by Sophia, but then it is unclear why account_address is not changed, in node docs I saw it called only account_pubkey or so.

If it is not because of Sophia then the new naming looks unclear, are contracts have some keypair? Isn't contract id generated by the creator address plus transaction nonce as in state channels?

dincho commented 1 year ago

Do you refer to this code: https://github.com/aeternity/aepp-calldata-js/blob/master/src/ApiEncoder.js#L8 ? If so, I'm keeping it consistent with the reference erl implementation: https://github.com/aeternity/aeserialization/blob/master/src/aeser_api_encoder.erl#L211

davidyuk commented 1 year ago

Do you refer to this code?

yep

I'm keeping it consistent with the reference erl implementation

Why don't rename account_address to account_pubkey as in aeser_api_encoder.erl#L221? Though I like address instead pubkey in both cases. In the case of contract id, it is not a public key at all.

marc0olo commented 1 year ago

Though I like address instead pubkey in both cases.

I think this is also a problem in the node implementation and API, isn't it? always wondered about this. I also prefer address over pubkey. it is an encoded pubkey, right?! :D

dincho commented 1 year ago

it is an encoded pubkey, right?! :D

It is the public key indeed, the address term I guess is used to be easier for the users to grasp it.