Auto-signing contract proposals using LegalLab

It is now possible to let LegalLab auto-sign contract proposals for you, simplifying often occurring tasks during development. You enable this feature by checking the “Auto-sign contract proposals” checkbox in the Create Contract tab. The feature is only available when LegalLab is connected. If this checkbox is enabled when a contract proposal is received, the contract will be automatically loaded and presented, and LegalLab will automatically sign the contract for the proposed role.

Auto-Sign Contract Proposals
Auto-Sign Contract Proposals

#new, #development, #legallab, #features, #contracts


Killing a State Machine

If a state-machine associated with a token or set of tokens misbehaves, and needs to be stopped, an operator of Neuro-Features on the Neuron® that hosts the state-machine can kill it. This does not destroy the token or tokens associated with the state-machine, it just stops the state-machine. The event is also appropriately logged, with information about who took the responsibility to kill the machine.

In order to be able to kill a state machine, the operator needs to fullfil the following requirements:

  • Be an operator on the Neuron hosting the state-machine (i.e. have an administrative account on the Neuron).
  • Have a Digital ID associated with the account.
  • Have sufficient access rights to administer Neuro-Features. (This means, having the Admin.Notarius.NeuroFeatures privilege associated with one of its roles.)
  • Digitally sign an approval of the killing of the machine, where the user affirms to reviewing the token and taking the responsibility of killing the state-machine.

Accessing the Token

To access available tokens on the Neuron, go to the Neuro-Features section in the administrative portal:

Accessing Neuro-Features
Accessing Neuro-Features

Find the corresponding token, and open it by clicking on its ID. A link of the following type is opened:

https://DOMAIN/NeuroFeature.md?ID=TOKEN_ID

If you know the Token ID, you can open the page directly by replacing TOKEN_ID in the URL above with the correct Token ID. If you don’t know the Token ID, but you know the ID of the smart contract that created the token, you can use the script prompt, to find the Token ID, using the following SELECT statement:

select 
	top 1 TokenId 
from 
	NeuroFeatureTokens 
where 
	CreationContract=CONTRACT_ID

Killing the state machine

Once the Current State part of the Neuro-Feature page has loaded, it will present a Kill Machine button, if the token has an associated state-machine.

Accessing the Kill Switch
Accessing the Kill Switch

Press this button to open a new page where you can kill the machine. The page has the following URL. If you have the Token ID already, and cannot open the Neuro-Feature page associated with the token for some reason, you can enter this URL directly into the broker, replacing TOKEN_ID with the corresponding Token ID:

https://DOMAIN/KillMachine.md?ID=TOKEN_ID

The page that opens is simple and informs the user they need to approve the operation using their Digital ID, and that they will be responsible for the action:

Killing the machine
Killing the machine

Press the Kill Machine button to initiate the process by sending a petition to the Digital Identity of the currently logged in user:

Petition Signature for Killing Machine
Petition Signature for Killing Machine

If a Legal Identity is associated with your account you will receive an acknowledgement that a petition has been sent.

Acknowledgement Petition Sent
Acknowledgement Petition Sent

You will see this petition in your Digital ID app, as follows:

Signature Petition
Signature Petition

Take time to read through the purpose of the signature. If you agree, sign the petition, and the state-machine will be killed:

State Machine Killed
State Machine Killed

#tutorial, #new, #features, #neuro-feature, #state-machine


Embedding PDF Documents in Markdown via URL

As mentioned in a previous article, PDF documents can be embedded into Markdown. You can now also embed PDF documents, by simply using the URL, and embedding it into a multimedia construct in Markdown.

Example:

