[API] can I read a register without knowing owner?

There is a function autonomi::client::Client::register_get(), that requires RegisterAddress, so I have to know an owner of the register, and the name he has given to the register. Is it possible to read a register just by knowing it’s XorAddress in the network? That would allow linking to data without knowing owner’s public keys. I think it’s the basic functionality for public data.


Check out the Dev Forum

3 Likes

If I understand your question: yes, all you need is the RegisterAddress (which is like an xor address, just not the same as a chunk or datamap address).

If not, people wouldn’t be able to use awe to access websites published by others, because the awv:// URLs are just the RegisterAddress which holds the website metadata versions.

3 Likes

It seems you cannot create RegisterAddress without providing owner’s PublicKey:

https://docs.rs/autonomi/latest/autonomi/client/registers/struct.RegisterAddress.html#method.new

Do you use registers in awe, or chunks/files? I’ll dive into your code, thanks.

1 Like

When you use 'awe update` you pass a register address as a parameter so look at what I do with that.

Sorry, ignore that, it’s not what you want. When you view a website using the ‘awv’ protocol it is given a register address which it uses to obtain the metadata for the website (and any version of the metadata store in register entries).

So look at what the ‘awv’ protocol handler does with the hex register address it receives from the front end.

Ok, I assumed, that RegisterAddress is just a xor address derived from meta and pk, but it turns out owner is in fact encoded in RegisterAddress hex representation. Thank you.

1 Like