An experimental script for running ICO-like events on Steem

21 days ago
69 in steem-dev

With a lot of talk happening around UIA (User Issued Assets) on Steem, I decided to spend a day experimenting with how we could use some of the existing data storage here on the Steem blockchain to actually run an ICO-like event. Without actually having smart contracts like ETH, the service itself I wrote is a sort of "fake" smart contract that runs much like a bot would, using steem-python. It's no where near as secure as a real smart contract however, as you actually have to trust the user running the script to do you right.

The source code is available here.

At this early of a stage, it's only function is to process incoming transactions, ensure they're valid, and make an trail of transactions that could then be audited to prove participation. The goal is to explore how we (as a community and as developers working with Steem) can raise funds to help kickstart projects without having to tap into the rewards pool so much. Imagine how much it would contribute to Steem's success if we had a dozen teams all working on their own individual (and funded) Steem platforms!

As a note, no one should expect to download this script and use it as is :)

Concepts & Theories

Channeling between two accounts

The current model I have setup uses two accounts, a donation account and a processed account. Each transaction between donation account sending to the processed account is considered as a "valid" donation for the purposes of these fake ICOs. Any funds that are just sent to the donation account while the script isn't running (to process it) or any donations send directly to the processed account would not be considered valid for the ICO, and would end up being purely untracked donations.

The donation account is a funnel which receives all donations for the project and processes their validity based on:

  • start block
  • end block
  • currency type (steem/sbd)

It also is the account that stores the state of the event within it's json_metadata. The donation account's goal is to never actually hold onto funds for more than a minute or so (while waiting for irreversible blocks), so that if it gets compromised, there are no funds within it.

The processed account is the final destination of all valid funds, and only funds sent from the donation account are considered valid. This account should have it's keys locked up tight (not in a script like this), and probably using multi-sig for it's owner/active keys.

State storage & persistence

Currently to maintain an index of donors, the script updates it's own state to the json_metadata of the donation account upon activity, at most once a minute. Any block explorer will show this data, and it would be very easy to build a live updating webpage for an ICO that just continually reloads the donation account and parses it's json_metadata. This provides an easy way to see who has donated and how much without having to replay the entire sequence of blocks to build an index.

Ideally, that's what should be done though, building an index that monitors the start and end blocks, then builds a donor list based on the transactions between the donation and processed accounts.

The json_metadata field has limitations, mainly related to the maximum block size on Steem. Quick estimates show that approximately 2000 account could donate using this method before the json_metadata field for the account fills up. So that's a challenge to overcome. Luckily since the transfer between the donation and processed accounts is the actual operation of record, the overall donation log could be audited and rebuilt even if it filled.

Bandwidth(gas) for transfers

The script is intelligent enough to queue/batch all transfers, and upon a failure to send, reports the failure within the console and retains the operation for when enough SP is available. Every 10-15 seconds it attempts to process all ops within the queue, and will process as many as it's currently allowed with it's bandwidth.

If the account itself see's a massive amount of transactions during the ICO - more SP may need to be delegated to the account in order to allow processing of all of the transactions.

Transferability & Tokens

This setup currently doesn't support the ability to transfer ownership of tokens OR even the existence of tokens.

The hope is that if UIA's end up coming to Steem, this workflow model could be adapted to actually issue tokens upon creation, thus solving both of these challenges.

Expanding into custom_json ops

Things could get very interesting with more work on this concept and the expansion into custom_json ops within the blockchain. The ops themselves are still bound to the limitations of the block size, but these ops could be used for transferring ownership (before UIAs), maintaining state, and setting parameters of the event.

Future Plans

I'm planning on continuing the exploration of these ideas, and am looking forward to seeing what sorts of ideas the community has around this concept. Making an announcement post and simply asking for donations works to some degree, but having a real system where we could run crowdfunding events for projects within the blockchain would be an incredible step forward.

Once I have a little more stable version of the script, I'll probably setup a test to stress-test the bot and it's performance to see how it does. Priorities are elsewhere for the time being though, so I'm not sure when I'll revisit the concept.

Authors get paid when people like you upvote their post.
Join our amazing community to comment and reward others.
Sort Order:  trending
72
  ·  20 days ago

cool meanwhile project :) I can´t wait to play with the real deal, is gonna be awesome!!

·
·
·
35
  ·  18 days ago

Cool

·
63
  ·  21 days ago

... steemit

·
·
31
  ·  20 days ago

He obviously meant steam.

59
  ·  20 days ago

Can't wait for first successful ICO on Steemit.

69
  ·  21 days ago

Why not just let people send funds to the donation account, and then lookup transaction history to determine which deposits were valid or not?
What problems does icomanager attempt to solve? I'm not sure I understand the concept.

·
69
  ·  21 days ago

You could definitely do that, and then by hand return all of the invalid funds and record which ones were valid into some sort of data store.

The goal here was to automate it like most smart contracts would do - sort of like an ERC20 token sale on ETH would.

I don't know that it specifically solves a problems though. It doesn't have to, it's an experiment and it was fun to write :)

