HathorNetwork / hathor-core

Hathor core is the official and reference client for operating a full node in Hathor Network.
https://hathor.network
Apache License 2.0
82 stars 23 forks source link

[Design] New API proposals #148

Closed jansegre closed 3 years ago

jansegre commented 3 years ago

I'm creating this issue to discuss the addition of 2 new APIs:

obiyankenobi commented 3 years ago

Both look ok to me.

Do you think it's worth making them public (on our nodes)? Or maybe just for people running their own full node? Doesn't seem to be much of a problem. I mean, the APIs don't seem costly to run.

jansegre commented 3 years ago

I think it's fine for them to be public. But honestly I hope we can eventually shut down the public fullnode APIs.

pedroferreira1 commented 3 years ago

If the idea of the create token endpoint is to facilitate HTR integration I think it's good but if we feel that any custom token integration would need this API I think it's not so difficult to add support for that. I couldn't think any reasons why a custom token integration would use that (only if some exchange decide to list a custom token, which does not seem reasonable to happen anytime soon).

Anyway, both APIs look good to me.

msbrogli commented 3 years ago

In GET /v1a/validate_address/{address}'s response, we should rename script to p2pkh_script.

Besides that, all good to me.

jansegre commented 3 years ago

In GET /v1a/validate_address/{address}'s response, we should rename script to p2pkh_script.

I prefer script because we may have other address types in the future (actually is multisig address different?) and it doesn't really matter for the user of the script field, which would be to just have the script to use for sending to that address.

But maybe we could have a "type": "p2pkh" field in addition to script. What do you think? @msbrogli

jansegre commented 3 years ago

If the idea of the create token endpoint is to facilitate HTR integration I think it's good but if we feel that any custom token integration would need this API I think it's not so difficult to add support for that. I couldn't think any reasons why a custom token integration would use that (only if some exchange decide to list a custom token, which does not seem reasonable to happen anytime soon).

I don't see any particular use for custom token integrations besides what would already be useful in particular to HTR. Maybe if we introduce custom token specific addresses in the future, than it would be super useful for not having to reimplement that logic. But yeah, facilitating these integrations is not a goal of this API.

msbrogli commented 3 years ago

In GET /v1a/validate_address/{address}'s response, we should rename script to p2pkh_script.

I prefer script because we may have other address types in the future (actually is multisig address different?) and it doesn't really matter for the user of the script field, which would be to just have the script to use for sending to that address.

But maybe we could have a "type": "p2pkh" field in addition to script. What do you think? @msbrogli

A type field seems good to me.

jansegre commented 3 years ago

A type field seems good to me.

I'll add that and I think this is done.