Neo: Create GetValidatorsScript interop

Created on 7 Apr 2019  路  6Comments  路  Source: neo-project/neo

Currently we use a multisig with secp256r1 to generate the validators script, but it is possible that this changes in the future (for example adopting Schnorr or any different kind of verification). So, it would be nice to have Neo interop call to inform the current ValidatorsScript.

Example:
Neo.Blockchain.GetValidatorsScript => current multisig verification script

discussion

Most helpful comment

We don't need to add flag in front of each signature. We can add flags in front of public keys except secp256r1. In this way, we can be compatible with old signature scripts and support arbitrary signature algorithms in the future.

All 6 comments

The best thing we can do is add a flag (enum) in front of each signature that specifies the format, in this way we can be prepared for the future.

0x01 = secp256r1
0x02 = secp256k1
...

We don't need to add flag in front of each signature. We can add flags in front of public keys except secp256r1. In this way, we can be compatible with old signature scripts and support arbitrary signature algorithms in the future.

Good idea with the byte marks. Secp256r1 already has a prefix, we can just keep them. So, are you ok with the new interop? I can start coding.

GetValidatorsScript or GetValidatorsScriptHash? Which is better?

In fact we may need the full Script in some cases (I need to verify to be sure), but it would be better to have this flexibility, and for the ScriptHash just to do:

Hash160

Another related call is for NextConsensus field, but I'm also not fully sure if that would be effective.

A third option is to use GetValidatorsScriptHash to look into the deployed contract (but it would necessarialy need to be deployed in this case) to get the source.

Closing this, perhaps integrate this on native policy contract in the future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vncoelho picture vncoelho  路  3Comments

roman-khimov picture roman-khimov  路  3Comments

borovik96 picture borovik96  路  4Comments

realloc picture realloc  路  4Comments

igormcoelho picture igormcoelho  路  4Comments