koinos / koinos/koinos-cli

[FEATURE]: KAP name resolution

Open
#190 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
7
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### New feature

Allow use of KAP names instead of addresses when using CLI for `register`, `payer`, and contract calls which accept an address as a parameter. (open to additional command suggestions)

```
🔐 > register luke luke.koin
Contract 'luke' at address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf registered

🔐 > payer luke.koin
Payer set to address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf

🔐 > koin.balance_of luke.koin
'luke.koin' resolved to address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf
10.2888231 KOIN
```

If needed, names could be required to use the `kap://` prefix.

```
🔐 > koin.balance_of kap://luke.koin
```

For `register`, `payer`, and read-only contract entry points, the output will display the address(es) for each of the names used. Current `register` output is fine. `payer` output should be added to always echo the address. Contract calls should echo each of the names resolved. If the entry point is not read-only, there should be an additional check before executing the command.

```
🔐 > koin.transfer luke.koin 1
'luke.koin' resolved to address 1Phen7sf6kjAgJ3jwiheWW6SFDumDoWgUf
Continue? (y/n)
```

If user types `y`, execute the command as normal. If `n`, display `contract call aborted` and return.

To support this integration, I propose adding a `address_of` command which accepts a KAP name and returns the address of the name's owner.

### Anything else?

Seeking feedback on this design and implementation details. I will devote time to implementing if this feature is desired.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the CLI entry points for register, payer, and contract calls, then assess how a proposed address_of command could resolve KAP names. Done means supported address parameters accept names, resolved addresses are displayed, state-changing calls require confirmation, and cancellation returns the specified message.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
blockchain, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.