Re: Prefix Conditions

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