bradyrussell / UISCoin

Java cryptocurrency made to learn more about Bitcoin.
https://bradyrussell.github.io/UISCoin/javadoc
0 stars 1 forks source link

virtual machine script operator? #22

Closed bradyrussell closed 3 years ago

bradyrussell commented 3 years ago

im thinking an operator like OP VIRTUALSCRIPT where the stack is [virtual script bytecode] [byte number of stack items to take] then N byte arrays it would initialize and execute a given script with the specified stack. then pushes the (boolean result / resulting stack / both?) back onto the real stack

I cant think of anything useful to do with this immediately but it would be cool. I can imagine an unlocking script providing a locking script with a virtual script which it executes to determine validity, able to have stack elements from either parent script.

I can't see any immediate vulnerabilities this would introduce besides increasing the overall cpu usage of the network but script validation is probably a minimal effort anyways given the overall script length limit

bradyrussell commented 3 years ago

could also maybe add GZIP/UNZIP operators to allow for more code execution within the limits

bradyrussell commented 3 years ago

done