Neo: [Feature Request] Interop or VM functionality

Created on 1 Jun 2018  路  7Comments  路  Source: neo-project/neo

Add the following methods ( or similar) to the interop layer or VM:

  • Hex
  • Unhex
  • ScriptHashToAddress
  • AddressToScriptHash
enhancement

Most helpful comment

@dicarlo2 you made me think about it and I suddently dont want this feature anymore... O.o let me explain why. base58 address and scripthash are almost the same, but the first comes with integrity check. If that existed months ago , I believe some problems in some smart contracts wouldnt have existed (I cannot go into details), because of this integrity check and perhaps stronger type checking for address type (not just bytearray) being allowed in.upper level languages. But now these problems seem to be solved in another way, and Im starting to question if this current base58 address format is the best for users (I dont think so). So, if other address standards exist in the future , we would need more interop.... so perhaps its better to keep only scripthash in lower levels, like you just said :) but I dont know for sure, must think more, carefully...

All 7 comments

I prefer Interop

Can this be built in compilers?

It can be in the compilers to convert /unconvert at compile time. But for ByteArray that are on the stack it would need to be in the Interop layer.

In the spirit of the conversation, I'd like to ask for another related method hahaha is there some sort of validateAddress in lower layers?
That would be nice to ensure the address is valid... the way it is now, we have byte[] for everything, we can validate things like length, but I don't think it can be validated to be an address. If it was passed as Base58 Address it could be validated, but as you said before, we currently cannot do that in lower layers (too expensive to convert it to scripthash). So, if we manage to provide some Address support in lower layers, it would also be nice to have a validateAddress (and we can perhaps start to use a specific type for it in Neo) :)

What鈥檚 the use case for using base58 addresses vs just always using script hashes in smart contracts?

@dicarlo2 you made me think about it and I suddently dont want this feature anymore... O.o let me explain why. base58 address and scripthash are almost the same, but the first comes with integrity check. If that existed months ago , I believe some problems in some smart contracts wouldnt have existed (I cannot go into details), because of this integrity check and perhaps stronger type checking for address type (not just bytearray) being allowed in.upper level languages. But now these problems seem to be solved in another way, and Im starting to question if this current base58 address format is the best for users (I dont think so). So, if other address standards exist in the future , we would need more interop.... so perhaps its better to keep only scripthash in lower levels, like you just said :) but I dont know for sure, must think more, carefully...

Base58 addresses for UI, scripthash for lower levels.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shargon picture shargon  路  3Comments

roman-khimov picture roman-khimov  路  3Comments

igormcoelho picture igormcoelho  路  3Comments

realloc picture realloc  路  4Comments

vncoelho picture vncoelho  路  4Comments