Skip to content

Commit 25fa4b4

Browse files
author
HOME\kailin
committed
no message
1 parent abe8a4c commit 25fa4b4

File tree

1 file changed

+85
-117
lines changed

1 file changed

+85
-117
lines changed

NisApi.src.html

Lines changed: 85 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--suppress HtmlUnknownTag -->
1+
<!--suppress HtmlUnknownTag -->
22
<html>
33

44
<head>
@@ -524,7 +524,7 @@ <h4>Multisig accounts:</h4>
524524
<td>
525525
<p>Optional field in case the transaction contains a message. The
526526
payload is the actual (possibly encrypted) message data. The payload is
527-
allowed to have a maximal size of 512 bytes. Transaction validation detects
527+
allowed to have a maximal size of 1024 bytes. Transaction validation detects
528528
if the limit is exceeded and returns an error in this case.</p>
529529
</td>
530530
</tr>
@@ -2099,64 +2099,6 @@ <h2>Requesting parts of the block chain</h2>
20992099
identified by block height or block hash or can supply up to 10 blocks
21002100
beginning at a certain height.</p>
21012101

2102-
<!-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -->
2103-
<h3>Getting a block with a given hash</h3>
2104-
2105-
<api get>/block/get</api>
2106-
2107-
2108-
<desc>
2109-
<p class=NemNoSpacing>Gets a block from the chain that has a
2110-
given hash.</p>
2111-
</desc>
2112-
2113-
<h4>Parameter:</h4>
2114-
2115-
<table class=NemTableGrid>
2116-
<tr>
2117-
<td>
2118-
<p class=JSON>blockHash </p>
2119-
</td>
2120-
<td>
2121-
<p class=NemNoSpacing>The 256 bit sha3 hash of the block.
2122-
The hash must be supplied as hexadecimal string.</p>
2123-
</td>
2124-
</tr>
2125-
</table>
2126-
2127-
<h4>Example:</h4>
2128-
2129-
<p><a href="http://127.0.0.1:7890/block/get?blockHash=58efa578aea719b644e8d7c731852bb26d8505257e03a897c8102e8c894a99d6">http://127.0.0.1:7890/block/get?blockHash=58efa578aea719b644e8d7c731852bb26d8505257e03a897c8102e8c894a99d6</a>
2130-
</p>
2131-
2132-
<h4>Example of returned JSON object (main network):</h4>
2133-
2134-
<resp>
2135-
{
2136-
"timeStamp": 9232942,
2137-
"signature": "005f91b8908fc173a428ff8e8c4a0ee0d69e4004aed0d08f27690b6b6672ef74ccc6b89695bed5f29b0f4a812cb84bfa459f52a4e14a11e574793969f0e1a30f",
2138-
"prevBlockHash": {
2139-
"data": "f721e563b4431594c5af6f6be0a913f47f0aca6c3b8ee6a703bfe175ee54babf"
2140-
},
2141-
"type": 1,
2142-
"transactions": [
2143-
],
2144-
"version": 1744830465,
2145-
"signer": "78e121cc1cf63424651ec64251e78efda81386c9f5e9eb4cb08b2a2192c9dce5",
2146-
"height": 42803
2147-
}
2148-
</resp>
2149-
2150-
<h4>Possible Errors:</h4>
2151-
2152-
<p class=NemNoSpacing>If the block hash is not found in the
2153-
database, NIS will return a JSON error object. See
2154-
<appa>Error object</appa>
2155-
or more information of the error object and
2156-
<alnk>Appendix B: NIS Errors</alnk>
2157-
for the error message.
2158-
</p>
2159-
21602102
<!-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -->
21612103
<h3>Getting a block with a given height</h3>
21622104

@@ -3791,7 +3733,7 @@ <h2>Provisioning a namespace</h2>
37913733
</code></pre>
37923734

37933735
<p>This time the parent is set to the parent namespace, in this case the root namespace 'alice'. The rental fee for a sub-namespace
3794-
is 10% of the fee for a root namespace, i.e. 5000 XEM. Be sure to wait until you own the root namespace or NIS will respond with
3736+
is 200 XEM. Be sure to wait until you own the root namespace or NIS will respond with
37953737
an error message. Once the transaction is included in a block, you own the sub-namespace 'alice.vouchers' as long as the root namespace 'alice'
37963738
does not expire.</p>
37973739

@@ -3985,6 +3927,7 @@ <h3>Gathering data for the signature</h3>
39853927
mosaic supply change transactions the version must be
39863928
</p>
39873929
<li>0x68 &lt;&lt; 24 + 1 (main network)</li>
3930+
<li>0x60 &lt;&lt; 24 + 1 (mijin network)</li>
39883931
<li>0x98 &lt;&lt; 24 + 1 (test network)</li>
39893932
<b>Example (main network):</b> 0x01, 0x00, 0x00, 0x68
39903933
<p></p>
@@ -3993,6 +3936,7 @@ <h3>Gathering data for the signature</h3>
39933936
For transfer transactions and multisig aggregate modification transactions the version must be
39943937
</p>
39953938
<li>0x68 &lt;&lt; 24 + 2 (main network)</li>
3939+
<li>0x60 &lt;&lt; 24 + 2 (mijin network)</li>
39963940
<li>0x98 &lt;&lt; 24 + 2 (test network)</li>
39973941
<b>Example (main network):</b> 0x02, 0x00, 0x00, 0x68
39983942
</ul>
@@ -4254,23 +4198,26 @@ <h3>Gathering data for the signature</h3>
42544198

42554199
<h4colored>Provision namespace transaction part</h4colored>
42564200
<li>
4257-
<b>Length of rental fee sink's public key byte array (always 32):</b> 4 bytes (integer).
4258-
<ul>
4259-
<b>Always:</b> 0x20, 0x00, 0x00, 0x00
4201+
<b>Length of rental fee sink's Encoded Address (always 40):</b> 4 bytes (integer).
4202+
<ul>
4203+
<b>Always:</b> 0x28, 0x00, 0x00, 0x00
42604204
</ul>
42614205
</li>
42624206
<li>
4263-
<b>Public key bytes of rental fee sink:</b> 32 bytes.
4207+
<b>Address bytes of rental fee sink:</b> 40 bytes.
42644208
<ul>
4265-
<b>Always:</b> 0x3e, 0x82, 0xe1, 0xc1, 0xe4, 0xa7, 0x5a, 0xda, 0xa3, 0xcb,
4266-
0xa8, 0xc1, 0x01, 0xc3, 0xcd, 0x31, 0xd9, 0x81, 0x7a, 0x2e, 0xb9, 0x66, 0xeb,
4267-
0x3b, 0x51, 0x1f, 0xb2, 0xed, 0x45, 0xb8, 0xe2, 0x62
4209+
<b>Always (TAMESPACEWH4MKFMBCVFERDPOOP4FK7MTDJEYP35):</b> 0x35, 0x33, 0x50, 0x59, 0x45, 0x4a, 0x44, 0x54, 0x4d, 0x37,
4210+
0x4b, 0x46, 0x34, 0x50, 0x4f, 0x4f, 0x50, 0x44, 0x52, 0x45,
4211+
0x46, 0x56, 0x43, 0x42, 0x4d, 0x46, 0x4b, 0x4d, 0x34, 0x48,
4212+
0x57, 0x45, 0x43, 0x41, 0x50, 0x53, 0x45, 0x4d, 0x41, 0x54
42684213
</ul>
42694214
</li>
42704215
<li>
4271-
<b>Fental fee (always 50000000000):</b> 8 bytes (long).
4272-
<ul>
4273-
<b>Always:</b> 0x00, 0x74, 0x3b, 0xa4, 0x0b, 0x00, 0x00, 0x00
4216+
<b>Rental fee (Root always: 5000000000, Sub always: 200000000) for namespace:</b> 8 bytes (long).
4217+
<ul>
4218+
<b>Root always:</b> 0x00, 0xf2, 0x05, 0x2a, 0x01, 0x00, 0x00, 0x00
4219+
<br />
4220+
<b>Sub always:</b> 0x00, 0xc2, 0xeb, 0x0b, 0x00, 0x00, 0x00, 0x00
42744221
</ul>
42754222
</li>
42764223
<li>
@@ -4560,23 +4507,24 @@ <h3>Gathering data for the signature</h3>
45604507
</li>
45614508
<p>The levy structure ends here.</p>
45624509
<li>
4563-
<b>Length of creation fee sink's public key byte array (always 32):</b> 4 bytes (integer).
4510+
<b>Length of creation fee sink's encoded address byte array (always 40):</b> 4 bytes (integer).
45644511
<ul>
4565-
<b>Always:</b> 0x20, 0x00, 0x00, 0x00
4512+
<b>Always:</b> 0x28, 0x00, 0x00, 0x00
45664513
</ul>
45674514
</li>
45684515
<li>
4569-
<b>Public key bytes of creation fee sink:</b> 32 bytes.
4516+
<b>Address key bytes of creation fee sink:</b> 40 bytes.
45704517
<ul>
4571-
<b>Always:</b> 0x53, 0xe1, 0x40, 0xb5, 0x94, 0x7f, 0x10, 0x4c, 0xab, 0xc2, 0xd6, 0xfe, 0x8b,
4572-
0xae, 0xdb, 0xc3, 0x0e, 0xf9, 0xa0, 0x60, 0x9c, 0x71, 0x7d, 0x96, 0x13,
4573-
0xde, 0x59, 0x3e, 0xc2, 0xa2, 0x66, 0xd3
4518+
<b>Always (TBMOSAICOD4F54EE5CDMR23CCBGOAM2XSJBR5OLC):</b> 0x43, 0x4c, 0x4f, 0x35, 0x52, 0x42, 0x4a, 0x53, 0x58, 0x32,
4519+
+0x4d, 0x41, 0x4f, 0x47, 0x42, 0x43, 0x43, 0x33, 0x32, 0x52,
4520+
+0x4d, 0x44, 0x43, 0x35, 0x45, 0x45, 0x34, 0x35, 0x46, 0x34,
4521+
+0x44, 0x4f, 0x43, 0x49, 0x41, 0x53, 0x4f, 0x4d, 0x42, 0x54
45744522
</ul>
45754523
</li>
45764524
<li>
45774525
<b>Fee quantity:</b> 8 bytes (long).
45784526
<ul>
4579-
<b>Always: (50000000000)</b> 0x00, 0x74, 0x3b, 0xa4, 0x0b, 0x00, 0x00, 0x00
4527+
<b>Always: (5000000000)</b> 0x00, 0xf2, 0x05, 0x2a, 0x01, 0x00, 0x00, 0x00
45804528
</ul>
45814529
</li>
45824530