Kudos to you for your work on steem-python, I've been enjoyin writing things like this in it!

·
·
69
  ·  21 days ago

You don't have to do anything by hand, you can just auto-refund invalid ones with a script.

Furthermore, if you want to have 2 accounts, you can pass references by including original deposit's trx_id, into a transfer's memo. Thus, you can move funds from donation to cold address without losing a reference to whom paid what.

In any case, these solutions are off-chain, and I think that mimicking a smart contract is an engineering overkill.

·
·
·
69
  ·  20 days ago

The things you outlined are exactly what this does... ? It's a script that auto refunds and auto transfers.

These solutions can absolutely be off chain - which I also outlined in my post. I didn't want to setup a database for this experiment so I choose to store the data on chain. I even outlined that these should be stored in an external index for scalability.

In any case, these solutions are off-chain, and I think that mimicking a smart contract is an engineering overkill.

Overkill is fun to do some times :)

I prefaced this whole thing stating this was an experiment and that I'm not even running the script for anything. I'm looking to spur discussion on how people could use the blockchain to accomplish fund raising, and provide some example scripts that might get peoples brains thinking. Nothin more!

59
  ·  21 days ago

Am I missing something her? @jesta do you work for Steemit inc? Seriously. Your work is becoming pretty fundamental to the survival and the success of this network and site.

I can not thank you enough and even though I'm actually short on cash, I would happily power down and donate half of my account holdings to you at this point.

You're changing the game. You're revolutionary.

·
69
  ·  20 days ago

I am not employed by Steemit Inc :)

I think within the Steem ecosystem there's room for potentially dozens/hundreds of individual businesses to operate. Look how many companies revolve and build services around BTC! It's my hope to eventually be one of those other companies, operating under some of the visions I have for Steem, and to continue building great community based platforms.

Thank you though! I'm just one cog in this grand machine. There's dozens of other people who's work I rely upon to enable me to build these sorts of things.

·
·
59
  ·  20 days ago

That's what I was hoping and I agree!

66
  ·  21 days ago

@jesta, I will openly admit I barely understand many of the technical items you discuss as it is out of my realm. But what I do recognize is the value you have provided the steemit community in the 11 months I have been here. Steemstats (which I use everyday) is big value add, along with everything else.

I thank you for it.

If you ever have any questions about personal finance, real estate or investing feel free to ask as that is what I am knowledgeable in. Least I could do after all you have done for the community. Steem on.

·
66
  ·  21 days ago

Just voted you for witness as well, didn't realize I hadn't already. Thanks again!

·
·
69
  ·  21 days ago

Thank you as well! It makes me pretty happy to know so many people find value and usefulness in the projects I put time into :)

60
  ·  21 days ago

Why do I follow you again? Oh, that's right, you educate me.
Thanks for the post.

72
  ·  21 days ago

Just quickly perusing the article and without looking at the code, one question arises: why don't you use the native escrow function of the blockchain? And then using the custom_json layers for further meta-data, if need will be? Just curious.

Anyway, kudoz and thanks for all your hardwork here, @jesta!

·
69
  ·  20 days ago

Honestly I didn't even think about it. That'd be a pretty interesting use case for escrow.

·
·
72
  ·  20 days ago

Yeap, that's what I thought too. Btw, sent you a DM in chat, maybe you'll have time to look. Thanks.

67
  ·  20 days ago

This is huge, again! What a great idea and you are making it all happen. You rock!!!

Thanks for sharing the wealth of information with us and keeping us up-to-date with the news. Namaste :)

68
  ·  21 days ago

Fuck yeah! Building the foundation of Steem v2. I envy your skills.

68
  ·  21 days ago

Interesting! Never stop, I can't wait to see what you keeping cooking up :)

I've been thinking about ICOs for offline businesses. The real challenge seems to be legal and accounting.

56
  ·  21 days ago

You are a genius! Recently tried using your steemstats.com and found it very useful. Keep up!

50
  ·  21 days ago

Very awesome concept. I'd love to see this implemented here!

cheers,
@clayford08

67
  ·  21 days ago

way to go!

35
  ·  21 days ago

Interesting idea.

If the account is compromised, could the attacker start sending the coin out without waiting for the confirmations to complete?

·
69
  ·  21 days ago

If they compromise the server running the scripts - yes. I suppose if they got ahold of the active key they could do the same too.

It'd be pretty obvious (hopefully) to the owners that some of the funds were being redirected else where. At least in those scenarios, all of the funds that have already been processed would be safe :)

50
  ·  21 days ago

too technical for me....but deserve my upvote and resteem for your effort...hehehe...

44
  ·  21 days ago

Nice post! Thanks. Please follow me: @martinst

54
  ·  21 days ago

This is yet another demonstration of steem-python's ability to accomplish such advanced tasks in such a simple manner!

58
  ·  21 days ago

Is it really possible to run ICO tokens on steem..

·
59
  ·  21 days ago

Not to run the tokens themselves on Steem, at this point, but using Steem to sell them to the first round of public users could work. Then you could trade them on Openledger.

You should keep an eye out for EOS, Dan Larimers new project.

36
  ·  21 days ago

I haven't seen much for crowd funding to be honest. And even if I did see a mention of transfer if I wanted to I couldn't because there is no directions on how to. (Is there? And I just didn't see it?) the only resource I've been able to utilize is voting. :(

33
  ·  21 days ago

So much great information

50
  ·  21 days ago

nice post...I like this.

55
  ·  21 days ago

Thank you for your sharing

35
  ·  21 days ago

Interesting idea. If you ever need some help with Python, or want to look more at the IT security side, let me know. I'd love to help out!

72
  ·  21 days ago

jesta for president of the blockchain!

46
  ·  21 days ago

Great development and experimental!

59
  ·  21 days ago

We really need something like this.

62
  ·  21 days ago

Hi @jesta superb work. Steem on

41
  ·  21 days ago

Excellent experimental script @ jesta

44
  ·  21 days ago

we need more posts like this on steem, valuable information. Great job

58
  ·  21 days ago

Watching and learning. Thanks for all your efforts!

36
  ·  20 days ago

I will upvote you , please you will follow me .

42
  ·  20 days ago

Valuable post.. Good information.. Good job

62
  ·  20 days ago

This is crazy cool work man thank you so much @jesta for putting your time and energy into this, I really appreciate it.

41
  ·  20 days ago

You have a devil mind man!!! go 4 it!!!

36
  ·  20 days ago

you're cool, more than a steemer..
good job!!

41
  ·  20 days ago

Nice post. Thank you.
haahahahah like it.

47
  ·  20 days ago

53
  ·  21 days ago

Interesting publication of truth is very good information for all of us congratulations friend,, I hope you can go through my blog and notice my publications that largely deal with the crisis that my country is currently experiencing ... hits @jesta

38
  ·  20 days ago

wow @jesta. Steem is really getting some good upgrading so far.

48
  ·  20 days ago

@jesta Unreal You are the Man

47
  ·  20 days ago

Extraordinary hard work, what is done very well, I am touched very much by sharing this very valuable information.

52
  ·  20 days ago

@jesta Interesting proposal. you might want to look at what starbase is doing too? starbase.co They are STAR token though and product is not launched yet :-) But I think it has great potential

49
  ·  20 days ago

This is a crazy Idea man I love it !

50
  ·  20 days ago

Good work @jesta.

I'm currently doing some surveys for some projects that I believe would fit the purpose of Steem. This script could be of some use very soon.

38
  ·  20 days ago

sounds like a great idea! would it be possible to create multisig accounts on steem, so that the trust comes from resprected multisig members?

·
69
  ·  20 days ago

Not easily, but yes, it's totally possible

51
  ·  21 days ago

Now this is what im talking about. Open source Matters!!! I'm not verus in python but I'm going to take a look at your code.

50
  ·  20 days ago

I love how open source crypto currency code is.

65
  ·  20 days ago

Congratulations @jesta!
Your post was mentioned in my hit parade in the following categories:

  • Upvotes - Ranked 3 with 972 upvotes
  • Pending payout - Ranked 2 with $ 5098,83
41
  ·  19 days ago

I literally glanced over this post, stopped a few times an I definitely will have to give a proper read of this later.

65
  ·  19 days ago

Super you are working on a crowd fund service.

Making an announcement post and simply asking for donations works to some degree, but having a real system where we could run crowdfunding events for projects within the blockchain would be an incredible step forward.

I fully agree! Any successful service has a tailor made workflow and UI to optimise the user experience to become as simple as it can get. The more complex, the less it'll be used.

Looking forward what will come out of your and the community hands. I'm not an engineer, therefore don't know how I could be of support.

37
  ·  19 days ago

Hey guys! New to steemit and need some exposure! Great content exposing the new world order! Check it out!

67
  ·  19 days ago

I am not technical enough to understand ICO and dev terms but I can see this is a positive one, keep the Steem Force going the positive way :)

39
  ·  18 days ago

Impressive. I wish I spoke code :(

59
  ·  18 days ago

Very good ...I like this info :)

45
  ·  18 days ago

Congratulations! Your post has been shared on Steemit Facebook!

https://www.facebook.com/SteemitOfficial/

A new initiative has started where a valuable #Steemit post will be upload on the Steemit Facebook account to reach a broad audience and attract more people to Steemit!

Want to know more?
Check it out: https://steemit.com/facebook/@steve-speaks/stealing-facebook-users-everyday-1-steemit-post-will-be-posted-on-steemit-facebook-to-increase-your-audience

50
  ·  18 days ago

Interesting concept. Obvously you sill have a long way to go. I never knew steemit could be used to crowdfund. I guess you learn something new everyday.

35
  ·  18 days ago

Cool

55
  ·  18 days ago

It can be quite a challenge to get start-up funding for projects. It would be nice to have an avenue to help access funds for steem related projects.

32
  ·  17 days ago

I'm quite interested in learning more about this...I feel as though I have just opened Pandora's box.