coinbase / coinbase/mesh-specifications

DataAPI for address validation

Open
#72 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Shell
Stars
342
Forks
100
PR merge metrics
No merged PRs in 30d

Description

I'm working for an exchange and have integrated a blockchain by using Rosetta. This project is really amazing and is well compatible with our current blockchain integration process. But there is a feature I want to request.

**Is your feature request related to a problem? Please describe.**

We will check the address that the customer input in the withdrawal process:

1. customer might input an invalid address by mistake, in which case, we should remind him/her to do re-check. For example, `1JTxUeSwH5Ba2ib2UD6Whv5ZXB8RRjfRM8` is a valid address but `1JTxUeSwH5Ba2ib2UD6Whv5ZXB8RRjfRM9` is not.
2. customer might input an address in the format which we don't support yet or are not ready to open to customers. For example, for Bitcoin, we support the withdrawal to P2PKH and P2SH address , but we don't support the withdrawal to P2WPKH and P2WSH address.

For the blockchain we have integrated via Rosetta, I used `/account/balance` to check if the address is valid or not; For invalid address, it would return`invalid account name`. But I think it's just a workaround, and is not working for the case 2 above.

**Describe the solution you'd like**

I am wondering if Rosetta can add one more API, like `/account/info`:

1. for case 1, it returns "invalid account"
2. for case 2, it returns something like this:

```json
{
"account_identifier": {
"address": "1JTxUeSwH5Ba2ib2UD6Whv5ZXB8RRjfRM8",
"sub_account": {
"address": "aabbcc",
"metadata": {}
},
"metadata": {},
"type": "P2PKH"
}
}
```

The `type` field is not in the `metadata` for it's not optional.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.