![`Harmonized Web API for real-time data.pdf`](https://neuro-foundation.io/Papers/Harmonized%20Web%20API%20for%20real-time%20data.pdf)

This results in:

#new, #features, #pdf, #neuron, #markdown


Publishing and transforming XML web content using XSLT

You can now publish XML files as web content, and have the XML source be automatically transformed to a web page using XSL transforms (XSLT). This feature is available from build 2025-08-26. The XSLT can transform the XML to either Markdown or directly to HTML. By doing this you can publish the content directly using its source in XML, without worrying about having to update any corresponding content pages. The XSLT will automatically transform the underlying source data to its presentable form when a user wants to see it.

Example

Consider the following source XML file. It describes a harmonized interface, and the XML acts as a definition for the interface:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/Xsl/InterfaceToMarkdown.xslt"?>
<interface xmlns="urn:nfi:iot:hi:1.0" id="urn:nfi:iot:hi:actuator:analogOutput:1.0">
	<description>Generical analog output.</description>
	<sensorData>
		<field name="Analog Output" use="Optional" m="true" type="q" description="Momentary output value."/>
		<field name="Analog Output, Raw" use="Optional" m="true" type="integer" description="Momentary raw binary output value."/>
		<field name="Analog Output, Bits" use="Optional" s="true" type="integer" description="Number of bits of precision of output value."/>
		<field name="Analog Output, Range, Low" use="Optional" s="true" type="q" description="Lowest possible value."/>
		<field name="Analog Output, Range, High" use="Optional" s="true" type="q" description="Highest possible value."/>
		<comment><![CDATA[The output value must be reported using the correct precision and unit. Examples of units that could be used:

* `%` - for instance 0-100 %
* `mA` - for instance 4-20 mA
* `V` - for instance 0-10 V]]></comment>
	</sensorData>
	<controlParameters>
		<parameter name="Analog Output" use="Mandatory" type="numeric" range="RangeElement" description="Desired state of output."/>
		<parameter name="Analog Output, Raw" use="Optional" type="integer" range="RangeElement" description="Desired raw state of output. The int version must always be supported. If the range supports numbers larger than that supported by the int type, the device must also support the long version."/>
	</controlParameters>
</interface>

Notice the second row. It contains a processing instruction that references an XSL Transform document that can be used to transform the XML:

<?xml-stylesheet type="text/xsl" href="/Xsl/InterfaceToMarkdown.xslt"?>

You can review the XSLT transform referenced here. See if you can see how it works. Otherwise, review the XSLT tutorial on w3schools to learn how XSLT works.

XSLT on the Neuron

On the TAG Neuron®, the XSL Transform procedure works a bit differently than on a traditional web server. In the traditional case, it is the browser that transforms the XML into a presentable page. This means that all the information is returned, including information you might not want to present. The process is also somewhat slowed down, since two requests have to be made.

Traditional Flow title=
Traditional Flow

On the Neuron, it is the the web server that transforms the XML into a presentable page, not the browser. This means that only one request has to be made. Furthermore, the web server can transform the content in two passes, simplifying the construction of the XSLT: The developer can choose to transform the XML to Markdown first. This Markdown then gets implicitly transformed into HTML in a second step:

XSLT Transform on a Neuron (using Markdown) title=
XSLT Transform on a Neuron (using Markdown)

A developer can also choose to transform the XML directly to HTML, as in the traditional case. Still, on the Neuron, this transform would be performed on the server:

XSLT Transform on a Neuron (directly to HTML) title=
XSLT Transform on a Neuron (directly to HTML)

An added benefit of transforming the content on the web server, is that you get consistent results regardless of browser used to view the page.

#web, #xml, #xsl, #markdown, #new, #features


Web login procedure

There is a new web session login procedure available in the Neuron®. From build 2025-08-18, clients performing web session login must follow this new procedure. For users using the browser to login, this is accomplished by simply refreshing the page to ensure the most recent javascript file is loaded when logging in.

Note: Web session login is used to access the administrative page. Agent API uses another type of login, based on JWT bearer tokens.

The client calls the /Login web resource with a JSON object payload as follows:

{
	"UserName": Required(Str(PUserName)),
	"PasswordHash": Required(Str(PPasswordHash)),
	"Nonce": Required(Str(PNonce))
}

While the web resource is the same as before, the following is new:

  • A PasswordHash property is sent instead of a Password in clear text (albeit over an obligatory encrypted channel, i.e. basic authentication over HTTPS). How this password hash is computed is described below.
  • A Nonce value is available. This value must be unique, and cannot be reused. It is recommended this is a base64-encoding of a sufficiently large random number, for instance a 32-byte random number, to generate sufficient entropy. Reusing a nonce value will result in an error being returned.
  • The respone of the web resource is another JSON object, instead of the earlier redirection response if successful, and a session variable state change, if an error occurred.

The purpose of the change is twofold:

  • Secure the login endpoint
  • Allow third party clients to login using the web login.

The response to the call is a JSON object as follows:

{
	"ok": Required(Bool(POk)),
	"message": Optional(Str(PMessage))
}

If ok is false, the message will contain an error message. Note that the login will be available in the current session. To enable sessions, cookies must be enabled.

Hash Digest computation

The client needs to perform the following computations to generate the hash digest to send to the Neuron®:

  1. Compute H1 = SHA3-256(UserName + ":" + Domain + ":" + Password), where Domain is the host name or main domain name of the Neuron®. It cannot be an alternative domain name, it must be the main domain name of the Neuron®.

  2. Compute H2 = HMAC-SHA-256(UTF8Encode(Nonce),H1), where the UTF-8 encoded Nonce is used as key to the HMAC-SHA-256 algorithm, and H1 is used as the data whose digest is to be computed. Note that the UTF-8 encoding must not include a preamble or byte-order-mark (BOM).

  3. Compute PasswordHash = BASE64(H2).

Note: For a reference implementation, see the /Login.js javascript resource on an updated Neuron®.

#new, #api, #security


Posts tagged #new

No more posts with the given tag could be found. You can go back to the main view by selecting Home in the menu above.