Voting using a counterparty asset

Sorry if this has been asked before- tried searching, but the results page isn’t very user friendly.

I wish to allow voting for a hackathon using counterparty assets.

1) create a main counterparty asset for the 10 judges, will call it HackJudge, send 1 token to each judges wallet
2) create a new asset called round1 with 10 tokens and distribute it to HackJudge holders
3) create a new wallet for each of the 4 hacking teams
4) judges then send the asset to the team of their choice
watch the addresses
5) repeat 2-4 for multiple rounds

No problem so far.

But what if i want to allow the judges to have 2 tokens so that they can vote for 2 teams, and I only want them to be able to vote for each team once?

Is there a better way to do this?



That's an interesting use case scenario.  

A practical non-solution is that judges could be trusted :-)

I'd suggest to take a look at Ethereum Smart Contracts (on testnet), but that's still not fully tested (although it could be) and it might look hacky considering it's testnet, not mainnet.

I can't come up with anything good. I was thinking about using multisig addresses to have judges send tokens from them (and then use 2-of-2 or 2-of-3 so that each pair or three judges keep each other in check, but I'm not sure if this makes sense and whether that would be considered sufficient to prevent collusion (if the judges can't be trusted)).

If you use to verify outcomes, then you can't really have your own site to declare the winner of each round, but otherwise you could have a program that would count votes from unique addresses and that way allow the judges to waste their 2nd vote if they want to (as it wouldn't be counted).  The question of course is why should anyone trust your vote-counting site and not trust the judges, so this doesn't sound like a better approach than simply trusting the judges either. But if you publish the judges addresses, then anyone could use to see which of them may have sent 2 tokens to the same destination.


Considering the way in which the judges vote are transparent, it wouldn’t be in their interests to vote against the rules.

@Global_trade_repo - good point! For this usage, thats good enough.

Also concerned about
confirmation time- I think the wallet will only show the
new balance for an address after 1 confirmation. I’ve seen 1 confirm
take up to an hour. Are there any alternative watching systems?
Something that can watch several wallets on a single screen, and show
balances even with pending transactions? (have a feeling I’ll need to
write something…)

@coin_republic, if they vote on a Federated Node (say, VM) setup for this opportunity you could tail the log:

$ sudo tail -f /home/xcp/.config/counterpartyd/counterpartyd.log

Or make a Web page that shows output from it in the browser.  
A simple shell script could read from this file, “grep” preselected asset names and show those transactions without scrolling.

That way you could see their votes as soon as they appear. 
You could run this out of a small VM with Internet connection (and an up to date bitcoind).

IIRC shows unconfirmed transactions and they appear pretty fast. 

would prefer to keep it simple, i’m not familiar with setting up the node.
checking out the blockscan API, the call
shows confirmed only.
would be perfect if you could add a parameter like: &include=unconfirmed

IIRC if you watch an individual addresse, its transactions appear even when they’re unconfirmed, although it’s less convenient to watch 4 addresses (of the 4 teams).

Or try
@EBX, are those unconfirmed or confirmed only?

By the way, you could create/use the hackaton logo for the asset to make it easier to visually follow the voting process…

Can probably scrape the address page as well (limit to once a minute). Trying to make it look as appealing as possible and think a single page tally of results in a transparent manner would be best.

Thanks for the logo tip! Will definitely do. does indeed show unconfirmed transactions as soon as they are seen in the mempool – you can see them come in and watch them pop into the confirmed state in real time. Also there’s filters so that you can hide/show/blacklist the displaying of certain asset transactions – so you can easily filter out only the assets you want to show being sent across [helpful in case of a distribution while you’re watching :P])

Also, if you’re handy with programming you can connect to the partychain SocketIO server with a few lines of code and listen in real-time for sends or what have you, check for only the asset you want, and display only the info you want. The code for PartyChain is also up on github (but a bit out of date atm, meaning to up date that soon with current code).

Definitely sounds like an interesting use case @coin_republic! Be sure to let us know if the hackathon is planned to be public or what your plans are, as I and I imagine others might be interested in participating ;).

@coin_republic  What do you need to see for the unconfirmed transactions in the API, just the balances?

Happy New Year from Singapore!
@ebx - we are in the planning stages now, It will be public, I’ll definitely make a post on the counterparty forum.

@mtbitcoin - unconfirmed would be needed, or total balance per asset including unconfirmed so we can get a quick tally of votes without waiting for a confirmation.

           <span style="font-family: Arial, Verdana;"><span style="font-size: 13px; line-height: normal;">@something<br>"IIRC

if you watch an individual addresse, its transactions appear even when
they’re unconfirmed, although it’s less convenient to watch 4 addresses
(of the 4 teams)."

Not seeing pending come up on the watch address page, am i on the correct one?
only seeing confirmed


Showing unconfirmed now? Wasn’t earlier.

Got that clarified over at the blockscan thread:

I think the best way going forward is to use the balance API. I will add an additional data value for unconfirmed balances.

@coin_republic  I have updated the address balance api to show unconfirmed balances. Replace with your address and asset. The new value "unconfirmed_balance" should show the pending incoming value

Great work mtbitcoin, as always.

thanks for the change!

@coin_republic  Do let us know how this turns out?

ps: Are you planning to demo this at the inside bitcoins Singapore event?