Multisig - proof of concept

Multisig - a proof of concept

First, let me introduce three rather ordinary accounts: ak_vfWbz…, ak_dQvJH…, and ak_2aDMa….
They are not very active, and not very fat, but what is interesting is the following:

30> A = <<"ak_vfWbz6Sg1iesGWtMXmgb2RXyLbsiRTjgraD8CvZoCRKtN9zPi">>.
31> B = <<"ak_dQvJHJRRRNn1tkPincb9exxNcd4FPMBCTbFydngr4999x3LjV">>.
32> {ok, ABin} = aeser_api_encoder:safe_decode(account_pubkey, A). 
33> {ok, BBin} = aeser_api_encoder:safe_decode(account_pubkey, B).
34> AplusBBin = enacl:crypto_ed25519_add(ABin, BBin).
([email protected])35> aeser_api_encoder:encode(account_pubkey, AplusBBin).

It turns out the third account is the sum of the other two accounts - and this is not by accident (the odds of that happening would be astronomically small) and also if it wasn’t by construction there would not be a way to sign transactions on behalf of this account.

Taking a step back, æternity blockchain is based on ed25519 cryptography, and signing. Signatures (which is what is used to protect/verify transactions on the chain) in ed25519 is a closely related to Schnorr signatures - and this means that with a bit of elliptic curve magic it should be possible to do (n-out-of-n) multisig with normal transactions and a cleverly constructed account.

Earlier today I sat down with @dimitar.chain and we each created an account (ak_vfWbz... is mine and ak_dQvJHJ... is Dimitar’s) - only I know the private key of my account and only Dimitar knows his private key. Then, with an elaborate song and dance number that included sending 4 different partial results (two in each direction) , we managed to produce a (valid) signature of a SpendTx from our multi-sig account ak_2aDMa... - namely th_NLHUV…v1U.

It would be unfair to say that the process is simple and smooth, and I will not go into details on how to replicate this, there is a bit of work remaining before the concept is production ready for the mass market :sweat_smile: … But this little experiment proves that the cryptography works, and that multi-signed transactions are accepted by the network without any changes necessary.

Thanks to @dimitar.chain for helping out in the experiment. We used an extended version of the enacl library which is in a PR here - and the multisig scheme we used is outlined in this post.


This is awesome stuff, thanks for sharing that story! Would be great to get this production ready in the future :sunglasses:

Actually some screencast or sth like that would be great to see what you were doing there :grin:


Well if you produce such account and corresponding signatures - this is already in production - as you can see the transaction is on main net already. All of this is already supported by the nodes. It is up to clients and wallets to be able to produce such accounts and signatures, the multi sig is already in production :tada:


Do we have somebody here in the community with expertise in that area who wants to make this usable for everybody? If so please let me know here or DM me directly :slight_smile: