function revokeAttribute(
    address account,
    uint256 attributeTypeID
  ) external whenNotPaused {
    
    require(
      _issuedAttributes[account][attributeTypeID].exists,
      "only existing attributes may be removed"
    );

    
    address validator = _issuedAttributes[account][attributeTypeID].validator;
    
    
    require(
      msg.sender == validator || msg.sender == owner(),
      "only jurisdiction or issuing validators may revoke arbitrary attributes"
    );

    
    uint256 stake = _issuedAttributes[account][attributeTypeID].stake;

    
    address refundAddress;
    if (_issuedAttributes[account][attributeTypeID].setPersonally) {
      refundAddress = account;
    } else {
      address operator = _issuedAttributes[account][attributeTypeID].operator;
      if (operator == address(0)) {
        refundAddress = validator;
      } else {
        refundAddress = operator;
      }
    }

    
    delete _issuedAttributes[account][attributeTypeID];

    
    emit AttributeRemoved(validator, account, attributeTypeID);

    
    if (stake > 0 && address(this).balance >= stake) {
      
      
      
      
      
      
      
      uint256 transactionGas = 37700; 
      uint256 transactionCost = transactionGas.mul(tx.gasprice);

      
      if (stake > transactionCost) {
        
        if (refundAddress.send(stake.sub(transactionCost))) {
          emit StakeRefunded(
            refundAddress,
            attributeTypeID,
            stake.sub(transactionCost)
          );
        }

        
        if (tx.origin.send(transactionCost)) {
          emit TransactionRebatePaid(
            tx.origin,
            refundAddress,
            attributeTypeID,
            transactionCost
          );
        }

      
      } else if (stake > 0 && address(this).balance >= stake) {
        if (tx.origin.send(stake)) {
          emit TransactionRebatePaid(
            tx.origin,
            refundAddress,
            attributeTypeID,
            stake
          );
        }
      }
    }
  }