@@ -4725,45 +4673,62 @@ <h2>Transaction fees</h2>
47254673
<p class=JSON>Transfer transaction</p>
47264674
</td>
47274675
<td>
4728-
<p>The fee is the sum of the fee for transferring an amount of
4729-
XEM and the fee for appending a message to the transaction.</p>
4676+
<p>
4677+
The fee is the sum of the fee for transferring an amount of
4678+
XEM and the fee for appending a message to the transaction.
4679+
</p>
4680+
<p>1) Fees for transferring XEM to another account:<br />
4681+
<p>a) non mosaic xem transfer: 1 xem per 10_000 xem transferred, capped at 25 xem.<p>
4682+
4683+
<p>
4684+
Example: <br />
4685+
5 xem fee for a 45_000 xem transfer, 25 xem for a 500_000 xem transfer.
4686+
</p><br />
4687+
4688+
<p>2) Fees for appending a message to a transaction:<br />
4689+
4690+
<p>
4691+
b) messages: 1 xem per commenced 32 message bytes (messageLength / 32 + 1).
4692+
</p>
4693+
<p>
4694+
Example: <br />
4695+
message length of 48 bytes has 2 xem fee.
4696+
</p>
4697+
</p><br />
4698+
<p>3) Fees for transferring a mosaic to another account:<br />
4699+
4700+
<p>
4701+
c) mosaics with divisibility of 0 and a maxmimum supply of 10_000 are called small business mosaics.
4702+
1 xem fee for any transfer of a small business mosaic.
4703+
</p>
47304704

