diff --git a/en/slate-example/fonts/slate.eot b/en/slate-example/fonts/slate.eot new file mode 100644 index 00000000..13c4839a Binary files /dev/null and b/en/slate-example/fonts/slate.eot differ diff --git a/en/slate-example/fonts/slate.svg b/en/slate-example/fonts/slate.svg new file mode 100644 index 00000000..5f349823 --- /dev/null +++ b/en/slate-example/fonts/slate.svg @@ -0,0 +1,14 @@ + + + +Generated by IcoMoon + + + + + + + + + + diff --git a/en/slate-example/fonts/slate.ttf b/en/slate-example/fonts/slate.ttf new file mode 100644 index 00000000..ace9a46a Binary files /dev/null and b/en/slate-example/fonts/slate.ttf differ diff --git a/en/slate-example/fonts/slate.woff b/en/slate-example/fonts/slate.woff new file mode 100644 index 00000000..1e72e0ee Binary files /dev/null and b/en/slate-example/fonts/slate.woff differ diff --git a/en/slate-example/fonts/slate.woff2 b/en/slate-example/fonts/slate.woff2 new file mode 100644 index 00000000..7c585a72 Binary files /dev/null and b/en/slate-example/fonts/slate.woff2 differ diff --git a/en/slate-example/images/favicon.ico b/en/slate-example/images/favicon.ico new file mode 100644 index 00000000..2420b2b6 Binary files /dev/null and b/en/slate-example/images/favicon.ico differ diff --git a/en/slate-example/images/logo.png b/en/slate-example/images/logo.png new file mode 100644 index 00000000..cbee48a7 Binary files /dev/null and b/en/slate-example/images/logo.png differ diff --git a/en/slate-example/images/navbar.png b/en/slate-example/images/navbar.png new file mode 100644 index 00000000..df38e90d Binary files /dev/null and b/en/slate-example/images/navbar.png differ diff --git a/en/slate-example/includes/abandontransaction b/en/slate-example/includes/abandontransaction new file mode 100644 index 00000000..55c406dd --- /dev/null +++ b/en/slate-example/includes/abandontransaction @@ -0,0 +1,55 @@ +

AbandonTransaction

+

Added in Bitcoin Core 0.12.0

+ +

The abandontransaction RPC marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent.

+ +

Parameter #1---a transaction identifier (TXID)

+ +
+

Abandons the transaction on your node.

+
+
dash-cli abandontransaction fa3970c341c9f5de6ab13f128cbfec58d732e736a505fe32137ad551c799ecc4
+
+ + + + + + + + + + + + + + +
NameTypeRequiredDescription
TXIDstring (hex)Required
(exactly 1)
The TXID of the transaction that you want to abandon. The TXID must be encoded as hex in RPC byte order
+ +

Result---null on success

+ +
+

Result (no output from dash-cli because result is set to null).

+
+ + + + + + + + + + + + + + + +
NameTypeRequiredDescription
resultnullRequired
(exactly 1)
JSON null when the transaction and all descendants were abandoned
+ +

See also

+ + diff --git a/en/slate-example/includes/getblock b/en/slate-example/includes/getblock new file mode 100644 index 00000000..ccdaea10 --- /dev/null +++ b/en/slate-example/includes/getblock @@ -0,0 +1,215 @@ +

GetBlock

+

The getblock RPC gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

+ +
+

Get a block in raw hex:

+
+
dash-cli -testnet getblock \
+            0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84 \
+            false
+
+0100002011f5719a0a0c4881ff98b4a68c1c828dc3b10f5b51033f5f93d48dbf\
+000000004b8e38f197d6ee878e160d2bae3ce05ab898a6252458ec67ce770140\
+260397c4dd2ed659a1dd001d00636b5601010000000100000000000000000000\
+00000000000000000000000000000000000000000000ffffffff4b02041204dd\
+2ed65908fabe6d6d7445746d63506b62572d2d35584853467a765a6748696972\
+30657a3a6f6d656e010000000000000017fffff9020000000d2f6e6f64655374\
+726174756d2f00000000058028bb13010000001976a914bad55652dffb1af943\
+41015c94feea79793442fd88ac40e553b1020000001976a9142b7856de53d4c1\
+823090c98f8ad79862842c09b588ac4094dd89000000001976a914c2c29ebc78\
+7954ef99d01c5f79115abf7012fb8e88ac4094dd89000000001976a914d7b47d\
+4b40a23c389f5a17754d7f60f511c7d0ec88ac4094dd89000000001976a914dc\
+3e0793134b081145ec0c67a9c72a7b297df27c88ac00000000
+
+

Parameter #1---header hash

+ + + + + + + + + + + + + + + +
NameTypeRequiredDescription
Header Hashstring (hex)Required
(exactly 1)
The hash of the header of the block to get, encoded as hex in RPC byte order
+ +

Parameter #2---whether to get JSON or hex output

+ + + + + + + + + + + + + + + +
NameTypeRequiredDescription
FormatbooleanOptional
(true or false)
Set to false to get the block in serialized block format; set to true (the default) to get the decoded block as a JSON object
+ +

Result (if format was false)---a serialized block

