create account

Tips and Donations System (Hivemind Implementation) by imwatsi

View this thread on: hive.blogpeakd.comecency.com
· @imwatsi ·
$7.48
Tips and Donations System (Hivemind Implementation)
Without getting into the technical details too much, here's an overview of the implementation ideas I have, summarized from my current notes.

### Tracking payments

A memo protocol to define tips/donations can be used to trigger Hivemind to record the transactions in the database. This will standardize the memo values used when sending the payments (UIs will be responsible for generating these when tipping, and these details will be hidden from users).

The memo can have two sections:

- Identifier
- Destination: Associated post (permlink) or user account name

With Native Ads, I used a protocol that resembles: `hna:hive-133333/interesting-promo`.

- The `hna:` part is the identifier, an abbreviation of **Hivemind Native Ads**
- `hive-133333` is the community name
- `interesting-promo` is the permlink of the ad post

So I will design a memo protocol for this donations system as well.

### Support for goal-oriented donations

*These were inspired by @midlet's [recent post](https://beta.steemit.com/hive-136578/@midlet/the-fundraiser-a-concept-for-a-dapp-widget-feature-something)*

In short, a user can create a "donation post" to raise funds for any goal they want to. The post will contain metadata that defines it as a donation post as well as various parameters for the fundraising, like timeframes, funding target, etc.

So when a front-end loads this post, it will have access to these properties. The Hivemind API endpoint will also avail calculated stats for that post, such as total contributions and the contributing account names.

### Subscriptions (recurring payments) to support creators

*Inspired by @chekohler's [recent post](https://beta.steemit.com/hive-136578/@chekohler/subscribtions-on-steem-taking-donations-a-step-further)*

We could enable tips to be sent without associating a post, but an account instead, in the `Destination` portion of the memo protocol.

This gives front-ends options to show the following on a person's profile page or one of those profile dropdowns:

- "Send tip" button on a person's profile, which sends a tip to that person, which is only associated with that account and not any particular post.
- "Support this author" button that sets up a recurrent payment. It's only recurrent figuratively, since we don't have this functionality on the blockchain level. We could utilize a new custom JSON op to pledge `support` for an author/account.

I suppose this can also be used on communities as well, since communities are in essence Steem accounts that can receive funding. A "Support this channel" button can be introduced.

### Stats about donations

From suggestions made by @chekohler (concerning a way to see posts with the most donations like "trending"), my plan is to create endpoints that front-ends can use to access stats about donations. These can be organized by a variety of criteria such as community, tag, date, etc.

---

# FRONT-END ISSUES

*As far as the Hivemind backend work is concerned, there aren't any dependent changes that can stop me from starting work on this. However, there are front-end issues that will need to be addressed for the tipping/donations system to be implemented well:*

## Security of active keys and batch transactions

Right now, people use posting keys to login and perform social interactions and it's a prudent move because it safeguards funds.

There is a simple method to support tips and donations in a way that is integrated with social actions, but this simple method is not necessarily the best, for security reasons.

### The simple way: just let people sign in with active keys

Though this is simple to implement, it exposes a user's liquid funds to security vulnerabilities.

Another option that branches off this one is: *To enable tipping for the session by entering active key once.*

Now, this introduces an elevated risk since the more times you use your active key (copy to clipboard, etc) the higher the chance of a leak.

*One solution I had in mind:*


### Batch transactions

We could use `custom JSON` ops to record tips/donations, which only requires the posting key. Then these can be "pending" until a user visits their Wallet page and "releases" them, using their active key. In which case, the various transactions will need to be batch processed.

These transactions will also include the recurrent ones mentioned above, when they're due.

Hivemind can synchronize and serve this list of pending donation transactions as part of Wallet "context" through the API. The list is shown to the user for them to verify and approve.

I'm not sure if making batch transactions is possible on Steem, i.e. "one transaction containing many transactions." I couldn't find anything about it in the documentation.

Perhaps a front-end script embedded within the current Wallet session of a user that works in the background sending these individual transactions one-by-one can also work, if batch transactions aren't possible.

If batch transactions aren't possible on the blockchain level, can we make an exception for payments? Can that be proposed? Is it feasible? I'm not proficient in C++ so I can't speak on its feasibility/complexity.

