W3C home > Mailing lists > Public > public-interledger@w3.org > November 2016

Re: Prefix Conditions

From: Andrew Bransford Brown <andrewbb@gmail.com>
Date: Tue, 29 Nov 2016 11:38:39 -0500
Message-ID: <CAPS+YFLH76=2XRYsQ7iHL+Tk7uECriR4=E-MojgBm7tjzn79tw@mail.gmail.com>
To: Javier Romero <elmurci@gmail.com>
Cc: Interledger Community Group <public-interledger@w3.org>
The interface appears functional, however, needs serious review.

Buffer and Serialize are NOT financial or legal terms.

Andrew B. Brown
(512) 947-8282
http://KidsCourtyard.com


On Tue, Nov 29, 2016 at 11:20 AM, Javier Romero <elmurci@gmail.com> wrote:

> Hi guys,
>
> I am trying to embed a message (*e.g. {"id": "the_id", "value": 0.98,
> "description": "the description}*) in the condition through a Prefix
> Condition.
>
> I create the condition this way:
>
>
> const sender_fulfillment = new cc.Ed25519()
> // Set public_key
> sender_fulfillment.setPublicKey(new Buffer(pubKey, 'hex'))
> // Prefix
> const prefix = new cc.PrefixSha256()
> prefix.setPrefix(message)
> prefix.setSubfulfillment(sender_fulfillment)
> // Condition
> const condition = prefix.getConditionUri()
>
> And try to fulfil it like this:
>
> const receiver_fulfillment = new cc.Ed25519()
> receiver_fulfillment.setPublicKey(pubKey)
> const condition = receiver_fulfillment.getConditionUri()
> receiver_fulfillment.sign(message, seed)
> const prefix = new cc.PrefixSha256()
> prefix.setPrefix(message)
> prefix.setSubfulfillment(receiver_fulfillment)
> const fulfillment = prefix.serializeUri()
>
>
> These are the outputs:
>
>
> *Condition:* cc:1:25:kh7u0e_LzueXf_YyKCU_6b9AdkrWyDLghpt7odcp4p4:115
>
>
> *Fulfilment:* cf:1:EnsgInZhbHVlIjogMTIuOTkgfQAEYO
> wXK5OtXlY79JMscOEkUDTDVGfvLv1NZOv4GWg0Z-K_cn3fkbV_
> PzfYu9p1H7sVCGumRD4yupCF1LBINyBuSaB4tumYfz-bSB1PE006XF8rdW4dO5ZQ2KvsccW2S
> Az8Cg
>
>
> However, I am getting the below error when trying to validate it:
>
>
> ValidationError: Invalid ed25519 signature
>
>
>
> gist: https://gist.github.com/elmurci/d3322fe3798335bac0aa6315349b4447
>
>
> Any ideas?
>
Received on Tuesday, 29 November 2016 16:39:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 29 November 2016 16:39:20 UTC