Generating hashes... hash_entry() and AgentPubKeyB64

what is the Hasher used in hash_entry? Blake2b?

I don’t fully understand how an AgentPubKey is generated. It says in the documentation that its not a hash but an identifier… could anyone explain this concept?

Basically what I’m trying to do in my Happ is simple: handle user logins to play a game and then database their activity/scores in the DHT. I would like there to be Admin user authority and a joining code set by them in order for others to login /use the Happ / join the DHT.

Yeah… the underlying hashing is blake2b, but the overall system on top of it is called HoloHash… here’s some docs for the Rust crate that defines HoloHash

Ah this makes me think that you’ve seen the above documentation, sorry about that. Let me try…
There is no piece of data that you can pass to blake2b hashing algo to produce this value. It may, however, be used as a Key/Hash/Address in the DHT. I actually can’t recall what, if anything, comes back if you do a get for this address, but I do know that you can use the AgentPubKey as an address off which you can do a create_link for example. So it can work as, or be converted to, an EntryHash. It follows all the same conventions as the other HoloHash types though, having a 3 byte prefix by which it can be identified as being an AgentPubKey.
It is also representative of your address on the p2p network… so when you wish to send a signal, or do a remote call you can just give another agent’s AgentPubKey and it will know from that whether it can reach that agent on the network.

I don’t like to be discouraging, however having done this or something like it recently, I wouldn’t describe it as being simple, actually rather advanced. However, if you’re persistent, and had some good reference materials it could be achievable!

H-I-A session 3 went over something like this, “the progenitor pattern” Holochain-in-Action Session 3-progenitor pattern-how holochain run apps-dna property- unwrap vs (?)

1 Like

thank you very much for these answers and info! it does help clarify some things, but a few q’s if I may…

is the AgentPubKey generated from the conductor? I’m trying to understand if it is unique to the device or how an Agent is defined. For example, I want to use a Happ, so I install the software (associated DNA), then go through whichever permissions set by the app to join a certain DHT… does my AgentPubKey represent my IP address? my user login credentials / authority validation? or what is it exactly?
The reason I’m asking is bc I want to eventually get to the point where we make sure that users of the system are verifiably unique.

Why have both initial_pubkey and latest_pubkey? What are the advantages of agents being able to change their pubkey? I might prefer that it remains locked as the initial one generated.


Separate concept but on topic… how do I setup so that I can have users create multiple entries under one headerhash?

Ideally, the list of registered users would be distributed amongst the hosting peers (allowing for stuff like a leaderboard of stats). This way everyone knows that the results of the game are validated into the public ledger – it is tamperproof and fully distributed (no one controls it, not even Admin)

I hope my questions make sense. I’d for my discussion to be valuable to others, and am very open to exploring concepts. Let me know if I’m in the right place. many thanks :pray:

A conductor can contain 0, 1, or more AgentPubKeys, each associated with a private key.
Each installed happ can choose which private + AgentPubKey to install with / utilize.
There is an admin API function for the conductor called generateAgentPubKey that lets you generate one on demand.

no, not IP address. It does act as a thing that you can pass to holochain conductor though to specify who you’d you’d like to send a signal or call remote to, and if holochain has a network connection to the peer with that pub key then it will send it

I think there is some use case for the future holochain has for that, but at the moment they both are always the same and there can be no change.

1 Like

how do I call it? where can I find the definition? I only see it listed in the Enum but cannot find the path kitsune_p2p::agent_store::AgentInfoSigned
or anything about it in the HDK

what is the difference between kitsuneP2P and holochainP2P?

Depends what language you’re trying to call it from, but you can call it over the open Admin websocket connection. Running any conductor via holochain or hc sandbox should let you know which port the admin websocket is listening on.
From js, you can use this client, and these functions:

I think kitsunep2p is in theory a more general low level networking protocol, where-as holochainp2p utilizes it in ways that are clearly most applicable to holochain as a framework/protocol. In practice though they are pretty blended. My own mental model doesn’t distinguish much between them.

1 Like