***What do you think? In your opinion, how best can we go about solving the front-end issues above?***
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 204 others
👎  
properties (23)
authorimwatsi
permlinktips-and-donations-system-hivemind-implementation
categoryhive-136578
json_metadata{"tags":["hivemind","tips","donations","steemdev"],"users":["midlet","chekohler"],"links":["https://beta.steemit.com/hive-136578/@midlet/the-fundraiser-a-concept-for-a-dapp-widget-feature-something","https://beta.steemit.com/hive-136578/@chekohler/subscribtions-on-steem-taking-donations-a-step-further"],"app":"steemit/0.2","format":"markdown"}
created2020-01-09 14:57:06
last_update2020-01-09 14:57:06
depth0
children8
last_payout2020-01-16 14:57:06
cashout_time1969-12-31 23:59:59
total_payout_value3.786 HBD
curator_payout_value3.696 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,273
author_reputation131,386,362,730,495
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,225,725
net_rshares26,462,445,956,323
author_curate_reward""
vote details (269)
@borislavzlatanov ·
What about redirecting the user to their Wallet for any financial operations?
properties (22)
authorborislavzlatanov
permlinkq3umcs
categoryhive-136578
json_metadata{"app":"steemit/0.1"}
created2020-01-09 16:41:18
last_update2020-01-09 16:41:18
depth1
children1
last_payout2020-01-16 16:41:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length77
author_reputation23,537,778,362,414
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,229,618
net_rshares0
@midlet ·
Sort of defeats the purpose. The whole point is to create a frictionless user experience.
👍  
properties (23)
authormidlet
permlinkq3uodp
categoryhive-136578
json_metadata{"app":"steemit/0.2"}
created2020-01-09 17:25:00
last_update2020-01-09 17:25:00
depth2
children0
last_payout2020-01-16 17:25:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length89
author_reputation293,267,832,592,637
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,231,054
net_rshares284,510,020
author_curate_reward""
vote details (1)
@c-squared ·
c-squared-comment
<div class="pull-left">https://cdn.steemitimages.com/DQmVHt1f2jqCViLk6dX2SZsajYRWBpmdQA7sQDEbuQBxFB3/c2100.png</div><br>This post was shared in the <a href="https://discord.gg/B8JFmJ4">Curation Collective Discord community</a> for curators, and upvoted and resteemed by the @c-squared community account after manual review.<br/>@c-squared runs a <a href="https://steemit.com/witness/@c-cubed/announcing-the-launch-of-the-new-c-squared-witness">community witness</a>. Please consider using one of your witness votes on us <a href ="https://steemconnect.com/sign/account-witness-vote?witness=c-squared&approve=true">here</a>
properties (22)
authorc-squared
permlink20200109t234216439z
categoryhive-136578
json_metadata{"tags":["c-squared"]}
created2020-01-09 23:42:30
last_update2020-01-09 23:42:30
depth1
children0
last_payout2020-01-16 23:42:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length622
author_reputation8,872,520,093,091
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,240,419
net_rshares0
@midlet ·
Thoughts on the security issues.

So one of the things I took away from the users surveys I conducted as well as my own experience is that when we all say Steem is too hard, that's not 100% accurate. Everyone said it's easy once you learn or something along those lines. That seems pretty obvious, but I read that as in that it's not like there's a lot you have to remember or that it's actively difficult even with repeated use.

What that says to me is that it's not that using Steem is hard, it's that finding information on how to use Steem is hard. You have to scour the internet, or ask people on Discord, or the explanations that are accessible were written by people who are not very good at putting things plainly and making information accessible for people coming from a variety of levels of technical sophistication.

So to the point, I don't think frontends should "force" or push users to sign in with particular keys. I think there should be clearly written and easily accessible information on what the different keys do, and which one is appropriate for what actions. Then let the users do what they want. We are not the custodians of their security. That's their responsibility. We shouldn't sacrifice user experience for nanny security. That's what Steemit has been doing and it's not working.

Another angle

Use Keychain. This presents problems because there is no mobile version of keychain and it's a separate app that requires download and installation etc, but it only needs to be done once and it drastically improves the experience. Again, just making it part of the flow to point people to download Keychain and explain what it does clearly and concisely. Its not an ideal solution, but it's many steps forward from where we are.

