•   over 11 years ago

Do we have to use Value Message Requests for app-to-app communication

So I am writing an iPhone app, that will be able to communicate over bluetooth to send value messages. If someone using my app wanted to request some mintchip money from someone else using my app, is it ok to not use a value message request? Ie. instead just send the mintchip ID, amount, and an annotation? This way I would just use "Create Value Message Without Annotation" to create a value message.

  • 2 comments

  •   •   over 11 years ago

    There won't be a requirement to do so; because the creation of a Value message doesn't actually require any Request (you could create it spontaneously, if you know your target MintChip ID), the way you determine who you're sending it to is up to you.

    The benefit of using the format Request message is that many of the APIs provide for symmetric handling of both kinds, knowing how to pack them together and decode them.

    You choosing to "disassemble" a Request into just the ID, amount and annotation is equivalent to transforming the original ASN.1 structure to base64 encoding or any other encoding method; just because you're choosing to "transform" extra data out of it is up to you.

    Note, however, that Messages contain a Message Version in them to allow code to support (or choose not to support) past or future versions of the structure; if your code is expecting solely these three bits of information that you've chosen to send, but future MintChips require, say, the Random Challenge to be a mandatory match between Value and Request, then you've got a bit of code changing to support. If you stick to passing proper Messages, support will be provided in the API (in theory).

    Granted, you're writing your own API, since you're on iPhone, but you might be best served writing an API that mimics the design of the Java and .NET libraries, so if/when an iOS one is released, you're pretty much ready to use it.

  •   •   over 11 years ago

    Ya, I agree I would ideally like to mimic the rest of the APIs, but at the moment I haven't had any success creating value messages using the sample value request messages, and also if there is an API to be put out, it will seem like a waste to completely implement all of the create_message, parse_message, functions myself. Basically I have been trying to just port the PHP code into obj c, but with august fast approaching I am trying to speed up my development timeline

Comments are closed.