<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://betaardordocs.jelurida.com/index.php?action=history&amp;feed=atom&amp;title=Account_Setup_for_Message-based_Deposits</id>
	<title>Account Setup for Message-based Deposits - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://betaardordocs.jelurida.com/index.php?action=history&amp;feed=atom&amp;title=Account_Setup_for_Message-based_Deposits"/>
	<link rel="alternate" type="text/html" href="https://betaardordocs.jelurida.com/index.php?title=Account_Setup_for_Message-based_Deposits&amp;action=history"/>
	<updated>2026-05-14T18:12:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://betaardordocs.jelurida.com/index.php?title=Account_Setup_for_Message-based_Deposits&amp;diff=12784&amp;oldid=prev</id>
		<title>Almonte at 09:40, 12 January 2021</title>
		<link rel="alternate" type="text/html" href="https://betaardordocs.jelurida.com/index.php?title=Account_Setup_for_Message-based_Deposits&amp;diff=12784&amp;oldid=prev"/>
		<updated>2021-01-12T09:40:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
{{#seo:&lt;br /&gt;
|title=Account Setup for Message-based Deposits&lt;br /&gt;
|titlemode=replace&lt;br /&gt;
|keywords=ardor learning hub, ardor documentation, blockchain, proof of stake, ardor, ignis, jelurida, development, ardor wiki, wiki, tutorials, advanced tutorials, how-to, message-based deposits, prevent users to send tokens without a message&lt;br /&gt;
|description=This guide explains how to prevent users from accidentally sending tokens without message setting up the property nrs_recipient_ui_options. It is covered with a step-by-step guide for both configuring the receiving account and to send tokens to the account.&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Advanced_guides]]&lt;br /&gt;
&lt;br /&gt;
==Introduction== &lt;br /&gt;
&lt;br /&gt;
This guide explains how to configure the account property &amp;lt;code&amp;gt;nrs_recipient_ui_options&amp;lt;/code&amp;gt;. It prevents users from accidentally sending tokens without a message to the account that has the property set up.&lt;br /&gt;
&lt;br /&gt;
Decentralized applications that require a message to process the funds received, or any other use case that accepts message-based deposits should enable this functionality to prevent errors.&lt;br /&gt;
&lt;br /&gt;
The guide explains the configuration of the account that will require the message-based deposit as well as the end-user steps to send funds.&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;nrs_recipient_ui_options&amp;#039;&amp;#039;&amp;#039; property configuration==&lt;br /&gt;
&lt;br /&gt;
The [[Account_Properties|account property]] with name &amp;lt;code&amp;gt;nrs_recipient_ui_options&amp;lt;/code&amp;gt;, set by the recipient on itself is used to configure the modal in the [[Introductory_tour_of_ardors_features|Ardor UI]] when sending funds to that account. It also allows control over the message encryption, such as disabling it. The value of the &amp;lt;code&amp;gt;nrs_recipient_ui_options&amp;lt;/code&amp;gt; property is a JSON object containing the following fields:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;message_format&amp;#039;&amp;#039;&amp;#039;: [https://en.wikipedia.org/wiki/Regular_expression Regular expression] of the message format which is required when depositing to this address. For instance:&lt;br /&gt;
** The expression &amp;lt;code&amp;gt;[0-9]+&amp;lt;/code&amp;gt; will only allow a numeric message.&lt;br /&gt;
*** For instance: &amp;lt;code&amp;gt;291&amp;lt;/code&amp;gt;&lt;br /&gt;
** If the message should be of a particular length use the expression as follows: &amp;lt;code&amp;gt;[a-zA-Z0-9]{4,8}&amp;lt;/code&amp;gt;.&lt;br /&gt;
*** This format will only allow alphanumeric messages with length 4 to 8 characters.&lt;br /&gt;
** Note that the regular expression is case sensitive.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;encrypt_message&amp;#039;&amp;#039;&amp;#039;: default value for the encrypt message box. Must be boolean, not string - &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; is valid value, &amp;lt;code&amp;gt;&amp;quot;true&amp;quot;&amp;lt;/code&amp;gt; is not.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;encrypt_message_disabled&amp;#039;&amp;#039;&amp;#039;: if &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the encrypt message box is disabled. Set this to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if you can accept either only encrypted or only unencrypted messages. Must be boolean, not string. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the &amp;#039;&amp;#039;&amp;#039;encrypt_message&amp;#039;&amp;#039;&amp;#039; field must also be set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. Or else the configuration is invalid.&lt;br /&gt;
&lt;br /&gt;
Example of the &amp;lt;code&amp;gt;nrs_recipient_ui_options&amp;lt;/code&amp;gt; property: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&amp;quot;message_format&amp;quot;:&amp;quot;[a-zA-Z0-9]{4,8}&amp;quot;,&amp;quot;encrypt_message&amp;quot;:true,&amp;quot;encrypt_message_disabled&amp;quot;:true}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Checking the &amp;#039;&amp;#039;&amp;#039;nrs_recipient_ui_options&amp;#039;&amp;#039;&amp;#039; property==&lt;br /&gt;
Applications that implement withdrawal of funds to user&amp;#039;s account (like exchanges) should respect the &amp;#039;&amp;#039;&amp;#039;nrs_recipient_ui_options&amp;#039;&amp;#039;&amp;#039; property similarly to the Ardor UI - in order to protect the user from withdrawing funds to account owned by some other service which requires a message.&lt;br /&gt;
&lt;br /&gt;
To get the property, use the [[Accounts#Get_Account_Properties|Get Account Properties]] API with parameters&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;setter&amp;#039;&amp;#039;&amp;#039;: the account to which the user wants to withdraw funds&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;recipient&amp;#039;&amp;#039;&amp;#039;: again the account to which the user wants to withdraw funds. This parameter should be equal to the &amp;#039;&amp;#039;&amp;#039;setter&amp;#039;&amp;#039;&amp;#039; parameter because the &amp;#039;&amp;#039;&amp;#039;nrs_recipient_ui_options&amp;#039;&amp;#039;&amp;#039; property must be set by the account on itself.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;property&amp;#039;&amp;#039;&amp;#039;: the string &amp;quot;nrs_recipient_ui_options&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;btn size=&amp;quot;sm&amp;quot;&amp;gt;https://testardor.jelurida.com/test?requestType=getAccountProperties&amp;amp;property=nrs_recipient_ui_options&amp;amp;setter=ARDOR-S9Q3-GPL9-XLPB-EDW66&amp;amp;recipient=ARDOR-S9Q3-GPL9-XLPB-EDW66|&amp;lt;span class=&amp;quot;glyphicon glyphicon-cog&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Test Get Account Properties|btn-primary&amp;lt;/btn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
http://localhost:26876/nxt?&lt;br /&gt;
   requestType=getAccountProperties&amp;amp;property=nrs_recipient_ui_options&amp;amp;&lt;br /&gt;
   setter=ARDOR-S9Q3-GPL9-XLPB-EDW66&amp;amp;recipient=ARDOR-S9Q3-GPL9-XLPB-EDW66&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the account ARDOR-S9Q3-GPL9-XLPB-EDW66 is properly configured for message-based deposits, the result will be something like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;setterRS&amp;quot;: &amp;quot;ARDOR-S9Q3-GPL9-XLPB-EDW66&amp;quot;,&lt;br /&gt;
  &amp;quot;recipientRS&amp;quot;: &amp;quot;ARDOR-S9Q3-GPL9-XLPB-EDW66&amp;quot;,&lt;br /&gt;
  &amp;quot;recipient&amp;quot;: &amp;quot;13984674604228812481&amp;quot;,&lt;br /&gt;
  &amp;quot;requestProcessingTime&amp;quot;: 0,&lt;br /&gt;
  &amp;quot;setter&amp;quot;: &amp;quot;13984674604228812481&amp;quot;,&lt;br /&gt;
  &amp;quot;properties&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;property&amp;quot;: &amp;quot;nrs_recipient_ui_options&amp;quot;,&lt;br /&gt;
      &amp;quot;value&amp;quot;: &amp;quot;{\&amp;quot;message_format\&amp;quot;:\&amp;quot;[0-9]+\&amp;quot;,\&amp;quot;encrypt_message\&amp;quot;:true,\&amp;quot;encrypt_message_disabled\&amp;quot;:true}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it is a regular account, not configured for message-based deposits, the &amp;#039;&amp;#039;&amp;#039;properties&amp;#039;&amp;#039;&amp;#039; array will be empty.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;properties&amp;#039;&amp;#039;&amp;#039; array cannot contain more than 1 element for this request. If not empty, get the only element and then get the &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; field. It should be a string. Parse it as JSON object. If the parsing failed, consider this a regular account. If the parsing succeeded: &lt;br /&gt;
&lt;br /&gt;
* Get the &amp;#039;&amp;#039;&amp;#039;message_format&amp;#039;&amp;#039;&amp;#039; field of the parsed object:&lt;br /&gt;
** If not present, consider this a regular account.&lt;br /&gt;
** If &amp;#039;&amp;#039;&amp;#039;message_format&amp;#039;&amp;#039;&amp;#039; is present in the object, check if the message which the user entered is matched by this regular expression. If your UI doesn&amp;#039;t allow the user to enter message, block the withdrawal and show an explanatory error message to the user.&lt;br /&gt;
&lt;br /&gt;
* Get the &amp;#039;&amp;#039;&amp;#039;encrypt_message_disabled&amp;#039;&amp;#039;&amp;#039; field. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, this means that the destination account can accept either only encrypted or only unencrypted messaged. In this case check the &amp;#039;&amp;#039;&amp;#039;encrypt_message&amp;#039;&amp;#039;&amp;#039; field:&lt;br /&gt;
** If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the account accepts only encrypted messages&lt;br /&gt;
** If &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the account accepts only unencrypted messages&lt;br /&gt;
** Anything else: the account is not properly configured - consider that it is a regular account&lt;br /&gt;
&lt;br /&gt;
==Step-by-step configuration of the receiving account==&lt;br /&gt;
&lt;br /&gt;
It will be used the Ardor account &amp;lt;code&amp;gt;ARDOR-GHKP-XWB5-XMZB-CTUE3&amp;lt;/code&amp;gt; for this example. First [[Login_Page_Tutorial|login into the Ardor wallet]] with the account that will receive the funds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on &amp;#039;Account Properties&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
[[File:Account setup for Message-based deposits - 1.jpg|class=img-responsive|border|Account properties]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on &amp;#039;Set&amp;#039; as shows the following image:&lt;br /&gt;
&lt;br /&gt;
[[File:Account setup for Message-based deposits - 2.jpg|class=img-responsive|border|Set property]]&lt;br /&gt;
&lt;br /&gt;
Set the values of the account property:&lt;br /&gt;
* Recipient account (it must be the same account, in this case, &amp;lt;code&amp;gt;ARDOR-GHKP-XWB5-XMZB-CTUE3&amp;lt;/code&amp;gt;&lt;br /&gt;
* Property: &amp;lt;code&amp;gt;nrs_recipient_ui_options&amp;lt;/code&amp;gt;&lt;br /&gt;
* Value: The JSON message. In this case the values of the fields are&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;message_format&amp;#039;&amp;#039;&amp;#039;: [a-zA-Z0-9]{4,8}&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;encrypt_message&amp;#039;&amp;#039;&amp;#039;: true&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;encrypt_message_disabled&amp;#039;&amp;#039;&amp;#039;: false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Account_setup_for_Message-based_deposits_-_3.jpg|class=img-responsive|border|Set property values]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the transaction is bundled, the account property will appear in the &amp;quot;Incoming&amp;quot; properties. It can be updated or deleted if needed.&lt;br /&gt;
&lt;br /&gt;
The receiving account is now already configured. When sending funds it will check the correctness of the message format and will automatically enable the message encryption. Refer to the next section to see how to send funds to the receiving account.&lt;br /&gt;
&lt;br /&gt;
==Sending funds to the receiving account==&lt;br /&gt;
&lt;br /&gt;
It will be used the Ardor account &amp;lt;code&amp;gt;ARDOR-X8ZN-WUJ2-SXY3-FBUYC&amp;lt;/code&amp;gt; to send funds to the previously created receiving account of the section above. First [[Login_Page_Tutorial|login into the Ardor wallet]] with the account that will send the funds.&lt;br /&gt;
&lt;br /&gt;
It is possible to send any token, in this guide we will send IGNIS tokens to the &amp;lt;code&amp;gt;ARDOR-GHKP-XWB5-XMZB-CTUE3&amp;lt;/code&amp;gt; already configured.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;Send IGNIS&amp;quot; button:&lt;br /&gt;
&lt;br /&gt;
[[File:Account setup for Message-based deposits - 4.jpg|class=img-responsive|border|Send IGNIS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fill the recipient account (for this case: &amp;lt;code&amp;gt;ARDOR-GHKP-XWB5-XMZB-CTUE3&amp;lt;/code&amp;gt;), the amount, and the message.&lt;br /&gt;
&lt;br /&gt;
===Error when sending funds due to bad-formatted message=== &lt;br /&gt;
&lt;br /&gt;
When the message does not fit the regular expression set up in the recipient account, it will disable the &amp;quot;Submit&amp;quot; button and will be prompted a message as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Account setup for Message-based deposits - 5.jpg|class=img-responsive|border|Preventing users to send funds with a wrong message]]&lt;br /&gt;
&lt;br /&gt;
===Sending funds with well-formatted message===&lt;br /&gt;
&lt;br /&gt;
When the message is well-formatted it will allow sending funds to the recipient account as the following image shows:&lt;br /&gt;
&lt;br /&gt;
[[File:Account setup for Message-based deposits - 6.jpg|class=img-responsive|border|Sending funds with a well-formatted message]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Almonte</name></author>
	</entry>
</feed>