LXMF identity in NomadNet identify #347
-
Is there any way to request the LXMF identity from the Identity in NomadNet or use the LXMF address to identify? Right now the lack of ability to communicate with an identified user of LXMF is hampering messageboard utility. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
You can calculate the LXMF address from the specified RNS Identity. The nomadnet client uses a single identity for both LXMF and browsing pages, so you can do what you want. But the identity hash you get on the server side is the actual identity hash before it is exanded into any destination address. You can explore stuff like this with the included $ rnid -i /tmp/nomadnet/storage/identity -H lxmf.delivery
[2023-07-09 16:06:50] Loaded Identity <2cc20b9429c522e232710372dd5b7c47> from /tmp/nomadnet/storage/identity
[2023-07-09 16:06:50] The lxmf.delivery destination for this Identity is <c5e3842981456a23fc3332edc6056474>
[2023-07-09 16:06:50] The full destination specifier is <lxmf.delivery.2cc20b9429c522e232710372dd5b7c47/c5e3842981456a23fc3332edc6056474> As we can see, the identity hash for this identity is You can do this programatically in several ways. One way is to simply create an outgoing destination with the identity and aspects you want, and retrieve the destination hash: destination = RNS.Destination(identity, RNS.Destination.OUT, RNS.Destination.SINGLE, app_name, *aspects)
RNS.log("The "+str(args.hash)+" destination for this Identity is "+RNS.prettyhexrep(destination.hash))
RNS.log("The full destination specifier is "+str(destination)) Or, you can use the hash_from_name_and_identity() API function: import RNS
identity = RNS.Identity.from_file("/tmp/nomadnet/storage/identity")
readable_destination_hash = RNS.prettyhexrep(RNS.Destination.hash_from_name_and_identity("lxmf.delivery", identity))
print(readable_destination_hash) Results in: <c5e3842981456a23fc3332edc6056474> Hope that helps! |
Beta Was this translation helpful? Give feedback.
You're right! This actually will not always work! This is a pretty stupid situation, and we can solve it much more easily.
I just added the ability for the hashing function to take raw bytes input, instead of having to use an instantiated
Identity
.As of ae28f04, you can use something like this one-liner: