U-DID - Uncoerced Donations via Information Diffusion
It is a funding system designed to run on Bitcoin Cash or similar chains, without needing protocol changes. Refer to conceptual introduction post.
Creating and publishing my first U-DID intent
I said U-DID should be easy, so let's see. My intention in this little 2-part demo is to provide some funding to the 5 main BCH protocol client dev teams [1, 2, 3, 4, 5], in a way that would be visible by the general public, and processable by U-DID aware websites automatically to display e.g. funding statistics etc.
I already have a Memo account. It's a censorship-resistent social network built on top of - Bitcoin Cash ! You can get your own in about 5 minutes!
Memo easily allows anyone to post free-form short messages that cost about dust-amounts of BCH (> 546 satoshis) in fees to send. Okay, you do need to sign up, and you do need a *tiny* amount of BCH to start posting. $0.10 gets you set up easily, so there isn't much of a barrier to entry. You can hit up a BCH faucet to get a few sats if you want to just try it out.
Memo messages are bundled with OP_RETURNs that can be ~ 200 characters (read up on the Memo protocol for exact numbers, it's more like 218 for standard msgs).
I want to publish my intent to donate some coins to BCH development teams, so that tool seems good.
I'll start with my intent message:
(I just created a simple format in JSON - this could be changed at any time. Notice the version number field - it exists for future improvements!)
{
"udid-intent": {
"version": 1,
"total_amount": 1.0,
"currency_unit": "BCH"
"recipients": {
{
"name": "Bitcoin ABC",
"percentage": 20
},
{
"name": "Bitcoin Unlimited",
"percentage": 20
},
{
"name": "FloweeTheHub",
"percentage": 20
},
{
"name": "BCHD",
"percentage": 20
},
{
"name": "Bitcoin Verde",
"percentage": 20
},
}
}
}
In case that looks like scary code to you, don't be intimidated. It is just an ordinary, plain text file.
All this intent document is saying is that this is a "udid-intent" message, covering a total amount of 1.0 in the currency BCH.
And that the recipients will be the named parties, each intended to receive 20% of the pie. Simple enough, right?
BTW, that JSON was hacked together online in a couple of minutes using https://jsoneditoronline.org/ . Good site. Next time it will take me less time because I can just re-use my template!
NOTE: I forgot to mention in what timeframe I intend to fulfil this funding commitment. That's ok. I think some funding commitments can remain unspecified. There just isn't a whole lot people can then do with that information. It's best in that case to treat it like John McAfee's promise to remove his member if Bitcoin hit some price in future. Except, he did set a timeframe, but backed out. Anyway. In future, I will add some hints to my U-DID intents about the timeframe I intend to commit to. This helps the potential recipients of the funds to plan their coming day, week, month or year.
Now I have my intent document. But one problem - it is 490 bytes (Unix line end convention), which is TOO BIG for posting in a single memo message, or even for a single OP_RETURN on Bitcoin Cash in general (currently).
No worries though.
I don't need to post this intent onto the blockchain, I can just post a hash of it as proof, as long as I make it available elsewhere. Like for example here on read.cash . Or on my personal site elsewhere. Or on my "developer funding foundation website". Anywhere, as long as someone else can download it and verify that the proof matches the "intent document". It's hard to fake because it is extremely hard to produce a different document that hashes to the same value.
With me so far?
I save the above JSON in my favorite text editor, as a copy for myself on my local folder. That way I can later provide it to anyone.
I take a hash (cryptographic digest) of it:
$ sha256sum intent.txt
986348ecdff6306ac49a2529723edf08fcdaef69cf1b8e88dad1d05ef4061494 intent.txt
I need only the number.
I could stick that directly in a Memo message, but no-one would know what it refers to (unless I let them know somehow).
Easy to let them know! Just create an intent-hash message!
{
"udid-intent-hash": {
"version": 1,
"type": "sha256"
"value": "986348ecdff6306ac49a2529723edf08fcdaef69cf1b8e88dad1d05ef4061494",
"source": {
"url": "file:///home/btcfork/intent.txt"
}
}
That's 217 bytes locally when I saved it.
It just fits nicely in a Memo message! (I could save some space by compressing it a little using some common tools that strip out whitespace).
Maybe for the "url" field, I could have put in the URL of this article which contains the full intent document, but that would require me publishing this article while I'm still writing it. I thought about it, and decided against doing that. Perhaps for my next U-DID intent.
Right now the intent-hash is looking ready to send:
And POST!
Here it is, in Memo (which seems to flatten out the whitespace on its own, resulting in an ugly looking JSON message, but hey, any good text editor will let you view the result in pretty form.
Bam! I have published proof of my intent, and I'm going to publish this article just now, so everyone can see (and verify) that the intent-hash corresponds to the intent document.
Intent hashes which cannot be verified, can only be ignored.
In Part 2 of this demo, I demonstrate how to fulfil my intent, so that everyone (and their bots) can see it happened.
You might be able to guess, the JSON message for that will be called udid-fulfilment
.
It's all going to be on-chain, as it should :)
If you like what I did, and what U-DID can do for you as a developer or potential contributor to Bitcoin Cash, feel free to subscribe here or sponsor me in any way you see fit!
Further info:
References:
[1] Bitcoin ABC
[3] BCHD
[4] Flowee
[5] Bitcoin Verde
Image credits:
...and you will also help the author collect more tips.