SMACCO - SMart ACcount COmposer
This project aims to easily generate "smart accounts" for holding assets based on different (and combined) features:
- public/private key validation
- MultiSig
- timelock
- Asset-specific behavior (only allowing withdraws for specific assets, for example)
That will help NEO users to easily create and manage safe account addresses. Initially, only json interface will be provided to allow C# code generation (that will become AVM). After that, visual interfaces can help the design process, keeping in mind this is NOT a tool intended for developers, but to general public.
Official Documentation on ReadTheDocs
python3 -m pip install -r docs/requirements.txt
make docs
<script src="https://unpkg.com/neo-smacco/dist/bundle.js"></script>
Smacco = smacco.Smacco;
npm install neo-smacco
const Smacco = require('neo-smacco').Smacco;
npm test
npm run build
npm version minor
git push origin master --tags
npm publish
{
"standard": "smacco-1.0",
"input_type" : "single",
"pubkey_list" : ["036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb"],
"rule" : {
"rule_type": "ALLOW_IF",
"condition" : {
"condition_type" : "CHECKSIG"
}
}
}
{
"standard": "smacco-1.0",
"input_type" : "array",
"pubkey_list" : ["036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb",
"0303897394935bb5418b1c1c4cf35513e276c6bd313ddd1330f113ec3dc34fbd0d", "02e2baf21e36df2007189d05b9e682f4192a101dcdf07eed7d6313625a930874b4"],
"rule" : {
"rule_type": "ALLOW_IF",
"condition" : {
"condition_type" : "CHECKMULTISIG",
"minimum_required" : "2"
},
}
}
{
"standard": "smacco-1.0",
"input_type" : "single",
"pubkey_list" : ["036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb"],
"rules" : [
{
"rule_type": "DENY_IF",
"condition" : {
"condition_type" : "TIMESTAMP_LESS",
"timestamp" : "1536896190",
},
},
{
"rule_type": "ALLOW_IF",
"condition" : {
"condition_type" : "CHECKSIG"
},
},
]
}
This example is inspired by a conversation with @lerider and @vncoelho (neo-project/proposals#53), the idea is to demonstrate the capability of easily handling different logic for different assets (Neo/Gas/...).
{
"standard": "smacco-1.0",
"input_type" : "single",
"pubkey_list" : ["031a6c6fbbdf02ca351745fa86b9ba5a9452d785ac4f7fc2b7548ca2a46c4fcf4a", "036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb"],
"rules" : [
{
"rule_type": "ALLOW_IF",
"condition" : {
"condition_type" : "CHECKSIG",
"pubkey" : "0"
}
},
{
"rule_type": "ALLOW_IF",
"condition" : {
"condition_type" : "AND",
"conditions" : [
{
"condition_type" : "CHECKSIG",
"pubkey" : "1"
},
{
"condition_type" : "OR",
"conditions" : [
{
"condition_type" : "AND",
"conditions" : [
{
"condition_type" : "SELF_TRANSFER"
},
{
"condition_type" : "ONLY_NEO"
}
]
},
{
"condition_type" : "ONLY_GAS"
}
]
}
]
}
}
],
"default_rule" : "DENY_ALL"
}
Copyleft 2018
MIT license