In Swarm City, Seekers choose their own Provider. Providers indicate their interest in fulfilling a request by replying to it.
The Seeker has the ability to examine the reputation of anyone replying to their request.
The Seeker selects one of the Repliers to become the Provider.
How it could work:
On the detail view of an item, a list of replies is shown. The Seeker chooses a Replier to become a Provider by tapping the "Select" button.
It's important that only the selected Replier can fund the deal, so a secret is exchanged between the Seeker and the Replier.
The secret is the dealId, encrypted with the public key of the selected Replier.
The Seeker's public key is stored in the hashtagItem.
The client sends this information to the API.
The hashtagItem is updated to this:
"selectee": {
"encryptedDealId": "<String>", // the ID of the deal ( not the hash ) encrypted with the public key of the selected provider (see documentation below on how to encrypt data with a public key)
"address": "<String>" // the ETH address of the selected provider
}
After the update the API emits a hashtagItemChanged event.
The updated hashtagItem on the API has this format:
hastagItem
Key : 123abc // the dealHash
Value:
{
"itemHash": "123abc", // the sha3 hash of the unique ID held by seeker
"dateTime": "1519846041301", // dateTime when included in a block
"description": "Translate my 1 page manifesto from English to Dutch",
"value": "15000000000000000000", // Seeker's offer in SWT Wei
"hashtagFee": "500000000000000000", // Hashtag fee in SWT Wei
"location": "sp3n", // geohash
"seeker": {
"address": "0x42004cae3169A3CDa36c0fb32CAB78B1bb4CE87F", // Seeker's ethereum address
"username": "Xardas",
"avatarHash": "QmTKMG3aYCKnabDX3LKrYzLFPaCLoWEmXdGTR2CZjUEfZS", // IPFS hash of avatar
"rep": "0", // Seeker rep on this hashtag of this seeker
},
"replies": [{
"dateTime": 12345,
"username": "Tester Y",
"avatarHash": "<base64>",
"publicKey": "abc1234...", // the full Ethereum public key
"address": "0x123...abc", // the ETH address
"reputation": "<String>", // the ProviderRep balance on this hashtag
"description": "<String>", // the reply msg
}],
"selectee": {
"encryptedDealId": "<String>", // the ID of the deal (not the hash) encrypted with the publicKey of the selected provider
"address": "0x123...abc", // the ETH address
},
}
On the detail-page of myItem (= I am the seeker of this item), each reply is fully clickable, and consist of:
description
avatar
dateTime
name an "•" and ProviderRep and "SWR"
(visually represented simply as "SWR")
small white button with blue next-icon (select-button)
copy: "for (value) SWT"
By tapping one of the replies, the Seeker selects one, bringing it in the reply-detail-view (1).
The reply-detail-view (1) consists of:
small white button with blue previous-icon (back-button)
the reply message
timestamp
copy: "for (value) SWT"
avatar
name and "•" and ProviderRep (blue)
visually represented simply as "SWR"
a big white txt-button with copy "Select (name)"
Tapping the small white button with blue previous-icon will make the area change back to its default state, showing all the replies.
By tapping the big white txt-button with copy "Select (name)", the user selects this Replier to become the Provider for this deal. The area will change to the provider-selected-view (2).
The provider-selected-view (2) consists of:
reply message
timestamp
copy: "for (value) SWT"
avatar
name and "•" and ProviderRep (blue)
visually presented simply as "SWR"
We might not need to listen to hashtagItemChanged event from the API, since we already have a subscription open on item detail for real-time updates anyway. To be discussed further...
Abstract:
In Swarm City, Seekers choose their own Provider. Providers indicate their interest in fulfilling a request by replying to it.
The Seeker has the ability to examine the reputation of anyone replying to their request.
The Seeker selects one of the Repliers to become the Provider.
How it could work:
On the detail view of an item, a list of replies is shown. The Seeker chooses a Replier to become a Provider by tapping the "Select" button.
It's important that only the selected Replier can fund the deal, so a secret is exchanged between the Seeker and the Replier.
The secret is the
dealId
, encrypted with the public key of the selected Replier.The Seeker's public key is stored in the hashtagItem.
The client sends this information to the API.
The hashtagItem is updated to this:
After the update the API emits a
hashtagItemChanged
event.The updated hashtagItem on the API has this format:
hastagItem Key :
123abc
// the dealHash Value:How the API could work:
function selectProvider
parameters
hashTag <String>
the hashtag's addressdealHash <String>
the dealhashaddress <String>
the address of the selected replierencryptedDealId <Object>
the dealId encrypted with the selectedProvider public key.returns
What it looks like:
Userflow: https://invis.io/ABGM89SX3V5#/293990495_-Hashtag--contractadress---dealhash-_PROVSELECT_I ( > in Invision, hold shift to see clickable areas)
route: /hashtag/[contractadress]/[dealhash]
On the detail-page of myItem (= I am the seeker of this item), each reply is fully clickable, and consist of:
By tapping one of the replies, the Seeker selects one, bringing it in the reply-detail-view (1).
The reply-detail-view (1) consists of:
Tapping the small white button with blue previous-icon will make the area change back to its default state, showing all the replies.
By tapping the big white txt-button with copy "Select (name)", the user selects this Replier to become the Provider for this deal. The area will change to the provider-selected-view (2).
The provider-selected-view (2) consists of:
Desktop view:
Invisionlinks with login (for inspect mode!): mobile: https://projects.invisionapp.com/d/main#/console/13838256/293990495/inspect desktop: https://projects.invisionapp.com/d/main#/console/14147648/294447345/inspect
Documentation / references
Address vs. publicKey http://ethdocs.org/en/latest/account-management.html?highlight=address#keyfiles
Encrypt a message for an Ethereum publicKey: https://github.com/pubkey/eth-crypto/blob/master/tutorials/encrypted-message.md
Sample Gist showing usage & performance of the above module https://gist.github.com/sponnet/f91d826dca97321df0e3bb629ba1c621 ( requires nodejs >= v9.10.0 for the performance test )
With ♡ from Swarm City