shadow-chain implementation