For my darkclam followers and believers:
I have been very busy studying the ethereum VM and creating rough draft ideas and concepts for darkclam. No this
doesn't mean darkclam is going to be an eth asset or on the ether blockchain in any way. It simply means I am "borrowing" some technology from them and putting it in my project. With all eyes on eth at the moment, using this technology also gives some credibility to darkclam since it is using a VM already published open source in another project. I currently have the VM figured out to the point where I can call certain functions in a smart contract (essential in the darkclam system). You can check all my progress at:
https://github.com/daxxog/darkclamHere is an excerpt from
commit:42a56e8404f1977540c8abd6b1491d9fb562cabc for my programmers out there (maybe it will help you understand it better):
npm install -g ethereumjs-codesim
ethereumjs-codesim -C -f echo-test.sol --use-contract 'Echo' --callmethod 'Test(bytes32)' 'echo'
TODO: translate this into a system for the CLAM blockchain
The darkclam hypervisor manages:
* storage/memory management
* checkpoints / history
* magnet system
* eXtended/abi/cmd/json/system xajs
* gas management
* rpc system
* extended ABI system (new types)
Input -
Magnet - magnet links as data input
Output -
Function - an specially encoded function call, can be used to call code in other VMs
* dependencies
* x-vm communication
where new DCVM(Buffer bytecode, Buffer trie, Object abi)
(note, this constructor is ussually called from the Hypervisor)
bytecode - The VM bytecode, loaded from the [package-name].vm file
trie - The previous VM state, a Patricia Merkle Tree expressed as a Buffer
abi - The abi definition as a JavaScript Object, loaded from the [package-name].json file
DCVM.run(Object block, Integer index, Array args, Function cb(Buffer trie, Error err, Buffer return, Integer gasUsed, Array logs), Integer value)
(note, uses automatic ABI system, to make functions more dynamic)
block - the Block containing this transaction (encoded and sent to the Function)
index - the index of this transaction in the block (encoded and sent to the Function)
args[0] - The function name (entry point)
args[1 - ARG_LIMIT] - The arguments for the function (automatically encoded)
cb -
trie - The next VM state (hypervisor manages confirmations with a run/rewind system backed by the checkpoint system), a Patricia Merkle Tree expressed as a Buffer; if err return lastState :)
err - Graceful failing for VMs
return - Buffer data to return to the Hypervisor (for x-vm communication and direct function calling)
gasused - Amount of gas used running the selected function, passed back to Hypervisor for x-vm communication
logs - An Array of logs spit out by the function code
value - The value transacted (default 0)
For all the haters out there: fuck all of you.