You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>TRON uses the account model. The address is the unique identifier of an account, and a private key signature is required to operate an account. An account has many attributes, including TRX & TRC10 token balances, bandwidth, energy, Etc. An account can send transactions to increase or reduce its TRX or TRC10 token balances, deploy smart contracts, and trigger the smart contracts released by itself or others. All TRON accounts can apply to be Super Representatives or vote for the elected Super Representatives. Accounts are the basis of all activities on TRON.</p>
186
186
<h2id="how-to-create-an-account">How to Create an Account<aclass="headerlink" href="#how-to-create-an-account" title="Permanent link">¶</a></h2>
187
187
<ol>
188
-
<li>Use a wallet to generate the address and private key. To active the account, you need to transfer TRX or transfer token to the new created account. <ahref="https://tronscan.org/#/wallet/new">Generate an account</a></li>
188
+
<li>Use a wallet application(<ahref="https://www.tronlink.org/">TronLink</a> is recommended) to generate a pair of address and private key. To active the account, you need to transfer TRX or other token to it.</li>
189
189
<li>Use an account already existed in TRON network to create an account</li>
190
190
</ol>
191
191
<p>If you have enough staked BandWidth Points, creating an account only consume your staked BandWidth Points, otherwise, it burns 0.1 TRX.</p>
Copy file name to clipboardExpand all lines: mechanism-algorithm/multi-signatures/index.html
+45-20Lines changed: 45 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -222,7 +222,7 @@ <h4 id="account">Account<a class="headerlink" href="#account" title="Permanent l
222
222
</code></pre></div>
223
223
<p>Three attributes are added, owner_permission、witness_permission and active_permission. active_permission is a list, the length can not be bigger than 8.</p>
<p>AccountPermissionUpdateContract is a new contract type used to update the account permission.</p>
235
+
The definition of ContractType can be found <ahref="https://github.com/tronprotocol/java-tron/blob/master/protocol/src/main/protos/core/Tron.proto">here</a>.</p>
236
+
<p>AccountPermissionUpdateContract is a ContractType used to update the account permission.</p>
@@ -244,7 +245,7 @@ <h4 id="accountpermissionupdatecontract">AccountPermissionUpdateContract<a class
244
245
<ul>
245
246
<li><code>owner_address</code>: The address of the account whose permissions are to be modified</li>
246
247
<li><code>owner</code>: Owner permission</li>
247
-
<li><code>witness</code>: Witness permission (if the account is a SR(Super Representative))</li>
248
+
<li><code>witness</code>: Witness permission (only used by witness)</li>
248
249
<li><code>actives</code>: Active permission</li>
249
250
</ul>
250
251
<p>This will override the Original account permission. Therefore, if you only want to modify the owner permission, witness (if it is a SR account) and active permission also need to be set</p>
<li><code>threshold</code>: The threshold of the signature weight</li>
272
273
<li><code>parent_id</code>: Current 0</li>
273
274
<li>
274
-
<p><code>operations</code>: 32 bytes (256 b), each bit represent the execution permission of one contract, 1 means it owns the execution permission of the contract.</p>
275
-
<p>For instance, operations=0x0100...00(hex), 100...0(binary), refer to the definition of Transaction.ContractType in proto, the id of AccountCreateContract is 0, means this permission only owns the execution permission of AccountCreateContract</p>
275
+
<p><code>operations</code>: used by active permission, a hexadecimal coded sequence (little-endian byte order), 32 bytes (256 bits), and each bit represents the authority of a ContractType. The nth bit indicates the authority of the ContractType with ID n, its value 1 means that it has the authority to execute the ContractType, its value 0 means it doesn't have the authority.<br/>
276
+
To make it easier for users to read, start with the binary big-endian byte order to illustrate how to calculate the value of operations. The number of digits starts from 0, and corresponds to the ID of the ContractType from left to right. Convert a binary big-endian byte sequence to a hexadecimal little-endian byte sequence, that will be the value of operations. Below is an example of how to calculate the operations of active permission with operation TransferContract(ID=1) and operation VoteWitnessContract(ID=4) allowed. The mapping between ContractType and its ID can be seen in the above definition link of ContractType.</p>
277
+
<table>
278
+
<thead>
279
+
<tr>
280
+
<th>Operations Allowed</th>
281
+
<th>Binary Code(big-endian)</th>
282
+
<th>Binary Code(little-endian)</th>
283
+
<th>Hex Code(little-endian)</th>
284
+
</tr>
285
+
</thead>
286
+
<tbody>
287
+
<tr>
288
+
<td>TransferContract(1) & VoteWitnessContract(4)</td>
289
+
<td>01001000 00000000 00000000 ...</td>
290
+
<td>00010010 00000000 00000000 ...</td>
291
+
<td>12 00 00 ...</td>
292
+
</tr>
293
+
</tbody>
294
+
</table>
276
295
</li>
277
296
<li>
278
297
<p><code>keys</code>: The accounts and weights that all own the permission, 5 keys at most.</p>
<p>Super representatives can use this permission to manage block producing. Only SR(Super Representative) account has this permission.</p>
310
329
<p>Usage scenario example:
311
330
A super representative deploys a witness node on cloud server. In order to keep the account on the cloud server safe, you can only give the block producing permission to the account you put on cloud server. Because this account only owns block producing permission, no TRX transfer permission, so even if the account on the cloud server is leaked, the TRX will not be lost.</p>
312
-
<p>Witness node configuration:</p>
313
-
<ol>
314
-
<li>if no witness permission is used, no need to configure</li>
315
-
<li>if itness permission is used, need to reconfigure:</li>
316
-
</ol>
331
+
<p>Witness node configuration: when <ahref="https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#startup-a-fullnode-that-produces-blocks">start a fullnode as witness</a>, <code>localwitness</code> in the config file is filled in with the private key of the witness account and <code>localWitnessAccountAddress</code> is commented on as below:
// It is used when the SR(Super Representative) account has set the witnessPermission.
321
-
// When it is not empty, the localWitnessAccountAddress represents the address of the SR(Super Representative) account,
322
-
// and the localwitness is configured with the private key of the witnessPermissionAddress in the SR(Super Representatives) account.
323
-
// When it is empty,the localwitness is configured with the private key of the SR(Super Representatives) account.
324
-
325
-
//localWitnessAccountAddress =
326
-
333
+
//localWitnessAccountAddress =
334
+
localwitness = [
335
+
xxx // private key of the witness account
336
+
]
337
+
</code></pre></div></p>
338
+
<ul>
339
+
<li>If witness permission is not modified, there is no need to change config file. </li>
340
+
<li>
341
+
<p>If witness permission is modified, two modifications are required as follows:</p>
342
+
<ul>
343
+
<li><code>localwitness</code> needs to be changed to the private key of the account authorized with witness permission</li>
344
+
<li><code>localWitnessAccountAddress</code> shoule be explicitly set as the address of the witness account</li>
345
+
</ul>
346
+
<p>Below is an example of how to configure witness account <ahref="https://nile.tronscan.org/#/address/TCbxHgibJutCjVZUprvexKZZ4Rc6sJ4Xrk">TCbxHgibJutCjVZUprvexKZZ4Rc6sJ4Xrk</a> which authorize its witness permission to account TSwCH45gi2HvtqDYX3Ff39yHeu5moEqQDJ.
0 commit comments