4731-
<p>1) Fees for transferring XEM to another account:<br/>
4732-
a) If the amount transferred is less than 8 XEM then the
4733-
fee is 10 - amount XEM.<br/>
4734-
Example:<br/>
4735-
Transferring 6 XEM costs 4 XEM fee.<br/>
4736-
b) If the amount transferred is greater or equal 8 XEM
4737-
then the fee is<br/>
4738-
max(2, 99 * arctan(amount / 150000)) XEM.<br/>
4739-
Example:<br/>
4740-
Transferring 100000 XEM costs 58 XEM.</p>
4705+
<p>
4706+
d) for other mosaics as before the same formula is applied to calculate the xem equivalent, then the fee for transferring xem is applied.
4707+
Call that fee xemFee. To take into account the total quantities for different mosaics, an adjustment term is calculated. <br /><br />
4708+
For a mosaic called m calculate:<br />
4709+
<ol>
4710+
<li>maxMosaicQuantity = 9_000_000_000_000_000</li>
4711+
<li>totalMosaicQuantity = mosaic m supply * 10 ^ (mosaic m divisibility)</li>
4712+
<li>supplyRelatedAdjustment = floor(0.8 * ln(maxMosaicQuantity / totalMosaicQuantity)</li>
4713+
<li>
4714+
Then the fee is calculated as:<br />
4715+
fee = max(1L, xemFee - supplyRelatedAdjustment)
4716+
</li>
4717+
</ol>
4718+
</p>
47414719

4742-
<p>2) Fees for appending a message to a transaction:<br/>
4743-
Transferring 100000 XEM costs 58 XEM.</p>
4720+
<p>Example:<br />
4721+
Mosaic with 9_000_000 supply and divisibility of 3<br />
4722+
<ol>
4723+
<li>totalMosaicQuantity = 9_000_000 * 1_000 = 9_000_000_000</li>
4724+
<li>supplyRelatedAdjustment = floor(0.8 * ln(9_000_000_000_000_000 / 9_000_000_000)) = floor(11.052) = 11</li>
4725+
<li>transferring 150 such mosaics is like transferring 150_000 xem:</li>
4726+
<li>xemFee = 15 xem</li>
4727+
<li>fee = 15 xem - 11 xem = 4 xem</li>
4728+
</ol>
4729+
</p>
4730+
</p>
47444731

4745-
<p>2) Fees for transferring a mosaic to another account:<br/>
4746-
For each mosaic that is transferred the fee is calculated the following way:<br>
4747-
a) given a mosaic with initial supply s, divisibility d and quantity q, the XEM equivalent is (round to the next smaller integer)<br/>
4748-
xemEquivalent = (8,999,999,999 * q) / (s * 10^d) <br/>
4749-
The fee is then calculated by applying 1) to xemEquivalent and in a final step adding 25% to it:<br>
4750-
fee = (apply 1) to xemEquivalent) * 1.25<br>
4751-
Example:<br/>
4752-
Suppose the transaction has an amount of 3,000,000 micro-xem and the mosaic in the attachment has an initial supply of 1,000,000,
4753-
a divisibility of 3 and a quantity of 5,000. This means that a quantity of 15,000 will be transferred.
4754-
Applying the above formula gives<br>
4755-
xemEquivalent = (8,999,999,999 * 15,000) / (1,000,000 * 1000) = 134999<br>
4756-
The result was rounded to the next smaller integer. Applying 1) to xemEquivalent gives (again after rounding) 72.<br>
4757-
So the fee is 72 * 1.25 XEM = 90 XEM.</p>
4758-
4759-
<p>3) Fees for appending a message to a transaction:<br/>
4760-
If no message or an empty message is append it costs
4761-
0 XEM. Else the fee is calculated as<br/>
4762-
2 * max(1, message length / 16)<br/>
4763-
Example:<br/>
4764-
The unencrypted message &bdquo;The New Economy
4765-
Movement will change the world!!!&ldquo; has a length 49
4766-
characters and thus will cost 2 * 49/16 = 6 XEM.</p>
47674732
</td>
47684733
</tr>
47694734
<tr>
@@ -4809,23 +4774,26 @@ <h2>Transaction fees</h2>
48094774
<p class=JSON>Provision namespace transaction</p>
48104775
</td>
48114776
<td>
4812-
<p>108 XEM</p>
4777+
<p>20 XEM</p>
4778+
<p>plus:</p>
4779+
<p>Fee for root namespace provisioning: 5000 XEM</p>
4780+
<p>Fee for sub-namespace provisioning: 200 XEM</p>
48134781
</td>
48144782
</tr>
48154783
<tr>
48164784
<td>
48174785
<p class=JSON>Mosaic definition creation transaction</p>
48184786
</td>
48194787
<td>
4820-
<p>108 XEM</p>
4788+
<p>20 XEM</p>
48214789
</td>
48224790
</tr>
48234791
<tr>
48244792
<td>
48254793
<p class=JSON>Mosaic supply change transaction</p>
48264794
</td>
48274795
<td>
4828-
<p>108 XEM</p>
4796+
<p>20 XEM</p>
48294797
</td>
48304798
</tr>
48314799
</table>

0 commit comments

Comments
 (0)