I have an use case where i need to send data to multiple counter parties but the parties need to be kept anonymous of each other . After the endorsements are collected back from
For this, you need to use confidential identities. Confidential identities are represented in states by the AnonymousParty
class:
class MyState(val party: AnonymousParty): ContractState {
override val participants = listOf<AnonymousParty>(party)
}
The difference between a Party
and an AnonymousParty
is that AnonymousParty
identifies participants by public key only. As long as each transaction participant generates a new public key for the transaction, their identity, and therefore their involvement in the state, will be secret.
To create a transaction involving confidential identities, you must do the following:
SwapIdentitiesFlow
with each counterparty to automate the creation of confidential identities for all the participantsEach party will end up with the transaction in their vault, but each party is only identified by an anonymous public key, so the involvement of each party is kept secret from their peers.
You can find docs about this API here: https://docs.corda.net/api-identity.html. You can find an example usage of confidential identities here: https://github.com/joeldudleyr3/whistleblower.