function createLiability(
        bytes _demand,
        bytes _offer
    )
        external 
        onlyLighthouse
        gasPriceEstimated
        returns (RobotLiability liability) { 
        uint256 gasinit = gasleft();

        
        liability = new RobotLiability(robotLiabilityLib);
        emit NewLiability(liability);

        
        require(liability.call(abi.encodePacked(bytes4(0xd9ff764a), _demand))); 
        singletonHash(liability.demandHash());

        require(liability.call(abi.encodePacked(bytes4(0xd5056962), _offer))); 
        singletonHash(liability.offerHash());

        
        if (liability.lighthouseFee() > 0)
            xrt.safeTransferFrom(liability.promisor(),
                                 tx.origin,
                                 liability.lighthouseFee());

        
        ERC20 token = liability.token();
        if (liability.cost() > 0)
            token.safeTransferFrom(liability.promisee(),
                                   liability,
                                   liability.cost());

        
        if (address(liability.validator()) != 0 && liability.validatorFee() > 0)
            xrt.safeTransferFrom(liability.promisee(),
                                 liability,
                                 liability.validatorFee());

        
        uint256 gas = gasinit - gasleft() + 110525; 
        totalGasUtilizing       += gas;
        gasUtilizing[liability] += gas;
     }