Determine if the specified account is a standard account.
A standard account means:
PUSH <pubkey>
CHECKSIG
PUSH <m>
PUSH <pubkey 1>
...
PUSH <pubkey n>
PUSH <n>
CHECKMULTISIG
One solution to this would be to have different prefixes for standard and multisig accounts.
Currently standard accounts and multi-sig have prefixes 0x17. If the prefix was also changed, it would make it easier for users to verify whether they were sending funds to a multi-sig or a standard account, as standard accounts would start with an A and multi-sig accounts would start with a 'N' for example.
I second the comment from @decentralisedkev. It would be great if we have a way to distinguish a single signature address and a multi-sig address just by looking at it. should this be another NEP?
Oh! I've been discussing this with @shargon for a while hahaha good to know other people are also aligned with this. My suggestion is to create different classes for address contracts, but informing the script instead of the scripthash, so we could definitely know that the contract is multisig. The drawback is that it would be bigger than regular addresses, but much safer.
@erikzhang I don't know how to find if it's standard directly from scripthash (but I'm sure you got some good idea), but one thing I've been thinking is to extend NEP-10 to include notifications on Verification contracts that inform the standard of the contract (example NEP-XX and NEP-XY for single/multisig).
@erikzhang In this case, to ensure that it is REALLY standard, it will be necessary to check that first opcode is "21" PUSH33 and last is CHECKSIG.
21 PUSHBYTES33 036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb
ac CHECKSIG
Otherwise we can easily pass some other types of "password lock" contracts, or anything else (including jumps and loops). This example is not evil, but could be ;) Always return true: 51662045f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fbac
51 PUSH1
66 RET
20 PUSHBYTES32 45f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fbac
```
oh! how didnt I see that hahaha crazy me..... good, its safe then ! :)
Most helpful comment
I second the comment from @decentralisedkev. It would be great if we have a way to distinguish a single signature address and a multi-sig address just by looking at it. should this be another NEP?