+ + + + + + + + + + + + + + + +
NameTypeRequiredDescription
resultstring (hex)/nullRequired
(exactly 1
"The requested block as a serialized block, encoded as hex, or JSON null if an error occurred
+ +
+

Get the same block in JSON:

+
+
dash-cli -testnet getblock \
+  0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84
+
{
+  "hash": "0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84",
+  "confirmations": 3,
+  "size": 377,
+  "height": 4612,
+  "version": 536870913,
+  "merkleroot": "c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b",
+  "tx": [
+    "c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"
+  ],
+  "time": 1507208925,
+  "mediantime": 1507208645,
+  "nonce": 1449878272,
+  "bits": "1d00dda1",
+  "difficulty": 1.155066358813473,
+  "chainwork": "000000000000000000000000000000000000000000000000000001c3e86f0f04",
+  "previousblockhash": "00000000bf8dd4935f3f03515b0fb1c38d821c8ca6b498ff81480c0a9a71f511",
+  "nextblockhash": "0000000028817c7fce55d802f3647640600535a983d00e16076f284ec6cb001b"
+}
+
+

Result (if format was true or omitted)---a JSON block

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeRequiredDescription
resultobject/nullRequired
(exactly 1)
An object containing the requested block, or JSON null if an error occurred

hash
string (hex)Required
(exactly 1)
The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1

confirmations
number (int)Required
(exactly 1)
The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain"

size
number (int)Required
(exactly 1)
The size of this block in serialized block format, counted in bytes"

height
number (int)Required
(exactly 1)
The height of this block on its block chain"

version
number (int)Required
(exactly 1)
This block's version number. See [block version numbers][section block versions]"

merkleroot
string (hex)Required
(exactly 1)
The merkle root for this block, encoded as hex in RPC byte order"

tx
arrayRequired
(exactly 1)
An array containing the TXIDs of all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block"
→ →
TXID
string (hex)Required
(1 or more)
The TXID of a transaction in this block, encoded as hex in RPC byte order"

time
number (int)Required
(exactly 1)
The value of the time field in the block header, indicating approximately when the block was created"

mediantime
number (int)Required
(exactly 1)
Added in Bitcoin Core 0.12.0

The median block time in Unix epoch time"

nonce
number (int)Required
(exactly 1)
The nonce which was successful at turning this particular block into one that could be added to the best block chain"

bits
string (hex)Required
(exactly 1)
The value of the nBits field in the block header, indicating the target threshold this block's header had to pass"

difficulty
number (real)Required
(exactly 1)
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0"

chainwork
string (hex)Required
(exactly 1)
The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex"

previousblockhash
string (hex)Optional
(0 or 1)
The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block"

nextblockhash
string (hex)Optional
(0 or 1)
The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order"
diff --git a/en/slate-example/includes/intro b/en/slate-example/includes/intro new file mode 100644 index 00000000..f5fbf8ca --- /dev/null +++ b/en/slate-example/includes/intro @@ -0,0 +1,179 @@ +

Introduction

+

Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.

+ +

We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

+ +

This example API documentation page was created with Slate. Feel free to edit it and use it as a base for your own API's documentation.

+

Authentication

+
+

To authorize, use this code:

+
+
require 'kittn'
+
+api = Kittn::APIClient.authorize!('meowmeowmeow')
+
import kittn
+
+api = kittn.authorize('meowmeowmeow')
+
# With shell, you can just pass the correct header with each request
+curl "api_endpoint_here"
+  -H "Authorization: meowmeowmeow"
+
const kittn = require('kittn');
+
+let api = kittn.authorize('meowmeowmeow');
+
+
+

Make sure to replace meowmeowmeow with your API key.

+
+ +

Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our developer portal.

+ +

Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:

+ +

Authorization: meowmeowmeow

+ + +

Kittens

Get All Kittens

require 'kittn'
+
+api = Kittn::APIClient.authorize!('meowmeowmeow')
+api.kittens.get
+
import kittn
+
+api = kittn.authorize('meowmeowmeow')
+api.kittens.get()
+
curl "http://example.com/api/kittens"
+  -H "Authorization: meowmeowmeow"
+
const kittn = require('kittn');
+
+let api = kittn.authorize('meowmeowmeow');
+let kittens = api.kittens.get();
+
+
+

The above command returns JSON structured like this:

+
+
[
+  {
+    "id": 1,
+    "name": "Fluffums",
+    "breed": "calico",
+    "fluffiness": 6,
+    "cuteness": 7
+  },
+  {
+    "id": 2,
+    "name": "Max",
+    "breed": "unknown",
+    "fluffiness": 5,
+    "cuteness": 10
+  }
+]
+
+

This endpoint retrieves all kittens.

+

HTTP Request

+

GET http://example.com/api/kittens

+

Query Parameters

+ + + + + + + + + + + + + + + + + +
ParameterDefaultDescription
include_catsfalseIf set to true, the result will also include cats.
availabletrueIf set to false, the result will include kittens that have already been adopted.
+ + +

Get a Specific Kitten

require 'kittn'
+
+api = Kittn::APIClient.authorize!('meowmeowmeow')
+api.kittens.get(2)
+
import kittn
+
+api = kittn.authorize('meowmeowmeow')
+api.kittens.get(2)
+
curl "http://example.com/api/kittens/2"
+  -H "Authorization: meowmeowmeow"
+
const kittn = require('kittn');
+
+let api = kittn.authorize('meowmeowmeow');
+let max = api.kittens.get(2);
+
+
+

The above command returns JSON structured like this:

+
+
{
+  "id": 2,
+  "name": "Max",
+  "breed": "unknown",
+  "fluffiness": 5,
+  "cuteness": 10
+}
+
+

This endpoint retrieves a specific kitten.

+ + +

HTTP Request

+

GET http://example.com/kittens/<ID>

+

URL Parameters

+ + + + + + + + + + +
ParameterDescription
IDThe ID of the kitten to retrieve
+

Delete a Specific Kitten

require 'kittn'
+
+api = Kittn::APIClient.authorize!('meowmeowmeow')
+api.kittens.delete(2)
+
import kittn
+
+api = kittn.authorize('meowmeowmeow')
+api.kittens.delete(2)
+
curl "http://example.com/api/kittens/2"
+  -X DELETE
+  -H "Authorization: meowmeowmeow"
+
const kittn = require('kittn');
+
+let api = kittn.authorize('meowmeowmeow');
+let max = api.kittens.delete(2);
+
+
+

The above command returns JSON structured like this:

+
+
{
+  "id": 2,
+  "deleted" : ":("
+}
+
+

This endpoint deletes a specific kitten.

+

HTTP Request

+

DELETE http://example.com/kittens/<ID>

+

URL Parameters

+ + + + + + + + + + +
ParameterDescription
IDThe ID of the kitten to delete
diff --git a/en/slate-example/includes/quick-reference b/en/slate-example/includes/quick-reference new file mode 100644 index 00000000..2e49d64f --- /dev/null +++ b/en/slate-example/includes/quick-reference @@ -0,0 +1,252 @@ +

RPC Quick Reference

+

{% comment %} +Styling notes: use highly-visible style for upcoming changes (not yet +released) and changes made in the last 6 months. Use less-visible +style for changes made up to two years ago. Don't point out +changes made more than two years ago.

+ +

Use v0.n.n in abbreviation title to prevent autocrossrefing. +{% endcomment %}

+ + + +

{% assign DASH_NOT_IMPLEMENTED='Not Implemented' %}

+ + + +

{% assign DASH_NEW0_12_3='New in Dash Core 0.12.3' %} +{% assign DASH_UPDATED0_12_3='Updated in Dash Core 0.12.3' %}

+ + + +

{% assign DASH_NEW0_12_2='New in Dash Core 0.12.2' %} +{% assign DASH_UPDATED0_12_2='Updated in Dash Core 0.12.2' %}

+ + + +

{% assign DASH_NEW0_12_1='New in Dash Core 0.12.1' %} +{% assign DASH_UPDATED0_12_1='Updated in Dash Core 0.12.1' %}

+ + + +

{% assign DARKCOIN_NEW0_11_0='New in Darkcoin Core 0.11.0' %} +{% assign DARKCOIN_UPDATED0_11_0='Updated in Darkcoin Core 0.11.0' %}

+ + + +

{% assign DEPRECATED='Deprecated' %}

+ + + +

{% assign UPDATED0_14_0='Updated in Bitcoin Core 0.14.1' %}

+ + + +

{% assign NEW0_14_0='New in Bitcoin Core 0.14.0' %} +{% assign UPDATED0_14_0='Updated in Bitcoin Core 0.14.0' %}

+ + + +

{% assign UPDATED0_13_1='Updated in Bitcoin Core 0.13.1' %}

+ + + +

{% assign NEW0_13_0='New in Bitcoin Core 0.13.0' %} +{% assign UPDATED0_13_0='Updated in Bitcoin Core 0.13.0' %}

+ + + +

{% assign UPDATED0_12_1='Updated in Bitcoin Core 0.12.1' %}

+ + + +

{% assign NEW0_12_0='New in Bitcoin Core 0.12.0' %} +{% assign UPDATED0_12_0='Updated in Bitcoin Core 0.12.0' %}

+ + + +

{% assign NEW0_11_0='New in Bitcoin Core 0.11.0' %}

+ + + +

{% include helpers/summaries.md %}

+

RPC Summary Table

+

{% include layout/base/rpc-table.html %}

+

Addressindex RPCs

+

These RPCs are all Dash-specific and not found in Bitcoin Core

+ + +

Block Chain RPCs

+ +

Control RPCs

+ +

Dash RPCs

+ +

Generating RPCs

+ +

Mining RPCs

+ +

Network RPCs

+ +

Raw Transaction RPCs

+ +

Utility RPCs

+ +

Wallet RPCs

+

Note: the wallet RPCs are only available if Dash Core was built +with [wallet support][]{:#term-wallet-support}{:.term}, which is the +default.

+ + +

Removed RPCs

+ diff --git a/en/slate-example/includes/ref_p2p_networking b/en/slate-example/includes/ref_p2p_networking new file mode 100644 index 00000000..b1248dbf --- /dev/null +++ b/en/slate-example/includes/ref_p2p_networking @@ -0,0 +1,4628 @@ +

P2P Network

+

This section describes the Dash P2P network protocol (but it is [not a +specification][]). It does not describe the +[BIP70 payment protocol][/en/glossary/payment-protocol], the +[GetBlockTemplate mining protocol][section getblocktemplate], or any +network protocol never implemented in an official version of Dash Core.

+ +

All peer-to-peer communication occurs entirely over TCP.

+ + +

Constants And Defaults

+

The following constants and defaults are taken from Dash Core's +[chainparams.cpp][core chainparams.cpp] source code file.

+ +

| Network | Default Port | Magic Value | [Start String][/en/glossary/start-string]{:#term-start-string}{:.term} | Max nBits +|---------|--------------|-----------------------------------------------|--------------- +| Mainnet | 9999 | 0xBD6B0CBF | 0xBF0C6BBD | 0x1e0ffff0 +| Testnet | 19999 | 0xFFCAE2CE | 0xCEE2CAFF | 0x1e0ffff0 +| Regtest | 19994 | 0xDCB7C1FC | 0xFCC1B7DC | 0x207fffff +| Devnet | User-defined | 0xCEFFCAE2 | 0xE2CAFFCE | 0x207fffff

+ +

Note: the testnet start string and nBits above are for testnet3.

+ +

Command line parameters can change what port a node listens on (see +-help). Start strings are hardcoded constants that appear at the start +of all messages sent on the Dash network; they may also appear in +data files such as Dash Core's block database. The Magic Value and nBits +displayed above are in big-endian order; they're sent over the network in +little-endian order. The Start String is simply the endian reversed Magic Value.

+ +

Dash Core's [chainparams.cpp][core chainparams.cpp] also includes +other constants useful to programs, such as the hash of the genesis +blocks for the different networks.

+

Protocol Versions

+

The table below lists some notable versions of the P2P network protocol, +with the most recent versions listed first. (If you know of a protocol +version that implemented a major change but which is not listed here, +please [open an issue][docs issue].)

+ +

As of Dash Core 0.12.2.0, the most recent protocol version is 70208.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VersionInitial ReleaseMajor Changes
70208Dash Core 0.12.2.x
(Nov 2017)
• DIP-0001 (2MB blocks)
• Fee reduction (10x)
• InstantSend fix
• PrivateSend improvements
Experimental HD wallet
• Local Masternode support removed
70206Dash Core 0.12.1.x
(Mar 2017)
• Switch to Bitcoin Core 0.12.1
• BIP-0065 (CheckLockTimeVerify)
• BIP-0112 (CheckSequenceVerify)
70103Dash Core 0.12.0.x
(Aug 2015)
• Switch to Bitcoin Core 0.10
• Decentralized budget system
• New IX implementation
70076Dash Core 0.11.2.x
(Mar 2015)
• Masternode enhancements
• Mining/relay policy enhancements
• BIP-66 - strict DER encoding for signatures
70066Dash Core 0.11.1.x
(Feb 2015)
• InstantX fully implemented
• Spork fully implemented
• Masternode payment updates
• Rebrand to Dash (0.11.1.26)
70052Dash Core 0.11.0.x
(Jan 2015)
• Switch from fork of Litecoin 0.8 to Bitcoin 0.9.3
• Rebrand to Darkcoin Core
70051Dash Core 0.10.0.x
(Sep 2014)
• Release of the originally closed source implementation of DarkSend
70002Dash Core 0.9.0.x
(Mar 2014)
• Masternode implementation
• Rebrand to Darkcoin
70002Dash Core 0.8.7
(Jan 2014)
Initial release of Dash (branded XCoin) as a fork of Litecoin 0.8
+ +

Historical Bitcoin protocol versions for reference shown below since Dash is a +fork of Bitcoin Core.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VersionInitial ReleaseMajor Changes
70012Bitcoin Core 0.12.0
(Feb 2016)
[BIP130][]:
• Added sendheaders message.
70011Bitcoin Core 0.12.0
(Feb 2016)
[BIP111][]:
filter* messages are disabled without NODE_BLOOM after and including this version.
70002Bitcoin Core 0.9.0
(Mar 2014)
• Send multiple inv messages in response to a mempool message if necessary

[BIP61][]:
• Added reject message
70001Bitcoin Core 0.8.0
(Feb 2013)
• Added notfound message.

[BIP37][]:
• Added filterload message.
• Added filteradd message.
• Added filterclear message.
• Added merkleblock message.
• Added relay field to version message
• Added MSG_FILTERED_BLOCK inventory type to getdata message.
60002Bitcoin Core 0.7.0
(Sep 2012)
[BIP35][]:
• Added mempool message.
• Extended getdata message to allow download of memory pool transactions
60001Bitcoin Core 0.6.1
(May 2012)
[BIP31][]:
• Added nonce field to ping message
• Added pong message
60000Bitcoin Core 0.6.0
(Mar 2012)
[BIP14][]:
• Separated protocol version from Bitcoin Core version
31800Bitcoin Core 0.3.18
(Dec 2010)
• Added getheaders message and headers message.
31402Bitcoin Core 0.3.15
(Oct 2010)
• Added time field to addr message.
311Bitcoin Core 0.3.11
(Aug 2010)
• Added alert message.
209Bitcoin Core 0.2.9
(May 2010)
• Added checksum field to message headers.
106Bitcoin Core 0.1.6
(Oct 2009)
• Added receive IP address fields to version message.
+

Message Headers

+

All messages in the network protocol use the same container format, +which provides a required multi-field message header and an optional payload. +The message header format is:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
4start stringchar[4]Magic bytes indicating the originating network; used to seek to next message when stream state is unknown.
12command namechar[12]ASCII string which identifies what message type is contained in the payload. Followed by nulls (0x00) to pad out byte count; for example: version\0\0\0\0\0.
4payload sizeuint32_tNumber of bytes in payload. The current maximum number of bytes ([MAX_SIZE][max_size]) allowed in the payload by Dash Core is 32 MiB---messages with a payload size larger than this will be dropped or rejected.
4checksumchar[4]Added in protocol version 209.

First 4 bytes of SHA256(SHA256(payload)) in internal byte order.

If payload is empty, as in verack and getaddr messages, the checksum is always 0x5df6e0e2 (SHA256(SHA256(<empty string>))).
+ +

The following example is an annotated hex dump of a mainnet message +header from a verack message which has no payload.

+
bf0c6bbd ................... Start string: Mainnet
+76657261636b000000000000 ... Command name: verack + null padding
+00000000 ................... Byte count: 0
+5df6e0e2 ................... Checksum: SHA256(SHA256(<empty>))
+

Data Messages

+

The following network messages all request or provide data related to +transactions and blocks.

+ +

Overview Of P2P Protocol Data Request And Reply Messages

+ +

Many of the data messages use +[inventories][/en/glossary/inventory]{:#term-inventory}{:.term} as unique identifiers +for transactions and blocks. Inventories have a simple 36-byte +structure:

+ + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
4type identifieruint32_tThe type of object which was hashed. See list of type identifiers below.
32hashchar[32]SHA256(SHA256()) hash of the object in internal byte order.
+ +

The currently-available type identifiers are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Type IdentifierNameDescription
1[MSG_TX][msg_tx]{:#term-msg_tx}{:.term}The hash is a TXID.
2[MSG_BLOCK][msg_block]{:#term-msg_block}{:.term}The hash is of a block header.
3[MSG_FILTERED_BLOCK][msg_filtered_block]{:#term-msg_filtered_block}{:.term}The hash is of a block header; identical to MSG_BLOCK. When used in a getdata message, this indicates the response should be a merkleblock message rather than a block message (but this only works if a bloom filter was previously configured). Only for use in getdata messages.
4[MSG_TXLOCK_REQUEST][msg_txlock_request]{:#term-msg_txlock_request}{:.term}The hash is an Instant Send transaction lock request.
5[MSG_TXLOCK_VOTE][msg_txlock_vote]{:#term-msg_txlock_vote}{:.term}The hash is an Instant Send transaction vote.
6[MSG_SPORK][msg_spork]{:#term-msg_spork}{:.term}The hash is Spork ID.
7[MSG_MASTERNODE_PAYMENT_VOTE][msg_masternode_payment_vote]{:#term-msg_masternode_payment_vote}{:.term}The hash is a Masternode Payment Vote.
8[MSG_MASTERNODE_PAYMENT_BLOCK][msg_masternode_payment_block]{:#term-msg_masternode_payment_block}{:.term}The hash is a Masternode Payment Block.
8MSG_MASTERNODE_SCANNING_ERRORReplaced by MSG_MASTERNODE_PAYMENT_BLOCK
9[MSG_BUDGET_VOTE][msg_budget_vote]{:#term-msg_budget_vote}{:.term}Deprecated
10[MSG_BUDGET_PROPOSAL][msg_budget_proposal]{:#term-msg_budget_proposal}{:.term}Deprecated
11[MSG_BUDGET_FINALIZED][msg_budget_finalized]{:#term-msg_budget_finalized}{:.term}Deprecated
12[MSG_BUDGET_FINALIZED_VOTE][msg_budget_finalized_vote]{:#term-msg_budget_finalized_vote}{:.term}Deprecated
13[MSG_MASTERNODE_QUORUM][msg_masternode_quorum]{:#term-msg_masternode_quorum}{:.term}Not Implemented
14[MSG_MASTERNODE_ANNOUNCE][msg_masternode_announce]{:#term-msg_masternode_announce}{:.term}The hash is a Masternode Broadcast.
15[MSG_MASTERNODE_PING][msg_masternode_ping]{:#term-msg_masternode_ping}{:.term}The hash is a Masternode Ping.
16[MSG_DSTX][msg_dstx]{:#term-msg_dstx}{:.term}The hash is Private Send (Dark Send) Broadcast TX.
17[MSG_GOVERNANCE_OBJECT][msg_governance_object]{:#term-msg_governance_object}{:.term}The hash is a Governance Object.
18[MSG_GOVERNANCE_OBJECT_VOTE][msg_governance_object_vote]{:#term-msg_governance_object_vote}{:.term}The hash is a Governance Object Vote.
19[MSG_MASTERNODE_VERIFY][msg_masternode_verify]{:#term-msg_masternode_verify}{:.term}The hash is a Masternode Verify.
20[MSG_CMPCT_BLOCK][msg_cmpct_block]{:#term-msg_cmpct_block}{:.term}The hash is of a block header; identical to MSG_BLOCK. When used in a getdata message, this indicates the response should be a cmpctblock message. Only for use in getdata messages.
+ +

Type identifier zero and type identifiers greater than twenty are reserved +for future implementations. Dash Core ignores all inventories with +one of these unknown types.

+

Block

+

The block message transmits a single serialized block in the format +described in the [serialized blocks section][section serialized blocks]. +See that section for an example hexdump. It can be sent for two +different reasons:

+ +
    +
  1. GetData Response: Nodes will always send it in response to a +getdata message that requests the block with an inventory +type of MSG_BLOCK (provided the node has that block available for +relay).

  2. +
  3. Unsolicited: Some miners will send unsolicited block messages +broadcasting their newly-mined blocks to all of their peers. Many +mining pools do the same thing, although some may be misconfigured to +send the block from multiple nodes, possibly sending the same block +to some peers more than once.

  4. +
+

Blocktxn

+

Added in protocol version 70209 of Dash Core as described by BIP152

+ +

The blocktxn message sends requested block transactions to a node which +previously requested them with a getblocktxn message. It is defined as a message +containing a serialized BlockTransactions message.

+ +

Upon receipt of a properly-formatted requested blocktxn message, nodes should:

+ +
    +
  1. Attempt to reconstruct the full block by taking the prefilledtxn transactions from the original cmpctblock message and placing them in the marked positions
  2. +
  3. For each short transaction ID from the original cmpctblock message, in order, find the corresponding transaction (from either the blocktxn message or from other sources)
  4. +
  5. Place each short transaction ID in the first available position in the block
  6. +
  7. Once the block has been reconstructed, it shall be processed as normal.
  8. +
+ +

Short transaction IDs are expected to occasionally collide. Nodes must +not be penalized for such collisions.

+ +

The structure of BlockTransactions is defined below.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeEncodingDescription
32blockhashBinary blobThe output from a double-SHA256 of the block header, as used elsewhereThe blockhash of the block which the transactions being provided are in
1 or 3transactions
_length
CompactSizeAs used to encode array lengths elsewhereThe number of transactions provided
VariestransactionsList of transactionsAs encoded in tx messages in response to getdata MSG_TXThe transactions provided
+ + +

CmpctBlock

+

Added in protocol version 70209 of Dash Core as described by BIP152

+ +

The cmpctblock message is a reply to a getdata message which +requested a block using the inventory type MSG_CMPCT_BLOCK. If the +requested block was recently announced and is close to the tip of the +best chain of the receiver and after having sent the requesting peer +a sendcmpct message, nodes respond with a cmpctblock message containing +data for the block.

+ +

If the requested block is too old, the node responds with a *full non-compact block*

+ +

Upon receipt of a cmpctblock message, after sending a sendcmpct message, +nodes should calculate the short transaction ID for each unconfirmed +transaction they have available (i.e. in their mempool) and compare each +to each short transaction ID in the cmpctblock message. After finding +already-available transactions, nodes which do not have all transactions +available to reconstruct the full block should request the missing transactions +using a getblocktxn message.

+ +

A node must not send a cmpctblock message unless they are able to respond to +a getblocktxn message which requests every transaction in the block. A node +must not send a cmpctblock message without having validated that the header properly +commits to each transaction in the block, and properly builds on top of the existing, +fully-validated chain with a valid proof-of-work either as a part of the current most-work +valid chain, or building directly on top of it. A node may send a cmpctblock message before +validating that each transaction in the block validly spends existing UTXO set entries.

+ +

The cmpctblock message contains a vector of PrefilledTransaction whose +structure is defined below. A PrefilledTransaction is used in HeaderAndShortIDs +to provide a list of a few transactions explicitly.

+ + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeEncodingDescription
1 or 3indexCompactSizeCompact Size, differentially encoded since the last PrefilledTransaction in a listThe index into the block at which this transaction is
VariestxTransactionAs encoded in tx messages sent in response to getdata MSG_TXTransaction which is in the block at index index
+ +

The cmpctblock message is compromised of a serialized HeaderAndShortIDs +structure which is defined below. A HeaderAndShortIDs structure is used to +relay a block header, the short transactions IDs used for matching +already-available transactions, and a select few transactions which +we expect a peer may be missing.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeEncodingDescription
80headerBlock headerFirst 80 bytes of the block as defined by the encoding used by block messagesThe header of the block being provided
8nonceuint64_tLittle EndianA nonce for use in short transaction ID calculations
1 or 3shortids_
length
CompactSizeAs used to encode array lengths elsewhereThe number of short transaction IDs in shortids (i.e. block tx count - prefilledtxn
_length)
VariesshortidsList of 6-byte integersLittle EndianThe short transaction IDs calculated from the transactions which were not provided explicitly in prefilledtxn
1 or 3prefilledtxn
_length
CompactSizeAs used to encode array lengths elsewhereThe number of prefilled transactions in prefilledtxn (i.e. block tx count - shortids
_length)
VariesprefilledtxnList of Prefilled
Transactions
As defined by Prefilled
Transaction definition below
Used to provide the coinbase transaction and a select few which we expect a peer may be missing
+ +

Short Transaction ID calculation

+ +

Short transaction IDs are used to represent a transaction without sending a full 256-bit hash. They are calculated as follows,

+ + + +

The following annotated hexdump shows a cmpctblock message. (The +message header has been omitted.)

+
00000020981178a4342cec6316296b2ad84c9b7cdf9f
+2688e5d0fe1a0003cd0000000000f64870f52a3d0125
+1336c9464961216732b25fbf288a51f25a0e81bffb20
+e9600194d85a64a50d1cc02b0181 ................ Block Header
+
+3151b67e5b418b9d ............................ Nonce
+
+00 .......................................... Short IDs Length: 0
+............................................. Short IDs: None
+
+01 .......................................... Prefilled Transaction Length: 1
+
+Prefilled Transactions
+| 00 ........................................ Index: 0
+|
+| Transaction 1 (Coinbase)
+| | 01000000 ................................ Transaction Version: 1
+| | 01 ...................................... Input count: 1
+| |
+| | Transaction input #1
+| | |
+| | | 00000000000000000000000000000000
+| | | 00000000000000000000000000000000 ..... Outpoint TXID
+| | | ffffffff ............................. Outpoint index number: UINT32_MAX
+| | |
+| | | 13 ................................... Bytes in sig. script: 19
+| | | 03daaf010e2f5032506f6f6c2d74444153482f Secp256k1 signature
+| | |
+| | | ffffffff ............................. Sequence number: UINT32_MAX
+| |
+| | 04 ..................................... Number of outputs: 04
+| |
+| | Transaction output #1
+| | | ffe5654200000000 ..................... Duffs (11.13974271 Dash)
+| | |
+| | | 19 ................................... Bytes in pubkey script: 25
+| | | | 76 ................................. OP_DUP
+| | | | a9 ................................. OP_HASH160
+| | | | 14 ................................. Push 20 bytes as data
+| | | | | b885cb21ad12e593c1a46d814df47ccb
+| | | | | 450a7d84 ......................... PubKey hash
+| | | | 88 ................................. OP_EQUALVERIFY
+| | | | ac ................................. OP_CHECKSIG
+| |
+| | [...] .................................. 3 more tx outputs omitted
+| |
+| | 00000000 ............................... locktime: 0 (a block height)
+

GetBlocks

+

The getblocks message requests an inv message that provides block +header hashes starting from a particular point in the block chain. It +allows a peer which has been disconnected or started for the first time +to get the data it needs to request the blocks it hasn't seen.

+ +

Peers which have been disconnected may have stale blocks in their +locally-stored block chain, so the getblocks message allows the +requesting peer to provide the receiving peer with multiple header +hashes at various heights on their local chain. This allows the +receiving peer to find, within that list, the last header hash they had +in common and reply with all subsequent header hashes.

+ +

Note: the receiving peer itself may respond with an inv message +containing header hashes of stale blocks. It is up to the requesting +peer to poll all of its peers to find the best block chain.

+ +

If the receiving peer does not find a common header hash within the +list, it will assume the last common block was the genesis block (block +zero), so it will reply with in inv message containing header hashes +starting with block one (the first block after the genesis block).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
4versionuint32_tThe protocol version number; the same as sent in the version message.
Varieshash countcompactSize uintThe number of header hashes provided not including the stop hash. There is no limit except that the byte size of the entire message must be below the [MAX_SIZE][max_size] limit; typically from 1 to 200 hashes are sent.
Variesblock header hasheschar[32]One or more block header hashes (32 bytes each) in internal byte order. Hashes should be provided in reverse order of block height, so highest-height hashes are listed first and lowest-height hashes are listed last.
32stop hashchar[32]The header hash of the last header hash being requested; set to all zeroes to request an inv message with all subsequent header hashes (a maximum of 500 will be sent as a reply to this message; if you need more than 500, you will need to send another getblocks message with a higher-height header hash as the first entry in block header hash field).
+ +

The following annotated hexdump shows a getblocks message. (The +message header has been omitted.)

+ +

{% highlight text %} +71110100 ........................... Protocol version: 70001 +02 ................................. Hash count: 2

+ +

d39f608a7775b537729884d4e6633bb2 +105e55a16a14d31b0000000000000000 ... Hash #1

+ +

5c3e6403d40837110a2e8afb602b1c01 +714bda7ce23bea0a0000000000000000 ... Hash #2

+ +

00000000000000000000000000000000 +00000000000000000000000000000000 ... Stop hash +{% endhighlight %}

+

GetBlockTxn

+

Added in protocol version 70209 of Dash Core as described by BIP152

+ +

The getblocktxn message requests a blocktxn message for any transactions +that it has not seen after a compact block is received. It is defined as a +message containing a serialized BlockTransactionsRequest message. Upon receipt +of a properly-formatted getblocktxn message, nodes which recently provided the +sender of such a message with a cmpctblock message for the block hash +identified in this message must respond with either an appropriate +blocktxn message, or a full block message.

+ +

A blocktxn message response must contain exactly and only each transaction +which is present in the appropriate block at the index specified in the +getblocktxn message indexes list, in the order requested.

+ +

The structure of BlockTransactionsRequest is defined below.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeEncodingDescription
32blockhashBinary blobThe output from a double-SHA256 of the block header, as used elsewhereThe blockhash of the block which the transactions being requested are in
Variesindexes_lengthCompactSize uintAs used to encode array lengths elsewhereThe number of transactions requested
VariesindexesCompactSize uint[]Differentially encodedVector of compactSize containing the indexes of the transactions being requested in the block.
+ + +

GetData

+

The getdata message requests one or more data objects from another +node. The objects are requested by an inventory, which the requesting +node typically previously received by way of an inv message.

+ +

The response to a getdata message can be a tx message, block +message, merkleblock message, ix message, txlvote message, +mnw message, mnb message, mnp message, dstx message, govobj message, +govobjvote message, mnv message, notfound message, or cmpctblock message. <!-- What about spork? Only handled by getspork?-->

+ +

This message cannot be used to request arbitrary data, such as historic +transactions no longer in the memory pool or relay set. Full nodes may +not even be able to provide older blocks if they've pruned old +transactions from their block database. For this reason, the getdata +message should usually only be used to request data from a node which +previously advertised it had that data by sending an inv message.

+ +

The format and maximum size limitations of the getdata message are +identical to the inv message; only the message header differs.

+

GetHeaders

+

Added in protocol version 70077.

+ +

The getheaders message requests a headers message that provides block headers +starting from a particular point in the block chain. It allows a +peer which has been disconnected or started for the first time to get +the headers it hasn’t seen yet.

+ +

The getheaders message is nearly identical to the getblocks message, +with one minor difference: the inv reply to the getblocks message +will include no more than 500 block header hashes; the headers reply +to the getheaders message will include as many as 2,000 block headers.

+

Headers

+

Added in protocol version 31800 (of Bitcoin).

+ +

The headers message sends block headers to a node which +previously requested certain headers with a getheaders message. A headers +message can be empty.

+ + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
VariescountcompactSize uintNumber of block headers up to a maximum of 2,000. Note: headers-first sync assumes the sending node will send the maximum number of headers whenever possible.
Variesheadersblock_headerBlock headers: each 80-byte block header is in the format described in the [block headers section][section block header] with an additional 0x00 suffixed. This 0x00 is called the transaction count, but because the headers message doesn't include any transactions, the transaction count is always zero.
+ +

The following annotated hexdump shows a headers message. (The message +header has been omitted.)

+ +

{% highlight text %} +01 ................................. Header count: 1

+ +

02000000 ........................... Block version: 2 +b6ff0b1b1680a2862a30ca44d346d9e8 +910d334beb48ca0c0000000000000000 ... Hash of previous block's header +9d10aa52ee949386ca9385695f04ede2 +70dda20810decd12bc9b048aaab31471 ... Merkle root +24d95a54 ........................... Unix time: 1415239972 +30c31b18 ........................... Target (bits) +fe9f0864 ........................... Nonce

+ +

00 ................................. Transaction count (0x00) +{% endhighlight %}

+

Inv

+

The inv message (inventory message) transmits one or more inventories of +objects known to the transmitting peer. It can be sent unsolicited to +announce new transactions or blocks, or it can be sent in reply to a +getblocks message or mempool message.

+ +

The receiving peer can compare the inventories from an inv message +against the inventories it has already seen, and then use a follow-up +message to request unseen objects.

+ + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
VariescountcompactSize uintThe number of inventory entries.
VariesinventoryinventoryOne or more inventory entries up to a maximum of 50,000 entries.
+ +

The following annotated hexdump shows an inv message with two +inventory entries. (The message header has been omitted.)

+ +

{% highlight text %} +02 ................................. Count: 2

+ +

0f000000 ........................... Type: MSG_MASTERNODE_PING +dd6cc6c11211793b239c2e311f1496e2 +2281b200b35233eaae465d2aa3c9d537 ... Hash (mnp)

+ +

05000000 ........................... Type: MSG_TXLOCK_VOTE +afc5b2f418f8c06c477a7d071240f5ee +ab17057f9ce4b50c2aef4fadf3729a2e ... Hash (txlvote) +{% endhighlight %}

+

MemPool

+

Added in protocol version 60002 (of Bitcoin).

+ +

The mempool message requests the TXIDs of transactions that the +receiving node has verified as valid but which have not yet appeared in +a block. That is, transactions which are in the receiving node's memory +pool. The response to the mempool message is one or more inv +messages containing the TXIDs in the usual inventory format.

+ +

Sending the mempool message is mostly useful when a program first +connects to the network. Full nodes can use it to quickly gather most or +all of the unconfirmed transactions available on the network; this is +especially useful for miners trying to gather transactions for their +transaction fees. SPV clients can set a filter before sending a +mempool to only receive transactions that match that filter; this +allows a recently-started client to get most or all unconfirmed +transactions related to its wallet.

+ +

The inv response to the mempool message is, at best, one node's +view of the network---not a complete list of unconfirmed transactions +on the network. Here are some additional reasons the list might not +be complete:

+ + + +

There is no payload in a mempool message. See the [message header +section][section message header] for an example of a message without a payload.

+

MerkleBlock

+

Added in protocol version 70001 as described by BIP37.

+ +

The merkleblock message is a reply to a getdata message which +requested a block using the inventory type MSG_MERKLEBLOCK. It is +only part of the reply: if any matching transactions are found, they will +be sent separately as tx messages.

+ +

If a filter has been previously set with the filterload message, the +merkleblock message will contain the TXIDs of any transactions in the +requested block that matched the filter, as well as any parts of the +block's merkle tree necessary to connect those transactions to the +block header's merkle root. The message also contains a complete copy +of the block header to allow the client to hash it and confirm its +proof of work.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
80block headerblock_headerThe block header in the format described in the [block header section][section block header].
4transaction countuint32_tThe number of transactions in the block (including ones that don't match the filter).
Varieshash countcompactSize uintThe number of hashes in the following field.
Varieshasheschar[32]One or more hashes of both transactions and merkle nodes in internal byte order. Each hash is 32 bytes.
Variesflag byte countcompactSize uintThe number of flag bytes in the following field.
Variesflagsbyte[]A sequence of bits packed eight in a byte with the least significant bit first. May be padded to the nearest byte boundary but must not contain any more bits than that. Used to assign the hashes to particular nodes in the merkle tree as described below.
+ +

The annotated hexdump below shows a merkleblock message which +corresponds to the examples below. (The message header has been +omitted.)

+ +

{% highlight text %} +01000000 ........................... Block version: 1 +82bb869cf3a793432a66e826e05a6fc3 +7469f8efb7421dc88067010000000000 ... Hash of previous block's header +7f16c5962e8bd963659c793ce370d95f +093bc7e367117b3c30c1f8fdd0d97287 ... Merkle root +76381b4d ........................... Time: 1293629558 +4c86041b ........................... nBits: 0x04864c * 256**(0x1b-3) +554b8529 ........................... Nonce

+ +

07000000 ........................... Transaction count: 7 +04 ................................. Hash count: 4

+ +

3612262624047ee87660be1a707519a4 +43b1c1ce3d248cbfc6c15870f6c5daa2 ... Hash #1 +019f5b01d4195ecbc9398fbf3c3b1fa9 +bb3183301d7a1fb3bd174fcfa40a2b65 ... Hash #2 +41ed70551dd7e841883ab8f0b16bf041 +76b7d1480e4f0af9f3d4c3595768d068 ... Hash #3 +20d2a7bc994987302e5b1ac80fc425fe +25f8b63169ea78e68fbaaefa59379bbf ... Hash #4

+ +

01 ................................. Flag bytes: 1 +1d ................................. Flags: 1 0 1 1 1 0 0 0 +{% endhighlight %}

+ +

Note: when fully decoded, the above merkleblock message provided the +TXID for a single transaction that matched the filter. In the network +traffic dump this output was taken from, the full transaction belonging +to that TXID was sent immediately after the merkleblock message as +a tx message.

+

Parsing A MerkleBlock Message

+

{:.no_toc}

+ +

As seen in the annotated hexdump above, the merkleblock message +provides three special data types: a transaction count, a list of +hashes, and a list of one-bit flags.

+ +

You can use the transaction count to construct an empty merkle tree. +We'll call each entry in the tree a node; on the bottom are TXID +nodes---the hashes for these nodes are TXIDs; the remaining nodes +(including the merkle root) are non-TXID nodes---they may actually have +the same hash as a TXID, but we treat them differently.

+ +

Example Of Parsing A MerkleBlock Message

+ +

Keep the hashes and flags in the order they appear in the merkleblock +message. When we say "next flag" or "next hash", we mean the next flag +or hash on the list, even if it's the first one we've used so far.

+ +

Start with the merkle root node and the first flag. The table below +describes how to evaluate a flag based on whether the node being +processed is a TXID node or a non-TXID node. Once you apply a flag to a +node, never apply another flag to that same node or reuse that same +flag again.

+ + + + + + + + + + + + + + + + + + +
FlagTXID NodeNon-TXID Node
0Use the next hash as this node's TXID, but this transaction didn't match the filter.Use the next hash as this node's hash. Don't process any descendant nodes.
1Use the next hash as this node's TXID, and mark this transaction as matching the filter.The hash needs to be computed. Process the left child node to get its hash; process the right child node to get its hash; then concatenate the two hashes as 64 raw bytes and hash them to get this node's hash.
+ +

Any time you begin processing a node for the first time, evaluate the next +flag. Never use a flag at any other time.

+ +

When processing a child node, you may need to process its children (the +grandchildren of the original node) or further-descended nodes before +returning to the parent node. This is expected---keep processing depth +first until you reach a TXID node or a non-TXID node with a flag of 0.

+ +

After you process a TXID node or a non-TXID node with a flag of 0, stop +processing flags and begin to ascend the tree. As you ascend, compute +the hash of any nodes for which you now have both child hashes or for +which you now have the sole child hash. See the [merkle tree +section][section merkle trees] for hashing instructions. If you reach a +node where only the left hash is known, descend into its right child (if +present) and further descendants as necessary.

+ +

However, if you find a node whose left and right children both have the +same hash, fail. This is related to CVE-2012-2459.

+ +

Continue descending and ascending until you have enough information to +obtain the hash of the merkle root node. If you run out of flags or +hashes before that condition is reached, fail. Then perform the +following checks (order doesn't matter):

+ + + +

For a detailed example of parsing a merkleblock message, please see +the corresponding [merkle block examples section][section merkleblock +example].

+

Creating A MerkleBlock Message

+

{:.no_toc}

+ +

It's easier to understand how to create a merkleblock message after +you understand how to parse an already-created message, so we recommend +you read the parsing section above first.

+ +

Create a complete merkle tree with TXIDs on the bottom row and all the +other hashes calculated up to the merkle root on the top row. For each +transaction that matches the filter, track its TXID node and all of its +ancestor nodes.

+ +

Example Of Creating A MerkleBlock Message

+ +

Start processing the tree with the merkle root node. The table below +describes how to process both TXID nodes and non-TXID nodes based on +whether the node is a match, a match ancestor, or neither a match nor a +match ancestor.

+ + + + + + + + + + + + + + + + + + +
TXID NodeNon-TXID Node
Neither Match Nor Match AncestorAppend a 0 to the flag list; append this node's TXID to the hash list.Append a 0 to the flag list; append this node's hash to the hash list. Do not descend into its child nodes.
Match Or Match AncestorAppend a 1 to the flag list; append this node's TXID to the hash list.Append a 1 to the flag list; process the left child node. Then, if the node has a right child, process the right child. Do not append a hash to the hash list for this node.
+ +

Any time you begin processing a node for the first time, a flag should be +appended to the flag list. Never put a flag on the list at any other +time, except when processing is complete to pad out the flag list to a +byte boundary.

+ +

When processing a child node, you may need to process its children (the +grandchildren of the original node) or further-descended nodes before +returning to the parent node. This is expected---keep processing depth +first until you reach a TXID node or a node which is neither a TXID nor +a match ancestor.

+ +

After you process a TXID node or a node which is neither a TXID nor a +match ancestor, stop processing and begin to ascend the tree until you +find a node with a right child you haven't processed yet. Descend into +that right child and process it.

+ +

After you fully process the merkle root node according to the +instructions in the table above, processing is complete. Pad your flag +list to a byte boundary and construct the merkleblock message using the +template near the beginning of this subsection.

+

NotFound

+

Added in protocol version 70001.

+ +

The notfound message is a reply to a getdata message which +requested an object the receiving node does not have available for +relay. (Nodes are not expected to relay historic transactions which +are no longer in the memory pool or relay set. Nodes may also have +pruned spent transactions from older blocks, making them unable to +send those blocks.)

+ +

The format and maximum size limitations of the notfound message are +identical to the inv message; only the message header differs.

+

Tx

+

The tx message transmits a single transaction in the raw transaction +format. It can be sent in a variety of situations;

+ + + + + +

For an example hexdump of the raw transaction format, see the [raw +transaction section][raw transaction format].

+

Control Messages

+

The following network messages all help control the connection between +two peers or allow them to advise each other about the rest of the +network.

+ +

Overview Of P2P Protocol Control And Advisory Messages

+ +

Note that almost none of the control messages are authenticated in any +way, meaning they can contain incorrect or intentionally harmful +information. In addition, this section does not yet cover P2P protocol +operation over the [Tor network][tor]; if you would like to contribute +information about Tor, please [open an issue][docs issue].

+

Addr

+

The addr (IP address) message relays connection information +for peers on the network. Each peer which wants to accept incoming +connections creates an addr message providing its connection +information and then sends that message to its peers unsolicited. Some +of its peers send that information to their peers (also unsolicited), +some of which further distribute it, allowing decentralized peer +discovery for any program already on the network.

+ +

An addr message may also be sent in response to a getaddr message.

+ + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
VariesIP address countcompactSize uintThe number of IP address entries up to a maximum of 1,000.
VariesIP addressesnetwork IP addressIP address entries. See the table below for the format of a Dash network IP address.
+ +

Each encapsulated network IP address currently uses the following structure:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
4timeuint32Added in protocol version 31402.

A time in Unix epoch time format. Nodes advertising their own IP address set this to the current time. Nodes advertising IP addresses they've connected to set this to the last time they connected to that node. Other nodes just relaying the IP address should not change the time. Nodes can use the time field to avoid relaying old addr messages.

Malicious nodes may change times or even set them in the future.
8servicesuint64_tThe services the node advertised in its version message.
16IP addresscharIPv6 address in big endian byte order. IPv4 addresses can be provided as [IPv4-mapped IPv6 addresses][]
2portuint16_tPort number in big endian byte order. Note that Dash Core will only connect to nodes with non-standard port numbers as a last resort for finding peers. This is to prevent anyone from trying to use the network to disrupt non-Dash services that run on other ports.
+ +

The following annotated hexdump shows part of an addr message. (The +message header has been omitted and the actual IP address has been +replaced with a [RFC5737][] reserved IP address.)

+ +

{% highlight text %} +fde803 ............................. Address count: 1000

+ +

d91f4854 ........................... Epoch time: 1414012889 +0100000000000000 ................... Service bits: 01 (network node) +00000000000000000000ffffc0000233 ... IP Address: ::ffff:192.0.2.51 +208d ............................... Port: 8333

+ +

[...] .............................. (999 more addresses omitted) +{% endhighlight %}

+

Alert

+

Added in protocol version 311. +Removed by Bitcoin in protocol version 70013, but retained by Dash.

+ +

The alert message warns nodes of problems that may affect them or the +rest of the network. Each alert message is signed using a key controlled +by respected community members, mostly Dash Core developers.

+ +

To ensure all nodes can validate and forward alert messages, +encapsulation is used. Developers create an alert using the data +structure appropriate for the versions of the software they want to +notify; then they serialize that data and sign it. The serialized data +and its signature make up the outer alert message---allowing nodes +which don't understand the data structure to validate the signature and +relay the alert to nodes which do understand it. The nodes which +actually need the message can decode the serialized data to access the +inner alert message.

+ +

The outer alert message has four fields:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
Variablealert bytescompactSize uintThe number of bytes in following alert field.
VariablealertucharThe serialized alert. See below for a description of the current alert format.
Variablesignature bytescompactSize uintThe number of bytes in the following signature field.
VariablesignatureucharA DER-encoded ECDSA (secp256k1) signature of the alert signed with the developer's alert key.
+ +

Although designed to be easily upgraded, the format of the inner +serialized alert has not changed since the alert message was first +introduced in protocol version 311.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
4versionint32_tAlert format version. Version 1 from protocol version 311 through at least protocol version 70002.
8relayUntilint64_tThe time beyond which nodes should stop relaying this alert. Unix epoch time format.
8expirationint64_tThe time beyond which this alert is no longer in effect and should be ignored. Unix epoch time format.
4IDint32_tA unique ID number for this alert.
4cancelint32_tAll alerts with an ID number less than or equal to this number should be canceled: deleted and not accepted in the future.
VariessetCancel countcompactSize uintThe number of IDs in the following setCancel field. May be zero.
VariessetCancelint32_tAlert IDs which should be canceled. Each alert ID is a separate int32_t number.
4minVerint32_tThis alert only applies to protocol versions greater than or equal to this version. Nodes running other protocol versions should still relay it.
4maxVerint32_tThis alert only applies to protocol versions less than or equal to this version. Nodes running other protocol versions should still relay it.
Variesuser_agent countcompactSize uintThe number of user agent strings in the following setUser_agent field. May be zero.
VariessetUser_agentcompactSize uint + stringIf this field is empty, it has no effect on the alert. If there is at least one entry is this field, this alert only applies to programs with a user agent that exactly matches one of the strings in this field. Each entry in this field is a compactSize uint followed by a string---the uint indicates how many bytes are in the following string. This field was originally called setSubVer; since BIP14, it applies to user agent strings as defined in the version message.
4priorityint32_tRelative priority compared to other alerts.
Variescomment bytescompactSize uintThe number of bytes in the following comment field. May be zero.
VariescommentstringA comment on the alert that is not displayed.
VariesstatusBar bytescompactSize uintThe number of bytes in the following statusBar field. May be zero.
VariesstatusBarstringThe alert message that is displayed to the user.
Variesreserved bytescompactSize uintThe number of bytes in the following reserved field. May be zero.
VariesreservedstringReserved for future use. Originally called RPC Error.
+ +

The annotated hexdump below shows an alert message. (The message +header has been omitted.)

+ + + +

{% highlight text %} +73 ................................. Bytes in encapsulated alert: 115 +01000000 ........................... Version: 1 +3766404f00000000 ................... RelayUntil: 1329620535 +b305434f00000000 ................... Expiration: 1330917376

+ +

f2030000 ........................... ID: 1010 +f1030000 ........................... Cancel: 1009 +00 ................................. setCancel count: 0

+ +

10270000 ........................... MinVer: 10000 +48ee0000 ........................... MaxVer: 61000 +00 ................................. setUser_agent bytes: 0 +64000000 ........................... Priority: 100

+ +

00 ................................. Bytes In Comment String: 0 +46 ................................. Bytes in StatusBar String: 70 +53656520626974636f696e2e6f72672f +666562323020696620796f7520686176 +652074726f75626c6520636f6e6e6563 +74696e67206166746572203230204665 +627275617279 ....................... Status Bar String: "See [...]" +00 ................................. Bytes In Reserved String: 0

+ +

47 ................................. Bytes in signature: 71 +30450221008389df45f0703f39ec8c1c +c42c13810ffcae14995bb648340219e3 +53b63b53eb022009ec65e1c1aaeec1fd +334c6b684bde2b3f573060d5b70c3a46 +723326e4e8a4f1 ..................... Signature +{% endhighlight %}

+ +

Alert key compromise: Dash Core's source code defines a +particular set of alert parameters that can be used to notify users that +the alert signing key has been compromised and that they should upgrade +to get a new alert public key. Once a signed alert containing those +parameters has been received, no other alerts can cancel or override it. +See the ProcessAlert() function in the Dash Core [alert.cpp][core +alert.cpp] source code for the parameters of this message.

+

FilterAdd

+

Added in protocol version 70001 as described by BIP37.

+ +

The filteradd message tells the receiving peer to add a single element to +a previously-set bloom filter, such as a new public key. The element is +sent directly to the receiving peer; the peer then uses the parameters set +in the filterload message to add the element to the bloom filter.

+ +

Because the element is sent directly to the receiving peer, there is no +obfuscation of the element and none of the plausible-deniability privacy +provided by the bloom filter. Clients that want to maintain greater +privacy should recalculate the bloom filter themselves and send a new +filterload message with the recalculated bloom filter.

+ + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
Varieselement bytescompactSize uintThe number of bytes in the following element field.
Varieselementuint8_t[]The element to add to the current filter. Maximum of 520 bytes, which is the maximum size of an element which can be pushed onto the stack in a pubkey or signature script. Elements must be sent in the byte order they would use when appearing in a raw transaction; for example, hashes should be sent in internal byte order.
+ +

Note: a filteradd message will not be accepted unless a filter was +previously set with the filterload message.

+ +

The annotated hexdump below shows a filteradd message adding a TXID. +(The message header has been omitted.) This TXID appears in the same +block used for the example hexdump in the merkleblock message; if that +merkleblock message is re-sent after sending this filteradd message, +six hashes are returned instead of four.

+ +

{% highlight text %} +20 ................................. Element bytes: 32 +fdacf9b3eb077412e7a968d2e4f11b9a +9dee312d666187ed77ee7d26af16cb0b ... Element (A TXID) +{% endhighlight %}

+

FilterClear

+

Added in protocol version 70001 as described by BIP37.

+ +

The filterclear message tells the receiving peer to remove a +previously-set bloom filter. This also undoes the effect of setting the +relay field in the version message to 0, allowing unfiltered access to +inv messages announcing new transactions.

+ +

Dash Core does not require a filterclear message before a +replacement filter is loaded with filterload. It also doesn't require +a filterload message before a filterclear message.

+ +

There is no payload in a filterclear message. See the [message header +section][section message header] for an example of a message without a payload.

+

FilterLoad

+

Added in protocol version 70001 as described by BIP37.

+ +

The filterload message tells the receiving peer to filter all relayed +transactions and requested merkle blocks through the provided filter. +This allows clients to receive transactions relevant to their wallet +plus a configurable rate of false positive transactions which can +provide plausible-deniability privacy.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
VariesnFilterBytescompactSize uintNumber of bytes in the following filter bit field.
Variesfilteruint8_t[]A bit field of arbitrary byte-aligned size. The maximum size is 36,000 bytes.
4nHashFuncsuint32_tThe number of hash functions to use in this filter. The maximum value allowed in this field is 50.
4nTweakuint32_tAn arbitrary value to add to the seed value in the hash function used by the bloom filter.
1nFlagsuint8_tA set of flags that control how outpoints corresponding to a matched pubkey script are added to the filter. See the table in the Updating A Bloom Filter subsection below.
+ +

The annotated hexdump below shows a filterload message. (The message +header has been omitted.) For an example of how this payload was +created, see the [filterload example][section creating a bloom filter].

+ +

{% highlight text %} +02 ......... Filter bytes: 2 +b50f ....... Filter: 1010 1101 1111 0000 +0b000000 ... nHashFuncs: 11 +00000000 ... nTweak: 0/none +00 ......... nFlags: BLOOM_UPDATE_NONE +{% endhighlight %}

+ +

Initializing A Bloom Filter

+ +

Filters have two core parameters: the size of the bit field and the +number of hash functions to run against each data element. The following +formulas from BIP37 will allow you to automatically select appropriate +values based on the number of elements you plan to insert into the +filter (n) and the false positive rate (p) you desire to maintain +plausible deniability.

+ + + +

Note that the filter matches parts of transactions (transaction +elements), so the false positive rate is relative to the number of +elements checked---not the number of transactions checked. Each normal +transaction has a minimum of four matchable elements (described in the +comparison subsection below), so a filter with a false-positive rate of +1 percent will match about 4 percent of all transactions at a minimum.

+ +

According to BIP37, the formulas and limits described above provide +support for bloom filters containing 20,000 items with a false positive +rate of less than 0.1 percent or 10,000 items with a false positive rate +of less than 0.0001 percent.

+ +

Once the size of the bit field is known, the bit field should be +initialized as all zeroes.

+ +

Populating A Bloom Filter

+ +

The bloom filter is populated using between 1 and 50 unique hash +functions (the number specified per filter by the nHashFuncs +field). Instead of using up to 50 different hash function +implementations, a single implementation is used with a unique seed +value for each function.

+ +

The seed is nHashNum * 0xfba4c795 + nTweak as a uint32_t, where the values +are:

+ + + +

If the seed resulting from the formula above is larger than four bytes, +it must be truncated to its four most significant bytes (for example, +0x8967452301 & 0xffffffff → 0x67452301).

+ +

The actual hash function implementation used is the [32-bit Murmur3 hash +function][murmur3].

+ +

Warning icon +Warning: the Murmur3 hash function has separate 32-bit and 64-bit +versions that produce different results for the same input. Only the +32-bit Murmur3 version is used with Dash bloom filters.

+ +

The data to be hashed can be any transaction element which the bloom +filter can match. See the next subsection for the list of transaction +elements checked against the filter. The largest element which can be +matched is a script data push of 520 bytes, so the data should never +exceed 520 bytes.

+ +

The example below from Dash Core [bloom.cpp][core bloom.cpp hash] combines +all the steps above to create the hash function template. The seed is +the first parameter; the data to be hashed is the second parameter. The +result is a uint32_t modulo the size of the bit field in bits.

+ +

{% highlight c++ %} +MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash) % (vData.size() * 8) +{% endhighlight %}

+ +

Each data element to be added to the filter is hashed by nHashFuncs +number of hash functions. Each time a hash function is run, the result +will be the index number (nIndex) of a bit in the bit field. That bit +must be set to 1. For example if the filter bit field was 00000000 and +the result is 5, the revised filter bit field is 00000100 (the first bit +is bit 0).

+ +

It is expected that sometimes the same index number will be returned +more than once when populating the bit field; this does not affect the +algorithm---after a bit is set to 1, it is never changed back to 0.

+ +

After all data elements have been added to the filter, each set of eight +bits is converted into a little-endian byte. These bytes are the value +of the filter field.

+ +

Comparing Transaction Elements To A Bloom Filter

+ +

To compare an arbitrary data element against the bloom filter, it is +hashed using the same parameters used to create the bloom filter. +Specifically, it is hashed nHashFuncs times, each time using the same +nTweak provided in the filter, and the resulting output is modulo the +size of the bit field provided in the filter field. After each hash is +performed, the filter is checked to see if the bit at that indexed +location is set. For example if the result of a hash is 5 and the +filter is 01001110, the bit is considered set.

+ +

If the result of every hash points to a set bit, the filter matches. If +any of the results points to an unset bit, the filter does not match.

+ +

The following transaction elements are compared against bloom filters. +All elements will be hashed in the byte order used in blocks (for +example, TXIDs will be in internal byte order).

+ + + +

The following annotated hexdump of a transaction is from the [raw +transaction format section][raw transaction format]; the elements which +would be checked by the filter are emphasized in bold. Note that this +transaction's TXID (01000000017b1eab[...]) would also be checked, +and that the outpoint TXID and index number below would be checked as a +single 36-byte element.

+ +
01000000 ................................... Version
+
+01 ......................................... Number of inputs
+|
+| 7b1eabe0209b1fe794124575ef807057
+| c77ada2138ae4fa8d6c4de0398a14f3f ......... Outpoint TXID
+| 00000000 ................................. Outpoint index number
+|
+| 49 ....................................... Bytes in sig. script: 73
+| | 48 ..................................... Push 72 bytes as data
+| | | 30450221008949f0cb400094ad2b5eb3
+| | | 99d59d01c14d73d8fe6e96df1a7150de
+| | | b388ab8935022079656090d7f6bac4c9
+| | | a94e0aad311a4268e082a725f8aeae05
+| | | 73fb12ff866a5f01 ..................... Secp256k1 signature
+|
+| ffffffff ................................. Sequence number: UINT32_MAX
+
+01 ......................................... Number of outputs
+| f0ca052a01000000 ......................... Satoshis (49.99990000 BTC)
+|
+| 19 ....................................... Bytes in pubkey script: 25
+| | 76 ..................................... OP_DUP
+| | a9 ..................................... OP_HASH160
+| | 14 ..................................... Push 20 bytes as data
+| | | cbc20a7664f2f69e5355aa427045bc15
+| | | e7c6c772 ............................. PubKey hash
+| | 88 ..................................... OP_EQUALVERIFY
+| | ac ..................................... OP_CHECKSIG
+
+00000000 ................................... locktime: 0 (a block height)
+
+ +

Updating A Bloom Filter

+ +

Clients will often want to track inputs that spend outputs (outpoints) +relevant to their wallet, so the filterload field nFlags can be set to +allow the filtering node to update the filter when a match is found. +When the filtering node sees a pubkey script that pays a pubkey, +address, or other data element matching the filter, the filtering node +immediately updates the filter with the outpoint corresponding to that +pubkey script.

+ +

Automatically Updating Bloom Filters

+ +

If an input later spends that outpoint, the filter will match it, +allowing the filtering node to tell the client that one of its +transaction outputs has been spent.

+ +

The nFlags field has three allowed values:

+ + + + + + + + + + + + + + + + + + + + + + + +
ValueNameDescription
0BLOOM_UPDATE_NONEThe filtering node should not update the filter.
1BLOOM_UPDATE_ALLIf the filter matches any data element in a pubkey script, the corresponding outpoint is added to the filter.
2BLOOM_UPDATE_P2PUBKEY_ONLYIf the filter matches any data element in a pubkey script and that script is either a P2PKH or non-P2SH pay-to-multisig script, the corresponding outpoint is added to the filter.
+ +

In addition, because the filter size stays the same even though +additional elements are being added to it, the false positive rate +increases. Each false positive can result in another element being added +to the filter, creating a feedback loop that can (after a certain point) +make the filter useless. For this reason, clients using automatic filter +updates need to monitor the actual false positive rate and send a new +filter when the rate gets too high.

+

GetAddr

+

The getaddr message requests an addr message from the receiving +node, preferably one with lots of IP addresses of other receiving nodes. +The transmitting node can use those IP addresses to quickly update its +database of available nodes rather than waiting for unsolicited addr +messages to arrive over time.

+ +

There is no payload in a getaddr message. See the [message header +section][section message header] for an example of a message without a payload.

+

GetSporks

+

The getsporks message requests spork messages from the receiving node.

+ +

There is no payload in a getsporks message. See the [message header +section][section message header] for an example of a message without a payload.

+

Ping

+

The ping message helps confirm that the receiving peer is still +connected. If a TCP/IP error is encountered when sending the ping +message (such as a connection timeout), the transmitting node can assume +that the receiving node is disconnected. The response to a ping +message is the pong message.

+ +

Before protocol version 60000, the ping message had no payload. As of +protocol version 60001 and all later versions, the message includes a +single field, the nonce.

+ + + + + + + + + + + + + + + +
BytesNameData TypeDescription
8nonceuint64_tAdded in protocol version 60001 as described by BIP31.

Random nonce assigned to this ping message. The responding pong message will include this nonce to identify the ping message to which it is replying.
+ +

The annotated hexdump below shows a ping message. (The message +header has been omitted.)

+ +

{% highlight text %} +0094102111e2af4d ... Nonce +{% endhighlight %}

+

Pong

+

Added in protocol version 60001 as described by BIP31.

+ +

The pong message replies to a ping message, proving to the pinging +node that the ponging node is still alive. Dash Core will, by +default, disconnect from any clients which have not responded to a +ping message within 20 minutes.

+ +

To allow nodes to keep track of latency, the pong message sends back +the same nonce received in the ping message it is replying to.

+ +

The format of the pong message is identical to the ping message; +only the message header differs.

+

Reject

+

Added in protocol version 70002 as described by BIP61.

+ +

The reject message informs the receiving node that one of its previous +messages has been rejected.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
Variesmessage bytescompactSize uintThe number of bytes in the following message field.
VariesmessagestringThe type of message rejected as ASCII text without null padding. For example: "tx", "block", or "version".
1codecharThe reject message code. See the table below.
Variesreason bytescompactSize uintThe number of bytes in the following reason field. May be 0x00 if a text reason isn't provided.
VariesreasonstringThe reason for the rejection in ASCII text. This should not be displayed to the user; it is only for debugging purposes.
Variesextra datavariesOptional additional data provided with the rejection. For example, most rejections of tx messages or block messages include the hash of the rejected transaction or block header. See the code table below.
+ +

The following table lists message reject codes. Codes are tied to the +type of message they reply to; for example there is a 0x10 reject code +for transactions and a 0x10 reject code for blocks.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeIn Reply ToExtra BytesExtra TypeDescription
0x01any message0N/AMessage could not be decoded. Be careful of reject message feedback loops where two peers each don't understand each other's reject messages and so keep sending them back and forth forever.
0x10block message32char[32]Block is invalid for some reason (invalid proof-of-work, invalid signature, etc). Extra data may include the rejected block's header hash.
0x10tx message32char[32]Transaction is invalid for some reason (invalid signature, output value greater than input, etc.). Extra data may include the rejected transaction's TXID.
0x10ix message32char[32]InstantSend transaction is invalid for some reason (invalid tx lock request, conflicting tx lock request, etc.). Extra data may include the rejected transaction's TXID.
0x11block message32char[32]The block uses a version that is no longer supported. Extra data may include the rejected block's header hash.
0x11version message0N/AConnecting node is using a protocol version that the rejecting node considers obsolete and unsupported.
0x11dsa message0N/AConnecting node is using a PrivateSend protocol version that the rejecting node considers obsolete and unsupported.
0x11dsi message0N/AConnecting node is using a PrivateSend protocol version that the rejecting node considers obsolete and unsupported.
0x11dsc message0N/AConnecting node is using a PrivateSend protocol version that the rejecting node considers obsolete and unsupported.
0x11dsf message0N/AConnecting node is using a PrivateSend protocol version that the rejecting node considers obsolete and unsupported.
0x11dsq message0N/AConnecting node is using a PrivateSend protocol version that the rejecting node considers obsolete and unsupported.
0x11dssu message0N/AConnecting node is using a PrivateSend protocol version that the rejecting node considers obsolete and unsupported.
0x11govsync message0N/AConnecting node is using a governance protocol version that the rejecting node considers obsolete and unsupported.
0x11govobj message0N/AConnecting node is using a governance protocol version that the rejecting node considers obsolete and unsupported.
0x11govobjvote message0N/AConnecting node is using a governance protocol version that the rejecting node considers obsolete and unsupported.
0x11mnget message0N/AConnecting node is using a masternode payment protocol version that the rejecting node considers obsolete and unsupported.
0x11mnw message0N/AConnecting node is using a masternode payment protocol version that the rejecting node considers obsolete and unsupported.
0x11txlvote message0N/AConnecting node is using an InstantSend protocol version that the rejecting node considers obsolete and unsupported.
0x12tx message32char[32]Duplicate input spend (double spend): the rejected transaction spends the same input as a previously-received transaction. Extra data may include the rejected transaction's TXID.
0x12version message0N/AMore than one version message received in this connection.
0x40tx message32char[32]The transaction will not be mined or relayed because the rejecting node considers it non-standard---a transaction type or version unknown by the server. Extra data may include the rejected transaction's TXID.
0x41tx message32char[32]One or more output amounts are below the dust threshold. Extra data may include the rejected transaction's TXID.
0x42tx messagechar[32]The transaction did not have a large enough fee or priority to be relayed or mined. Extra data may include the rejected transaction's TXID.
0x43block message32char[32]The block belongs to a block chain which is not the same block chain as provided by a compiled-in checkpoint. Extra data may include the rejected block's header hash.
+ +

Reject Codes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeDescription
0x01Malformed
0x10Invalid
0x11Obsolete
0x12Duplicate
0x40Non-standard
0x41Dust
0x42Insufficient fee
0x43Checkpoint
+ +

The annotated hexdump below shows a reject message. (The message +header has been omitted.)

+ +

{% highlight text %} +02 ................................. Number of bytes in message: 2 +7478 ............................... Type of message rejected: tx +12 ................................. Reject code: 0x12 (duplicate) +15 ................................. Number of bytes in reason: 21 +6261642d74786e732d696e707574732d +7370656e74 ......................... Reason: bad-txns-inputs-spent +394715fcab51093be7bfca5a31005972 +947baf86a31017939575fb2354222821 ... TXID +{% endhighlight %}

+

SendCmpct

+

Added in protocol version 70209 of Dash Core as described by BIP152

+ +

The sendcmpct message tells the receiving peer whether or not to announce new +blocks using a cmpctblock message. It also sends the compact block protocol +version it supports. The sendcmpct message is defined as a message containing +a 1-byte integer followed by a 8-byte integer. The first integer is interpreted +as a boolean and should have a value of either 1 or 0. The second integer +is be interpreted as a little-endian version number.

+ +

Upon receipt of a sendcmpct message with the first and second integers +set to 1, the node should announce new blocks by sending a cmpctblock message.

+ +

Upon receipt of a sendcmpct message with the first integer set to 0, the node +shouldn't announce new blocks by sending a cmpctblock message, but instead announce +new blocks by sending invs or headers, as defined by [BIP130][].

+ +

Upon receipt of a sendcmpct message with the second integer set to something +other than 1, nodes should treat the peer as if they had not received the message +(as it indicates the peer will provide an unexpected encoding in cmpctblock messages, +and/or other, messages). This allows future versions to send duplicate +sendcmpct messages with different versions as a part of a version handshake.

+ +

Nodes should check for a protocol version of >= 70209 before sending sendcmpct +messages. Nodes shouldn't send a request for a MSG_CMPCT_BLOCK object to a peer +before having received a sendcmpct message from that peer. Nodes shouldn't +request a MSG_CMPCT_BLOCK object before having sent all sendcmpct messages +to that peer which they intend to send, as the peer cannot know what protocol +version to use in the response.

+ +

The structure of a sendcmpct message is defined below.

+ + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
1announcebool0 - Announce blocks via headers message or inv message
1 - Announce blocks via cmpctblock message
8versionuint64_tThe compact block protocol version number
+ +

The annotated hexdump below shows a sendcmpct message. (The message +header has been omitted.)

+ +

{% highlight text %} +01 ................................. Block announce type: Compact Blocks +0100000000000000 ................... Compact block version: 1 +{% endhighlight %}

+

SendHeaders

+

The sendheaders message tells the receiving peer to send new block +announcements using a headers message rather than an inv message.

+ +

There is no payload in a sendheaders message. See the [message header +section][section message header] for an example of a message without a payload.

+

Spork

+

Sporks are a mechanism by which updated code is released to the network, but +not immediately made active (or “enforced”). Enforcement of the updated code +can be activated remotely. Should problems arise, the code can be deactivated +in the same manner, without the need for a network-wide rollback or client update.

+ +

A spork message may be sent in response to a getsporks message.

+ +

The spork message tells the receiving peer the status of the spork defined by +the SporkID field. Upon receiving a spork message, the client must verify the +signature before accepting the spork message as valid.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nSporkIDintRequiredID assigned in spork.h
8nValueint64_tRequiredValue assigned to spork
8nTimeSignedint64_tRequiredTime the spork value was signed
66vchSigchar[]RequiredLength (1 byte) + Signature (65 bytes)
+ +

Sporks (per [src/spork.h][spork.h])

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Spork IDNumberNameDescription
100012INSTANTSEND_ENABLEDTurns on and off InstantSend network wide
100023INSTANTSEND_BLOCK_FILTERINGTurns on and off InstantSend block filtering
100045INSTANTSEND_MAX_VALUEControls the max value for an InstantSend transaction (currently 2000 dash)
100056NEW_SIGSTurns on and off new signature format for Dash-specific messages
100078MASTERNODE_PAYMENT_ENFORCEMENTRequires masternodes to be paid by miners when blocks are processed
100089SUPERBLOCKS_ENABLEDSuperblocks are enabled (10% of the block reward allocated to fund the dash treasury for funding approved proposals)
1000910MASTERNODE_PAY_UPDATED_NODESOnly current protocol version masternode's will be paid (not older nodes)
1001112RECONSIDER_BLOCKSForces reindex of a specified number of blocks to recover from unintentional network forks
1001314REQUIRE_SENTINEL_FLAGOnly masternode's running sentinel will be paid
Removed Sporks
1001213OLD_SUPERBLOCK_FLAGRemoved in Dash Core 0.12.3. No network function since block 614820
+ +

To verify vchSig, compare the hard-coded spork public key (strSporkPubKey +from [src/chainparams.cpp][spork pubkey]) with the public key recovered from +the spork message's hash and vchSig value (implementation details for Dash +Core can be found in CPubKey::RecoverCompact). The hash is a double SHA-256 hash of:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NetworkSpork Pubkey (wrapped)
Mainnet04549ac134f694c0243f503e8c8a9a986f5de6610049c40b07816809b0d1
d06a21b07be27b9bb555931773f62ba6cf35a25fd52f694d4e1106ccd237
a7bb899fdd
Testnet3046f78dcf911fbd61910136f7f0f8d90578f68d0b3ac973b5040fb7afb50
1b5939f39b108b0569dca71488f5bbf498d92e4d1194f6f941307ffd95f7
5e76869f0e
RegTestUndefined
Devnets046f78dcf911fbd61910136f7f0f8d90578f68d0b3ac973b5040fb7afb50
1b5939f39b108b0569dca71488f5bbf498d92e4d1194f6f941307ffd95f7
5e76869f0e
+ +

The following annotated hexdump shows a spork message.

+ +

{% highlight text %} +11270000 .................................... Spork ID: Spork 2 InstantSend enabled (10001) +0000000000000000 ............................ Value (0) +2478da5900000000 ............................ Epoch time: 2017-10-08 19:10:28 UTC (1507489828)

+ +

41 .......................................... Signature length: 65

+ +

1b6762d3e70890b5cfaed5d1fd72121c +d32020c827a89f8128a00acd210f4ea4 +1b36c26c3767f8a24f48663e189865ed +403ed1e850cdb4207cdd466419d9d183 +45 .......................................... Masternode Signature +{% endhighlight %}

+

VerAck

+

The verack message acknowledges a previously-received version +message, informing the connecting node that it can begin to send +other messages. The verack message has no payload; for an example +of a message with no payload, see the [message headers +section][section message header].

+

Version

+

The version message provides information about the transmitting node +to the receiving node at the beginning of a connection. Until both peers +have exchanged version messages, no other messages will be accepted.

+ +

If a version message is accepted, the receiving node should send a +verack message---but no node should send a verack message +before initializing its half of the connection by first sending a +version message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeRequired/OptionalDescription
4versionint32_tRequiredThe highest protocol version understood by the transmitting node. See the [protocol version section][section protocol versions].
8servicesuint64_tRequiredThe services supported by the transmitting node encoded as a bitfield. See the list of service codes below.
8timestampint64_tRequiredThe current Unix epoch time according to the transmitting node's clock. Because nodes will reject blocks with timestamps more than two hours in the future, this field can help other nodes to determine that their clock is wrong.
8addr_recv servicesuint64_tRequiredAdded in protocol version 106.

The services supported by the receiving node as perceived by the transmitting node. Same format as the 'services' field above. Dash Core will attempt to provide accurate information.
16addr_recv IP addresscharRequiredAdded in protocol version 106.

The IPv6 address of the receiving node as perceived by the transmitting node in big endian byte order. IPv4 addresses can be provided as [IPv4-mapped IPv6 addresses][]. Dash Core will attempt to provide accurate information.
2addr_recv portuint16_tRequiredAdded in protocol version 106.

The port number of the receiving node as perceived by the transmitting node in big endian byte order.
8addr_trans servicesuint64_tRequiredThe services supported by the transmitting node. Should be identical to the 'services' field above.
16addr_trans IP addresscharRequiredThe IPv6 address of the transmitting node in big endian byte order. IPv4 addresses can be provided as [IPv4-mapped IPv6 addresses][]. Set to ::ffff:127.0.0.1 if unknown.
2addr_trans portuint16_tRequiredThe port number of the transmitting node in big endian byte order.
8nonceuint64_tRequiredA random nonce which can help a node detect a connection to itself. If the nonce is 0, the nonce field is ignored. If the nonce is anything else, a node should terminate the connection on receipt<!--noref--> of a version message with a nonce it previously sent.
Variesuser_agent bytescompactSize uintRequiredNumber of bytes in following user_agent field. If 0x00, no user agent field is sent.
Variesuser_agentstringRequired if user_agent bytes > 0Renamed in protocol version 60000.

User agent as defined by BIP14. Previously called subVer.

Dash Core limits the length to 256 characters.
4start_heightint32_tRequiredThe height of the transmitting node's best block chain or, in the case of an SPV client, best block header chain.
1relayboolOptionalAdded in protocol version 70001 as described by BIP37.

Transaction relay flag. If 0x00, no inv messages or tx messages announcing new transactions should be sent to this client until it sends a filterload message or filterclear message. If the relay field is not present or is set to 0x01, this node wants inv messages and tx messages announcing new transactions.
+ +

The following service identifiers have been assigned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueNameDescription
0x00UnnamedThis node is not a full node. It may not be able to provide any data except for the transactions it originates.
0x01NODE_NETWORKThis is a full node and can be asked for full blocks. It should implement all protocol features available in its self-reported protocol version.
0x02NODE_GETUTXOThis node is capable of responding to the getutxo protocol request. Dash Core does not support this service.
0x04NODE_BLOOMThis node is capable and willing to handle bloom-filtered connections. Dash Core nodes used to support this by default, without advertising this bit, but no longer do as of protocol version 70201 (= NO_BLOOM_VERSION)
+ +

The following annotated hexdump shows a version message. (The +message header has been omitted and the actual IP addresses have been +replaced with [RFC5737][] reserved IP addresses.)

+ +

{% highlight text %} +3e120100 .................................... Protocol version: 70206 +0500000000000000 ............................ Services: NODE_NETWORK (1) + NODE_BLOOM (4) +bc8f5e5400000000 ............................ Epoch time: 1415483324

+ +

0100000000000000 ............................ Receiving node's services +00000000000000000000ffffc61b6409 ............ Receiving node's IPv6 address +270f ........................................ Receiving node's port number

+ +

0500000000000000 ............................ Transmitting node's services +00000000000000000000ffffcb0071c0 ............ Transmitting node's IPv6 address +270f ........................................ Transmitting node's port number

+ +

128035cbc97953f8 ............................ Nonce

+ +

14 .......................................... Bytes in user agent string: 20 +2f4461736820436f72653a302e31322e312e352f..... User agent: /Satoshi:0.9.2.1/

+ +

851f0b00 .................................... Start height: 728965 +01 .......................................... Relay flag: true +{% endhighlight %}

+

InstantSend Messages

+

The following network messages all help control the InstantSend feature of Dash. +InstantSend uses the masternode network to lock transaction inputs and enable +secure, instantaneous transactions. For additional details, refer to +the Developer Guide InstantSend section.

+ +

Overview Of P2P Protocol InstantSend Request And Reply Messages

+

ix

+

The ix message (transaction lock request) has the same structure as the tx message. +The masternode network responds with txlvote messages if the transaction inputs +can be locked.

+

txlvote

+

The txlvote message ([transaction lock vote][msg_txlock_vote]) +is sent by masternodes to indicate approval of a transaction lock request +ix message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
32txHashuint256RequiredTXID of the transaction to lock
36outPointoutpointRequiredThe unspent outpoint to lock in this transaction
36outpointMasternodeoutpointRequiredThe outpoint of the masternode which is signing the vote
66*vchMasternodeSignaturechar[]Required66 bytes in most cases. Length (1 byte) + Signature (65 bytes)
+ +

The following annotated hexdump shows a txlvote message. (The +message header has been omitted.)

+ +

{% highlight text %} +3c121fb4a12b2f715e2f70a9fa282115 +be197dde14073959fb2a2b8e95a7418f ..... TXID

+ +

Outpoint to lock +| bb607995757c6a6efd6429215dcb3688 +| b252d34d835c81fed310fd905f487020 ... Outpoint TXID +| 01000000 ........................... Outpoint index number: 1

+ +

Masternode Outpoint +| de9029c7e9b7eb7cd11f27ba670b2349 +| 0c3f0717b86ed949c316874589405cd2 ... Outpoint TXID +| 00000000 ........................... Outpoint index number: 0

+ +

41 ................................... Signature length: 65

+ +

1ccc39ffb9c62111a8c82823d3ce61d2 +380db4e8f76ec238d568908f37558a90 +4e79566a53663de12ec2be1183c87d61 +250e8ebd57be171be1d4b5e89b69c263 +88 ................................... Masternode Signature +{% endhighlight %}

+

PrivateSend Messages

+

The following network messages all help control the PrivateSend (formerly +DarkSend) coin mixing features built in to Dash and facilitated by the +masternode network.

+ +

Since the messages are all related to a single process, this diagram shows them +sequentially numbered. The dssu message (not shown) is sent by the +masternode in conjunction with some responses. For additional details, refer to +the Developer Guide PrivateSend section.

+ +

Overview Of P2P Protocol PrivateSend Request And Reply Messages

+

dsa

+

The dsa message allows a node to join a mixing pool. A collateral fee is +required and may be forfeited if the client acts maliciously. The message +operates in two ways:

+ +
    +
  1. When sent to a masternode without a current mixing queue, it initiates the +start of a new mixing queue

  2. +
  3. When sent to a masternode with a current mixing queue, it attempts to join the +existing queue

  4. +
+ +

Dash Core starts a new queue ~33% of the time and attempts to join an existing +queue the remainder of the time.

+ + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nDenomintRequiredDenomination that will be exclusively used when submitting inputs into the pool
216+txCollateraltx messageRequiredCollateral TX that will be charged if this client acts maliciously
+ +

The following annotated hexdump shows a dsa message. (The message header has +been omitted.)

+ +

{% highlight text %} +02000000 ................................... Denomination: 1 Dash (2)

+ +

Collateral Transaction +| Previous Output +| | +| | 010000000183bd1980c71c38f035db9b +| | 14d7f934f7d595181b3436e362899026 ....... Outpoint TXID +| | 19f3f7d3 ............................... Outpoint index number: 3556242201 +| +| 83 ....................................... Bytes in sig. script: 131 +| +| 000000006b483045022100f4d8fa0ae4132235fe +| cd540a62715ccfb1c9a97f8698d066656e30bb1e +| 1e06b90220301b4cc93f38950a69396ed89dfcc0 +| 8e72ec8e6e7169463592a0bf504946d98b812102 +| fa4b9c0f9e76e06d57c75cab9c8368a62a1ce8db +| 6eb0c25c3e0719ddd9ab549cffffffff01e09304 +| 00000000001976a914f895 ................... Secp256k1 signature: None +| +| 6a4eb0e5 ................................. Sequence number: 3853536874 +{% endhighlight %}

+

dsc

+

The dsc message indicates a PrivateSend mixing session is complete.

+ + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nSessionIDintRequiredID of the mixing session
4nMessageIDintRequiredID of the message describing the result of the mixing session
+ +

Reference the Message IDs table under the dssu message for descriptions of the +Message ID values.

+ +

The following annotated hexdump shows a dsc message. (The +message header has been omitted.)

+ +

{% highlight text %} +d9070700 ............................. Session ID: 791686 +14000000 ............................. Message ID: MSG_SUCCESS (20) +{% endhighlight %}

+

dsf

+

The dsf message is sent by the masternode as the final mixing transaction in +a PrivateSend mixing session. The masternode expects nodes in the mixing session +to respond with a dss message.

+ + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nSessionIDintRequiredID of the mixing session
#txFinaltx messageRequiredFinal mixing transaction with unsigned inputs
+ +

The following annotated hexdump shows a dsf message. (The +message header has been omitted.) Transaction inputs/outputs are only shown for +a single node (compare with the dsi message and dss message hexdumps).

+ +

{% highlight text %} +86140c00 ............................. Session ID: 791686

+ +

Transaction Message +| 01000000 ................................. Version: 1 +| +| 0f ......................................... Number of inputs: 15 +| +| [...] ...................................... 5 transaction inputs omitted +| +| Transaction input #6 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 02000000 ................................. Outpoint index number: 0 +| | +| | 00 ....................................... Bytes in sig. script: 0 +| | .......................................... Secp256k1 signature: None +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| Transaction input #7 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 0f000000 ................................. Outpoint index number: 15 +| | +| | 00 ....................................... Bytes in sig. script: 0 +| | .......................................... Secp256k1 signature: None +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| Transaction input #8 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 0d000000 ................................. Outpoint index number: 13 +| | +| | 00 ....................................... Bytes in sig. script: 0 +| | .......................................... Secp256k1 signature: None +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| +| [...] ...................................... 7 more transaction inputs omitted +| +| +| 0f ......................................... Number of outputs: 15 +| +| Transaction output #1 +| | e8e4f50500000000 ......................... Duffs (1.00001 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | 14826d7ba05cf76588a5503c03951dc9 +| | | | 14c91b6c ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +| +| +| [...] ...................................... 3 transaction outputs omitted +| +| +| Transaction output #5 +| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | 426614716e94812d483bca32374f6ac8 +| | | | cd121b0d ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +| +| +| [...] ...................................... 9 transaction outputs omitted +| +| +| Transaction output #15 +| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | f01197177de2358928196a543b2bbd97 +| | | | 3c2ab002 ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +| +| 00000000 ................................... locktime: 0 (a block height) +{% endhighlight %}

+

dsi

+

The dsi message replies to a dsq message that has the Ready field set to 0x01. +The dsi message contains user inputs for mixing along with the outputs and a +collateral. Once the masternode receives dsi messages from all members of the +pool, it responds with a dsf message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
?vecTxDSInCTxDSIn[]RequiredVector of users inputs (CTxDSIn serialization is equal to CTxIn serialization)
216+txCollateraltx messageRequiredCollateral transaction which is used to prevent misbehavior and also to charge fees randomly
?vecTxDSOutCTxDSOut[]RequiredVector of user outputs (CTxDSOut serialization is equal to CTxOut serialization)
+ +

The following annotated hexdump shows a dsi message. (The message header has +been omitted.)

+ +

{% highlight text %} +User inputs +| 03 ......................................... Number of inputs: 3 +| +| Transaction input #1 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 02000000 ................................. Outpoint index number: 2 +| | +| | 00 ....................................... Bytes in sig. script: 0 +| | .......................................... Secp256k1 signature: None +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| Transaction input #2 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 0f000000 ................................. Outpoint index number: 15 +| | +| | 00 ....................................... Bytes in sig. script: 0 +| | .......................................... Secp256k1 signature: None +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| Transaction input #3 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 0d000000 ................................. Outpoint index number: 13 +| | +| | 00 ....................................... Bytes in sig. script: 0 +| | .......................................... Secp256k1 signature: None +| | +| | ffffffff ................................. Sequence number: UINT32_MAX

+ +

Collateral Transaction +| 01000000 ................................... Version: 1 +| +| 01 ......................................... Number of inputs: 1 +| +| Previous Output +| | +| | 83bd1980c71c38f035db9b14d7f934f7 +| | d595181b3436e36289902619f3f7d383 ......... Outpoint TXID +| | 00000000 ................................. Outpoint index number: 0 +| | +| | 6b ....................................... Bytes in sig. script: 107 +| | +| | 483045022100f4d8fa0ae4132235fecd540a +| | 62715ccfb1c9a97f8698d066656e30bb1e1e +| | 06b90220301b4cc93f38950a69396ed89dfc +| | c08e72ec8e6e7169463592a0bf504946d98b +| | 812102fa4b9c0f9e76e06d57c75cab9c8368 +| | a62a1ce8db6eb0c25c3e0719ddd9ab549c ....... Secp256k1 signature +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| 01 ......................................... Number of outputs: 1 +| +| | e093040000000000 ......................... 300,000 Duffs (0.003 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | f8956a4eb0e53b05ee6b30edfd2770b5 +| | | | 26c1f1bb ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +| +| 00000000 ................................... locktime: 0 (a block height)

+ +

User outputs +| 03 ......................................... Number of outputs: 3 +| +| Transaction output #1 +| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | 14826d7ba05cf76588a5503c03951dc9 +| | | | 14c91b6c ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +| +| Transaction output #2 +| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | f01197177de2358928196a543b2bbd97 +| | | | 3c2ab002 ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +| +| Transaction output #3 +| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | 426614716e94812d483bca32374f6ac8 +| | | | cd121b0d ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +{% endhighlight %}

+

dsq

+

The dsq message provides nodes with mixing queue details and notifies them +when to sign final mixing TX messages.

+ +

If the message indicates the queue is not ready, the node verifies the message +is valid. It also verifies that the masternode is not flooding the network with +dsq messages in an attempt to dominate the queuing process. It then relays the +message to its connected peers.

+ +

If the message indicates the queue is ready, the node responds with a dsi +message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nDenomintRequiredDenomination allowed in this mixing session
36masternodeOutPointoutPointRequiredThe unspent outpoint of the masternode (holding 1000 DASH) which is hosting this session
8nTimeint64_tRequiredTime this dsq message was created
1fReadyboolRequiredIndicates if the mixing pool is ready to be executed
66*vchSigchar[]RequiredSignature of this message by masternode verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes))
+ +

Denominations (per [src/privatesend.cpp][privatesend denominations])

+ + + + + + + + + + + + + + + + + + + + + + + +
ValueDenomination
110 Dash
21 Dash
40.1 Dash
80.01 Dash
+ +

The following annotated hexdump shows a dsq message. (The +message header has been omitted.)

+ +

{% highlight text %} +08000000 ............................. Denomination: 0.01 Dash (8)

+ +

Masternode Outpoint +| aeed0e77c6db30a616507a37a129bc88 +| 1811f08afc51dd485d5322f36c1f04c5 ... Outpoint TXID +| 01000000 ........................... Outpoint index number: 1

+ +

1318a85900000000 ..................... Create Time: 2017-08-31 14:07:15 UTC

+ +

00 ................................... Ready: 0

+ +

41 ................................... Signature length: 65

+ +

1bd74386ea4e111197f1b4b4660c1415 +13486745ca10ba0632426ed3a644d941 +047e43c988680904d4a4fcf551d8813c +ec12d47ae9b00e870db294cd66708ab7 +dc ................................... Masternode Signature +{% endhighlight %}

+

dss

+

The dss message replies to a dsf message sent by the masternode managing the +mixing session. The dsf message provides the unsigned transaction inputs for +all members of the mixing pool. Each node verifies that the final transaction +matches what is expected. They then sign any transaction inputs belonging to +them and then relay them to the masternode via this dss message.

+ +

Once the masternode receives and validates all dss messages, it issues a +dsc message. If a node does not respond to a dsf message with signed +transaction inputs, it may forfeit the collateral it provided. This is to +minimize malicious behavior.

+ + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
#inputstxIn[]RequiredSigned inputs for mixing session
+ +

The following annotated hexdump shows a dss message. (The message header has +been omitted.) Note that these will be the same transaction inputs that were +supplied (unsiged) in the dsi message.

+ +

{% highlight text %} +User inputs +| 03 ......................................... Number of inputs: 3 +| +| Transaction input #1 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 02000000 ................................. Outpoint index number: 2 +| | +| | 6b ....................................... Bytes in sig. script: 107 +| | 483045022100b3a861dca83463aabf5e4a14a286 +| | 1b9c2e51e0dedd8a13552e118bf74eb4a68d0220 +| | 4a91c416768d27e6bdcfa45d28129841dbcc728b +| | f0bbec9701cfc4e743d23adf812102cc4876c9da +| | 84417dec37924e0479205ce02529bb0ba88631d3 +| | ccc9cfcdf00173 ........................... Secp256k1 signature +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| Transaction input #2 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 0f000000 ................................. Outpoint index number: 15 +| | +| | 6a ....................................... Bytes in sig. script: 106 +| | 4730440220268f3b7799ca4ec132e511a4756019 +| | c56016f7771561dc0597d84e9b1fa9fc08022067 +| | 5199b9b3f9a7eba69b7bbb4aa2a413d955762f9d +| | 68be5a9c02c6772c8078fd812103258925f0dbbf +| | 9d5aa20a675459fa2e86c9f9061dee82a00dca73 +| | 9080f051d891 ............................. Secp256k1 signature +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| Transaction input #3 +| | +| | 36bdc3796c5630225f2c86c946e2221a +| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID +| | 0d000000 ................................. Outpoint index number: 13 +| | +| | 6a ....................................... Bytes in sig. script: 106 +| | 4730440220404bb067e0c94a2bd75c6798c1af8c +| | 95e8b92f5e437cff2bcb4660f24a34d06d02203a +| | b707bd371a84a9e7bd1fbe3b0c939fd23e0a9165 +| | de78809b9310372a4b3879812103a9a6c5204811 +| | a8cab04b595ed622a1fed6efd3b2d888fadd0c97 +| | 3737fcdf2bc7 ............................. Secp256k1 signature +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +{% endhighlight %}

+

dssu

+

The dssu message provides a mixing pool status update.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nMsgSessionIDintRequiredSession ID
4nMsgStateintRequiredCurrent state of mixing process
4nMsgEntriesCountintRequiredNumber of entries in the mixing pool
4nMsgStatusUpdateintRequiredUpdate state and/or signal if entry was accepted or not
4nMsgMessageIDintRequiredID of the typical masternode reply message
+ +

Pool State

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
0POOL_STATE_IDLE
1POOL_STATE_QUEUE
2POOL_STATE_ACCEPTING_ENTRIES
3POOL_STATE_SIGNING
4POOL_STATE_ERROR
5POOL_STATE_SUCCESS
+ +

Pool Status Update

+ + + + + + + + + + + + + + + +
StatusDescription
0STATUS_REJECTED
1STATUS_ACCEPTED
+ +

Message IDs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeDescription
0x00ERR_ALREADY_HAVE
0x01ERR_DENOM
0x02ERR_ENTRIES_FULL
0x03ERR_EXISTING_TX
0x04ERR_FEES
0x05ERR_INVALID_COLLATERAL
0x06ERR_INVALID_INPUT
0x07ERR_INVALID_SCRIPT
0x08ERR_INVALID_TX
0x09ERR_MAXIMUM
0x0A (10)ERR_MN_LIST
0x0B (11)ERR_MODE
0x0C (12)ERR_NON_STANDARD_PUBKEY
0x0D (13)ERR_NOT_A_MN (Not used)
0x0E (14)ERR_QUEUE_FULL
0x0F (15)ERR_RECENT
0x10 (16)ERR_SESSION
0x11 (17)ERR_MISSING_TX
0x12 (18)ERR_VERSION
0x13 (19)MSG_NOERR
0x14 (20)MSG_SUCCESS
0x15 (21)MSG_ENTRIES_ADDED
+ +

The following annotated hexdump shows a dssu message. (The +message header has been omitted.)

+ +

{% highlight text %} +86140c00 ............................. Session ID: 791686 +02000000 ............................. State: POOL_STATE_ACCEPTING_ENTRIES (2) +03000000 ............................. Entries: 3 +01000000 ............................. Status Update: STATUS_ACCEPTED (1) +13000000 ............................. Message ID: MSG_NOERR (0x13) +{% endhighlight %}

+

dstx

+

The dstx message allows masternodes to broadcast subsidized transactions without +fees (to provide security in mixing).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
#txtx messageRequiredThe transaction
36masternodeOutPointoutPointRequiredThe unspent outpoint of the masternode (holding 1000 DASH) which is signing the message
66vchSigchar[]RequiredSignature of this message by masternode verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes))
8sigTimeint64_tRequireTime this message was signed
+ +

The following annotated hexdump shows a dstx message. (The +message header has been omitted.)

+ +

{% highlight text %} +Transaction Message +| 01000000 ................................. Version: 1 +| +| 0b ......................................... Number of inputs: 11 +| +| Transaction input #1 +| | +| | 0adb782b2170018eada54534be880e70 +| | 74ed8307a566731119b1782362af43ad ......... Outpoint TXID +| | 05000000 ................................. Outpoint index number: 5 +| | +| | 6a ....................................... Bytes in sig. script: 106 +| | 47304402204ed56f525ae6df707f9cbe +| | 55c78d82bbcc02daa1fb27b0bf54588a +| | 446dcc804102200c4e03c4a2b9a90aef +| | 9f01de7c28812a0e8b280e6c153b0bd8 +| | 26d2ff660102e18121028c96903b2709 +| | 7b331d55abd1f42d2ff6cc7c784ab839 +| | 7c232b73a34a149a348e ..................... Secp256k1 signature +| | +| | ffffffff ................................. Sequence number: UINT32_MAX +| +| [...] ...................................... 10 more transaction inputs omitted +| +| +| 0b ......................................... Number of outputs: 11 +| +| Transaction output #1 +| | e8e4f50500000000 ......................... Duffs (1.00001000 Dash) +| | +| | 19 ....................................... Bytes in pubkey script: 25 +| | | 76 ..................................... OP_DUP +| | | a9 ..................................... OP_HASH160 +| | | 14 ..................................... Push 20 bytes as data +| | | | 0febbeaa8818b2c2f80fb8c98f90bdae +| | | | 41fe5c26 ............................. PubKey hash +| | | 88 ..................................... OP_EQUALVERIFY +| | | ac ..................................... OP_CHECKSIG +| +| [...] ...................................... 10 more transaction outputs omitted +| +| +| 00000000 ................................... locktime: 0 (a block height)

+ +

Masternode Unspent Outpoint +| 387d522def2abfb9bdd15be899f074f3 +| 49b414cef078ec642e1d14b42996b9fc ......... Outpoint TXID +| 00000000 ................................. Outpoint index number: 0

+ +

1b6fb8f90f0df6e502bc10aab9604e49 +2d14214e05331c9761c834d55c7536e3 +3369e5909479ea88116aad7ea64587d9 +59364326c97d7f249f7b9293e120a5b6 +1c ................................... Masternode Signature

+ +

ece5a95900000000 ..................... Signature Timestamp +{% endhighlight %}

+

Masternode Messages

+

The following network messages enable the masternode features built in to Dash.

+ +

Overview Of P2P Protocol Masternode Request And Reply Messages

+ +

For additional details, refer to the Developer Guide Masternode Sync +and Masternode Payment sections.

+

dseg

+

The dseg message requests either the entire masternode list or a specific +entry. To request the list of all masternodes, use an empty txIn (TXID of all +zeros and an index of 0xFFFFFFFF). To request information about a specific +masternode, use the unspent outpoint associated with that masternode.

+ +

The response to a dseg message is an mnb message inventory and an +mnp message inventory for each requested masternode. Masternodes ignore this +request if they are not fully synced.

+ + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
36masternodeOutPointoutPointRequiredRequest options:
All Entries - empty txIn
Single Entry - Masternode's unspent outpoint which is holding 1000 DASH
+ +

{% highlight text %} +Note: Dash Core only allows nodes to request the entire list every 3 hours. +Additional requests sent prior to then may result in the node being banned. +{% endhighlight %}

+ +

The following annotated hexdump shows a dseg message requesting all +masternodes. (The message header has been omitted.)

+ +

{% highlight text %} +Masternode Unspent Outpoint +| 00000000000000000000000000000000 +| 00000000000000000000000000000000 ......... Outpoint TXID +| ffffffff ................................. Outpoint index number: 0 +{% endhighlight %}

+ +

The following annotated hexdump shows a dseg message requesting a specific +masternode. (The message header has been omitted.)

+ +

{% highlight text %} +Masternode Unspent Outpoint +| 7fe33a2901aa654598ae0af572d4fbec +| ee97af2d0276f189d177dee5848ef3da ......... Outpoint TXID +| 00000000 ................................. Outpoint index number: 0 +{% endhighlight %}

+

mnb

+

The mnb message is sent whenever a masternode comes online or a client is +syncing. The masternode will send this message which describes the masternode +entry and how to validate messages from it.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
36outPointoutPointRequiredThe unspent outpoint of the masternode (holding 1000 DASH) which is signing the message
#addrCServiceRequiredIPv4 address of the masternode
33-65pubKeyCollateralAddressCPubKeyRequiredCPubKey of the main 1000 DASH unspent outpoint. Length determined by if it is a compressed public key or not.
33-65pubKeyMasternodeCPubKeyRequiredCPubKey of the secondary signing key (For all messaging other than the announce message). Length determined by if it is a compressed public key or not.
66sigchar[]RequiredSignature of this message verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes))
8sigTimeint64_tRequiredTime which the signature was created
4nProtocolVersionintRequiredThe protocol version of the masternode
#lastPingmnp messageRequiredThe last known ping of the masternode
8nLastDsqint64_tDeprecatedRemoved in Dash Core 0.12.3.0

The last time the masternode sent a dsq message (for mixing) (DEPRECATED)
+ +

The following annotated hexdump shows a mnb message. (The +message header has been omitted and the actual IP address has been replaced +with a RFC5737 reserved IP address.)

+ +

{% highlight text %} +Masternode Unspent Outpoint +| 3fbc7d4a8f68ba6ecb02a8db34d1f5b6 +| 2dc105f0b5c3505243435cf815d02394 ......... Outpoint TXID +| 01000000 ................................. Outpoint index number: 1

+ +

Masternode Address +| 00000000000000000000ffffc0000233 ......... IP Address: ::ffff:192.0.2.51 +| 270f ..................................... Port: 9999

+ +

Collateral Public Key +| 21 ....................................... Key Size: 33 +| 02 ....................................... Key Type: 2 - Compressed (even) +| 02a47a6845936a4199e126d35399dd09 +| 97c1aaf89a3fe70d474c53f29624a43a5b ....... Public Key

+ +

Masternode Public Key +| 41 ....................................... Key Size: 65 +| 04 ....................................... Key Type: 4 - Uncompressed +| 04da252243305d604cab90480880af4a +| b5cea3a934c91393452e9b7b4c97a87e +| 198bc809916ac2c27436a1db9c28d0aa +| bfefec4dc3c2193835fd9a56c31150c633 ....... Public Key

+ +

Message Signature +| 41 ....................................... Bytes in signature: 65 +| 1fb80f9ba8c110835e4a7dd4c8deccd7 +| 89027663d00084d9a99ef579a9b5601f +| 40727b27e91aab2897a078f63976ae25 +| 3ff8f01e56862e953278f432530f6ee080 ....... Signature

+ +

4728ef5800000000 ........................... Sig. Timestamp: 2017-04-13 07:27:03 UTC

+ +

3e120100 ................................... Protocol Version: 70206

+ +

Masternode Ping Message +| Masternode Unspent Outpoint +| | 3fbc7d4a8f68ba6ecb02a8db34d1f5b6 +| | 2dc105f0b5c3505243435cf815d02394 ........ Outpoint TXID +| | 01000000 ................................ Outpoint index number: 1 +| +| 94fc0fad18b166c2fedf1a5dc0511372 +| 26c353d57e086737ff05000000000000 ......... Chaintip block hash +| +| 66c1a95900000000 ......................... Sig. Timestamp: 2017-10-01 21:21:58 UTC +| +| Masternode Signature +| | 41 ..................................... Bytes in signature: 65 +| | 1b3017c49a03e2d77083f3c92a8c2e4c +| | d815d068b6256498a719e3cb6a34f774 +| | ec6434cfcbb7a5a51704350a05903287 +| | eecc82e6b40ac2fcfa2df29ddaa6c4fc +| | b8 ..................................... Masternode Signature +{% endhighlight %}

+

mnget

+

The mnget message requests masternode payment sync. The response to an +mnget message is mnw message inventories. Masternodes ignore this request if +they are not fully synced.

+ +

In protocol versions <=70208, the mnget message has a payload consisting of an +integer value requesting a specific number of payment votes. In protocol versions

+ +
+

70208, the mnget message has no payload.

+
+ + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nMnCountintDeprecatedDeprecated in Dash Core 0.12.3

Number of masternode payment votes to request
+ +

{% highlight text %} +Note: Dash Core limits how frequently a masternode payment sync can be +requested. Frequent requests will result in the node being banned. +{% endhighlight %}

+ +

The following annotated hexdump shows a pre-0.12.3 mnget message. (The +message header has been omitted.)

+ +

{% highlight text %} +a8170000 ................................... Count: 6056 +{% endhighlight %}

+

mnp

+

The mnp message is sent by masternodes every few minutes to ping the network +with a message that propagates across the whole network. Dash Core currently +uses a minimum masternode ping time of 10 minutes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
36masternodeOutPointoutPointRequiredThe unspent outpoint of the masternode (holding 1000 DASH) which is signing the message
32blockHashuint256RequiredBlock hash from 12 blocks ago (current chaintip minus 12). This offset allows nodes to be slightly out of sync.
8sigTimeint64_tRequiredTime which the signature was created
66*vchSigchar[]RequiredSignature of this message by masternode - verifiable via pubKeyMasternode (66 bytes in most cases. Length (1 byte) + Signature (65 bytes))
1fSentinelIsCurrentboolRequiredTrue if last sentinel ping was current
4nSentinelVersionuint32_tRequiredThe version of Sentinel running on the masternode which is signing the message
4nDaemonVersionuint32_tRequiredThe version of dashd on the masternode which is signing the message (i.e. CLIENT_VERSION)
+ +

The following annotated hexdump shows a mnp message. (The +message header has been omitted.)

+ +

{% highlight text %} +Masternode Unspent Outpoint +| 0bfa3616099771bb5f36181ff4060a9b +| 9afe7b3e47d7f4327800f0f8ce586c6e ......... Outpoint TXID +| 01000000 ................................. Outpoint index number: 1

+ +

a26a68ebb733192c1c40f9b42f872ac0 +e23d4c360e20d5ab6608000000000000 ........... Chaintip block hash

+ +

1bbfa95900000000 ........................... Sig. Timestamp: 2017-10-01 20:12:11 UTC

+ +

Masternode Signature +| 41 ....................................... Bytes in signature: 65 +| 1c2b205bd6ba472d7a9495f049ef66dc +| f844154846e25f2389385ba2d3e95cde +| cf3ccf82bc26d94c6fdafcd7b965bb61 +| db02d05483595196ea4d92b2e797612b +| 79 ....................................... Masternode Signature +{% endhighlight %}

+

mnv

+

The mnv message is used by masternodes to verify each other. Several mnv +messages are exchanged in the process. This results in the IP address of +masternode 1 being validated as of the provided block height.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
36masternodeOutPoint1outPointRequiredThe unspent outpoint which is holding 1000 DASH for masternode 1
36masternodeOutPoint2outPointRequiredThe unspent outpoint which is holding 1000 DASH for masternode 2
#addrCServiceRequiredIPv4 address and port of masternode 1
4nonceintRequiredRandom nonce
4nBlockHeightintRequiredBlock height
66vchSig1char[]Required*

Added in Step 2
Signature of this message by masternode 1 - verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes))

66vchSig2char[]Required*

Added in Step 3
Signature of this message by masternode 2 - verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes))

+ +

Initially, vin1, vin2, vchSig1 and vchSig2 are empty. They are +updated as the exchange of messages between the masternodes occurs as detailed +in the table below.

+ +

Masternode Verify Data Flow

+ +

| Step | MN 2 (Verifier) | Direction | MN 1 (Being verified) | Description | +| | Verification request | | | mnv message with no signatures | +| 1 | mnv message | → | | Contains addr, nonce, and nBlockHeight.
Sent by SendVerifyRequest(). +| 2 | | ← | mnv message | Add vchSig1 (signature of the IP address + nonce + hash of the requested block).
Sent by SendVerifyReply(). +| 3 | mnv message | → | | Verify vchSig1

Add masternodeOutPoint1, masternodeOutPoint2, and vchSig2 (signature of the IP address + nonce + hash of the requested block + masternodeOutPoint1 + masternodeOutPoint2) and relay message to peers if valid.
Sent by ProcessVerifyReply().

+ +

Nodes receiving a relayed mnv message (one in which masternodeOutPoint1, masternodeOutPoint2, vchSig1 +and vchSig2 are already present) use it to update the PoSe ban score. If the +ban score reaches MASTERNODE_POSE_BAN_MAX_SCORE (5), the masternode will be +considered malicious and banned. If the received message is valid, nodes +receiving it will relay it on to their connected peers.

+ +

{% highlight text %} +Important Notes: +* Dash Core limits how frequently a masternode verify request can be + requested. Frequent requests will result in the node being banned.

+ + + +

{% endhighlight %}

+ + + +

The following annotated hexdump shows a mnv message. This is an example of the +initial request (Step 1) so it does not contain any signatures. (The message +header has been omitted.)

+ +

{% highlight text %} +Masternode 1 Unspent Outpoint (empty) +| 00000000000000000000000000000000 +| 00000000000000000000000000000000 ......... Outpoint TXID +| ffffffff ................................. Outpoint index number: 0

+ +

Masternode 2 Unspent Outpoint (empty) +| 00000000000000000000000000000000 +| 00000000000000000000000000000000 ......... Outpoint TXID +| ffffffff ................................. Outpoint index number: 0

+ +

00000000000000000000ffff2d20ed4c ........... IP Address: ::ffff:45.32.237.76 +4e1f ....................................... Port: 19999 +9d090000 ................................... Nonce: 2641 +ed5c0000 ................................... Block height: 23789

+ +

Masternode 1 Signature +| 00 ....................................... Bytes in signature: 0 +| .......................................... Signature: Empty

+ +

Masternode 2 Signature +| 00 ....................................... Bytes in signature: 0 +| .......................................... Signature: Empty +{% endhighlight %}

+ +

The following annotated hexdump shows a mnv message. This is an example of the +initial response (Step 2) so it only contains the signature of masternode 1 (the +masternode being verified). (The message header has been omitted.)

+ +

{% highlight text %} +Masternode 1 Unspent Outpoint (empty) +| 00000000000000000000000000000000 +| 00000000000000000000000000000000 ......... Outpoint TXID +| ffffffff ................................. Outpoint index number: 0

+ +

Masternode 2 Unspent Outpoint (empty) +| 00000000000000000000000000000000 +| 00000000000000000000000000000000 ......... Outpoint TXID +| ffffffff ................................. Outpoint index number: 0

+ +

00000000000000000000ffff2d20ed4c ........... IP Address: ::ffff:45.32.237.76 +4e1f ....................................... Port: 19999 +9d090000 ................................... Nonce: 2641 +ed5c0000 ................................... Block height: 23789

+ +

Masternode 1 Signature +| 41 ....................................... Bytes in signature: 65 +| 1bf5bd6e6eda0cd32aafb826c4066fa5 +| 4a53baa6f4211528e51716054b4df981 +| d97a77e633947bbbfafd6882324b76a0 +| 90c6e65c16ca1222db48f8558537c062 +| f6 ....................................... Signature

+ +

Masternode 2 Signature +| 00 ....................................... Bytes in signature: 0 +| .......................................... Signature: Empty +{% endhighlight %}

+

mnw

+

The mnw message is used to pick the next winning masternode. When a new block +is found on the network, a masternode quorum will be determined and those 10 +selected masternodes will issue the masternode payment vote message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
36masternodeOutPointoutPointRequiredThe unspent outpoint of the masternode (holding 1000 DASH) which is signing the message
4nBlockHeightintRequiredThe blockheight which the payee should be paid
?payeeAddressCScriptRequiredThe address receiving payment
66*vchSigchar[]RequiredSignature of the masternode which is signing the message (66 bytes in most cases. Length (1 byte) + Signature (65 bytes))
+ +

The following annotated hexdump shows a mnw message. (The +message header has been omitted.)

+ +

{% highlight text %} +Masternode Unspent Outpoint +| 0c1b5c5846792b25b05eeea9586d8c34 +| ecb996c566bedb4ecf6a68fe8ffa9582 ......... Outpoint TXID +| 00000000 ................................. Outpoint index number: 0

+ +

fb4f0a00 ................................... Block pay height: 675835

+ +

Payee Address +| 19 ....................................... Address Length: 25 +| | 76 ..................................... OP_DUP +| | a9 ..................................... OP_HASH160 +| | 14 ..................................... Push 20 bytes as data +| | | 1767c363646be7d8e4475c0aa85ea454 +| | | 9fd102c4 ............................. Pubkey hash +| | 88 ..................................... OP_EQUALVERIFY +| | ac ..................................... OP_CHECKSIG

+ +

Masternode Signature +| 41 ....................................... Bytes in signature: 65 +| 1c25da47190a83937fb5ef607235703a +| 7cdda155bf5a1ae6139929024750f899 +| a90a4f57cdf9d54c9d9603c1f31009f8 +| e257355b49c0484fb4c31bc412c73dd9 +| 20 ....................................... Signature +{% endhighlight %}

+

mnwb

+

There is no message for mnwb (inv message only).

+ +

The following annotated hexdump shows an inv message with a mnwb +inventory entry. (The message header has been omitted.)

+ +

{% highlight text %} +01 ................................. Count: 1

+ +

08000000 ........................... Type: MSG_MASTERNODE_PAYMENT_BLOCK (8) +dd6cc6c11211793b239c2e311f1496e2 +2281b200b35233eaae465d2aa3c9d537 ... Hash: mnwb +{% endhighlight %}

+

ssc

+

The ssc message is used to track the sync status of masternode objects. This +message is sent in response to sync requests for the list of masternodes +(dseg message), masternode payments (mnget message), governance objects +(govsync message), and governance object votes (govsync message).

+ + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
4nItemIDintRequiredMasternode Sync Item ID
4nCountintRequiredNumber of items to sync
+ +

Sync Item IDs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDDescriptionResponse To
2MASTERNODE_SYNC_LISTdseg message
3MASTERNODE_SYNC_MNWmnget message
10MASTERNODE_SYNC_GOVOBJgovsync message
11MASTERNODE_SYNC_GOVOBJ_VOTEgovsync message with non-zero hash
+ +

The following annotated hexdump shows a ssc message. (The +message header has been omitted.)

+ +

{% highlight text %} +02000000 ................................... Item ID: MASTERNODE_SYNC_LIST (2) +bf110000 ................................... Count: 4543 +{% endhighlight %}

+

Governance Messages

+

The following network messages enable the Governance features built in to Dash. +For additional details on the governance system, see this Budget System page.

+ +

Overview Of P2P Protocol Governance Request And Reply Messages

+ +

For additional details, refer to the Developer Guide Governance section.

+

govobj

+

The govobj message contains a governance object that is generally a proposal, +contract, or setting. Masternodes ignore this request if they are not fully synced.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
32nHashParentuint256RequiredParent object (a hash of all zeros here indicates this is the root object, not a child object).
4nRevisionintRequiredObject revision in the system
8nTimeint64_tRequiredTime which this object was created
32nCollateralHashuint256Required*Hash of the collateral fee transaction for proposals.

Set to all zeros for Triggers/Watchdogs.
0-16384strDatastringRequiredData field - can be used for anything (leading varint indicates size of data)
4nObjectTypeintRequiredType of governance object:
0 - Unknown
1 - Proposal
2 - Trigger
3 - Watchdog
36masternodeOutPointoutPointRequired*The unspent outpoint of the masternode (holding 1000 DASH) which is signing this object.

Set to all zeros for proposals since they can be created by non-masternodes.
66*vchSigchar[]Required*Signature of the masternode (Length (1 byte) + Signature (65 bytes))

Not required for proposals - they will have a length of 0x00 and no Signature.
+ +

Governance Object Types (defined by src/governance-object.h)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeNameDescription
0GOVERNANCE_OBJECT_UNKNOWN
1GOVERNANCE_OBJECT_PROPOSALSubmitted proposal (requires collateral transaction - currently 5 Dash)
2GOVERNANCE_OBJECT_TRIGGERMasternode generated. Removed after activation/execution. Used for superblocks.
3GOVERNANCE_OBJECT_WATCHDOGMasternode generated. Two hour expiration time.

DEPRECATED since 12.2.
+ +

The following annotated hexdump shows a govobj message for a Proposal object. +Notice the presence of a non-zero collateral hash, a masternodeOutPoint that is an +empty Outpoint (hash of all zeros), and no vchSig. +(The message header has been omitted.)

+ +

{% highlight text %} +00000000000000000000000000000000 +00000000000000000000000000000000 ..... Parent Hash (0 = root) +01000000 ............................. Revision: 1 +c8dfd65900000000 ..................... Create timestamp: 2017-10-06 01:43:31 UTC +633611d2f3e7481325242f200c7f3485 +e3a9b4b6301e7f7d18d87d8231f3880b ..... Collateral Hash

+ +

Data +| 3e02 ............................... Data length: 574 +| 356235623232373 ... 376435643564 ... Data (truncated)

+ +

01000000 ............................. Object Type: GOVERNANCE_OBJECT_PROPOSAL (1)

+ +

Masternode Unspent Outpoint +| 00000000000000000000000000000000 +| 00000000000000000000000000000000 ... Outpoint TXID +| ffffffff ........................... Outpoint index number: 0

+ +

00 ................................... Signature length: 0

+ +

| .................................... Masternode Signature (None required) +{% endhighlight %}

+ +

The following annotated hexdump shows a govobj message for a Trigger object. +Notice the collateral hash of all zeros. +(The message header has been omitted.)

+ +

{% highlight text %} +00000000000000000000000000000000 +00000000000000000000000000000000 ..... Parent Hash (0 = root) +01000000 ............................. Revision: 1 +911ea85900000000 ..................... Create timestamp: 2017-08-31 14:34:57 UTC +00000000000000000000000000000000 +00000000000000000000000000000000 ..... Collateral Hash (None required)

+ +

Data +| ae11 ............................... Data length: 4526 +| fdae11356235623 ... 376435643564 ... Data (truncated)

+ +

02000000 ............................. Object Type: GOVERNANCE_OBJECT_TRIGGER (2)

+ +

Masternode Unspent Outpoint +| ffefbe4959085907bcd2ba29e357a441 +| fa7b6e26e25896d8127332bba2419e97 ... Outpoint TXID +| 00000000 ........................... Outpoint index number: 0

+ +

41 ................................... Signature length: 65

+ +

1ce3b782f66be8ae9fc4158680128864 +341202b6006384083ab2d9cfa73795e2 +6000668e84af4ef6a284a52b53843524 +72037d51bd9079ffd5c087d9632865ee +75 ................................... Masternode Signature +{% endhighlight %}

+

govobjvote

+

The govobjvote message is used to indicate the voting status of a governance +object. Voting status is comprised of the vote outcome (how the masternode +voted) and the vote signal (the network support status). A sufficient number of +yes votes results in the proposed funding being payed out in the next +superblock (assuming their are sufficient funds available in the budget).

+ +

The initial govobjvote message is created by a masternode to vote on a +governance object (proposal, etc.). When the masternode votes, it broadcasts +the govobjvote message to all its peers.

+ +

When a node receives a valid, new govobjvote message, it relays the message +to all its connected peers to propagate the vote.

+ +

Additionally, nodes can request govobjvote messages for specific governance +objects via a govsync message. Masternodes ignore requests for votes if they +are not fully synced.

+ +

{% highlight text %} +Dash Core limits how frequently a masternode can vote on a governance object. +A masternode's vote will not be processed if it has been less than 60 minutes +since its last vote on that object. Additionally, invalid votes can result in +the node being banned. +{% endhighlight %}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
36masternodeOutPointoutPointRequiredThe unspent outpoint of the masternode (holding 1000 DASH) which is voting
32nParentHashuint256RequiredObject (govobj) being voted on (proposal, contract, setting or final budget)
4nVoteOutcomeintRequiredNone (0), Yes (1), No (2), Abstain (3)
4nVoteSignalintRequiredNone (0), Funding (1), Valid (2), Delete (3), Endorsed (4)
8nTimeint64_tRequiredTime the vote was created
66*vchSigchar[]RequiredSignature of the masternode (66 bytes in most cases. Length (1 byte) + Signature (65 bytes))
+ +

Governance Object Vote Signals (defined by src/governance-object.h)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueNameDescription
1FundingMinimum network support has been reached for this object to be funded (doesn't mean it will for sure though)
2ValidMinimum network support has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc.)
3DeleteMinimum network support has been reached saying this object should be deleted from the system entirely
4EndorsedMinimum network support has been reached flagging this object as endorsed by an elected representative body
+ +

The following annotated hexdump shows a govobjvote message. (The +message header has been omitted.)

+ +

{% highlight text %} +Masternode Unspent Outpoint +| 57566a0ef85e6cac3415ced67b0b07e1 +| 781bafb853650d7c9d56d8bc132cc3b4 ... Outpoint TXID +| 00000000 ........................... Outpoint index number: 0

+ +

ad9579d5c181eee904156df1c88b050f +b8b4d39e5fda71f015996dbf14a51bff...... Parent Hash (0 = root) +01000000 ............................. Vote Outcome: VOTE_OUTCOME_NONE (1) +02000000 ............................. Vote Signal: VOTE_SIGNAL_VALID (2) +b517a85900000000 ..................... Vote Create Timestamp: 2017-08-31 14:05:41 UTC +00000000000000000000000000000000 ..... Collateral Hash

+ +

1b049113a81fe913f061ad295561d267 +00b8135a021ab0356a1e89b18d663d0b +dc45e9c09ee0427223e332b52e8d709e +6d64e86b6435d7bdf207d8f23b6ae0db +6f ................................... Masternode Signature +{% endhighlight %}

+

govsync

+

The govsync message is used to request syncing of governance objects +(govobj message and govobjvote message) with peers. Masternodes ignore this +request if they are not fully synced.

+ +

This message responds in one of two ways depending on the request:

+ +
    +
  1. Object Sync - When a masternode receives a govsync message with a hash of all zeros, it +responds with one ssc message for govobj objects and one for govobjvote +objects. The masternode also sends an inv message (MSG_GOVERNANCE_OBJECT - 0x17) +for all valid govobj governance objects. +Governance object votes are excluded in this type of response.

  2. +
  3. Vote Sync - When a masternode receives a govsync message with a specific hash, it +responds with one ssc message for govobj objects and one for govobjvote +objects. The masternode also sends both a govobj inventory message +(MSG_GOVERNANCE_OBJECT - 0x17) and govobjvote inventory messages +(MSG_GOVERNANCE_OBJECT_VOTE - 0x18) for the single governance object requested.

  4. +
+ + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData typeRequiredDescription
32nHashuint256RequiredHash of governance object to request
Set to all zeros to request all objects (excludes votes)
#filterCBloomFilterRequiredCan be set to all zeros.
Only supported since [protocol version 70206][section protocol versions]
+ +

{% highlight text %} +Dash Core limits how frequently the first type of sync (object sync) can be +requested. Frequent requests will result in the node being banned. +{% endhighlight %}

+ +

The following annotated hexdump shows a govsync message. (The +message header has been omitted.)

+ +

{% highlight text %} +2e46ea5418e097a3dbcccbee3cf2a911 +6fb94ba635153f276dcb2123efcb73ff ..... Hash +00000000000000000000 ................. Bloom Filter +{% endhighlight %}

+

Deprecated Messages

+

The following network messages have been deprecated and should no longer be used.

+

mnvs

+

Masternode Budget Sync - Deprecated since 12.1

+

mvote

+

Masternode Budget Vote - Deprecated since 12.1

+

mprop

+

Masternode Budget Proposal - Deprecated since 12.1

+

fbs

+

Masternode Budget Final - Deprecated since 12.1

+

fbvote

+

Masternode Budget Final Vote - Deprecated since 12.1

+

mn quorum

+

Not Implemented

diff --git a/en/slate-example/index.html b/en/slate-example/index.html new file mode 100644 index 00000000..36b727e8 --- /dev/null +++ b/en/slate-example/index.html @@ -0,0 +1,763 @@ + + + + + + + + API Reference + + + + + + + + + + + NAV + Navbar + + +
+ +
+ cli +
+ + +
+
  • + Dash Core RPCs + +
  • +
  • + Introduction +
  • +
  • + Authentication +
  • +
  • + Kittens + +
  • +
    + +
    +
    +
    +
    +

    Dash Core RPCs

    AbandonTransaction

    +

    Added in Bitcoin Core 0.12.0

    + +

    The abandontransaction RPC marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent.

    + +

    Parameter #1---a transaction identifier (TXID)

    + +
    +

    Abandons the transaction on your node.

    +
    +
    dash-cli abandontransaction fa3970c341c9f5de6ab13f128cbfec58d732e736a505fe32137ad551c799ecc4
    +
    + + + + + + + + + + + + + + +
    NameTypeRequiredDescription
    TXIDstring (hex)Required
    (exactly 1)
    The TXID of the transaction that you want to abandon. The TXID must be encoded as hex in RPC byte order
    + +

    Result---null on success

    + +
    +

    Result (no output from dash-cli because result is set to null).

    +
    + + + + + + + + + + + + + + + +
    NameTypeRequiredDescription
    resultnullRequired
    (exactly 1)
    JSON null when the transaction and all descendants were abandoned
    + +

    See also

    + + +

    GetBlock

    +

    The getblock RPC gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

    + +
    +

    Get a block in raw hex:

    +
    +
    dash-cli -testnet getblock \
    +            0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84 \
    +            false
    +
    +0100002011f5719a0a0c4881ff98b4a68c1c828dc3b10f5b51033f5f93d48dbf\
    +000000004b8e38f197d6ee878e160d2bae3ce05ab898a6252458ec67ce770140\
    +260397c4dd2ed659a1dd001d00636b5601010000000100000000000000000000\
    +00000000000000000000000000000000000000000000ffffffff4b02041204dd\
    +2ed65908fabe6d6d7445746d63506b62572d2d35584853467a765a6748696972\
    +30657a3a6f6d656e010000000000000017fffff9020000000d2f6e6f64655374\
    +726174756d2f00000000058028bb13010000001976a914bad55652dffb1af943\
    +41015c94feea79793442fd88ac40e553b1020000001976a9142b7856de53d4c1\
    +823090c98f8ad79862842c09b588ac4094dd89000000001976a914c2c29ebc78\
    +7954ef99d01c5f79115abf7012fb8e88ac4094dd89000000001976a914d7b47d\
    +4b40a23c389f5a17754d7f60f511c7d0ec88ac4094dd89000000001976a914dc\
    +3e0793134b081145ec0c67a9c72a7b297df27c88ac00000000
    +
    +

    Parameter #1---header hash

    + + + + + + + + + + + + + + + +
    NameTypeRequiredDescription
    Header Hashstring (hex)Required
    (exactly 1)
    The hash of the header of the block to get, encoded as hex in RPC byte order
    + +

    Parameter #2---whether to get JSON or hex output

    + + + + + + + + + + + + + + + +
    NameTypeRequiredDescription
    FormatbooleanOptional
    (true or false)
    Set to false to get the block in serialized block format; set to true (the default) to get the decoded block as a JSON object
    + +

    Result (if format was false)---a serialized block

    + + + + + + + + + + + + + + + +
    NameTypeRequiredDescription
    resultstring (hex)/nullRequired
    (exactly 1
    "The requested block as a serialized block, encoded as hex, or JSON null if an error occurred
    + +
    +

    Get the same block in JSON:

    +
    +
    dash-cli -testnet getblock \
    +  0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84
    +
    {
    +  "hash": "0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84",
    +  "confirmations": 3,
    +  "size": 377,
    +  "height": 4612,
    +  "version": 536870913,
    +  "merkleroot": "c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b",
    +  "tx": [
    +    "c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"
    +  ],
    +  "time": 1507208925,
    +  "mediantime": 1507208645,
    +  "nonce": 1449878272,
    +  "bits": "1d00dda1",
    +  "difficulty": 1.155066358813473,
    +  "chainwork": "000000000000000000000000000000000000000000000000000001c3e86f0f04",
    +  "previousblockhash": "00000000bf8dd4935f3f03515b0fb1c38d821c8ca6b498ff81480c0a9a71f511",
    +  "nextblockhash": "0000000028817c7fce55d802f3647640600535a983d00e16076f284ec6cb001b"
    +}
    +
    +

    Result (if format was true or omitted)---a JSON block

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeRequiredDescription
    resultobject/nullRequired
    (exactly 1)
    An object containing the requested block, or JSON null if an error occurred

    hash
    string (hex)Required
    (exactly 1)
    The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1

    confirmations
    number (int)Required
    (exactly 1)
    The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain"

    size
    number (int)Required
    (exactly 1)
    The size of this block in serialized block format, counted in bytes"

    height
    number (int)Required
    (exactly 1)
    The height of this block on its block chain"

    version
    number (int)Required
    (exactly 1)
    This block's version number. See [block version numbers][section block versions]"

    merkleroot
    string (hex)Required
    (exactly 1)
    The merkle root for this block, encoded as hex in RPC byte order"

    tx
    arrayRequired
    (exactly 1)
    An array containing the TXIDs of all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block"
    → →
    TXID
    string (hex)Required
    (1 or more)
    The TXID of a transaction in this block, encoded as hex in RPC byte order"

    time
    number (int)Required
    (exactly 1)
    The value of the time field in the block header, indicating approximately when the block was created"

    mediantime
    number (int)Required
    (exactly 1)
    Added in Bitcoin Core 0.12.0

    The median block time in Unix epoch time"

    nonce
    number (int)Required
    (exactly 1)
    The nonce which was successful at turning this particular block into one that could be added to the best block chain"

    bits
    string (hex)Required
    (exactly 1)
    The value of the nBits field in the block header, indicating the target threshold this block's header had to pass"

    difficulty
    number (real)Required
    (exactly 1)
    The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0"

    chainwork
    string (hex)Required
    (exactly 1)
    The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex"

    previousblockhash
    string (hex)Optional
    (0 or 1)
    The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block"

    nextblockhash
    string (hex)Optional
    (0 or 1)
    The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order"
    +

    Introduction

    +

    Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.

    + +

    We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

    + +

    This example API documentation page was created with Slate. Feel free to edit it and use it as a base for your own API's documentation.

    +

    Authentication

    +
    +

    To authorize, use this code:

    +
    +
    require 'kittn'
    +
    +api = Kittn::APIClient.authorize!('meowmeowmeow')
    +
    import kittn
    +
    +api = kittn.authorize('meowmeowmeow')
    +
    # With shell, you can just pass the correct header with each request
    +curl "api_endpoint_here"
    +  -H "Authorization: meowmeowmeow"
    +
    const kittn = require('kittn');
    +
    +let api = kittn.authorize('meowmeowmeow');
    +
    +
    +

    Make sure to replace meowmeowmeow with your API key.

    +
    + +

    Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our developer portal.

    + +

    Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:

    + +

    Authorization: meowmeowmeow

    + + +

    Kittens

    Get All Kittens

    require 'kittn'
    +
    +api = Kittn::APIClient.authorize!('meowmeowmeow')
    +api.kittens.get
    +
    import kittn
    +
    +api = kittn.authorize('meowmeowmeow')
    +api.kittens.get()
    +
    curl "http://example.com/api/kittens"
    +  -H "Authorization: meowmeowmeow"
    +
    const kittn = require('kittn');
    +
    +let api = kittn.authorize('meowmeowmeow');
    +let kittens = api.kittens.get();
    +
    +
    +

    The above command returns JSON structured like this:

    +
    +
    [
    +  {
    +    "id": 1,
    +    "name": "Fluffums",
    +    "breed": "calico",
    +    "fluffiness": 6,
    +    "cuteness": 7
    +  },
    +  {
    +    "id": 2,
    +    "name": "Max",
    +    "breed": "unknown",
    +    "fluffiness": 5,
    +    "cuteness": 10
    +  }
    +]
    +
    +

    This endpoint retrieves all kittens.

    +

    HTTP Request

    +

    GET http://example.com/api/kittens

    +

    Query Parameters

    + + + + + + + + + + + + + + + + + +
    ParameterDefaultDescription
    include_catsfalseIf set to true, the result will also include cats.
    availabletrueIf set to false, the result will include kittens that have already been adopted.
    + + +

    Get a Specific Kitten

    require 'kittn'
    +
    +api = Kittn::APIClient.authorize!('meowmeowmeow')
    +api.kittens.get(2)
    +
    import kittn
    +
    +api = kittn.authorize('meowmeowmeow')
    +api.kittens.get(2)
    +
    curl "http://example.com/api/kittens/2"
    +  -H "Authorization: meowmeowmeow"
    +
    const kittn = require('kittn');
    +
    +let api = kittn.authorize('meowmeowmeow');
    +let max = api.kittens.get(2);
    +
    +
    +

    The above command returns JSON structured like this:

    +
    +
    {
    +  "id": 2,
    +  "name": "Max",
    +  "breed": "unknown",
    +  "fluffiness": 5,
    +  "cuteness": 10
    +}
    +
    +

    This endpoint retrieves a specific kitten.

    + + +

    HTTP Request

    +

    GET http://example.com/kittens/<ID>

    +

    URL Parameters

    + + + + + + + + + + +
    ParameterDescription
    IDThe ID of the kitten to retrieve
    +

    Delete a Specific Kitten

    require 'kittn'
    +
    +api = Kittn::APIClient.authorize!('meowmeowmeow')
    +api.kittens.delete(2)
    +
    import kittn
    +
    +api = kittn.authorize('meowmeowmeow')
    +api.kittens.delete(2)
    +
    curl "http://example.com/api/kittens/2"
    +  -X DELETE
    +  -H "Authorization: meowmeowmeow"
    +
    const kittn = require('kittn');
    +
    +let api = kittn.authorize('meowmeowmeow');
    +let max = api.kittens.delete(2);
    +
    +
    +

    The above command returns JSON structured like this:

    +
    +
    {
    +  "id": 2,
    +  "deleted" : ":("
    +}
    +
    +

    This endpoint deletes a specific kitten.

    +

    HTTP Request

    +

    DELETE http://example.com/kittens/<ID>

    +

    URL Parameters

    + + + + + + + + + + +
    ParameterDescription
    IDThe ID of the kitten to delete
    + +
    +
    +
    + cli +
    +
    +
    + + diff --git a/en/slate-example/javascripts/all.js b/en/slate-example/javascripts/all.js new file mode 100644 index 00000000..0b6d3ec8 --- /dev/null +++ b/en/slate-example/javascripts/all.js @@ -0,0 +1,131 @@ +!function(){if("ontouchstart"in window){var e,t,n,r,i,o,s={};e=function(e,t){return Math.abs(e[0]-t[0])>5||Math.abs(e[1]-t[1])>5},t=function(e){this.startXY=[e.touches[0].clientX,e.touches[0].clientY],this.threshold=!1},n=function(t){return!this.threshold&&void(this.threshold=e(this.startXY,[t.touches[0].clientX,t.touches[0].clientY]))},r=function(t){if(!this.threshold&&!e(this.startXY,[t.changedTouches[0].clientX,t.changedTouches[0].clientY])){var n=t.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),r.simulated=!0,t.target.dispatchEvent(r)}},i=function(e){var t=Date.now(),n=t-s.time,r=e.clientX,i=e.clientY,a=[Math.abs(s.x-r),Math.abs(s.y-i)],u=o(e.target,"A")||e.target,c=u.nodeName,l="A"===c,f=window.navigator.standalone&&l&&e.target.getAttribute("href");return s.time=t,s.x=r,s.y=i,!((!e.simulated&&(n<500||n<1500&&a[0]<50&&a[1]<50)||f)&&(e.preventDefault(),e.stopPropagation(),!f))&&(f&&(window.location=u.getAttribute("href")),void(u&&u.classList&&(u.classList.add("energize-focus"),window.setTimeout(function(){u.classList.remove("energize-focus")},150))))},o=function(e,t){for(var n=e;n!==document.body;){if(!n||n.nodeName===t)return n;n=n.parentNode}return null},document.addEventListener("touchstart",t,!1),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",r,!1),document.addEventListener("click",i,!0)}}(),/*! + * jQuery JavaScript Library v2.2.0 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-08T20:02Z + */ +function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=oe.type(e);return"function"!==n&&!oe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e,t,n){if(oe.isFunction(t))return oe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return oe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ge.test(t))return oe.filter(t,e,n);t=oe.filter(t,e)}return oe.grep(e,function(e){return Z.call(t,e)>-1!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t={};return oe.each(e.match(we)||[],function(e,n){t[n]=!0}),t}function s(){Q.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s),oe.ready()}function a(){this.expando=oe.expando+a.uid++}function u(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(je,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Ne.test(n)?oe.parseJSON(n):n)}catch(e){}ke.set(e,t,n)}else n=void 0;return n}function c(e,t,n,r){var i,o=1,s=20,a=r?function(){return r.cur()}:function(){return oe.css(e,t,"")},u=a(),c=n&&n[3]||(oe.cssNumber[t]?"":"px"),l=(oe.cssNumber[t]||"px"!==c&&+u)&&Ae.exec(oe.css(e,t));if(l&&l[3]!==c){c=c||l[3],n=n||[],l=+u||1;do o=o||".5",l/=o,oe.style(e,t,l+c);while(o!==(o=a()/u)&&1!==o&&--s)}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}function l(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&oe.nodeName(e,t)?oe.merge([e],n):n}function f(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(c=oe.contains(o.ownerDocument,o),s=l(d.appendChild(o),"script"),c&&f(s),n)for(p=0;o=s[p++];)Fe.test(o.type||"")&&n.push(o);return d}function d(){return!0}function h(){return!1}function g(){try{return Q.activeElement}catch(e){}}function v(e,t,n,r,i,o){var s,a;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(a in t)v(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=h;else if(!i)return this;return 1===o&&(s=i,i=function(e){return oe().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=oe.guid++)),e.each(function(){oe.event.add(this,t,i,r,n)})}function m(e,t){return oe.nodeName(e,"table")&&oe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function y(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function x(e){var t=ze.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function b(e,t){var n,r,i,o,s,a,u,c;if(1===t.nodeType){if(Ee.hasData(e)&&(o=Ee.access(e),s=Ee.set(t,o),c=o.events)){delete s.handle,s.events={};for(i in c)for(n=0,r=c[i].length;n1&&"string"==typeof g&&!re.checkClone&&Be.test(g))return e.each(function(i){var o=e.eq(i);v&&(t[0]=g.call(this,i,o.html())),T(o,t,n,r)});if(d&&(i=p(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=oe.map(l(i,"script"),y),a=s.length;f")).appendTo(t.documentElement),t=Ve[0].contentDocument,t.write(),t.close(),n=C(e,t),Ve.detach()),Ue[e]=n),n}function k(e,t,n){var r,i,o,s,a=e.style;return n=n||Je(e),n&&(s=n.getPropertyValue(t)||n[t],""!==s||oe.contains(e.ownerDocument,e)||(s=oe.style(e,t)),!re.pixelMarginRight()&&Qe.test(s)&&Ye.test(t)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o)),void 0!==s?s+"":s}function N(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function j(e){if(e in rt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=nt.length;n--;)if(e=nt[n]+t,e in rt)return e}function L(e,t,n){var r=Ae.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function A(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=oe.css(e,n+De[o],!0,i)),r?("content"===n&&(s-=oe.css(e,"padding"+De[o],!0,i)),"margin"!==n&&(s-=oe.css(e,"border"+De[o]+"Width",!0,i))):(s+=oe.css(e,"padding"+De[o],!0,i),"padding"!==n&&(s+=oe.css(e,"border"+De[o]+"Width",!0,i)));return s}function D(t,n,r){var i=!0,o="width"===n?t.offsetWidth:t.offsetHeight,s=Je(t),a="border-box"===oe.css(t,"boxSizing",!1,s);if(Q.msFullscreenElement&&e.top!==e&&t.getClientRects().length&&(o=Math.round(100*t.getBoundingClientRect()[n])),o<=0||null==o){if(o=k(t,n,s),(o<0||null==o)&&(o=t.style[n]),Qe.test(o))return o;i=a&&(re.boxSizingReliable()||o===t.style[n]),o=parseFloat(o)||0}return o+A(t,n,r||(a?"border":"content"),i,s)+"px"}function O(e,t){for(var n,r,i,o=[],s=0,a=e.length;s=0&&n=0},isPlainObject:function(e){return"object"===oe.type(e)&&!e.nodeType&&!oe.isWindow(e)&&!(e.constructor&&!ne.call(e.constructor.prototype,"isPrototypeOf"))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ee[te.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;e=oe.trim(e),e&&(1===e.indexOf("use strict")?(t=Q.createElement("script"),t.text=e,Q.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(ae,"ms-").replace(ue,ce)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[I]=!0,e}function i(e){var t=O.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||U)-(~e.sourceIndex||U);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function l(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function p(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[c]=!(s[c]=f))}}else x=v(x===s?x.splice(h,x.length):x),o?o(null,s,x,u):K.apply(s,x)})}function y(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],s=o||T.relative[" "],a=o?1:0,u=d(function(e){return e===t},s,!0),c=d(function(e){return ee(t,e)>-1},s,!0),l=[function(e,n,r){var i=!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):c(e,n,r));return t=null,i}];a1&&h(l),a>1&&p(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ae,"$1"),n,a0,o=e.length>0,s=function(r,s,a,u,c){var l,f,p,d=0,h="0",g=r&&[],m=[],y=j,x=r||o&&T.find.TAG("*",c),b=_+=null==y?1:Math.random()||.1,w=x.length;for(c&&(j=s===O||s||c);h!==w&&null!=(l=x[h]);h++){if(o&&l){for(f=0,s||l.ownerDocument===O||(D(l),a=!$);p=e[f++];)if(p(l,s||O,a)){u.push(l);break}c&&(_=b)}i&&((l=!p&&l)&&d--,r&&g.push(l))}if(d+=h,i&&h!==d){for(f=0;p=n[f++];)p(g,m,s,a);if(r){if(d>0)for(;h--;)g[h]||m[h]||(m[h]=J.call(u));m=v(m)}K.apply(u,m),c&&!r&&m.length>0&&d+n.length>1&&t.uniqueSort(u)}return c&&(_=b,j=y),g};return i?r(s):s}var b,w,T,S,C,E,k,N,j,L,A,D,O,q,$,F,H,P,R,I="sizzle"+1*new Date,M=e.document,_=0,W=0,B=n(),z=n(),X=n(),V=function(e,t){return e===t&&(A=!0),0},U=1<<31,Y={}.hasOwnProperty,Q=[],J=Q.pop,G=Q.push,K=Q.push,Z=Q.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),le=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),pe=new RegExp("^"+re+"$"),de={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,me=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){D()};try{K.apply(Q=Z.call(M.childNodes),M.childNodes),Q[M.childNodes.length].nodeType}catch(e){K={apply:Q.length?function(e,t){G.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},D=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:M;return r!==O&&9===r.nodeType&&r.documentElement?(O=r,q=O.documentElement,$=!C(O),(n=O.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(O.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=ve.test(O.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=I,!O.getElementsByName||!O.getElementsByName(I).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&$){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&$)return t.getElementsByClassName(e)},H=[],F=[],(w.qsa=ve.test(O.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+I+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+I+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=O.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=ve.test(P=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),H.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),H=H.length&&new RegExp(H.join("|")),t=ve.test(q.compareDocumentPosition),R=t||ve.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},V=t?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===O||e.ownerDocument===M&&R(M,e)?-1:t===O||t.ownerDocument===M&&R(M,t)?1:L?ee(L,e)-ee(L,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],u=[t];if(!i||!o)return e===O?-1:t===O?1:i?-1:o?1:L?ee(L,e)-ee(L,t):0;if(i===o)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?s(a[r],u[r]):a[r]===M?-1:u[r]===M?1:0},O):O},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==O&&D(e),n=n.replace(le,"='$1']"),w.matchesSelector&&$&&!X[n+" "]&&(!H||!H.test(n))&&(!F||!F.test(n)))try{var r=P.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,O,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==O&&D(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==O&&D(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!$):void 0;return void 0!==r?r:w.attributes||!$?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!w.detectDuplicates,L=!w.sortStable&&e.slice(0),e.sort(V),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return L=null,e},S=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=S(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=S(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:de,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return de.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=E(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=B[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&B(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,p,d,h,g=o!==s?"nextSibling":"previousSibling",v=t.parentNode,m=a&&t.nodeName.toLowerCase(),y=!u&&!a,x=!1;if(v){if(o){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===m:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?v.firstChild:v.lastChild],s&&y){for(p=v,f=p[I]||(p[I]={}),l=f[p.uniqueID]||(f[p.uniqueID]={}),c=l[e]||[],d=c[0]===_&&c[1],x=d&&c[2],p=d&&v.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){l[e]=[_,d,x];break}}else if(y&&(p=t,f=p[I]||(p[I]={}),l=f[p.uniqueID]||(f[p.uniqueID]={}),c=l[e]||[],d=c[0]===_&&c[1],x=d),x===!1)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((a?p.nodeName.toLowerCase()!==m:1!==p.nodeType)||!++x||(y&&(f=p[I]||(p[I]={}),l=f[p.uniqueID]||(f[p.uniqueID]={}),l[e]=[_,x]),p!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[I]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),s=i.length;s--;)r=ee(e,i[s]),e[r]=!(t[r]=i[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(ae,"$1"));return i[I]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)>-1}}),lang:r(function(e){return pe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=$?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[n<0?n+t:n]}),even:c(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(s=o[0]).type&&w.getById&&9===t.nodeType&&$&&T.relative[o[1].type]){if(t=(T.find.ID(s.matches[0].replace(be,we),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=de.needsContext.test(e)?0:o.length;i--&&(s=o[i],!T.relative[a=s.type]);)if((u=T.find[a])&&(r=u(s.matches[0].replace(be,we),ye.test(o[0].type)&&l(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return K.apply(n,r),n;break}}return(c||k(e,f))(r,t,!$,n,!t||ye.test(e)&&l(t.parentNode)||t),n},w.sortStable=I.split("").sort(V).join("")===I,w.detectDuplicates=!!A,D(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(O.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);oe.find=le,oe.expr=le.selectors,oe.expr[":"]=oe.expr.pseudos,oe.uniqueSort=oe.unique=le.uniqueSort,oe.text=le.getText,oe.isXMLDoc=le.isXML,oe.contains=le.contains;var fe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&oe(e).is(n))break;r.push(e)}return r},pe=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},de=oe.expr.match.needsContext,he=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,ge=/^.[^:#\[\.,]*$/;oe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?oe.find.matchesSelector(r,e)?[r]:[]:oe.find.matches(e,oe.grep(t,function(e){return 1===e.nodeType}))},oe.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(oe(e).filter(function(){for(t=0;t1?oe.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&de.test(e)?oe(e):e||[],!1).length}});var ve,me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ye=oe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||ve,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:me.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof oe?t[0]:t,oe.merge(this,oe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:Q,!0)),he.test(r[1])&&oe.isPlainObject(t))for(r in t)oe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=Q.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=Q,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):oe.isFunction(e)?void 0!==n.ready?n.ready(e):e(oe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),oe.makeArray(e,this))};ye.prototype=oe.fn,ve=oe(Q);var xe=/^(?:parents|prev(?:Until|All))/,be={children:!0,contents:!0,next:!0,prev:!0};oe.fn.extend({has:function(e){var t=oe(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&oe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?oe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?Z.call(oe(e),this[0]):Z.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(oe.uniqueSort(oe.merge(this.get(),oe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),oe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return fe(e,"parentNode")},parentsUntil:function(e,t,n){return fe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return fe(e,"nextSibling")},prevAll:function(e){return fe(e,"previousSibling")},nextUntil:function(e,t,n){return fe(e,"nextSibling",n)},prevUntil:function(e,t,n){return fe(e,"previousSibling",n)},siblings:function(e){return pe((e.parentNode||{}).firstChild,e)},children:function(e){return pe(e.firstChild)},contents:function(e){return e.contentDocument||oe.merge([],e.childNodes)}},function(e,t){oe.fn[e]=function(n,r){var i=oe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=oe.filter(r,i)),this.length>1&&(be[e]||oe.uniqueSort(i),xe.test(e)&&i.reverse()),this.pushStack(i)}});var we=/\S+/g;oe.Callbacks=function(e){e="string"==typeof e?o(e):oe.extend({},e);var t,n,r,i,s=[],a=[],u=-1,c=function(){for(i=e.once,r=t=!0;a.length;u=-1)for(n=a.shift();++u-1;)s.splice(n,1),n<=u&&u--}),this},has:function(e){return e?oe.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return i=a=[],s=n="",this},disabled:function(){return!s},lock:function(){return i=a=[],n||(s=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},oe.extend({Deferred:function(e){var t=[["resolve","done",oe.Callbacks("once memory"),"resolved"],["reject","fail",oe.Callbacks("once memory"),"rejected"],["notify","progress",oe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return oe.Deferred(function(n){oe.each(t,function(t,o){var s=oe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&oe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?oe.extend(e,r):r}},i={};return r.pipe=r.then,oe.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=J.call(arguments),s=o.length,a=1!==s||e&&oe.isFunction(e.promise)?s:0,u=1===a?e:oe.Deferred(),c=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?J.call(arguments):i,r===t?u.notifyWith(n,r):--a||u.resolveWith(n,r)}};if(s>1)for(t=new Array(s),n=new Array(s),r=new Array(s);i0||(Te.resolveWith(Q,[oe]),oe.fn.triggerHandler&&(oe(Q).triggerHandler("ready"),oe(Q).off("ready"))))}}),oe.ready.promise=function(t){return Te||(Te=oe.Deferred(),"complete"===Q.readyState||"loading"!==Q.readyState&&!Q.documentElement.doScroll?e.setTimeout(oe.ready):(Q.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s))),Te.promise(t)},oe.ready.promise();var Se=function(e,t,n,r,i,o,s){var a=0,u=e.length,c=null==n;if("object"===oe.type(n)){i=!0;for(a in n)Se(e,t,a,n[a],!0,o,s)}else if(void 0!==r&&(i=!0,oe.isFunction(r)||(s=!0),c&&(s?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(oe(e),n)})),t))for(;a-1&&void 0!==n&&ke.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){ke.remove(this,e)})}}),oe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Ee.get(e,t),n&&(!r||oe.isArray(n)?r=Ee.access(e,t,oe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=oe.queue(e,t),r=n.length,i=n.shift(),o=oe._queueHooks(e,t),s=function(){oe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Ee.get(e,n)||Ee.access(e,n,{empty:oe.Callbacks("once memory").add(function(){Ee.remove(e,[t+"queue",n])})})}}),oe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length",""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};He.optgroup=He.option,He.tbody=He.tfoot=He.colgroup=He.caption=He.thead,He.th=He.td;var Pe=/<|&#?\w+;/;!function(){var e=Q.createDocumentFragment(),t=e.appendChild(Q.createElement("div")),n=Q.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),re.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",re.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Re=/^key/,Ie=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Me=/^([^.]*)(?:\.(.+)|)/;oe.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,c,l,f,p,d,h,g,v=Ee.get(e);if(v)for(n.handler&&(o=n,n=o.handler,i=o.selector),n.guid||(n.guid=oe.guid++),(u=v.events)||(u=v.events={}),(s=v.handle)||(s=v.handle=function(t){return"undefined"!=typeof oe&&oe.event.triggered!==t.type?oe.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(we)||[""],c=t.length;c--;)a=Me.exec(t[c])||[],d=g=a[1],h=(a[2]||"").split(".").sort(),d&&(f=oe.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=oe.event.special[d]||{},l=oe.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&oe.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||(p=u[d]=[],p.delegateCount=0,f.setup&&f.setup.call(e,r,h,s)!==!1||e.addEventListener&&e.addEventListener(d,s)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,l):p.push(l),oe.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,c,l,f,p,d,h,g,v=Ee.hasData(e)&&Ee.get(e);if(v&&(u=v.events)){for(t=(t||"").match(we)||[""],c=t.length;c--;)if(a=Me.exec(t[c])||[],d=g=a[1],h=(a[2]||"").split(".").sort(),d){for(f=oe.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;o--;)l=p[o],!i&&g!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(o,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(e,l));s&&!p.length&&(f.teardown&&f.teardown.call(e,h,v.handle)!==!1||oe.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)oe.event.remove(e,d+t[c],n,r,!0);oe.isEmptyObject(u)&&Ee.remove(e,"handle events")}},dispatch:function(e){e=oe.event.fix(e);var t,n,r,i,o,s=[],a=J.call(arguments),u=(Ee.get(this,"events")||{})[e.type]||[],c=oe.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=oe.event.handlers.call(this,e,u),t=0;(i=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((oe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a), +void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:oe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return a]*)\/>/gi,We=/\s*$/g;oe.extend({htmlPrefilter:function(e){return e.replace(_e,"<$1>")},clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=oe.contains(e.ownerDocument,e);if(!(re.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||oe.isXMLDoc(e)))for(s=l(a),o=l(e),r=0,i=o.length;r0&&f(s,!u&&l(e,"script")),a},cleanData:function(e){for(var t,n,r,i=oe.event.special,o=0;void 0!==(n=e[o]);o++)if(Ce(n)){if(t=n[Ee.expando]){if(t.events)for(r in t.events)i[r]?oe.event.remove(n,r):oe.removeEvent(n,r,t.handle);n[Ee.expando]=void 0}n[ke.expando]&&(n[ke.expando]=void 0)}}}),oe.fn.extend({domManip:T,detach:function(e){return S(this,e,!0)},remove:function(e){return S(this,e)},text:function(e){return Se(this,function(e){return void 0===e?oe.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return T(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=m(this,e);t.appendChild(e)}})},prepend:function(){return T(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=m(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return T(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return T(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(oe.cleanData(l(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return oe.clone(this,e,t)})},html:function(e){return Se(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!We.test(e)&&!He[($e.exec(e)||["",""])[1].toLowerCase()]){e=oe.htmlPrefilter(e);try{for(;n1)},show:function(){return O(this,!0)},hide:function(){return O(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Oe(this)?oe(this).show():oe(this).hide()})}}),oe.Tween=q,q.prototype={constructor:q,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||oe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(oe.cssNumber[n]?"":"px")},cur:function(){var e=q.propHooks[this.prop];return e&&e.get?e.get(this):q.propHooks._default.get(this)},run:function(e){var t,n=q.propHooks[this.prop];return this.options.duration?this.pos=t=oe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):q.propHooks._default.set(this),this}},q.prototype.init.prototype=q.prototype,q.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=oe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){oe.fx.step[e.prop]?oe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[oe.cssProps[e.prop]]&&!oe.cssHooks[e.prop]?e.elem[e.prop]=e.now:oe.style(e.elem,e.prop,e.now+e.unit)}}},q.propHooks.scrollTop=q.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},oe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},oe.fx=q.prototype.init,oe.fx.step={};var it,ot,st=/^(?:toggle|show|hide)$/,at=/queueHooks$/;oe.Animation=oe.extend(I,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return c(n.elem,e,Ae.exec(t),n),n}]},tweener:function(e,t){oe.isFunction(e)?(t=e,e=["*"]):e=e.match(we);for(var n,r=0,i=e.length;r1)},removeAttr:function(e){return this.each(function(){oe.removeAttr(this,e)})}}),oe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?oe.prop(e,t,n):(1===o&&oe.isXMLDoc(e)||(t=t.toLowerCase(),i=oe.attrHooks[t]||(oe.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void oe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=oe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!re.radioValue&&"radio"===t&&oe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(we);if(o&&1===e.nodeType)for(;n=o[i++];)r=oe.propFix[n]||n,oe.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),ut={set:function(e,t,n){return t===!1?oe.removeAttr(e,n):e.setAttribute(n,n),n}},oe.each(oe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||oe.find.attr;ct[t]=function(e,t,r){var i,o;return r||(o=ct[t],ct[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ct[t]=o),i}});var lt=/^(?:input|select|textarea|button)$/i,ft=/^(?:a|area)$/i;oe.fn.extend({prop:function(e,t){return Se(this,oe.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[oe.propFix[e]||e]})}}),oe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&oe.isXMLDoc(e)||(t=oe.propFix[t]||t,i=oe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=oe.find.attr(e,"tabindex");return t?parseInt(t,10):lt.test(e.nodeName)||ft.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),re.optSelected||(oe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),oe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){oe.propFix[this.toLowerCase()]=this});var pt=/[\t\r\n\f]/g;oe.fn.extend({addClass:function(e){var t,n,r,i,o,s,a,u=0;if(oe.isFunction(e))return this.each(function(t){oe(this).addClass(e.call(this,t,M(this)))});if("string"==typeof e&&e)for(t=e.match(we)||[];n=this[u++];)if(i=M(n),r=1===n.nodeType&&(" "+i+" ").replace(pt," ")){for(s=0;o=t[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");a=oe.trim(r),i!==a&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,s,a,u=0;if(oe.isFunction(e))return this.each(function(t){oe(this).removeClass(e.call(this,t,M(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(we)||[];n=this[u++];)if(i=M(n),r=1===n.nodeType&&(" "+i+" ").replace(pt," ")){for(s=0;o=t[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");a=oe.trim(r),i!==a&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):oe.isFunction(e)?this.each(function(n){oe(this).toggleClass(e.call(this,n,M(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=oe(this),o=e.match(we)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=M(this),t&&Ee.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Ee.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+M(n)+" ").replace(pt," ").indexOf(t)>-1)return!0;return!1}});var dt=/\r/g;oe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=oe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,oe(this).val()):e,null==i?i="":"number"==typeof i?i+="":oe.isArray(i)&&(i=oe.map(i,function(e){return null==e?"":e+""})),t=oe.valHooks[this.type]||oe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=oe.valHooks[i.type]||oe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(dt,""):null==n?"":n)}}}),oe.extend({valHooks:{option:{get:function(e){return oe.trim(e.value)}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,s=o?null:[],a=o?i+1:r.length,u=i<0?a:o?i:0;u-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),oe.each(["radio","checkbox"],function(){oe.valHooks[this]={set:function(e,t){if(oe.isArray(t))return e.checked=oe.inArray(oe(e).val(),t)>-1}},re.checkOn||(oe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var ht=/^(?:focusinfocus|focusoutblur)$/;oe.extend(oe.event,{trigger:function(t,n,r,i){var o,s,a,u,c,l,f,p=[r||Q],d=ne.call(t,"type")?t.type:t,h=ne.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||Q,3!==r.nodeType&&8!==r.nodeType&&!ht.test(d+oe.event.triggered)&&(d.indexOf(".")>-1&&(h=d.split("."),d=h.shift(),h.sort()),c=d.indexOf(":")<0&&"on"+d,t=t[oe.expando]?t:new oe.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:oe.makeArray(n,[t]),f=oe.event.special[d]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!oe.isWindow(r)){for(u=f.delegateType||d,ht.test(u+d)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(r.ownerDocument||Q)&&p.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=p[o++])&&!t.isPropagationStopped();)t.type=o>1?u:f.bindType||d,l=(Ee.get(s,"events")||{})[t.type]&&Ee.get(s,"handle"),l&&l.apply(s,n),l=c&&s[c],l&&l.apply&&Ce(s)&&(t.result=l.apply(s,n),t.result===!1&&t.preventDefault());return t.type=d,i||t.isDefaultPrevented()||f._default&&f._default.apply(p.pop(),n)!==!1||!Ce(r)||c&&oe.isFunction(r[d])&&!oe.isWindow(r)&&(a=r[c],a&&(r[c]=null),oe.event.triggered=d,r[d](),oe.event.triggered=void 0,a&&(r[c]=a)),t.result}},simulate:function(e,t,n){var r=oe.extend(new oe.Event,n,{type:e,isSimulated:!0});oe.event.trigger(r,null,t),r.isDefaultPrevented()&&n.preventDefault()}}),oe.fn.extend({trigger:function(e,t){return this.each(function(){oe.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return oe.event.trigger(e,t,n,!0)}}),oe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){oe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),oe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),re.focusin="onfocusin"in e,re.focusin||oe.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){oe.event.simulate(t,e.target,oe.event.fix(e))};oe.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Ee.access(r,t);i||r.addEventListener(e,n,!0),Ee.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Ee.access(r,t)-1;i?Ee.access(r,t,i):(r.removeEventListener(e,n,!0),Ee.remove(r,t))}}});var gt=e.location,vt=oe.now(),mt=/\?/;oe.parseJSON=function(e){return JSON.parse(e+"")},oe.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||oe.error("Invalid XML: "+t),n};var yt=/#.*$/,xt=/([?&])_=[^&]*/,bt=/^(.*?):[ \t]*([^\r\n]*)$/gm,wt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tt=/^(?:GET|HEAD)$/,St=/^\/\//,Ct={},Et={},kt="*/".concat("*"),Nt=Q.createElement("a");Nt.href=gt.href,oe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gt.href,type:"GET",isLocal:wt.test(gt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":oe.parseJSON,"text xml":oe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?B(B(e,oe.ajaxSettings),t):B(oe.ajaxSettings,e)},ajaxPrefilter:_(Ct),ajaxTransport:_(Et),ajax:function(t,n){function r(t,n,r,a){var c,f,y,x,w,S=n;2!==b&&(b=2,u&&e.clearTimeout(u),i=void 0,s=a||"",T.readyState=t>0?4:0,c=t>=200&&t<300||304===t,r&&(x=z(p,T,r)),x=X(p,x,T,c),c?(p.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(oe.lastModified[o]=w),w=T.getResponseHeader("etag"),w&&(oe.etag[o]=w)),204===t||"HEAD"===p.type?S="nocontent":304===t?S="notmodified":(S=x.state,f=x.data,y=x.error,c=!y)):(y=S,!t&&S||(S="error",t<0&&(t=0))),T.status=t,T.statusText=(n||S)+"",c?g.resolveWith(d,[f,S,T]):g.rejectWith(d,[T,S,y]),T.statusCode(m),m=void 0,l&&h.trigger(c?"ajaxSuccess":"ajaxError",[T,p,c?f:y]),v.fireWith(d,[T,S]),l&&(h.trigger("ajaxComplete",[T,p]),--oe.active||oe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,a,u,c,l,f,p=oe.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?oe(d):oe.event,g=oe.Deferred(),v=oe.Callbacks("once memory"),m=p.statusCode||{},y={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!a)for(a={};t=bt.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return i&&i.abort(t),r(0,t),this}};if(g.promise(T).complete=v.add,T.success=T.done,T.error=T.fail,p.url=((t||p.url||gt.href)+"").replace(yt,"").replace(St,gt.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=oe.trim(p.dataType||"*").toLowerCase().match(we)||[""],null==p.crossDomain){c=Q.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=Nt.protocol+"//"+Nt.host!=c.protocol+"//"+c.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=oe.param(p.data,p.traditional)),W(Ct,p,n,T),2===b)return T;l=oe.event&&p.global,l&&0===oe.active++&&oe.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Tt.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(mt.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=xt.test(o)?o.replace(xt,"$1_="+vt++):o+(mt.test(o)?"&":"?")+"_="+vt++)),p.ifModified&&(oe.lastModified[o]&&T.setRequestHeader("If-Modified-Since",oe.lastModified[o]),oe.etag[o]&&T.setRequestHeader("If-None-Match",oe.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+kt+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)T.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,T,p)===!1||2===b))return T.abort();w="abort";for(f in{success:1,error:1,complete:1})T[f](p[f]);if(i=W(Et,p,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,p]),2===b)return T;p.async&&p.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},p.timeout));try{b=1,i.send(y,r)}catch(e){if(!(b<2))throw e;r(-1,e)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return oe.get(e,t,n,"json")},getScript:function(e,t){return oe.get(e,void 0,t,"script")}}),oe.each(["get","post"],function(e,t){oe[t]=function(e,n,r,i){return oe.isFunction(n)&&(i=i||r,r=n,n=void 0),oe.ajax(oe.extend({url:e,type:t,dataType:i,data:n,success:r},oe.isPlainObject(e)&&e))}}),oe._evalUrl=function(e){return oe.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},oe.fn.extend({wrapAll:function(e){var t;return oe.isFunction(e)?this.each(function(t){oe(this).wrapAll(e.call(this,t))}):(this[0]&&(t=oe(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return oe.isFunction(e)?this.each(function(t){oe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=oe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=oe.isFunction(e);return this.each(function(n){oe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){oe.nodeName(this,"body")||oe(this).replaceWith(this.childNodes)}).end()}}),oe.expr.filters.hidden=function(e){return!oe.expr.filters.visible(e)},oe.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var jt=/%20/g,Lt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;oe.param=function(e,t){var n,r=[],i=function(e,t){t=oe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=oe.ajaxSettings&&oe.ajaxSettings.traditional),oe.isArray(e)||e.jquery&&!oe.isPlainObject(e))oe.each(e,function(){i(this.name,this.value)});else for(n in e)V(n,e[n],t,i);return r.join("&").replace(jt,"+")},oe.fn.extend({serialize:function(){return oe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=oe.prop(this,"elements");return e?oe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!oe(this).is(":disabled")&&Ot.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!qe.test(e))}).map(function(e,t){var n=oe(this).val();return null==n?null:oe.isArray(n)?oe.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}}),oe.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var qt={0:200,1223:204},$t=oe.ajaxSettings.xhr();re.cors=!!$t&&"withCredentials"in $t,re.ajax=$t=!!$t,oe.ajaxTransport(function(t){var n,r;if(re.cors||$t&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(s in i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(qt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),oe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return oe.globalEval(e),e}}}),oe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),oe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=oe("