Proposing a front-end agnostic way to store Bitcoin Lightning, crypto and social media addresses in a Hive profile

(edited)

I am currently building a new social media app for hive (@cyberspace77) and implemented Bitcoin Lightning tips in the app.

Instead of every app storing the preferred Bitcoin address of the user in their own variable or object, I propose a front-end agnostic way in doing that.

Adding a wallet object to the profile in

posting_json_metadata

like so

{"profile":{
...
"wallet":{"ln":"lightning address"}
...
}}

wallet is an object that can associate multiple cryptocurrencies to a hive user:

{"profile":{
...
"wallet":{"ln":"lightning@address","btc":"bc1...","eth":"0x..."}
...
}}

If we agree on this format, every existing and future dapp could use this setting, so the user can configure their addresses once for all apps and to save space on the blockchain.

Likewise the next idea is to also unify how we store external social media links on hive. One idea is to use a similar concept, a social object in profile, linking to the social media addresses of the user.

"social":{"x":"...","instagram":"...","discord":"",...}

What do you think about this?

@blocktrades @gtg @peakd @ecency @asgarth @good-karma @sagarkothari88 @tibfox @hivesuite.app @leofinance @threespeak @lordbutterfly @nftshowroom @crimsonclad @acidyo @roelandp @arcange @stoodkev @mahdiyari @deathwing @howo @brianoflondon

bitcoin-accepted-here-1.png

0.48536902 BEE
15 comments

Hi

We already have this in our mobile app and website:
Here is the format example, where type define if it is external chain or 2nd layer name, etc.:

{
  "profile": {
    "name": "...",
    "about": "...",
    "version": 2,
    "tokens": [
      {
        "symbol": "BTC",
        "type": "CHAIN",
        "meta": {
          "address": "1848UG3vGSaRP94NxdYtyCMbfsSJha48BC",
          "publicKey": "03e4928405fd277ac60b08b74783dcec1aeeb9505d75031484cab97b9982507fe9",
          "show": true
        }
      },
      {
        "symbol": "ETH",
        "type": "CHAIN",
        "meta": { "address": "0x436a...3da3", "publicKey": "0x0433...f6d0", "show": true }
      },
      { "symbol": "LEO", "type": "ENGINE", "meta": { "show": true } }
    ]
  }
}

profile.tokens in posting_json_metadata is an array of {symbol, type, meta} that lists a Hive user's linked wallets. Entries with type: "CHAIN" hold the user's public receive address on another blockchain (meta.address). Show an entry only when meta.show is not false.

0.01556527 BEE

oh cool, looks a bit complicated though, but more expandable, I was aiming for a simpler approach, just having the address association. Where do you use the tokens?

0E-8 BEE
(edited)

@vikisecrets modified this reply with more context!

In the Ecency wallet, on web and mobile:

  • Your own wallet: the list decides which tokens you see. External chain addresses (BTC, ETH, SOL and others) sit next to the Hive Engine tokens you picked and you can hide any of them without unlinking.
  • Sending to someone: when you transfer or tip, we read the recipient's profile.tokens and offer their external addresses as destinations. On the website the transfer itself goes through MetaMask; the mobile app shows the balances.

So it backs a full wallet, which is why each entry carries a type and a meta object and not only an address.

The format, a read snippet and the write rules are documented here: https://docs.ecency.com/developers/wallets/#profile-tokens-format

0E-8 BEE

Then let's take the ecency approach even though its a but complicated, ok? Then we have 3 apps following one format. I would see the social media links on the same level as tokens.

0E-8 BEE

Didn‘t know you can tip Sats via @ecency. How does that work?

0E-8 BEE

You can’t tip lightning sats, we have BTC and other chains tipping working with MetaMask extension on website. Mobile app shows your balances on those tokens, website allows you to transfer. Lightning network is not there yet. We haven’t seen much utility or usage to extend those areas…

0E-8 BEE

Adding a data point for the social part: denser (the Hive frontend we're building, running at /) already writes profile.social in posting_json_metadata, so there is an existing format to reconcile with.

Our keys and values:

"social": {
  "x": "handle",          // x.com/handle
  "ig": "handle",         // Instagram
  "yt": "handle",         // youtube.com/@handle
  "tg": "handle",         // Telegram, t.me/handle
  "bsky": "name.bsky.social",
  "dc": "username",       // Discord
  "nostr": "npub1..."
}
  • Values are bare handles, without @ or a URL, so each app builds its own link.
  • They are self-declared and unverified, and denser labels them that way on the profile.

We're happy to switch to full names (instagram, youtube, telegram, discord, bluesky) if that's what people settle on. We'd read both spellings during a transition, so existing profiles keep working.

One practical point that applies to whatever format wins: posting_json_metadata is rewritten as a whole, so each app should merge key by key inside social (and wallet) and keep keys it doesn't know about. We found that denser's own profile save dropped foreign keys inside social, and we're fixing that now.

@rubencress, we'll register the format with OpenAttribute once the key names are settled.

0.01490173 BEE
(edited)

@blocktrades agreed on the merge point, and it deserves a line in whatever gets agreed here rather than a footnote.

On waiting for the names to settle: between you, @ecency and @vikisecrets there are six or seven open choices in this thread and nobody appointed to decide any of them. I'd register what denser writes today. If the spelling changes later it costs nothing, because a new version is one more registration and the old one stays readable.

This is the whole thing:

  "oa": 1,
  "action": "register_attribute",
  "attribute": {
    "account": "blocktrades",
    "leaf": "social",
    "version": "1.0.0",
    "category": "identity",
    "description": "External social handles on a Hive profile, as denser writes them: bare handles, no @ and no URL, self-declared and unverified. Keys in use: x, ig, yt, tg, bsky, dc, nostr.",
    "schema": { "type": "object", "additionalProperties": { "type": "string" } }
  }
}

