6

1. Summary

I would like to add a «Donate» Bitcoin button on my README.md file located on my GitHub repository.


2. Not helped

2.1. Manually button

HTML-code using bitcoin protocol:

<a href="bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037"><img src="https://www.drupal.org/files/project-images/bitcoindonate.png" alt="Bitcoin Donate Button"></a>

It's work on HTML page of my GitHub Pages site, demonstration.

But in .md GitHub files not one codes of Meta Stack Exchange answer not work for bitcoin protocol, demonstration.

<a href="bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037"><img src="https://www.drupal.org/files/project-images/bitcoindonate.png" alt="Bitcoin Donate Button"></a>

[**![Bitcoin Donate Button**](https://www.drupal.org/files/project-images/bitcoindonate.png)](bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037)

<a href="bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037">![Bitcoin Donate Button](https://www.drupal.org/files/project-images/bitcoindonate.png)</a>

2.2. Third-party

JavaScript not supported on GitHub README.md pages. By this reason doesn't help me:

1 Answer 1

5

1. Demonstration

Donate button

Click to donate button on page:

https://github.com/KristinitaTest/KristinitaTest.github.io/blob/master/donate/README.md

Link must be opened in your Bitcoin client, example:

Electrum


2. Relevance

This answer is relevant for April 2018. In the future, the data of this answer may be obsolete.


3. Redirect

You need to use redirect.

User click on Donate button → is redirected to Bitcoin-Redirect page in current tab → then opened bitcoin wallet of user → in current tab is opened page, on which Donate button is situated.


4. Details

4.1. Source of Donate button

[![Bitcoin Donate Button](https://i.sstatic.net/MnQ6V.png)](http://KristinitaTest.github.io/donate/Bitcoin-Redirect)

If you click the image, you will go to a page http://KristinitaTest.github.io/donate/Bitcoin-Redirect. See answer on Meta Stack Exchange, how use Markdown markup for this construction. Alternative worked HTML source:

<a href="http://KristinitaTest.github.io/donate/Bitcoin-Redirect"><img src="https://i.sstatic.net/MnQ6V.png"></a>

4.2. Source of Bitcoin-Redirect page

<script>
window.location.href = "bitcoin:17uctxtsWG3gpyAy6iJ8AVd5rdSjkJH2?label=In%20the%20treatme0of%20Sasha's%20teeth&amp;amount=0.0037";
history.back();
</script>

Use JavaScript methods window.location.href and history.back.

1
  • Does this method also support lightning payments? (I am not sure whether, if one can also pay with lightning with ones Bitcoin client, and set that option as default, or whether that requires another manual step/a different client) In essence, are the default transaction fees for a donation using this method (currently) in the range of ~$0.04 or in the range of ~$13?
    – a.t.
    Commented Dec 17, 2021 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.