Standardised Formatting for Motions


We had some issues recently with different users not being able to correctly verify motion hashes. It seems that different browser/OS combinations treat the text coming from this website differently to each other and this was causing the checked hashes to return different values to the original.
This prompted me to build a browser independent tool for both formatting and verifying motions and their hashes. The tool is the Assistant bot which also has some other functions around this forum.

To use Assistant to format a motion, send a PM to @assistant. the first two words of the message should be ‘motion hash’. Any other text in the message will be treated as the motion text and will be formatted into a standard motion.

eg. motion hash this is my motion

Once correctly formatted, Assistant will calculate the RIPEMD160 hash of the motion text and will reply to your PM with the text for your post.
To copy that text you need to click the ‘Verify’ link towards the bottom of Assistant reply. This shows you the raw text that was hashed. If you paste that raw text, in it’s entirety, into your post, it will appear nicely formatted as it did in Assistant reply.
If you don’t copy the raw ‘verify’ text, your post won’t be nicely formatted and the verification text will fail the hash if any one checks.

Assistant adds some hidden html tags to the formatted motion which will allow future tools to easily access information.

To verify a motion hash, reply to a motion post, mention Assistant and follow immediately with the word ‘verify’. Assistant will scan the entire thread for any motions and re-calculate the hash on each. This provides a nice, easy way to verify that a motions text hasn’t changed and that you are voting for the correct thing in your Nu client.

I hope Assistant becomes useful. It will certainly help some beneficial development ideas I have to ensure that future motions are all in the same format.


eg. sending a PM with the following text

motion hash this is my motion

provides the following motion:

Motion RIPEMD160 hash: 886c36dd00ebdf8f87812d141ba941e053c21830

=##=##=##=##=##=## Motion hash starts with this line ##=##=##=##=##=##=

this is my motion

=##=##=##=##=##=## Motion hash ends with this line ##=##=##=##=##=##=

Verify. Use everything between and including the <motionhash></motionhash> tags.

By clicking the verify link above and pasting everything between and including the <motionhash. tags into, I got the hash:

Thanks @wooly_sammoth This is a huge step ahead as verifying motions have been very complicated for many including myself. Ideally I like to see the forum software verifying motions itself. E.g. by just showing a green tick alongside the hash in the OP or a red cross when it is not validated against the proposed text. But I might be over asking.

1 Like

very nice job.

Motion RIPEMD160 hash: fb1112655ad32255ff5a84210f0a89e6cde3b974

=##=##=##=##=##=## Motion hash starts with this line ##=##=##=##=##=##=

cryptog motion

=##=##=##=##=##=## Motion hash ends with this line ##=##=##=##=##=##=


@assistant verify

Hi @cryptog

Here are the verification results of all the motion and custodian hashes I could find in this thread:

I found the following hashes:
2 Motion | 0 Custodial

motion hash
Original Hash : fb1112655ad32255ff5a84210f0a89e6cde3b974
Calculated Hash : fb1112655ad32255ff5a84210f0a89e6cde3b974
The hash is good.

motion hash
Original Hash : 886c36dd00ebdf8f87812d141ba941e053c21830
Calculated Hash : d2c59ef3af54c4ae9ee5d2a9741b49d05dd7e260
The hash has changed indicating a change to the text.

1 Like

Excellent job!

I am not sure I understand this part fully. How does the bot knows there was a motion in the thread? html tags? What is considered the original hash?

So, what is the use case for a shareholder that wants to promote a motion, click verify, copy everything including < motionhash ></ motionhash> , and open a new thread with it?

ps : @assistant tip 2 @woolly_sammoth

Good questions.
The verify scan the thread for any post which contains the hidden html tags that denote a motion or custodial proposal. It expects each to be produced by the private message command to Assistant and so each to contain it’s own unique hash. I did it this way as I have seen several threads where the motion is tweaked and posted again with a new hash. If it is felt that this is unnecessary I can change it to just pull the first post of a thread and check that.

the easiest way for a shareholder to promote a motion in another post would be to use the
assistant motion vote [hash]
command as that will pull in most of the detail of the motion and link to the original post.

Oh, my bad, I meant promote=propose. Do shareholders need to create a new topic and copy the raw text showed in the “verify” page?

:slight_smile: no problem.
Yeah, that’s how I saw it working.

  1. Shareholder wishes to propose a motion.
  2. Shareholder composes motion away from site.
  3. Shareholder sends Pm to Assistant motion hash [momotion text]
  4. Shareholder clicks on ‘verify’ link in the reply from Assistant and copies the entire thing.
  5. Shareholder starts new topic and pastes the copied text into the post. They can then add any other text they want but that won’t be included in the hash

The instruction next to the verify link, to copy everything including the tags in instruction for if you want to independently verify the hash with a tool that isn’t Assistant bot.
When calculating the hash, assistant uses the raw text contained by the tags. By copying just that portion of the raw text, any other tool that calculates RIPEMD160 hashes should return the same value.


Got it.

When is polished up and verified then must go to the documentation :wink:

If I send in this (a blank line between paragraphs) to assistant


to get motion hash I get this back



There is one extra blank line added.
The “verify” text uses <p>foo</p><br><p>bar</p> which adds the extra new line.

if i send this


I get


How can I have exactly blank line ?

you can just write

<p>you can just write <br>html</p>

1 Like

Yes I can but I thought there is a better way that all needed to be done is copy and paste?

I don’t think so, why are you so picky with the newlines? :smile: I think discourse will always make a paragraph out of the line when you just hit enter. The assistant bot could perform some postprocessing to avoid this, but does it look so terrible with the additional line spacing?

I can certainly take a look when I next do some maintenance on Assistant. As @creon says, it would need to do some postprocessing before calculating the hash but it should be doable. It’s not going to be for a while yet though I’m afraid.

I think so :wink:

I thought all it needed is having every enter translated to a <br> and skip all the <p></p>?

Looking at the code it seems I was replacing line breaks (\n) with html breaks (<br />). I’ve switched to replace them with blank strings instead.
that new code is now running, would you like to give it another go?