vishalxl / nostr_console

Nostr console is an open-source twitter-like social network, direct chat app and group chat all bundled into one program. Built on the decentralized Nostr protocol.
GNU Affero General Public License v3.0
441 stars 33 forks source link

[BUG] User profile followers consisting of five Leading zeros unidentifiable because of duplicates #64

Closed Sakhalinfox closed 6 months ago

Sakhalinfox commented 1 year ago

Issue Description

Viewing a users profile consisting of followers with five leading zeros makes it impossible to uniquely identify the actual follower or those they follow because of duplicates.

Steps to Reproduce

  1. Use option 9 to Show user profile and enter pubkey of the user (d4843f4c280abba3d43d84ed7924b2567d7c166f5e72985b9f06d355601b5d78) belonging to EzoFox.
  2. Both the following and follower users are listed. Those beginning with five zeros '00000' are not uniquely identifiable because of duplicates.

image

Expected Result

Need to way to uniquely identify all duplicate followers and following users with PoW leading zero's in their hex pubkey. Same applies to npub's if the npubs are eventually also displayed in Nostr_Console in future updates. One way would be to display the beginning 4-5 digits and ending 4-5 digits of the hex pubkey (and same in the case of npub characters) separated by a delimiter like ':' colon or '...' ellipses. Eg: 00000:217qa, 00000:18s7j....

This way the user can copy that shortened hex or npub and paste it on option 8 to follow a new contact. This would also mean the Follow a new contact would need to accept such a format of shortened npub or hexpubkey.

The other option would be to display the complete following and follower hex Pubkey ID's / npub ID's on formatted on separate lines instead of a comma separated list. Those who have usernames/handles with NIP05 verification can also be displayed for easily finding such users and then following them or mentioning them.

Example reproduction details Pubkey: npub16jzr7npgp2a684pasnkhjf9j2e7hc9n0teefskulqmf42cqmt4uqwszk52 HexPubkey: d4843f4c280abba3d43d84ed7924b2567d7c166f5e72985b9f06d355601b5d78

Test Environment Details

vishalxl commented 6 months ago

Fixed with latest commit.

Now every profile shows 10 leading digits. Example for ezofox shown:

ezofox profile 21 april 2024