The experience we want to move towards is donations/tips being about as frictionless as upvoting. It might require some different approaches to how we think about security, but I think it's worth it.
👍  ,
properties (23)
authormidlet
permlinkq3uoc4
categoryhive-136578
json_metadata{"app":"steemit/0.2"}
created2020-01-09 17:24:06
last_update2020-01-09 17:24:06
depth1
children2
last_payout2020-01-16 17:24:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,958
author_reputation293,267,832,592,637
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,231,031
net_rshares11,746,235,342
author_curate_reward""
vote details (2)
@imwatsi ·
$0.05
> We shouldn't sacrifice user experience for nanny security.

I agree. UX is top priority.

I can't recall off the top of my head where I read or heard this, but it goes something along the lines:

*The app shouldn't adapt to the limitations of the blockchain at the expense of UX but the blockchain should cater to the needs of real world apps.*

That said, I think Keychain is an awesome way to bridge that gap. It would be beneficial if it was highlighted more, like how MetaMask has become ubiquitous.

This is from a section of their API documentation:

> Sites can request that the extension sign and broadcast a transfer operation for STEEM or SBD. Note that a confirmation will always be shown to the user for transfer operations and they cannot be disabled.

Perhaps we could propose this to them to support tips/donations:

- provision a setting for tip enabled site (think trusted sites)
- allow unconfirmed transfers on that site only, that follow these rules:
    - only transfers that follow the memo protocol (can be implemented using a regex check)
    - must be below a user set maximum (optional)
👍  
properties (23)
authorimwatsi
permlinkq3utui
categoryhive-136578
json_metadata{"app":"steemit/0.2"}
created2020-01-09 19:23:09
last_update2020-01-09 19:23:09
depth2
children1
last_payout2020-01-16 19:23:09
cashout_time1969-12-31 23:59:59
total_payout_value0.027 HBD
curator_payout_value0.027 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,114
author_reputation131,386,362,730,495
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,234,253
net_rshares324,397,277,331
author_curate_reward""
vote details (1)
@midlet ·
> Perhaps we could propose this to them to support tips/donations:
> - provision a setting for tip enabled site (think trusted sites)
> - allow unconfirmed transfers on that site only, that follow these rules:

Sounds solid. Wonder if they'd be open to that. @yabapmatt
👍  
properties (23)
authormidlet
permlinkq3uudh
categoryhive-136578
json_metadata{"users":["yabapmatt"],"app":"steemit/0.2"}
created2020-01-09 19:34:30
last_update2020-01-09 19:34:30
depth3
children0
last_payout2020-01-16 19:34:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length269
author_reputation293,267,832,592,637
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,234,638
net_rshares277,741,946
author_curate_reward""
vote details (1)
@steemitboard ·
Congratulations @imwatsi! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://steemitimages.com/60x70/http://steemitboard.com/@imwatsi/votes.png?202001091950"></td><td>You distributed more than 1250 upvotes. Your next target is to reach 1500 upvotes.</td></tr>
</table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@imwatsi) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=imwatsi)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-imwatsi-20200109t204656000z
categoryhive-136578
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2020-01-09 20:46:57
last_update2020-01-09 20:46:57
depth1
children0
last_payout2020-01-16 20:46:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length893
author_reputation38,975,615,169,260
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,236,427
net_rshares0
@tts ·
To listen to the audio version of this article click on the play image.
[![](https://s18.postimg.org/51o0kpijd/play200x46.png)](http://ec2-52-72-169-104.compute-1.amazonaws.com/imwatsi__tips-and-donations-system-hivemind-implementation.mp3)
Brought to you by [@tts](https://steemit.com/tts/@tts/introduction). If you find it useful please consider upvoting this reply.
👎  , ,
properties (23)
authortts
permlinkre-tips-and-donations-system-hivemind-implementation-20200109t152143
categoryhive-136578
json_metadata""
created2020-01-09 15:21:42
last_update2020-01-09 15:21:42
depth1
children0
last_payout2020-01-16 15:21:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length368
author_reputation-4,535,154,553,995
root_title"Tips and Donations System (Hivemind Implementation)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,226,532
net_rshares-89,941,159,159
author_curate_reward""
vote details (3)