1
0
mirror of https://github.com/danog/toncontest.git synced 2024-11-26 20:15:01 +01:00
toncontest/wallet
2019-10-12 21:14:02 +02:00
..
proto update 2019-10-12 21:14:02 +02:00
create.fif update 2019-10-11 16:54:08 +02:00
gen-pub.fif Update 2019-10-08 19:45:25 +02:00
inspect.fif Move 2019-10-11 13:31:10 +02:00
lib.fif update 2019-10-12 21:14:02 +02:00
merge.fif Bugfix 2019-10-11 19:23:59 +02:00
README.md update 2019-10-12 21:14:02 +02:00
sign.fif Add testing scripts 2019-10-12 18:30:39 +02:00
test.fif update 2019-10-12 21:14:02 +02:00
verify.fif update 2019-10-11 16:54:08 +02:00
wallet-code.fc update 2019-10-12 21:14:02 +02:00
wallet-code.fif update 2019-10-12 21:14:02 +02:00
wallet-create.fif update 2019-10-12 21:14:02 +02:00

Multisignature wallet

Daniil Gentili's submission (@danogentili, daniil@daniil.it).

Project structure:

Fift scripts:

  • gen-pub.fif - Generates public/private keypair
  • wallet-create.fif - Creates shared wallet
  • wallet-create.fif - Creates wallet code update request
  • create.fif - Creates simple message to be sent to wallet
  • sign.fif - Adds signature to wallet message
  • verify.fif - Verifies signature of message against known public key
  • merge.fif - Merges multiple messages with same content and different signatures
  • inspect.fif - Inspects the contents of request
  • lib.fif - Library with functions to deserialize and inspect contents of TON messages

FunC code:

  • wallet-code.fc - Wallet code
  • wallet-code-update.fc - Wallet code with minor change to test wallet code upgrade

Scripts:

  • test.sh - Creates wallet, set of signed requests and tests wallet in TON VM
  • test-update.sh - Tests wallet code upgrade functionality (after test.sh) in TON VM

Testing

The test.sh scripts contains a full set of commands to test every script.

usage: fift -s wallet/wallet-create.fif <workchain-id> <wallet-name> <n> <k> <privkey1> [<pubkey2> ...]

Creates a new multisignature wallet in specified workchain composed of (1-10) keys.
The first of the keys must be a private key (pre-existing or not), used to generate the wallet; the rest MUST be public keys.

Min (1-10) signatures required to send an order; load pre-existing public keys from files <key1...n>.

usage: gen-pub.fif <privkey>

Create public key files from private keys; if doesn't exist, it will be created. Will also print the hex public key ID.

  • `inspect Upgradable multisignature wallet. Included signature verification scripts to avoid problems with eventual preloaded orders with invalid signatures.

Code can be upgraded via a special multisignature message.