Skip to content

Commit f8b13cf

Browse files
authored
modify doc of private_network's dynamic parameters, active permission and witness permission; remove files not in nav (#418)
1 parent 94e83c7 commit f8b13cf

File tree

8 files changed

+114
-137
lines changed

8 files changed

+114
-137
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,5 +224,5 @@ <h1 id="welcome-to-the-java-tron-user-manual">Welcome to the java-tron user manu
224224

225225
<!--
226226
MkDocs version : 1.3.0
227-
Build Date UTC : 2025-02-17 09:36:25.703235+00:00
227+
Build Date UTC : 2025-03-03 07:26:46.768314+00:00
228228
-->

mechanism-algorithm/account/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h2 id="introduction">Introduction<a class="headerlink" href="#introduction" tit
185185
<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 &amp; 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>
186186
<h2 id="how-to-create-an-account">How to Create an Account<a class="headerlink" href="#how-to-create-an-account" title="Permanent link">&para;</a></h2>
187187
<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. <a href="https://tronscan.org/#/wallet/new">Generate an account</a></li>
188+
<li>Use a wallet application(<a href="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>
189189
<li>Use an account already existed in TRON network to create an account</li>
190190
</ol>
191191
<p>If you have enough staked BandWidth Points, creating an account only consume your staked BandWidth Points, otherwise, it burns 0.1 TRX.</p>

mechanism-algorithm/multi-signatures/index.html

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ <h4 id="account">Account<a class="headerlink" href="#account" title="Permanent l
222222
</code></pre></div>
223223
<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>
224224
<h4 id="contracttype">ContractType<a class="headerlink" href="#contracttype" title="Permanent link">&para;</a></h4>
225-
<div class="highlight"><pre><span></span><code><span class="kd">message</span><span class="w"> </span><span class="nc">Transaction</span><span class="w"> </span><span class="p">{</span>
225+
<p><div class="highlight"><pre><span></span><code><span class="kd">message</span><span class="w"> </span><span class="nc">Transaction</span><span class="w"> </span><span class="p">{</span>
226226
<span class="w"> </span><span class="kd">message</span><span class="w"> </span><span class="nc">Contract</span><span class="w"> </span><span class="p">{</span>
227227
<span class="w"> </span><span class="kd">enum</span><span class="w"> </span><span class="n">ContractType</span><span class="w"> </span><span class="p">{</span>
228228
<span class="w"> </span><span class="na">AccountCreateContract</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
@@ -232,7 +232,8 @@ <h4 id="contracttype">ContractType<a class="headerlink" href="#contracttype" tit
232232
<span class="w"> </span><span class="p">}</span>
233233
<span class="p">}</span>
234234
</code></pre></div>
235-
<p>AccountPermissionUpdateContract is a new contract type used to update the account permission.</p>
235+
The definition of ContractType can be found <a href="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>
236237
<h4 id="accountpermissionupdatecontract">AccountPermissionUpdateContract<a class="headerlink" href="#accountpermissionupdatecontract" title="Permanent link">&para;</a></h4>
237238
<div class="highlight"><pre><span></span><code><span class="kd">message</span><span class="w"> </span><span class="nc">AccountPermissionUpdateContract</span><span class="w"> </span><span class="p">{</span>
238239
<span class="w"> </span><span class="kt">bytes</span><span class="w"> </span><span class="na">owner_address</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
@@ -244,7 +245,7 @@ <h4 id="accountpermissionupdatecontract">AccountPermissionUpdateContract<a class
244245
<ul>
245246
<li><code>owner_address</code>: The address of the account whose permissions are to be modified</li>
246247
<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>
248249
<li><code>actives</code>: Active permission</li>
249250
</ul>
250251
<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>
@@ -271,8 +272,26 @@ <h4 id="permission">Permission<a class="headerlink" href="#permission" title="Pe
271272
<li><code>threshold</code>: The threshold of the signature weight</li>
272273
<li><code>parent_id</code>: Current 0</li>
273274
<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) &amp; 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>
276295
</li>
277296
<li>
278297
<p><code>keys</code>: The accounts and weights that all own the permission, 5 keys at most.</p>
@@ -309,25 +328,31 @@ <h3 id="witness-permission">Witness Permission<a class="headerlink" href="#witne
309328
<p>Super representatives can use this permission to manage block producing. Only SR(Super Representative) account has this permission.</p>
310329
<p>Usage scenario example:
311330
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 <a href="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:
317332
<div class="highlight"><pre><span></span><code># config.conf
318-
319-
// Optional.The default is empty.
320-
// 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 <a href="https://nile.tronscan.org/#/address/TCbxHgibJutCjVZUprvexKZZ4Rc6sJ4Xrk">TCbxHgibJutCjVZUprvexKZZ4Rc6sJ4Xrk</a> which authorize its witness permission to account TSwCH45gi2HvtqDYX3Ff39yHeu5moEqQDJ.
347+
<div class="highlight"><pre><span></span><code>#config.conf
348+
localWitnessAccountAddress = TCbxHgibJutCjVZUprvexKZZ4Rc6sJ4Xrk
327349
localwitness = [
328-
f4df789d3210ac881cb900464dd30409453044d2777060a0c391cbdf4c6a4f57
350+
yyy // private key of TSwCH45gi2HvtqDYX3Ff39yHeu5moEqQDJ
329351
]
330352
</code></pre></div>
353+
Notice: Only one private key can be added to <code>localwitness</code> when witness permission is modified.</p>
354+
</li>
355+
</ul>
331356
<h3 id="active-permission">Active Permission<a class="headerlink" href="#active-permission" title="Permanent link">&para;</a></h3>
332357
<p>Active permission is composed of a set of contract execution permission, like creating an account, transfer function, etc.</p>
333358
<p>Active permission's features:</p>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)