-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Corda 4.3
Tokens SDK 1.2-SNAPSHOT
Hi,
I would like to know the reasoning behind the gap that I found in the EvolvableTokenType distribution list design.
Here's my example (let's follow in this example the distribution list that is stored in our maintainer: the DMV):
- 5 nodes:
- DMV: Department of Motor Vehicles; issues
CarTokenType - BMW Dealership: Issues
NonFungibleTokenofCarTokenType - Alice, Bob, and Carol: Holders of the
NonFungibleToken
- DMV: Department of Motor Vehicles; issues
CarTokenTypehas 2 modifiable attributes:- mileage
- car price (used to pay tax when car is bought)
- DMV creates a new
CarTokenType: DMV dist list is empty - Alice buys the car from BMW Dealership (i.e. BMW issues the token to Alice):
IssueTokensFlowcallsUpdateDistributionListFlow, since it's an issue command; only the issuer's distribution list is updated (see here), meaning DMV dist list is still empty - Alice's car goes through yearly inspection, repair shop calls some API to inform DMV, the DMV updates the mileage and estimated price on the
CarTokenType; since DMV dist list is empty; only DMV is aware of the update. - Alice wants to sell car to Bob; Alice's node doesn't have the latest version of her
CarTokenType.
That's the gap that I'm talking about. Now, let's assume that the DMV added Alice as an observer when they updated CarTokenType. So DMV dist list is still empty but Alice now has the latest version of CarTokenType.
- Alice sells the car to Bob; since it's a
move; thenAbstractMoveTokensFlowwill callUpdateDistributionListFlowwhich in turn will callupdateDistributionListhere; unlikeissuecommands which updates only theissuer's distribution list, amovecommand updates themaintainer(see here), so now DMV dist list has Bob - Car goes through yearly inspection; shop calls API to update DMV, DMV updates
CarTokenType, since DMV has Bob in its distribution list; then Bob gets the update (thanx to this line) - Let's say Bob sells the car to Carol; then it's a move command and again the move command updates the DMV (now DMV dist list has Bob and Carol).
So my question is, why this gap on issue? Why only on move commands do holders get added to the maintainer's distribution list, allowing them to get the updates when the maintainer does one?
On issue, to keep data in sync between the holder and the maintainer, I have to add the holder explicitly as an observer in the UpdateEvolvablteToken flow.