B2B Agreements
In MyOS, business agreements are simply Blue documents that establish formal relationships between parties with specific terms, conditions, and operations. While there's nothing technically special about these documents—they appear in Blink's activities like any other document—they serve a critical business purpose by transforming static agreements into dynamic, executable processes.
Beyond Basic Access Rights
In the previous section, we saw how Alice could share her teaching agent directly or through offers. Now we'll explore another powerful approach to establishing business relationships in MyOS – creating specialized B2B agreement documents that define custom terms, payment structures, and operational workflows between organizations, all using the same underlying Blue document-with-rules foundation.
Blue is particularly well-suited for B2B agreements because it can:
- Precisely specify everything the parties have agreed upon
- Transform static terms into executable operations
- Maintain state to track the relationship over time
- Automate workflows between the parties
- Handle permissions and access rights conditionally
What makes Blue agreements truly powerful is distributed trust. Rather than Alice and the platform needing to fully trust each other, they can involve trusted third parties (like payment processors or verification services) to independently enforce specific parts of the agreement. This shifts trust from the relationship to the process itself, creating more secure and reliable business arrangements.
In this section, we'll focus on establishing the agreement structure and operations. Later, in the Payments section, we'll extend this example to include automated payment processing, showing how the same agreement can evolve to handle financial transactions.
Alice's B2B Agreement Story
Let's continue Alice's teaching journey and see how she expands her business through a B2B agreement with an e-learning platform.
Receiving the Agreement Proposal
Alice receives a proposal from "Sample E-learning Platform" who wants to resell her online lessons to their students. The platform needs to access Alice's schedule and manage bookings on behalf of their customers.
Opening the proposal, Alice can review the specific terms offered:
Alice can see Blink's summary of the key agreement terms:
- The platform will pay 10% of sales with a minimum payment of $100
- They want the ability to cancel bookings up to 48 hours in advance without penalties
- Either party can terminate the agreement at any point
If Alice has questions about the proposal, she can ask Blink directly to clarify any details:
Agreement in Action
After Alice accepts the agreement, it becomes active and the e-learning platform can begin booking lessons on behalf of their students. The agreement document keeps track of all activity and maintains the current balance:
As lessons are booked, the agreement automatically:
- Tracks each booking in its activity timeline
- Updates the current balance ($187 in this example)
- Counts the total lessons booked (12)
- Maintains the agreement's operational state
When Alice wants to request payment for the accumulated balance, she can use the "Request payment" operation built into the agreement:
Technical Details (TODO)
-
same interface for operations as for Online Lessons booking part
-
bookOperation, Platform:
- call booking on the subagent
- if succeeded, add one credit to the current balance
- save the booking document
-
cancelOperation (date, reason), Platform:
- find booking document related with this date
- if exists, call cancel()
- if that succeeds, update current balance
- otherwise return the error
- return error that not such booking exists
-
requestPayout, Alice
- if biz conditions are met, Platform is informed Alice would like to be paid
-
terminate, both
- each party can terminate this agreement at any point
-
channels:
- Alice timeline
- Platform timeline
- Alice's agent for Online Lessons
-
some Java code to show booking to Online Lesson or to this agreement share the interface