Dealing with concurrency on Cardano is something that most dapps and protocols have had to contend with due to the nature of utxo. There exists some local state and more than one actor wants to mutate that state at the same time.
Traditionally, this has been solved by each dapp one of two ways.
1.) Fragment the utxos so that each actor has a better chance of getting their own view of the world to complete their transaction. This is complex for a developer to implement, still results in some collisions of actors, and doesn't scale well due to the added costs of maintaining a large set of utxos.
2.) Utilize a "batcher" approach. Each actor submits an "order" transaction that represents their desire to complete an action on the protocol. Later, the protocol operator or a federated group of batchers bundles up the orders and executes them as a group against the protocol.
On other blockchains that are not utxo-based, an account-model has no issue with concurrent transactions as they have global state. Every protocol having to manage a huge list of utxos or find a way to pay decentralized batcher/scooper operators. This is a reason to pick other chains instead of Cardano. For example, WorldMobile picked a cardano sidechain based on Cosmos.
One idea I had to solve this issue is to create a CIP for Smart Transactions™.
A Smart Transaction contains input and output utxos just like a standard transaction. However, some of the input and output utxos are not fixed at submission time, but are instead resolved while the transaction sits in the mempool. Instead of a hash#index for an input utxo, it is defined as a criteria object.
A Criteria object contains an address bytearray. This will cause the mempool to find a utxo that must be assigned to that address. Additional fields can be added to this criteria to match on amount of ada (exact, less than, greater than, between). Another field could be added to match a utxo containing specific inline datum values. There also needs to be the concept of capturing datum values as variables that can be used on the output side of the smart transaction.
The cardano-node is already validating transactions in the mempool. Whenever a new block arrives, transactions that exist in that block are dropped from the mempool. Also, any mempool transaction that has passed beyond the TTL value becomes invalid and is dropped.
What Smart Transactions proposes is to add additional validation to see if there exists any utxos that can be gathered to make a valid transaction. If it ever happens that a valid transaction cannot be built based on a transaction's criteria, it will be dropped from the mempool. If a valid transaction can be constructed from utxos in the virtual mempool ledger state, they are added to new areas outside of the body of the transaction. So a Smart Transaction contains criteria utxos, smart output utxos, and an area of what utxos got resolved by the mempool.
On the output utxo side, there needs to be some flexibility so that an output utxo can have a computed amount of ada, native assets, and datum. I'm not sure exactly how to implement this piece, but we need to support certain capabilities such as take an input datum integer value, increment it and apply it to the output datum. Maybe snippets of plutus code could be used for these capabilities.
At the end of the day, we need to have the capability for two actors to put in a Smart Transaction that interacts with a smart contract, doesn't specify exactly which utxos on the contract it uses, but instead specifies what a utxo must look like to be used. Then, if both come in at nearly the same time, the second one ends up selecting utxos from the output of the first one. Both are placed successfully into the mempool as chained transactions.
There are likely some security implications to this to ensure it cannot be overly abused. Users might need to be warned whenever a criteria is selecting an open-ended utxo from an address in their own wallet. This also introduces the possibility that pool operators could engage in front-running. We would need to decide on whether this type of capability is useful enough to overcome these issues. I personally think this would open up Cardano to be able to build any type of protocol or dapp that is currently possible on other blockchains without resorting to batchers or cost-prohibitive architectures.