Skip to content

Are durableHandles superior over plain strings when used as "key" in store? #9663

Answered by dckc
anilhelvaci asked this question in Q&A
Discussion options

You must be logged in to vote

As you point out, there are advantages and disadvantages to each; it's not the case that handles are always superior to strings as keys.

The terminology we use to talk about the distinction is: strings are forgeable identities, and handles are unforgeable.

strings can be effectively unforgeable in some senses, if sufficient entropy is used to allocate them; but since the operation of the chain and the JS VM are visible to anyone running a node, they could take that string and use it in a contract. This is not so for unforgeable objects. Even if you have all sorts of knowledge about the identity, there's no way to break ocap access rules and get a reference in a contract.

cc @Jovonni

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@erights
Comment options

@anilhelvaci
Comment options

anilhelvaci Jul 13, 2024
Collaborator Author

Answer selected by anilhelvaci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants