I want Solidity code to define a function f that would map two Ethereum addresses A, B into a new address X = f(A,B) such that there is nearly zero probability that X is an already taken address (an address of an existing wallet or an address equal to f(C,D) where C!=A or D!=B.
I will explain why I want this. I want to create a token COURT that would represent decisions of several courts, each court denoted by an address. A party may endorse or not endorse the court decision. If a court B decision is enforced on a wallet A then f(A,B) is considered as a valid reservoir of money, otherwise not.
address(uint256(keccak256(abi.encodePacked(addressA, addressB))))
should do the "concatenate them together and hash" part. But make sure that's going to actually be useful for you.mapping(address => mapping(address => uint256)) courtBalances
and usecourtBalances[addressA][addressB]
?