Skip to content

Instantly share code, notes, and snippets.

View vladimirfomene's full-sized avatar
👋

Mayemene Fomene Jean Vladimir vladimirfomene

👋
View GitHub Profile
@vladimirfomene
vladimirfomene / anchor_explanation.md
Last active October 31, 2023 09:12
Why BDK anchors are important?

Anchor is:

If this block exists in the best chain (or a chain of given chain_tip), then we know that this transaction is confirmed in the best chain.

Blocks in bdk_chain are identified by BlockId which is block_height+block_hash. So we anchor transactions to BlockIds and we just need to know whether this BlockId is in the best chain.

Sometimes we know the confirmation height of a transaction, but we don't know the confirmation block hash (Electrum). So we have a looser definition for Anchor, so that the anchor BlockId can be of a different height to the confirmation height of the transaction.

For Electrum (as @Steve Myers mentioned), we need to get the tip before getting tx data, and ensure the tip still exists in the best chain after grabbing all the tx data. We use the tip as the anchor BlockId in this scenario.

import base64, codecs, json, requests
REST_HOST = 'localhost:8289'
MACAROON_PATH = './volumes/tapd/alice-tap/data/regtest/admin.macaroon'
TLS_PATH = './volumes/tapd/alice-tap/tls.cert'
batch_key_hex = '020cccd7a1f96d34ab42f40cf580fd81d88ce0caa72c5fec75d261c4f66cbeb000'
batch_key = bytes.fromhex(batch_key_hex)
url = f'https://{REST_HOST}/v1/taproot-assets/assets/mint/batches/{batch_key}'
macaroon = codecs.encode(open(MACAROON_PATH, 'rb').read(), 'hex')

Splice Backend API Documentation

This documentation outlines the API endpoints for onboarding, on/off ramps and cross border payment across currencies.

Generate a New Wallet

  • Endpoint: POST api/wallets
import os
import hashlib
import elliptic
import base58
from binascii import unhexlify as decode_hex
from binascii import hexlify
# Constants
n = 115792089237316195423570985008687907852837564279074904382605163141518161494337
@vladimirfomene
vladimirfomene / gist:7becea8e1747430f8be45a92c53df71e
Created October 2, 2018 07:29 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@vladimirfomene
vladimirfomene / article_outline_02.md
Last active August 22, 2018 10:45
Auth0 article outline

Creating and Consuming a RESTFUL web service with Springboot and Retrofit.

Overview of creating and consuming RESTFUL web service with Springboot and Retrofit

Creating RESTFUL APIS with Springboot

  • Clone Sample project
  • Create entities which will be saved in the database(I will use user and posts as my entities).
  • Create repositories to interact with these entities.
  • Create a RESTFUL service with @RestController for interacting with entities.
  • Extend the REST service with HATEOS(Hypermedia as the Engine of Application State)
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: spaghetti_code
-- ------------------------------------------------------
-- Server version 5.7.19-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@vladimirfomene
vladimirfomene / Report.md
Last active June 18, 2021 07:30
Payment Gateway Project Report

Payment Gateway for the Mifos Platform and Beyonic Payment Service

Project Goals

<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:text="Guest List"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />