@@ -31,13 +31,6 @@ This page will go through the main steps as follows:
31
31
- Add an additional signature to a multi-sig transaction with the ``concordium-client `` tool.
32
32
- Send a multi-sig transaction with the ``concordium-client `` tool on chain.
33
33
34
- .. note ::
35
-
36
- Mutli-sig signing can be used on all active transaction types which are currently: ``DeployModule ``, ``InitContract ``,
37
- ``UpdateContract ``, ``Transfer(CCD) ``, ``TransferWithMemo ``, ``TransferWithSchedule ``,
38
- ``TransferWithScheduleAndMemo ``, ``ConfigureDelegation ``, ``ConfigureBaker ``, ``RegisterData ``, ``UpdateCredential ``,
39
- and ``UpdateCredentialsKeys ``.
40
-
41
34
Create a multi-sig account
42
35
==========================
43
36
@@ -162,8 +155,8 @@ To add additional keys to an existing account on Concordium using the ``concordi
162
155
The ``<number-of-credential-to-sign> `` specifies the minimum number of credentials that are needed to sign the
163
156
transaction after the update.
164
157
165
- Configure the `` concordium-client `` tool to use a multi-sig account
166
- ===================================================================
158
+ Configure the tool to use a multi-sig account
159
+ =============================================
167
160
168
161
To configure the ``concordium-client `` tool to use a multi-sig account, you can either:
169
162
@@ -274,19 +267,116 @@ tool in this section (Option 2). The first option is covered in the
274
267
275
268
.. note ::
276
269
277
- This command updates the keys in the key directory of your local ``concordium-client `` tool. No transaction is sent on-chain.
270
+ This command updates the keys in the key directory of your local ``concordium-client `` tool. No transaction
271
+ is sent on-chain.
278
272
279
273
280
274
Create a multi-sig transaction
281
275
==============================
276
+
277
+ Multi-sig transactions can be created for all active transaction types which are currently: ``DeployModule ``,
278
+ ``InitContract ``, ``UpdateContract ``, ``Transfer(CCD) ``, ``TransferWithMemo ``, ``TransferWithSchedule ``,
279
+ ``TransferWithScheduleAndMemo ``, ``ConfigureDelegation ``, ``ConfigureBaker ``, ``RegisterData ``,
280
+ ``UpdateCredential ``, and ``UpdateCredentialsKeys ``.
281
+
282
+ To create a multi-sig transaction, execute a transaction-creating command and add an ``--out `` flag.
283
+ This flag will cause ``concordium-client `` to output the partially-signed
284
+ transaction into the specified file instead of sending it on-chain.
285
+
286
+ If you omit the ``--signers `` flag, ``concordium-client `` will output
287
+ a transaction signed with all keys associated with the account as present in the local key directory.
288
+ If you want to sign with specific keys from the local key directory,
289
+ you can specify some of them with the ``--signers `` flag (e.g. ``--signer "0:0,0:1" ``).
290
+
291
+ For example, to create a multi-sig transaction to send 1 CCD to an account on testnet using all local keys,
292
+ run the following command:
293
+
294
+ .. code-block :: console
295
+
296
+ $concordium-client transaction send --receiver 4bbdAUCDK2D6cUvUeprGr4FaSaHXKuYmYVjyCa4bXSCu3NUXzA --amount 1 --out ./transaction.json --energy 5000 --sender 4jxvYasaPncfmCFCLZCvuL5cZuvR5HAQezCHZH7ZA7AGsRYpix --grpc-port 20000 --grpc-ip node.testnet.concordium.com
297
+
298
+ The partially-signed transaction is output into the file ``transaction.json `` and has the following format:
299
+
300
+ .. code-block :: json
301
+ :force:
302
+
303
+ {
304
+ "energy" : 5000 ,
305
+ "expiryTime" : 1716995242 ,
306
+ "nonce" : 46 ,
307
+ "payload" : {
308
+ "amount" : " 1000000" ,
309
+ "toAddress" : " 4bbdAUCDK2D6cUvUeprGr4FaSaHXKuYmYVjyCa4bXSCu3NUXzA" ,
310
+ "transactionType" : " transfer"
311
+ },
312
+ "signature" : {
313
+ "0" : {
314
+ "0" : " 3099534c5f32daf64dc40b7a0013979b9b74b167d259fc787a363ed2db7f1bcdafdcf06e166b2d915c7f29043186b3015a6064755bf3c3733bca2151b2b19c04"
315
+ }
316
+ },
317
+ "signer" : " 4jxvYasaPncfmCFCLZCvuL5cZuvR5HAQezCHZH7ZA7AGsRYpix" ,
318
+ "version" : 1
319
+ }
320
+
321
+ If you want to sign the transaction with keys that are not in the local key directory, you need to provide
322
+ the keys as a separte file with the ``--keys `` flag. Keys provided with a flag take precedence and no
323
+ lookup of local keys in the key directory is performed.
324
+
325
+ For example, to create a multi-sig transaction to send 1 CCD to an account on testnet using keys for signing
326
+ from a file, run the following command:
327
+
328
+ .. code-block :: console
329
+
330
+ $concordium-client transaction send --keys ./keypair.json --receiver 4bbdAUCDK2D6cUvUeprGr4FaSaHXKuYmYVjyCa4bXSCu3NUXzA --amount 1 --out ./transaction.json --energy 5000 --sender 4jxvYasaPncfmCFCLZCvuL5cZuvR5HAQezCHZH7ZA7AGsRYpix --grpc-port 20000 --grpc-ip node.testnet.concordium.com
331
+
332
+ where ``keypair.json `` is a file of the following format:
333
+
334
+ .. code-block :: json
335
+ :force:
336
+
337
+ {
338
+ "cidx" : {
339
+ "kidx" : {
340
+ "encryptedSignKey" : {
341
+ "metadata" : {
342
+ "encryptionMethod" : " AES-256" ,
343
+ "iterations" : ...,
344
+ "salt" : ...,
345
+ "initializationVector" : ...,
346
+ "keyDerivationMethod" : " PBKDF2WithHmacSHA256"
347
+ },
348
+ "cipherText" : ...
349
+ },
350
+ "verifyKey" : ...,
351
+ "schemeId" : " Ed25519"
352
+ },
353
+ ...
354
+ },
355
+ ...
356
+ }
357
+
358
+
359
+ If you want to create a partially-signed transaction with no signatures at all, you can use an
360
+ empty ``keypair.json `` file of the following format:
361
+
362
+ .. code-block :: json
363
+ :force:
364
+
365
+ {}
366
+
282
367
Add an additional signature to a multi-sig transaction
283
368
======================================================
284
369
285
370
.. _sign-with-keyfile :
286
371
372
+ .. Step: Add an additional signature
373
+ .. stack run concordium-client -- transaction add-signature ./transaction.json --signers "0:1" --grpc-port 20000 --grpc-ip node.testnet.concordium.com
374
+
287
375
Send a multi-sig transaction on-chain
288
376
=====================================
289
377
378
+ .. Step: Send the fully signed transaction on-chain
379
+ .. stack run concordium-client -- transaction submit ./transaction.json --grpc-port 20000 --grpc-ip node.testnet.concordium.com
290
380
291
381
.. note ::
292
382
0 commit comments