An experimental script for running ICO-like events on Steem

in steem-dev •  2 years ago  (edited)

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.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

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


  ·  2 years ago Reveal Comment

You're the fucking man @jesta.

You've done far more for Steem than, well, nevermind...

... steemit

He obviously meant steam.

Can't wait for first successful ICO on Steemit.

  ·  2 years ago Reveal Comment
  ·  2 years ago (edited)

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.

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!

  ·  2 years ago (edited)

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.

  ·  2 years ago (edited)

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!

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.

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.

That's what I was hoping and I agree!

@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.

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

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 :)

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

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!

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

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

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 :)

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

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.

Nice post! Thanks. Please follow me: @martinst

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
  ·  2 years ago (edited)

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

Congratulations! Your post has been shared on Steemit Facebook!

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:

Nice post. Thank you.
haahahahah like it.

Interesting idea.

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

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 :)

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

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

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

@jesta Unreal You are the Man

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

nice post...I like this.

Valuable post.. Good information.. Good job

Great development and experimental!

We really need something like this.

Hi @jesta superb work. Steem on

Excellent experimental script @ jesta

jesta for president of the blockchain!

Watching and learning. Thanks for all your efforts!

I will upvote you , please you will follow me .

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

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

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

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

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.

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

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.

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. :(

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

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


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

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

This is a crazy Idea man I love it !

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.

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

Not easily, but yes, it's totally possible

So much great information

I love how open source crypto currency code is.

Thank you for your sharing

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

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.

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!

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 :)

Impressive. I wish I spoke code :(

Very good ...I like this info :)

way to go!

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.


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.

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

  ·  2 years ago Reveal Comment

Wow, this sounds Amazing!! Quite inspirational for me as well! Way to go @jesta :) !! Keep it up!! Wishing you a inspirational start to your week :)!!!

And following you now :)!!!
plz. upvote & comments all my post

  ·  2 years ago Reveal Comment