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 --tmp
In another terminal download this repository
git clone https://github.com/emostov/proxy-multisig-staking.git
cd proxy-multisig-staking
Install dependencies
yarn install
Run the demo
yarn start
- Eve create anonymous proxy,
A
, with herself as anAny
proxy.proxy.anonymous()
- Eve adds 2/3 multisig,
M
, as time delayedStaking
proxy toA
.proxy.proxy(proxy.addProxy)
- Eve adds 1/3 multsig
C
, as aCancelProxy
proxy.proxy(proxy.addProxy)
-M
executesbatchAll(staking.bond, staking.setKeys, batchAll(staking.bond, staking.setKeys, staking.validate))
on behalf ofA
multisig.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))
M
is compromised and announces a unwantedproxy.announce(staking.validate)
,u
, on behalf ofA
proxy.announce(staking.validate)
- Announcement watchdog witnesses an unexpected proxy announcement and alerts
C
composite members. C
member cancelsu
on behalf ofA
multisig.asMultiThreshold1(proxy.rejectAnnouncement(u))
- Design & build announcement watchdog