Demo of institutional grade key management primitives for Substrate staking operations; utilizing multisigs, anonymous proxy accounts, and Staking + CancelProxy proxy filters. Features usage of the multisig and proxy Substrate FRAME pallets.
In one terminal, start a substrate or polkadot --dev --tmp node. (We use --tmp because we need to purge the DB between demo runs.) If you compile from scratch it can take up to 30 minutes for the node to start.
git clone https://github.com/paritytech/polkadot.git
cd polkadot
cargo run -- --dev --tmpIn another terminal download this repository
git clone https://github.com/emostov/proxy-multisig-staking.git
cd proxy-multisig-stakingInstall dependencies
yarn installRun the demo
yarn start- Eve create anonymous proxy,
A, with herself as anAnyproxy.proxy.anonymous()
- Eve adds 2/3 multisig,
M, as time delayedStakingproxy toA.proxy.proxy(proxy.addProxy)
- Eve adds 1/3 multsig
C, as aCancelProxyproxy.proxy(proxy.addProxy)-MexecutesbatchAll(staking.bond, staking.setKeys, batchAll(staking.bond, staking.setKeys, staking.validate))on behalf ofAmultisig.approveAsMulti(proxy.announce(batchAll(staking.bond, staking.setKeys, staking.validate)))multisig.asMulti(proxy.announce(batchAll(staking.bond, staking.setKeys, staking.validate)))- Wait for announcement delay
proxy.proxyAnnounced(batchAll(staking.bond, staking.setKeys, staking.validate))
Mis compromised and announces a unwantedproxy.announce(staking.validate),u, on behalf ofAproxy.announce(staking.validate)
- Announcement watchdog witnesses an unexpected proxy announcement and alerts
Ccomposite members. Cmember cancelsuon behalf ofAmultisig.asMultiThreshold1(proxy.rejectAnnouncement(u))
- Design & build announcement watchdog