One of the issues I'm not sure how to handle is identifying the parties. It's all intended to be pseudonymous and so the party is really identified by their pubkey. However, writing the full pubkey for 3 parties into each clamSpeech with a contract wastes space.
A way to deal with this would be for people to register "identities" (presumably short handles or pseudonyms, up to 14 characters long) associated with a pubkey. Then the contracts could reference the "identities" and look up the corresponding pubkey.
Are you familiar with the CLAMour system?
To voice your support for a petition you post "clamour xxxxxxxx" as your CLAMspeech when staking, where xxxxxxxx is the first 8 hex digits of the sha256 hash of the full text of the petition you are supporting.
There's an obvious attack there, in that it's not hard to find another text with an opposite meaning but which has the same first 8 hex digits in its hash. There are only 4 billion different 8 digit prefixes, and so brute forcing it wouldn't take too long.
To combat that, we require that the full sha256 hash be registered using a "create clamour" CLAMspeech before its prefix is acceptable for supporting. Then if a petition ever gains widespread support and two opposing parties step forward claiming that their text is the one being supported, we can tell which one is the right one by checking which was registered first. The CLAM client keep track of this automatically, like this:
$ clamd getclamour deaddea1
{
"pid" : "deaddea1",
"hash" : "deaddea108069f92a0538fea6f08f63f7bbae2caa12d272a6393ced034bb1ec2",
"url" : "http://txti.es/deaddea1",
"txid" : "76a2e1689c06e2d0cd809523345f90112a9143719a567253279815968e7b3eaf",
"confirmations" : 18590
}
You could use a similar scheme to associate short codes with public keys on a first-come first-served basis.
Here's how this could be done on-chain:
Suppose Alice wants to register the handle "Alice" and associate it with the pubkey Q which has address A. Assuming there's not an "Alice" already register, she could make a tx which spends with a first input from A and clamspeech "registerid:Alice" -- the pubkey Q would be visible since the first input spends from A, and its clear that the holder of the private key for Q signed the tx. This registration could be stored in a database (independent of Clams). Then in contracts when "Alice" is used, Q could be looked up.
I think it's a mistake to assume that people have control of transaction creation. Maybe they are creating transactions by withdrawing from a web wallet, and so even own the pubkey of the first input. The web wallet will hopefully allow them to specify the CLAMspeech for their transaction however.
Before going into any more details, I'm curious if anyone has comments. Are there objections to this? Or a clearer way to do this?
I think it's best to use CLAMspeech when possible rather than making assumptions about the ownership of input addresses.
[/quote]