Skip to content

Commit

Permalink
fix: specification updated
Browse files Browse the repository at this point in the history
  • Loading branch information
siandreev committed Sep 27, 2023
1 parent b1a9af8 commit 924e3c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ Wallet V5 has 93% lower storage fees, can delegate payments for gas to third par

### Build

`npx blueprint build` or `yarn blueprint build`
`npm run build:v5`

### Test

`npx blueprint test` or `yarn blueprint test`
`npm run test`

### Deploy or run another script
### Deployment
1. Deploy library: `npm run deploy-library`
2. Deploy wallet: `npm run deploy-wallet`

`npx blueprint run` or `yarn blueprint run`
### Get wallet compiled code

### Add a new contract

`npx blueprint create ContractName` or `yarn blueprint create ContractName`
`npm run print-wallet-code`
14 changes: 12 additions & 2 deletions Specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ You need to put two requests in your message body:

Yes. We have considered constant-size schemes where the wallet only stores trusted extension code. However, extension authentication becomes combursome and expensive: plugin needs to transmit additional data and each request needs to recompute plugin’s address. We estimate that for the reasonably sized wallets (less than 100 plugins) authentication via the dictionary lookup would not exceed costs of indirect address authentication.

### What is library on masterchain?

Library is a special code storage mechanism that allows to reduce storage cost for a new Wallet V5 contract instance. Wallet V5 contract code is stored into a masterchain library.
When wallet contract is being deployed, original code hash is being used as the contract code.
Library contract itself data and code are empty cells. That leads to the inability to change the library code, delete the contract, or withdraw funds from it.
Therefore, any Wallet V5 user can top up the library contract balance if they are afraid that the library code of their wallet will be frozen.

## Wallet ID

Expand All @@ -131,10 +137,14 @@ Wallet ID disambiguates requests signed with the same public key to different wa
For Wallet V5 we suggest using the following wallet ID:

```
mainnet: 20230823 + workchain
testnet: 30230823 + workchain
wallet_id$_ global_id:int32 wc:int8 version:(## 8) subwallet_number:(## 32) = WalletID;
```

- `global_id` is a TON chain identifier. TON Mainnet `global_id = -239` and TON Testnet `global_id = -3`.
- `wc` is a Workchain. -1 for Masterchain and 0 for Basechain.
- `version`: current version of wallet v5 is `0`.
- `subwallet_number` can be used to get multiplie wallet contracts binded to the single keypair.

## Packed address

To make authorize extensions efficiently we compress 260-bit address (workchain + sha256 of stateinit) into a 256-bit integer:
Expand Down

0 comments on commit 924e3c6

Please sign in to comment.