Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condition and fulfillment in escrow #698

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ckeshava
Copy link
Collaborator

@ckeshava ckeshava commented Mar 22, 2024

High Level Overview of Change

Provide utility functions to generate cryptographic condition and fulfillment for conditional escrows.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Did you update CHANGELOG.md?

  • Yes
  • No, this change does not impact library users

Test Plan

Included unit test and snippet test to validate the working of generate_crypto_conditions function.

This work was inspired by the PR by author and also the XRPL tutorials

Many thanks to both these sources.

from typing import Dict, Optional, TypedDict

# CK: TODO Find a py.typed or library stub for cryptoconditions
from cryptoconditions import PreimageSha256 # type: ignore
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know if you have any ideas to get mypy to work with a cryptographic library

cancel_after=datetime_to_ripple_time(datetime.now()) + 100,
)

create_escrow_response = submit_and_wait(create_tx, client, wallet1)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have empirically observed that the generated cryptographic condition always begins with A0258020... and ends with ...810120. I don't have statistical numbers to prove my point, but the outputs from this library do not appear random, despite varying secret inputs.

Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/cffi@1.16.0 environment, eval, filesystem, unsafe 0 580 kB Armin.Rigo, alexgaynor, fijal, ...5 more
pypi/cryptoconditions@0.8.1 environment, eval, filesystem 0 97.7 kB bigchaindb, troymc

View full report↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant