-
Notifications
You must be signed in to change notification settings - Fork 25
Synergy
Synergy is a phenomenon where a program that holds two capabilities can do something by bringing these two capabilities together that cannot be done when they are separated. In human terms, if I have a can, and you have a can opener, we can't help each other over the phone, but if we get together, we can open the can. In the systems we know the only way to bring capabilities together is to send one to the other in a message, or alternatively to send both to some other object.
Synergy is a general pattern in capability systems. It takes several forms: rights amplification, sibling communication, sealing or branding — even the equality operator can make synergy possible.
Rights Amplification is a particular example of Synergy where opaque tokens are passed around, representing the right to take some action. The holders of those tokens can't do anything with them directly, but they can be turned in to the service that manages them in order to exercise some more interesting power.
Sibling Communication is another way of providing Synergy. It works in languages and systems that allow direct communication between members of the same class. For instance, in Java, two members of the same class will both have access to the same static members, so they can use that as a means of private communication. Other objects can pass around objects of the Class, and when some piece of code has two of them at the same time, they can be asked to collaborate and perform actions together. Or two members of the class could be used as two ends of a communications channel that is otherwise inaccessible within the language.
This kind of privileged communications can also be represented as Sealers and UnSealers. Some object is passed in to a Sealer, which returns an opaque object. The Sealed object can only be unsealed by presenting it to the matching unsealer. This allows clients to hold and pass around objects that can only be exercised to get the original object when shared with something that has access to the unsealer.
Purses and Payments in Agoric's ERTP use equality to support synergy. Each purse holds a Handle object internally that represents its identity. The actual assets are managed by an Issuer, which recognizes the indidual Purses by using the handle as a key in a weak map. In order to transfer assets from one purse or payment to another, the two handles must both be present simultaneously.