Signed from @blocktrades. No account with us, no permission, nothing to install, and nothing needed from me.

It is blocktrades.social and not profile.social because the name comes from the signing account and never from the payload. @profile is a real account, which is exactly why that rule exists. Keep writing profile.social as you do today; write blocktrades.social alongside it when it suits you.

The point of any of this: what denser means by social should outlive denser. Right now that meaning exists in a repository, and the profiles are on a chain.

0E-8 BEE

This is very close to the implementation I did in the cyberspace app, except using the long-form names for the social media sites like "youtube", "instagram" etc, normalized to lower-case, and also storing just the handle (normalized) for known social media sites (also automatically extracted from urls), or the url for unknown ones, as a fallback, if the user provided a full url, otherwise only the text is stored, the user provided.

When displaying the social links, its up to the front-ends how to display (sanitize) the usernames and link to the respective sites, for known social media types.

"social":{
"x":"username",
"instagram":"username",
"discord":"username",
"link-1":"url",...
}
0E-8 BEE

Sounds like a good plan! I think its great and maybe @rubencress could even add openattributes for that so we are rly standardized :)

We currently store all the things 3speak related into a 3speak object of the metadata but of course we could switch that - especially since not so many people have used social media links or lightning on 3speak.tv yet.

0.01474131 BEE

I think this is a nice approach to add things. I think it's a good way for any frontend to access the information. Your dictionary approach sounds better than the list approach. I think ecency is trying to mix in Hive Engine tokens, and the basic information for an address would be enough. I am not sure if a public key is needed, though. If it is, maybe then the dictionary would return a type with {address, public key}.

0.01444088 BEE

Gold idea. One standard for all. Lightning tipps could be a real plus for Hive ecosystem. 👍🏻

0.01468807 BEE

Great proposal for standardizing wallet and social links on Hive!

0.01469803 BEE

One point about using @v4vapp if you send small amounts put #sats in the memo. That way it stays as sats and I don't try converting to Hive (that doesn't happen for small amounts anyway).

0.01448392 BEE

Thx for the info, glad that v4v is still alive, so every user now also has their LN address, which is cool, was thinking also sending sats to sats.v4v.app but decided atm to let v4v decide or the user with their v4v settings whether to convert or not.

0E-8 BEE

cool idea

0.01463664 BEE

A shared wallet field in the profile metadata makes so much sense, every app reinventing its own spot for addresses is just silly.

0E-8 BEE

I agree with the proposal as it also makes the debugging more easier to diagnose

0E-8 BEE

Nice idea about making the wallet of the user be manage in a variable of object

0E-8 BEE

@sagarkothari88 interesting discussion here

0E-8 BEE

Storing the lightning address once in the profile instead of every app keeping its own copy just makes sense, hope the frontends pick it up.

0 BEE
(edited)

Thanks for the tag @tibfox.

Look; its really simple: I couldn’t care less whether @ecency has these registered or not. I care that they’re easy to find so @vikisecrets doesn’t have to ask the question or propose a format in the first place.

Imagine @ecency hadn’t replied here. Who would have known where to look? Just a few. Certainly not new devs, or community members who want to build on top of Hive. What happens then is that @vikisecrets ships profile.wallet, and a fourth format exists, and profile.tokens stays invisible to everyone outside this thread. That’s not even a near miss, that’s reality, the normal case right now.

Besides that, @ecency could be gone tomorrow (hopefully they arent going anywhere). But let's say that happens; a brand, a business, a platform that leaves takes the format with them. Every profile that used it stays on chain forever and its not easy to find. Same for 3Speak. Same for any platform build on top of Hive. Same for yours.

A registration doesn’t die with the app that wrote it.

Developers need to step up here. @OpenAttribute is a library of what Hive’s apps actually write, for anyone to see, find and use. One signed custom_json and you’re in it.

The only apps using it right now is;
@liketu
@snapie
@threespeak
@opntree

Thank you! other devs @peakd @ecency @scrobble @blocktrades @asgarth; if you want the ecosystem to grow on/with each other; take a little bit of responsibility and register the attributes. Its 2 or 3 minutes of work. Not a dumb thing to do.

https://openattribute.app

0E-8 BEE